From 9088d7e251adcd0007e395c7b06857ecfdf2e655 Mon Sep 17 00:00:00 2001 From: maqiyuan Date: Mon, 28 Apr 2014 17:00:44 +0800 Subject: [PATCH] branch: yandytex with kpathsea. --- src/texsourc/FMT.TODO | 34 + src/texsourc/Makefile.gcc | 5 + src/texsourc/PDF.TODO | 25 + src/texsourc/itex.c | 202 +- src/texsourc/kpathsea/export_kpathsea.bat | 1 + src/texsourc/kpathsea/kpathsea/AUTHORS | 11 + src/texsourc/kpathsea/kpathsea/BUGS | 565 + src/texsourc/kpathsea/kpathsea/ChangeLog | 8566 ++++++++++ src/texsourc/kpathsea/kpathsea/Makefile.am | 322 + src/texsourc/kpathsea/kpathsea/Makefile.in | 2314 +++ src/texsourc/kpathsea/kpathsea/NEWS | 351 + src/texsourc/kpathsea/kpathsea/PROJECTS | 23 + src/texsourc/kpathsea/kpathsea/README | 17 + src/texsourc/kpathsea/kpathsea/absolute.c | 96 + src/texsourc/kpathsea/kpathsea/absolute.h | 44 + src/texsourc/kpathsea/kpathsea/ac/kpathsea.ac | 11 + src/texsourc/kpathsea/kpathsea/ac/mktex.ac | 20 + src/texsourc/kpathsea/kpathsea/ac/withenable.ac | 8 + src/texsourc/kpathsea/kpathsea/access.c | 90 + src/texsourc/kpathsea/kpathsea/aclocal.m4 | 1195 ++ src/texsourc/kpathsea/kpathsea/atou.c | 28 + src/texsourc/kpathsea/kpathsea/bsnl.awk | 17 + src/texsourc/kpathsea/kpathsea/c-auto.h | 157 + src/texsourc/kpathsea/kpathsea/c-auto.in | 249 + src/texsourc/kpathsea/kpathsea/c-ctype.h | 85 + src/texsourc/kpathsea/kpathsea/c-dir.h | 52 + src/texsourc/kpathsea/kpathsea/c-errno.h | 27 + src/texsourc/kpathsea/kpathsea/c-fopen.h | 77 + src/texsourc/kpathsea/kpathsea/c-limits.h | 36 + src/texsourc/kpathsea/kpathsea/c-memstr.h | 63 + src/texsourc/kpathsea/kpathsea/c-minmax.h | 84 + src/texsourc/kpathsea/kpathsea/c-namemx.h | 36 + src/texsourc/kpathsea/kpathsea/c-pathch.h | 100 + src/texsourc/kpathsea/kpathsea/c-pathmx.h | 45 + src/texsourc/kpathsea/kpathsea/c-proto.h | 36 + src/texsourc/kpathsea/kpathsea/c-stat.h | 56 + src/texsourc/kpathsea/kpathsea/c-std.h | 95 + src/texsourc/kpathsea/kpathsea/c-unistd.h | 57 + src/texsourc/kpathsea/kpathsea/cnf-to-paths.awk | 58 + src/texsourc/kpathsea/kpathsea/cnf.c | 281 + src/texsourc/kpathsea/kpathsea/cnf.h | 43 + src/texsourc/kpathsea/kpathsea/concat.c | 35 + src/texsourc/kpathsea/kpathsea/concat3.c | 33 + src/texsourc/kpathsea/kpathsea/concatn.c | 72 + src/texsourc/kpathsea/kpathsea/concatn.h | 41 + src/texsourc/kpathsea/kpathsea/config.h | 235 + src/texsourc/kpathsea/kpathsea/configure | 16081 +++++++++++++++++++ src/texsourc/kpathsea/kpathsea/configure.ac | 146 + src/texsourc/kpathsea/kpathsea/db.c | 744 + src/texsourc/kpathsea/kpathsea/db.h | 53 + src/texsourc/kpathsea/kpathsea/debug.c | 55 + src/texsourc/kpathsea/kpathsea/debug.h | 109 + src/texsourc/kpathsea/kpathsea/default.h | 36 + src/texsourc/kpathsea/kpathsea/dir.c | 146 + src/texsourc/kpathsea/kpathsea/dirent.c | 146 + src/texsourc/kpathsea/kpathsea/dirent.h | 53 + src/texsourc/kpathsea/kpathsea/doc/Makefile.am | 8 + src/texsourc/kpathsea/kpathsea/doc/Makefile.in | 753 + src/texsourc/kpathsea/kpathsea/doc/bugs.texi | 897 ++ src/texsourc/kpathsea/kpathsea/doc/hier.texi | 102 + src/texsourc/kpathsea/kpathsea/doc/install.texi | 1238 ++ src/texsourc/kpathsea/kpathsea/doc/kpathsea.info | 4761 ++++++ src/texsourc/kpathsea/kpathsea/doc/kpathsea.texi | 2545 +++ src/texsourc/kpathsea/kpathsea/doc/unixtex.texi | 45 + src/texsourc/kpathsea/kpathsea/elt-dirs.c | 513 + src/texsourc/kpathsea/kpathsea/expand.c | 409 + src/texsourc/kpathsea/kpathsea/expand.h | 59 + src/texsourc/kpathsea/kpathsea/extend-fname.c | 30 + src/texsourc/kpathsea/kpathsea/file-p.c | 36 + src/texsourc/kpathsea/kpathsea/find-suffix.c | 57 + src/texsourc/kpathsea/kpathsea/fn.c | 119 + src/texsourc/kpathsea/kpathsea/fn.h | 71 + src/texsourc/kpathsea/kpathsea/fontmap.c | 201 + src/texsourc/kpathsea/kpathsea/fontmap.h | 33 + src/texsourc/kpathsea/kpathsea/getopt.c | 962 ++ src/texsourc/kpathsea/kpathsea/getopt.h | 161 + src/texsourc/kpathsea/kpathsea/getopt1.c | 177 + src/texsourc/kpathsea/kpathsea/hash.c | 265 + src/texsourc/kpathsea/kpathsea/hash.h | 96 + src/texsourc/kpathsea/kpathsea/kdefault.c | 124 + src/texsourc/kpathsea/kpathsea/knj.c | 477 + src/texsourc/kpathsea/kpathsea/knj.h | 62 + src/texsourc/kpathsea/kpathsea/kpathsea.c | 138 + src/texsourc/kpathsea/kpathsea/kpathsea.h | 43 + src/texsourc/kpathsea/kpathsea/kpsestat.c | 126 + src/texsourc/kpathsea/kpathsea/kpsewhich.c | 779 + src/texsourc/kpathsea/kpathsea/lib.h | 232 + src/texsourc/kpathsea/kpathsea/line.c | 72 + src/texsourc/kpathsea/kpathsea/line.h | 39 + src/texsourc/kpathsea/kpathsea/magstep.c | 112 + src/texsourc/kpathsea/kpathsea/magstep.h | 59 + src/texsourc/kpathsea/kpathsea/make-suffix.c | 68 + src/texsourc/kpathsea/kpathsea/man/Makefile.am | 31 + src/texsourc/kpathsea/kpathsea/man/Makefile.in | 598 + src/texsourc/kpathsea/kpathsea/man/kpseaccess.man | 66 + .../kpathsea/kpathsea/man/kpsereadlink.man | 30 + src/texsourc/kpathsea/kpathsea/man/kpsestat.man | 51 + src/texsourc/kpathsea/kpathsea/man/kpsewhich.man | 144 + src/texsourc/kpathsea/kpathsea/man/mktexlsr.man | 44 + src/texsourc/kpathsea/kpathsea/man/mktexmf.man | 57 + src/texsourc/kpathsea/kpathsea/man/mktexpk.man | 115 + src/texsourc/kpathsea/kpathsea/man/mktextfm.man | 65 + src/texsourc/kpathsea/kpathsea/mingw32.c | 438 + src/texsourc/kpathsea/kpathsea/mingw32.h | 85 + src/texsourc/kpathsea/kpathsea/mktex.cnf | 18 + src/texsourc/kpathsea/kpathsea/mktex.opt | 120 + src/texsourc/kpathsea/kpathsea/mktexdir | 54 + src/texsourc/kpathsea/kpathsea/mktexdir.opt | 11 + src/texsourc/kpathsea/kpathsea/mktexlsr | 218 + src/texsourc/kpathsea/kpathsea/mktexmf | 142 + src/texsourc/kpathsea/kpathsea/mktexnam | 219 + src/texsourc/kpathsea/kpathsea/mktexnam.opt | 107 + src/texsourc/kpathsea/kpathsea/mktexpk | 279 + src/texsourc/kpathsea/kpathsea/mktextfm | 152 + src/texsourc/kpathsea/kpathsea/mktexupd | 58 + src/texsourc/kpathsea/kpathsea/path-elt.c | 140 + src/texsourc/kpathsea/kpathsea/paths.h | 316 + src/texsourc/kpathsea/kpathsea/pathsearch.c | 671 + src/texsourc/kpathsea/kpathsea/pathsearch.h | 116 + src/texsourc/kpathsea/kpathsea/proginit.c | 85 + src/texsourc/kpathsea/kpathsea/proginit.h | 48 + src/texsourc/kpathsea/kpathsea/progname.c | 799 + src/texsourc/kpathsea/kpathsea/progname.h | 70 + src/texsourc/kpathsea/kpathsea/putenv.c | 110 + src/texsourc/kpathsea/kpathsea/readable.c | 140 + src/texsourc/kpathsea/kpathsea/readable.h | 43 + src/texsourc/kpathsea/kpathsea/readlink.c | 77 + src/texsourc/kpathsea/kpathsea/rm-suffix.c | 41 + src/texsourc/kpathsea/kpathsea/str-list.c | 148 + src/texsourc/kpathsea/kpathsea/str-list.h | 103 + src/texsourc/kpathsea/kpathsea/str-llist.c | 93 + src/texsourc/kpathsea/kpathsea/str-llist.h | 66 + src/texsourc/kpathsea/kpathsea/strcasecmp.c | 76 + src/texsourc/kpathsea/kpathsea/strstr.c | 121 + src/texsourc/kpathsea/kpathsea/strtol.c | 291 + src/texsourc/kpathsea/kpathsea/systypes.h | 28 + .../kpathsea/kpathsea/tests/cnfnewline.test | 16 + .../kpathsea/kpathsea/tests/cnfnewline/texmf.cnf | 1 + .../kpathsea/kpathsea/tests/kpseaccess.test | 50 + .../kpathsea/kpathsea/tests/kpsereadlink.test | 13 + src/texsourc/kpathsea/kpathsea/tests/kpsestat.test | 19 + .../kpathsea/kpathsea/tests/kpsewhich.test | 21 + src/texsourc/kpathsea/kpathsea/tex-file.c | 1442 ++ src/texsourc/kpathsea/kpathsea/tex-file.h | 141 + src/texsourc/kpathsea/kpathsea/tex-glyph.c | 417 + src/texsourc/kpathsea/kpathsea/tex-glyph.h | 98 + src/texsourc/kpathsea/kpathsea/tex-hush.c | 52 + src/texsourc/kpathsea/kpathsea/tex-hush.h | 40 + src/texsourc/kpathsea/kpathsea/tex-make.c | 541 + src/texsourc/kpathsea/kpathsea/tex-make.h | 48 + src/texsourc/kpathsea/kpathsea/texmf.cnf | 786 + src/texsourc/kpathsea/kpathsea/tilde.c | 198 + src/texsourc/kpathsea/kpathsea/tilde.h | 34 + src/texsourc/kpathsea/kpathsea/types.h | 358 + src/texsourc/kpathsea/kpathsea/uppercasify.c | 35 + src/texsourc/kpathsea/kpathsea/variable.c | 310 + src/texsourc/kpathsea/kpathsea/variable.h | 54 + src/texsourc/kpathsea/kpathsea/version.ac | 22 + src/texsourc/kpathsea/kpathsea/version.c | 30 + src/texsourc/kpathsea/kpathsea/version.h | 36 + src/texsourc/kpathsea/kpathsea/win32/ChangeLog | 78 + src/texsourc/kpathsea/kpathsea/win32/Makefile.am | 82 + src/texsourc/kpathsea/kpathsea/win32/Makefile.in | 764 + src/texsourc/kpathsea/kpathsea/win32/dirutil.c | 62 + src/texsourc/kpathsea/kpathsea/win32/dirutil.h | 3 + src/texsourc/kpathsea/kpathsea/win32/fmtutil.c | 959 ++ src/texsourc/kpathsea/kpathsea/win32/getdestdir.c | 248 + src/texsourc/kpathsea/kpathsea/win32/getdestdir.h | 1 + src/texsourc/kpathsea/kpathsea/win32/mktexfmt.c | 95 + src/texsourc/kpathsea/kpathsea/win32/mktexlsr.c | 225 + src/texsourc/kpathsea/kpathsea/win32/mktexmf.c | 354 + src/texsourc/kpathsea/kpathsea/win32/mktexpk.c | 1245 ++ src/texsourc/kpathsea/kpathsea/win32/mktextfm.c | 393 + src/texsourc/kpathsea/kpathsea/win32/mktexupd.c | 112 + src/texsourc/kpathsea/kpathsea/win32/mktexupd.h | 1 + .../kpathsea/kpathsea/win32/mktexupdmain.c | 33 + src/texsourc/kpathsea/kpathsea/win32lib.c | 434 + src/texsourc/kpathsea/kpathsea/win32lib.h | 281 + src/texsourc/kpathsea/kpathsea/xbasename.c | 67 + src/texsourc/kpathsea/kpathsea/xcalloc.c | 35 + src/texsourc/kpathsea/kpathsea/xdirname.c | 116 + src/texsourc/kpathsea/kpathsea/xdirtest.c | 157 + src/texsourc/kpathsea/kpathsea/xfopen.c | 48 + src/texsourc/kpathsea/kpathsea/xfseek.c | 27 + src/texsourc/kpathsea/kpathsea/xfseeko.c | 26 + src/texsourc/kpathsea/kpathsea/xftell.c | 30 + src/texsourc/kpathsea/kpathsea/xftello.c | 31 + src/texsourc/kpathsea/kpathsea/xgetcwd.c | 157 + src/texsourc/kpathsea/kpathsea/xmalloc.c | 34 + src/texsourc/kpathsea/kpathsea/xopendir.c | 47 + src/texsourc/kpathsea/kpathsea/xopendir.h | 33 + src/texsourc/kpathsea/kpathsea/xputenv.c | 125 + src/texsourc/kpathsea/kpathsea/xrealloc.c | 43 + src/texsourc/kpathsea/kpathsea/xstat.c | 54 + src/texsourc/kpathsea/kpathsea/xstat.h | 45 + src/texsourc/kpathsea/kpathsea/xstrdup.c | 29 + src/texsourc/kpathsea/make-obj.bat | 63 + src/texsourc/kpathsea/meaning.txt | 71 + src/texsourc/kpathsea/win32/c-auto.h | 157 + src/texsourc/kpathsea/win32/kpathsea.h | 43 + src/texsourc/kpathsea/win32/paths.h | 316 + src/texsourc/lib.h | 2 +- src/texsourc/makefile | 5 +- src/texsourc/openinou.c | 282 +- src/texsourc/ptex-base.ch | 6859 ++++++++ src/texsourc/subroute.c | 304 +- src/texsourc/test-for.c | 10 + src/texsourc/tex3.c | 14 +- src/texsourc/tex8.c | 6 +- src/texsourc/tex9.c | 4 +- src/texsourc/texd.h | 6 +- src/texsourc/texmf.c | 53 +- src/texsourc/texmf.exp | Bin 0 -> 4323 bytes src/texsourc/texmf.h | 19 +- src/texsourc/texmf.lib | Bin 0 -> 7794 bytes src/texsourc/zen-cls.bat | 5 + 216 files changed, 74947 insertions(+), 628 deletions(-) create mode 100644 src/texsourc/FMT.TODO create mode 100644 src/texsourc/Makefile.gcc create mode 100644 src/texsourc/PDF.TODO create mode 100644 src/texsourc/kpathsea/export_kpathsea.bat create mode 100644 src/texsourc/kpathsea/kpathsea/AUTHORS create mode 100644 src/texsourc/kpathsea/kpathsea/BUGS create mode 100644 src/texsourc/kpathsea/kpathsea/ChangeLog create mode 100644 src/texsourc/kpathsea/kpathsea/Makefile.am create mode 100644 src/texsourc/kpathsea/kpathsea/Makefile.in create mode 100644 src/texsourc/kpathsea/kpathsea/NEWS create mode 100644 src/texsourc/kpathsea/kpathsea/PROJECTS create mode 100644 src/texsourc/kpathsea/kpathsea/README create mode 100644 src/texsourc/kpathsea/kpathsea/absolute.c create mode 100644 src/texsourc/kpathsea/kpathsea/absolute.h create mode 100644 src/texsourc/kpathsea/kpathsea/ac/kpathsea.ac create mode 100644 src/texsourc/kpathsea/kpathsea/ac/mktex.ac create mode 100644 src/texsourc/kpathsea/kpathsea/ac/withenable.ac create mode 100644 src/texsourc/kpathsea/kpathsea/access.c create mode 100644 src/texsourc/kpathsea/kpathsea/aclocal.m4 create mode 100644 src/texsourc/kpathsea/kpathsea/atou.c create mode 100644 src/texsourc/kpathsea/kpathsea/bsnl.awk create mode 100644 src/texsourc/kpathsea/kpathsea/c-auto.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-auto.in create mode 100644 src/texsourc/kpathsea/kpathsea/c-ctype.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-dir.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-errno.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-fopen.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-limits.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-memstr.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-minmax.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-namemx.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-pathch.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-pathmx.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-proto.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-stat.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-std.h create mode 100644 src/texsourc/kpathsea/kpathsea/c-unistd.h create mode 100644 src/texsourc/kpathsea/kpathsea/cnf-to-paths.awk create mode 100644 src/texsourc/kpathsea/kpathsea/cnf.c create mode 100644 src/texsourc/kpathsea/kpathsea/cnf.h create mode 100644 src/texsourc/kpathsea/kpathsea/concat.c create mode 100644 src/texsourc/kpathsea/kpathsea/concat3.c create mode 100644 src/texsourc/kpathsea/kpathsea/concatn.c create mode 100644 src/texsourc/kpathsea/kpathsea/concatn.h create mode 100644 src/texsourc/kpathsea/kpathsea/config.h create mode 100644 src/texsourc/kpathsea/kpathsea/configure create mode 100644 src/texsourc/kpathsea/kpathsea/configure.ac create mode 100644 src/texsourc/kpathsea/kpathsea/db.c create mode 100644 src/texsourc/kpathsea/kpathsea/db.h create mode 100644 src/texsourc/kpathsea/kpathsea/debug.c create mode 100644 src/texsourc/kpathsea/kpathsea/debug.h create mode 100644 src/texsourc/kpathsea/kpathsea/default.h create mode 100644 src/texsourc/kpathsea/kpathsea/dir.c create mode 100644 src/texsourc/kpathsea/kpathsea/dirent.c create mode 100644 src/texsourc/kpathsea/kpathsea/dirent.h create mode 100644 src/texsourc/kpathsea/kpathsea/doc/Makefile.am create mode 100644 src/texsourc/kpathsea/kpathsea/doc/Makefile.in create mode 100644 src/texsourc/kpathsea/kpathsea/doc/bugs.texi create mode 100644 src/texsourc/kpathsea/kpathsea/doc/hier.texi create mode 100644 src/texsourc/kpathsea/kpathsea/doc/install.texi create mode 100644 src/texsourc/kpathsea/kpathsea/doc/kpathsea.info create mode 100644 src/texsourc/kpathsea/kpathsea/doc/kpathsea.texi create mode 100644 src/texsourc/kpathsea/kpathsea/doc/unixtex.texi create mode 100644 src/texsourc/kpathsea/kpathsea/elt-dirs.c create mode 100644 src/texsourc/kpathsea/kpathsea/expand.c create mode 100644 src/texsourc/kpathsea/kpathsea/expand.h create mode 100644 src/texsourc/kpathsea/kpathsea/extend-fname.c create mode 100644 src/texsourc/kpathsea/kpathsea/file-p.c create mode 100644 src/texsourc/kpathsea/kpathsea/find-suffix.c create mode 100644 src/texsourc/kpathsea/kpathsea/fn.c create mode 100644 src/texsourc/kpathsea/kpathsea/fn.h create mode 100644 src/texsourc/kpathsea/kpathsea/fontmap.c create mode 100644 src/texsourc/kpathsea/kpathsea/fontmap.h create mode 100644 src/texsourc/kpathsea/kpathsea/getopt.c create mode 100644 src/texsourc/kpathsea/kpathsea/getopt.h create mode 100644 src/texsourc/kpathsea/kpathsea/getopt1.c create mode 100644 src/texsourc/kpathsea/kpathsea/hash.c create mode 100644 src/texsourc/kpathsea/kpathsea/hash.h create mode 100644 src/texsourc/kpathsea/kpathsea/kdefault.c create mode 100644 src/texsourc/kpathsea/kpathsea/knj.c create mode 100644 src/texsourc/kpathsea/kpathsea/knj.h create mode 100644 src/texsourc/kpathsea/kpathsea/kpathsea.c create mode 100644 src/texsourc/kpathsea/kpathsea/kpathsea.h create mode 100644 src/texsourc/kpathsea/kpathsea/kpsestat.c create mode 100644 src/texsourc/kpathsea/kpathsea/kpsewhich.c create mode 100644 src/texsourc/kpathsea/kpathsea/lib.h create mode 100644 src/texsourc/kpathsea/kpathsea/line.c create mode 100644 src/texsourc/kpathsea/kpathsea/line.h create mode 100644 src/texsourc/kpathsea/kpathsea/magstep.c create mode 100644 src/texsourc/kpathsea/kpathsea/magstep.h create mode 100644 src/texsourc/kpathsea/kpathsea/make-suffix.c create mode 100644 src/texsourc/kpathsea/kpathsea/man/Makefile.am create mode 100644 src/texsourc/kpathsea/kpathsea/man/Makefile.in create mode 100644 src/texsourc/kpathsea/kpathsea/man/kpseaccess.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/kpsereadlink.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/kpsestat.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/kpsewhich.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/mktexlsr.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/mktexmf.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/mktexpk.man create mode 100644 src/texsourc/kpathsea/kpathsea/man/mktextfm.man create mode 100644 src/texsourc/kpathsea/kpathsea/mingw32.c create mode 100644 src/texsourc/kpathsea/kpathsea/mingw32.h create mode 100644 src/texsourc/kpathsea/kpathsea/mktex.cnf create mode 100644 src/texsourc/kpathsea/kpathsea/mktex.opt create mode 100644 src/texsourc/kpathsea/kpathsea/mktexdir create mode 100644 src/texsourc/kpathsea/kpathsea/mktexdir.opt create mode 100644 src/texsourc/kpathsea/kpathsea/mktexlsr create mode 100644 src/texsourc/kpathsea/kpathsea/mktexmf create mode 100644 src/texsourc/kpathsea/kpathsea/mktexnam create mode 100644 src/texsourc/kpathsea/kpathsea/mktexnam.opt create mode 100644 src/texsourc/kpathsea/kpathsea/mktexpk create mode 100644 src/texsourc/kpathsea/kpathsea/mktextfm create mode 100644 src/texsourc/kpathsea/kpathsea/mktexupd create mode 100644 src/texsourc/kpathsea/kpathsea/path-elt.c create mode 100644 src/texsourc/kpathsea/kpathsea/paths.h create mode 100644 src/texsourc/kpathsea/kpathsea/pathsearch.c create mode 100644 src/texsourc/kpathsea/kpathsea/pathsearch.h create mode 100644 src/texsourc/kpathsea/kpathsea/proginit.c create mode 100644 src/texsourc/kpathsea/kpathsea/proginit.h create mode 100644 src/texsourc/kpathsea/kpathsea/progname.c create mode 100644 src/texsourc/kpathsea/kpathsea/progname.h create mode 100644 src/texsourc/kpathsea/kpathsea/putenv.c create mode 100644 src/texsourc/kpathsea/kpathsea/readable.c create mode 100644 src/texsourc/kpathsea/kpathsea/readable.h create mode 100644 src/texsourc/kpathsea/kpathsea/readlink.c create mode 100644 src/texsourc/kpathsea/kpathsea/rm-suffix.c create mode 100644 src/texsourc/kpathsea/kpathsea/str-list.c create mode 100644 src/texsourc/kpathsea/kpathsea/str-list.h create mode 100644 src/texsourc/kpathsea/kpathsea/str-llist.c create mode 100644 src/texsourc/kpathsea/kpathsea/str-llist.h create mode 100644 src/texsourc/kpathsea/kpathsea/strcasecmp.c create mode 100644 src/texsourc/kpathsea/kpathsea/strstr.c create mode 100644 src/texsourc/kpathsea/kpathsea/strtol.c create mode 100644 src/texsourc/kpathsea/kpathsea/systypes.h create mode 100644 src/texsourc/kpathsea/kpathsea/tests/cnfnewline.test create mode 100644 src/texsourc/kpathsea/kpathsea/tests/cnfnewline/texmf.cnf create mode 100644 src/texsourc/kpathsea/kpathsea/tests/kpseaccess.test create mode 100644 src/texsourc/kpathsea/kpathsea/tests/kpsereadlink.test create mode 100644 src/texsourc/kpathsea/kpathsea/tests/kpsestat.test create mode 100644 src/texsourc/kpathsea/kpathsea/tests/kpsewhich.test create mode 100644 src/texsourc/kpathsea/kpathsea/tex-file.c create mode 100644 src/texsourc/kpathsea/kpathsea/tex-file.h create mode 100644 src/texsourc/kpathsea/kpathsea/tex-glyph.c create mode 100644 src/texsourc/kpathsea/kpathsea/tex-glyph.h create mode 100644 src/texsourc/kpathsea/kpathsea/tex-hush.c create mode 100644 src/texsourc/kpathsea/kpathsea/tex-hush.h create mode 100644 src/texsourc/kpathsea/kpathsea/tex-make.c create mode 100644 src/texsourc/kpathsea/kpathsea/tex-make.h create mode 100644 src/texsourc/kpathsea/kpathsea/texmf.cnf create mode 100644 src/texsourc/kpathsea/kpathsea/tilde.c create mode 100644 src/texsourc/kpathsea/kpathsea/tilde.h create mode 100644 src/texsourc/kpathsea/kpathsea/types.h create mode 100644 src/texsourc/kpathsea/kpathsea/uppercasify.c create mode 100644 src/texsourc/kpathsea/kpathsea/variable.c create mode 100644 src/texsourc/kpathsea/kpathsea/variable.h create mode 100644 src/texsourc/kpathsea/kpathsea/version.ac create mode 100644 src/texsourc/kpathsea/kpathsea/version.c create mode 100644 src/texsourc/kpathsea/kpathsea/version.h create mode 100644 src/texsourc/kpathsea/kpathsea/win32/ChangeLog create mode 100644 src/texsourc/kpathsea/kpathsea/win32/Makefile.am create mode 100644 src/texsourc/kpathsea/kpathsea/win32/Makefile.in create mode 100644 src/texsourc/kpathsea/kpathsea/win32/dirutil.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/dirutil.h create mode 100644 src/texsourc/kpathsea/kpathsea/win32/fmtutil.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/getdestdir.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/getdestdir.h create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexfmt.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexlsr.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexmf.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexpk.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktextfm.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexupd.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexupd.h create mode 100644 src/texsourc/kpathsea/kpathsea/win32/mktexupdmain.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32lib.c create mode 100644 src/texsourc/kpathsea/kpathsea/win32lib.h create mode 100644 src/texsourc/kpathsea/kpathsea/xbasename.c create mode 100644 src/texsourc/kpathsea/kpathsea/xcalloc.c create mode 100644 src/texsourc/kpathsea/kpathsea/xdirname.c create mode 100644 src/texsourc/kpathsea/kpathsea/xdirtest.c create mode 100644 src/texsourc/kpathsea/kpathsea/xfopen.c create mode 100644 src/texsourc/kpathsea/kpathsea/xfseek.c create mode 100644 src/texsourc/kpathsea/kpathsea/xfseeko.c create mode 100644 src/texsourc/kpathsea/kpathsea/xftell.c create mode 100644 src/texsourc/kpathsea/kpathsea/xftello.c create mode 100644 src/texsourc/kpathsea/kpathsea/xgetcwd.c create mode 100644 src/texsourc/kpathsea/kpathsea/xmalloc.c create mode 100644 src/texsourc/kpathsea/kpathsea/xopendir.c create mode 100644 src/texsourc/kpathsea/kpathsea/xopendir.h create mode 100644 src/texsourc/kpathsea/kpathsea/xputenv.c create mode 100644 src/texsourc/kpathsea/kpathsea/xrealloc.c create mode 100644 src/texsourc/kpathsea/kpathsea/xstat.c create mode 100644 src/texsourc/kpathsea/kpathsea/xstat.h create mode 100644 src/texsourc/kpathsea/kpathsea/xstrdup.c create mode 100644 src/texsourc/kpathsea/make-obj.bat create mode 100644 src/texsourc/kpathsea/meaning.txt create mode 100644 src/texsourc/kpathsea/win32/c-auto.h create mode 100644 src/texsourc/kpathsea/win32/kpathsea.h create mode 100644 src/texsourc/kpathsea/win32/paths.h create mode 100644 src/texsourc/ptex-base.ch create mode 100644 src/texsourc/test-for.c create mode 100644 src/texsourc/texmf.exp create mode 100644 src/texsourc/texmf.lib create mode 100644 src/texsourc/zen-cls.bat diff --git a/src/texsourc/FMT.TODO b/src/texsourc/FMT.TODO new file mode 100644 index 0000000..c7ae531 --- /dev/null +++ b/src/texsourc/FMT.TODO @@ -0,0 +1,34 @@ +HEADER + DATE + MD5 +MAIN + +nodes + + 0 hlist_node hlist_node + 1 vlist_node vlist_node + 2 rule_node dir_node *** + 3 ins_node rule_node + 4 mark_node ins_node + 5 adjust_node disp_node *** + 6 ligature_node mark_node + 7 disc_node adjust_node + 8 whatsit_node ligature_node + 9 math_node disc_node +10 glue_node whatsit_node +11 kern_node math_node +12 penalty_node glue_node +13 unset_node kern_node +14 penalty_node +15 unset_node +16 + +font + font_dir[] + +catcode + 16 kanji + 17 kana + 18 other_kchar + + diff --git a/src/texsourc/Makefile.gcc b/src/texsourc/Makefile.gcc new file mode 100644 index 0000000..2f8abbc --- /dev/null +++ b/src/texsourc/Makefile.gcc @@ -0,0 +1,5 @@ +OBJS = itex.o local.o md5file.o openinou.o subroute.o\ + tex0.o tex1.o tex2.o tex3.o tex4.o tex5.o tex6.o\ + tex7.o tex8.o tex9.o texmf.o yandy_pool.o + +CC = gcc diff --git a/src/texsourc/PDF.TODO b/src/texsourc/PDF.TODO new file mode 100644 index 0000000..6c9664c --- /dev/null +++ b/src/texsourc/PDF.TODO @@ -0,0 +1,25 @@ +Basic + origin: h, v + compress level: all, object + pdf scheme: pdf, pdf/a + encrypt: yes, no + +PDFTeX + +1. output_one_char -> + pdf_begin_string(f) + pdf_print_char(f, c) + adv_char_width(f, c) + +2. pdf_begin_string -> + f != prev_f -> pdf_end_string() pdf_set_font(f) + +3. pdf_end_string + ? pdf_doing_sting + +4. pdf_end_string_nl + +5. adv_char_width(f, c) + pdf_h += ? + +6. pdf_set_rule diff --git a/src/texsourc/itex.c b/src/texsourc/itex.c index 092f38a..74dddf3 100644 --- a/src/texsourc/itex.c +++ b/src/texsourc/itex.c @@ -60,12 +60,13 @@ extern clock_t start_time, main_time, finish_time; /* in local.c */ #endif /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */ - +/* sec 0004 */ void initialize (void) { integer i; integer k; integer flag; /* bkph */ + #ifndef ALLOCATEHYPHEN hyph_pointer z; #endif @@ -114,6 +115,7 @@ void initialize (void) /* Fill in background of `delete' for inverse mapping */ for (i = 0; i <= 255; i++) xord[chr(i)] = 127; + #ifdef JOKE for (i = 128; i <= 255 ; i++) xord[xchr[i]] = i; @@ -202,10 +204,9 @@ void initialize (void) xeq_level[k] = level_one; no_new_control_sequence = true; - hash[hash_base].v.LH = 0; /* next(hash_base):= 0 */ - hash[hash_base].v.RH = 0; /* text(hash_base):= 0 */ -/* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max */ -/* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */ + next(hash_base) = 0; + text(hash_base) = 0; + for (k = hash_base + 1; k <= undefined_control_sequence - 1; k++) hash[k] = hash[hash_base]; @@ -334,7 +335,6 @@ void initialize_aux (void) /* shown_mode = 0; */ /* page_contents = 0; */ page_tail = page_head; - //mem[mem_top - 2].hh.v.RH = 0; link(page_head) = 0; } #endif // end of ifdef ALLOCATEMAIN @@ -386,6 +386,7 @@ void line_break_ (integer final_widow_penalty) { right_skip = finite_shrink(right_skip); } + q = left_skip; r = right_skip; background[1] = width(q) + width(r); @@ -1085,6 +1086,7 @@ void prefixed_command (void) else eq_define(cur_font_loc, data, cur_chr); break; + case def: { if (odd(cur_chr) && !(a >= 4) && (global_defs >= 0)) @@ -1101,6 +1103,7 @@ void prefixed_command (void) eq_define(p, call + (a % 4), def_ref); } break; + case let: { n = cur_chr; @@ -1142,6 +1145,7 @@ void prefixed_command (void) eq_define(p, cur_cmd, cur_chr); } break; + case shorthand_def: { n = cur_chr; @@ -1167,6 +1171,7 @@ void prefixed_command (void) eq_define(p, char_given, cur_val); } break; + case math_char_def_code: { scan_fifteen_bit_int(); @@ -1177,6 +1182,7 @@ void prefixed_command (void) eq_define(p, math_given, cur_val); } break; + default: { scan_eight_bit_int(); @@ -1189,24 +1195,28 @@ void prefixed_command (void) else eq_define(p, assign_int, count_base + cur_val); break; + case dimen_def_code: if ((a >= 4)) geq_define(p, assign_dimen, scaled_base + cur_val); else eq_define(p, assign_dimen, scaled_base + cur_val); break; + case skip_def_code: if ((a >= 4)) geq_define(p, assign_glue, skip_base + cur_val); else eq_define(p, assign_glue, skip_base + cur_val); break; + case mu_skip_def_code: if ((a >= 4)) geq_define(p, assign_mu_glue, mu_skip_base + cur_val); else eq_define(p, assign_mu_glue, mu_skip_base + cur_val); break; + case toks_def_code: if ((a >= 4)) geq_define(p, assign_toks, toks_base + cur_val); @@ -1219,6 +1229,7 @@ void prefixed_command (void) } } break; + case read_to_cs: { scan_int(); @@ -1242,6 +1253,7 @@ void prefixed_command (void) eq_define(p, call, cur_val); } break; + case toks_register: case assign_toks: { @@ -1327,6 +1339,7 @@ void prefixed_command (void) } } break; + case assign_int: { p = cur_chr; @@ -1339,6 +1352,7 @@ void prefixed_command (void) eq_word_define(p, cur_val); } break; + case assign_dimen: { p = cur_chr; @@ -1351,6 +1365,7 @@ void prefixed_command (void) eq_word_define(p, cur_val); } break; + case assign_glue: case assign_mu_glue: { @@ -1371,6 +1386,7 @@ void prefixed_command (void) eq_define(p, glue_ref, cur_val); } break; + case def_code: { if (cur_chr == cat_code_base) @@ -1423,6 +1439,7 @@ void prefixed_command (void) eq_word_define(p, cur_val); } break; + case def_family: { p = cur_chr; @@ -1437,12 +1454,14 @@ void prefixed_command (void) eq_define(p, data, cur_val); } break; + case tex_register: case advance: case multiply: case divide: do_register_command(a); break; + case set_box: { scan_eight_bit_int(); @@ -1468,21 +1487,27 @@ void prefixed_command (void) } } break; + case set_aux: alter_aux(); break; + case set_prev_graf: alter_prev_graf(); break; + case set_page_dimen: alter_page_so_far(); break; + case set_page_int: alter_integer(); break; + case set_box_dimen: alter_box_dimen(); break; + case set_shape: { scan_optional_equals(); @@ -1511,6 +1536,7 @@ void prefixed_command (void) eq_define(par_shape_loc, shape_ref, p); } break; + case hyph_data: if (cur_chr == 1) { @@ -1539,6 +1565,7 @@ void prefixed_command (void) goto lab30; } break; + case assign_font_dimen: { find_font_dimen(true); @@ -1548,6 +1575,7 @@ void prefixed_command (void) font_info[k].cint = cur_val; } break; + case assign_font_int: { n = cur_chr; @@ -1562,12 +1590,15 @@ void prefixed_command (void) skew_char[f] = cur_val; } break; + case def_font: new_font(a); break; + case set_interaction: new_interaction(); break; + default: { confusion("prefix"); @@ -1600,6 +1631,7 @@ void bad_formator_pool (char *name, char *defaultname, char *envvar) name_of_file[name_length + 1] = ' '; sprintf(log_line, "(Perhaps your %s environment variable is not set correctly)\n", envvar); show_line(log_line, 0); + { char *s; /* extra info 99/April/28 */ @@ -1759,7 +1791,9 @@ bool load_fmt_file (void) } p = 0; /* mem_bot */ q = rover; - do { + + do + { if (undumpthings(mem[p], q + 2 - p)) return -1; @@ -2192,7 +2226,9 @@ lab6666:; void final_cleanup (void) { small_number c; + c = cur_chr; + if (job_name == 0) open_log_file(); @@ -2411,30 +2447,35 @@ void show_frozen (void) #pragma warning(disable:4127) // conditional expression is constant -/* void texbody() */ int texbody (void) /* now returns a value --- bkph */ { history = 3; set_paths(TEXFORMATPATHBIT + TEXINPUTPATHBIT + TEXPOOLPATHBIT + TFMFILEPATHBIT); -/* magic number */ - if (ready_already == 314159L) + + if (ready_already == 314159L) /* magic number */ goto lab1; /* These tests are almost all compile time tests and so could be eliminated */ bad = 0; + if ((half_error_line < 30) || (half_error_line > error_line - 15)) bad = 1; + if (max_print_line < 60) bad = 2; + if (dvi_buf_size % 8 != 0) bad = 3; + if (1100 > mem_top) bad = 4; /* not compile time */ -/* if (hash_prime > hash_size) */ + if (hash_prime > (hash_size + hash_extra)) bad = 5; + if (max_in_open >= 128) bad = 6; /* p.14 */ + if (mem_top < 267) bad = 7; /* where from ? *//* not compile time */ #ifdef INITEX @@ -2445,18 +2486,19 @@ int texbody (void) /* now returns a value --- bkph */ bad = 10; } #endif /* INITEX */ -/* if ((mem_min > 0)||(mem_max < mem_top)) */ + if ((mem_min > mem_bot) || (mem_max < mem_top)) bad = 10; + if ((min_quarterword > 0) || (max_quarterword < 255)) bad = 11; -/* if ((0 > 0)||(262143L < 32767)) */ + if ((min_halfword > 0) || (max_halfword < 32767)) bad = 12; -/* if ((0 < 0)||(255 > 262143L)) */ + if ((min_quarterword < min_halfword) || (max_quarterword > max_halfword)) bad = 13; -/* if ((mem_min < 0)||(mem_max >= 262143L)||(-0 - mem_min > 262144L)) */ + if ((mem_min < min_halfword) || (mem_max >= max_halfword) || (mem_bot - mem_min >= max_halfword)) bad = 14; /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */ @@ -2473,42 +2515,49 @@ int texbody (void) /* now returns a value --- bkph */ if (font_max > 256) #endif bad = 16; -/* if ((save_size > 262143L)||(max_strings > 262143L)) */ + if ((save_size > max_halfword) || (max_strings > max_halfword)) bad = 17; + if (buf_size > max_halfword) bad = 18; + if (max_quarterword - min_quarterword < 255) bad = 19; -/* if cs_token_flag + undefined_control_sequence > max_halfword then bad <- 21;*/ -/* if ((hash_size + 4876) > 262143L)*/ -/* if ((hash_size + 4876) > max_halfword) */ - if ((hash_size + 4095 + 781) > max_halfword) + + if (cs_token_flag + undefined_control_sequence > max_halfword) bad = 21; + if (format_default_length > PATHMAX) bad = 31; /* if (2 * 262143L < mem_top - mem_min) */ if (max_halfword < (mem_top - mem_min) / 2) bad = 41; + if (bad > 0) { sprintf(log_line, "%s%s%ld\n", "Ouch---my internal constants have been clobbered!", "---case ", (long) bad); show_line(log_line, 1); - if (! knuth_flag) + + if (!knuth_flag) bad_formator_pool(format_file, "the format file", "TEXFORMATS"); /* 96/Jan/17 */ + goto lab9999; // abort } + initialize(); + #ifdef INITEX if (is_initex) { if (!get_strings_started()) goto lab9999; // abort + init_prim(); init_str_ptr = str_ptr; init_pool_ptr = pool_ptr; - dateandtime(tex_time, day, month, year); + fix_date_and_time(tex_time, day, month, year); } #endif /* INITEX */ ready_already = 314159L; /* magic number */ @@ -2521,16 +2570,21 @@ lab1: /* get here directly if ready_already already set ... */ show_line(tex_version, 0); sprintf(log_line, " (%s %s)", application, yandyversion); show_line(log_line, 0); + if (format_ident > 0) slow_print(format_ident); + print_ln(); + #ifndef _WINDOWS fflush(stdout); #endif + job_name = 0; name_in_progress = false; log_opened = false; output_file_name = 0; + { { input_ptr = 0; @@ -2542,6 +2596,7 @@ lab1: /* get here directly if ready_already already set ... */ max_buf_stack = 0; param_ptr = 0; max_param_stack = 0; + #ifdef ALLOCATEBUFFER /* first = current_buf_size; */ memset (buffer, 0, current_buf_size); /* redundant */ @@ -2549,10 +2604,6 @@ lab1: /* get here directly if ready_already already set ... */ /* first = buf_size; */ memset (buffer, 0, buf_size); /* redundant ? */ #endif -/* do { - buffer[first]= 0; - decr(first); - } while(!(first == 0)); */ first = 0; /* 1999/Jan/22 */ scanner_status = 0; @@ -2565,8 +2616,10 @@ lab1: /* get here directly if ready_already already set ... */ cur_input.name_field = 0; force_eof = false; align_state = 1000000L; + if (!init_terminal()) goto lab9999; // abort + cur_input.limit_field = last; first = last + 1; } @@ -2578,18 +2631,23 @@ lab1: /* get here directly if ready_already already set ... */ { if (format_ident != 0) initialize(); + if (!open_fmt_file ()) goto lab9999; // abort + if (!load_fmt_file ()) { w_close(fmt_file); goto lab9999; // abort } + w_close(fmt_file); + while ((cur_input.loc_field < cur_input.limit_field) && - (buffer[cur_input.loc_field] == 32)) + (buffer[cur_input.loc_field] == ' ')) incr(cur_input.loc_field); } + #ifdef CHECKEQTB if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */ @@ -2598,16 +2656,19 @@ lab1: /* get here directly if ready_already already set ... */ decr(cur_input.limit_field); else buffer[cur_input.limit_field] = end_line_char; - dateandtime(tex_time, day, month, year); - magic_offset = str_start[886] - 9 * 16; /* following: */ + + fix_date_and_time(tex_time, day, month, year); + + magic_offset = str_start[886] - 9 * ord_noad; /* following: */ /* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */ + if (interaction == batch_mode) selector = no_print; else selector = term_only; if ((cur_input.loc_field < cur_input.limit_field) && - (eqtb[(hash_size + 1883) + buffer[cur_input.loc_field]].hh.v.RH != 0)) + (cat_code(buffer[cur_input.loc_field]) != escape)) start_input(); } @@ -2644,6 +2705,7 @@ lab9999: fflush(stdout); #endif ready_already = 0; + if ((history != 0) && (history != 1)) code = 1; else @@ -2694,18 +2756,21 @@ void add_variable_space(int size) /* All ini TeX code is here at end so can use same pragma optimize for it */ /* Ini-TeX code is rarely needed/used so make it small rather than fast */ -#pragma optimize("t", off) -#pragma optimize("s", on) +//#pragma optimize("t", off) +//#pragma optimize("s", on) #ifdef INITEX /* split out to allow sharing of code from do_initex and newpattern */ void reset_trie (void) { integer k; + for (k = - (integer) trie_op_size; k <= trie_op_size; k++) trie_op_hash[k] = 0; + for (k = 0; k <= 255; k++) trie_used[k] = min_trie_op; + max_op_used = min_trie_op; trie_op_ptr = 0; trie_not_ready = true; @@ -2724,6 +2789,7 @@ void reset_hyphen (void) hyph_word[z] = 0; hyph_list[z] = 0; /* hyph_list[z]:=null; l.18131 */ } + hyph_count = 0; } /* split out to allow optimize for space, not time */ @@ -2733,13 +2799,12 @@ void do_initex (void) integer k; /* hyph_pointer z; */ -/* -> 0164 */ for (k = mem_bot + 1; k <= lo_mem_stat_max; k++) mem[k].cint = 0; k = mem_bot; - while(k <= lo_mem_stat_max) + while (k <= lo_mem_stat_max) { glue_ref_count(k) = 1; stretch_order(k) = normal; @@ -3124,7 +3189,9 @@ void sort_avail (void) p = rlink(rover); rlink(rover) = empty_flag; old_rover = rover; - while (p != old_rover) { + + while (p != old_rover) + { if (p < rover) { q = p; @@ -3135,26 +3202,31 @@ void sort_avail (void) else { q = rover; + while (rlink(q) < p) q = rlink(q); + r = rlink(p); rlink(p) = rlink(q); rlink(q) = p; p = r; } } + p = rover; - while (rlink(p) != empty_flag) { + + while (rlink(p) != empty_flag) + { llink(rlink(p)) = p; p = rlink(p); } + mem[p + 1].hh.v.RH = rover; llink(rover) = p; } #endif /* INITEX */ #ifdef INITEX -/*****************APTEX********************/ str_number make_string_pool (char *s) { int slen = strlen(s); @@ -3170,7 +3242,7 @@ str_number make_string_pool (char *s) return (make_string()); } } -/*****************APTEX********************/ + void primitive_ (str_number s, quarterword c, halfword o) { pool_pointer k; @@ -3184,10 +3256,12 @@ void primitive_ (str_number s, quarterword c, halfword o) { k = str_start[s]; l = str_start[s + 1] - k; /* small_number l */ + for (j = 0; j <= l - 1; j++) { buffer[j] = str_pool[k + j]; } + cur_val = id_lookup(0, l); flush_string(); /* ********************** debugging only 96/Jan/20 should not happen */ @@ -3197,6 +3271,7 @@ void primitive_ (str_number s, quarterword c, halfword o) #endif hash[cur_val].v.RH = s; } + eqtb[cur_val].hh.b1 = 1; eqtb[cur_val].hh.b0 = c; eqtb[cur_val].hh.v.RH = o; @@ -3225,20 +3300,23 @@ trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v) overflow("pattern memory ops", trie_op_size); return 0; // abort_flag set } + u = trie_used[cur_lang]; -/* if u=max_quarterword then ??? */ + if (u == max_trie_op) { -/* overflow("pattern memory ops per language", max_quarterword-min_quarterword); ??? */ /* pattern memory ops per language */ overflow("pattern memory ops per language", max_trie_op - min_trie_op); return 0; // abort_flag set } + incr(trie_op_ptr); incr(u); trie_used[cur_lang] = u; + if (u > max_op_used) max_op_used = u; + hyf_distance[trie_op_ptr] = d; hyf_num[trie_op_ptr] = n; hyf_next[trie_op_ptr] = v; @@ -3248,11 +3326,13 @@ trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v) Result = u; return(Result); } + if ((hyf_distance[l]== d) && (hyf_num[l]== n) && (hyf_next[l]== v) && (trie_op_lang[l]== cur_lang)) { Result = trie_op_val[l]; return(Result); } + if (h > - (integer) trie_op_size) decr(h); else @@ -3269,20 +3349,25 @@ trie_pointer trie_node_ (trie_pointer p) /* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */ h = abs(toint(trie_c[p]) + 1009 * toint(trie_o[p]) + 2718 * toint(trie_l[p]) + 3142 * toint(trie_r[p])) % trie_size; - while (true) { + + while (true) + { q = trie_hash[h]; + if (q == 0) { trie_hash[h] = p; Result = p; return(Result); } + if ((trie_c[q] == trie_c[p]) && (trie_o[q] == trie_o[p]) && (trie_l[q]== trie_l[p]) && (trie_r[q]== trie_r[p])) { Result = q; return(Result); } + if (h > 0) decr(h); else @@ -3315,8 +3400,11 @@ void first_fit_ (trie_pointer p) c = trie_c[p]; z = trie_min[c]; - while (true) { + + while (true) + { h = z - c; + if (trie_max < h + 256) { if (trie_size <= h + 256) @@ -3326,21 +3414,30 @@ void first_fit_ (trie_pointer p) /* not dynamic ---- but can be set -h=... from command line in ini-TeX */ return; // abort_flag set } - do { - incr(trie_max); - trie_taken[trie_max] = false; - trie_trl[trie_max] = trie_max + 1; - trie_tro[trie_max] = trie_max - 1; - } while (!(trie_max == h + 256)); + + do + { + incr(trie_max); + trie_taken[trie_max] = false; + trie_trl[trie_max] = trie_max + 1; + trie_tro[trie_max] = trie_max - 1; + } + while (!(trie_max == h + 256)); } + if (trie_taken[h]) goto lab45; + q = trie_r[p]; - while (q > 0) { + + while (q > 0) + { if (trie_trl[h + trie_c[q]] == 0) goto lab45; + q = trie_r[q]; } + goto lab40; lab45: z = trie_trl[z]; @@ -3833,7 +3930,8 @@ void store_fmt_file (void) lab41: incr(j); l = j; - while (j < (int_base - 1)) { + while (j < (int_base - 1)) + { if ((equiv(j) != equiv(j + 1)) || (eq_type(j) != eq_type(j + 1)) || (eq_level(j) != eq_level(j + 1))) @@ -4451,5 +4549,5 @@ void init_prim (void) } #endif /* INITEX */ -#pragma optimize("s", off) /* 96/Sep/12 */ -#pragma optimize("t", on) /* 96/Sep/12 */ +//#pragma optimize("s", off) /* 96/Sep/12 */ +//#pragma optimize("t", on) /* 96/Sep/12 */ diff --git a/src/texsourc/kpathsea/export_kpathsea.bat b/src/texsourc/kpathsea/export_kpathsea.bat new file mode 100644 index 0000000..d7422ba --- /dev/null +++ b/src/texsourc/kpathsea/export_kpathsea.bat @@ -0,0 +1 @@ +svn export svn://tug.org/texlive/trunk/Build/source/texk/kpathsea/ kpathsea diff --git a/src/texsourc/kpathsea/kpathsea/AUTHORS b/src/texsourc/kpathsea/kpathsea/AUTHORS new file mode 100644 index 0000000..6c6a9b1 --- /dev/null +++ b/src/texsourc/kpathsea/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/src/texsourc/kpathsea/kpathsea/BUGS b/src/texsourc/kpathsea/kpathsea/BUGS new file mode 100644 index 0000000..a3268c9 --- /dev/null +++ b/src/texsourc/kpathsea/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 + 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 +, 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 +. To join, email 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 (via mail to +). + + If you are looking for general TeX help, such as how to use LaTeX, +please use the mailing list 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 +machines 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/src/texsourc/kpathsea/kpathsea/ChangeLog b/src/texsourc/kpathsea/kpathsea/ChangeLog new file mode 100644 index 0000000..b970eb1 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/ChangeLog @@ -0,0 +1,8566 @@ +2014-03-21 Peter Breitenlohner + + * Makefile.am, configure.ac, getopt.h: Revert previous change. + Cygwin system getopt() is incompatible with the GNU version. + +2014-03-06 Peter Breitenlohner + + * Makefile.am, configure.ac: Use Cygwin system getopt(). + * getopt.h: Avoid to redeclare the getopt API. + +2014-02-08 TANAKA Takuji + + * knj.[ch]: Add a new function win32_putc(). + (Windows only) + +2014-01-25 Akira Kakuto + + * kpsewhich.c : [WIN32 only] progname should be kpse->program_name + since progname can be NULL. + +2014-01-25 Peter Breitenlohner + + * knj.c: Drop unused variable (avoid warning). + +2014-01-25 TANAKA Takuji + + * knj.[ch]: Add a new function win32_getc(), win32_ungetc(), + win32_fputs(), and win32_puts(). (Windows only) + * kpsewhich.c, pathsearch.c, line.c: + Allow Unicode file name in kpsewhich. (Windows only) + * knj.c: Fix typo in error message. (Windows only) + +2014-01-14 Peter Breitenlohner + + * knj.c: Add #include as required for MinGW32. + Cast arg3 of fsyscp_spawnvp() to avoid warning. + +2014-01-14 Akira Kakuto + + * knj.[ch]: Add new functions fsyscp_spawnvp(), and fsyscp_system(). + (Windows only) + +2014-01-13 TANAKA Takuji + + * knj.[ch]: Add a new function fsyscp_popen(). (Windows only) + +2014-01-08 TANAKA Takuji + + * knj.c: Allow encoding name "" for non-utf8 command line. + Warn if unknown encoding. (Windows only) + +2014-01-04 Peter Breitenlohner + + * knj.c: Keep non-utf8 command line. Avoid compiler warnings. + +2014-01-01 TANAKA Takuji + + * knj.c, knj.h: Use cast for ASCII string conversion + from char to wchar_t. (Windows only) + +2013-12-31 Akira Kakuto + + * knj.h: Remove #include because Visual Studio 2010 + cannot compile Kpathsea. + +2013-12-31 TANAKA Takuji + + * knj.c, knj.h: Add new functions fsyscp_fopen() and + get_command_line_args_utf8() (Windows only) + * progname.c: Refine initialization for KANJI (Windows only) + +2013-12-03 TANAKA Takuji + + * elt-dirs.c, knj.c, knj.h, progname.c, readable.c: Support KANJI + file name in (e)upTeX and XeTeX on Windows. + +2013-09-22 Karl Berry + + * mktexlsr: output normal msgs to stdout, not stderr. + Suggestion from Scott Kostyshak, tex-live mail 29 Jun 2013 04:42:10. + +2013-08-17 Peter Breitenlohner + + * configure.ac (AH_TOP): Simplify the generation of c-auto.h. + +2013-08-14 Akira Kakuto + + * win32lib.c, mingw32.c (texlive_gs_init()): Fix a bug. 'n' and 'f' can + be drive letters. + +2013-08-12 Akira Kakuto + + * win32lib.c, mingw32.c (texlive_gs_init()): Do nothing if + TEXLIVE_WINDOWS_EXTERNAL_GS is defined and its value is not + '0', 'n', or 'f'. + +2013-08-07 Karl Berry + + * line.c (read_line): only at EOF if loc==0, i.e., do not ignore a + non-terminated last "line" of a file; distressingly common on Windows. + * Makefile.am (TESTS): add cnfnewline.test; + move all *.test to tests/ subdir. + (EXTRA_DIST): add tests/cnfnewline/texmf.cnf, a file without a + final newline. + + * kpsewhich.test: also check that we can read the environment + variable that we set. + +2013-07-07 TANAKA Takuji + + * knj.c and progname.c: Generalize the method to avoid the 0x5c problem + in path names to the cases CP936 (simplified Chinese) and CP950 + (traditional Chinese) on Windows system. + +2013-07-06 Peter Breitenlohner + + * Makefile.am: Use ../../am/rebuild.am. + +2013-07-05 Peter Breitenlohner + + * Makefile.am, man/Makefile.am: + Moved Makefile fragments to ../../am/. + +2013-07-01 Peter Breitenlohner + + * c-memstr.h: Drop mapping of BSD => SYSV/ANSI string functions. + +2013-06-25 Karl Berry + + * texmf.cnf (guess_input_kanji_encoding): config variable, + off by default. Per Akira. + +2013-06-25 Peter Breitenlohner + + * config.h: Remove definition of EXEEXT, comes from c-auto.h. + +2013-06-25 Akira Kakuto + + * config.h: define EXEEXT if DOSISH is defined. + + * win32lib.c: Unify two win32lib.c's in w32 sources. + + * progname.c, texmf.cnf: Define SELFAUTOGRANDPARENT to give a + robust TEXMFLOCAL. + +2013-06-16 Peter Breitenlohner + + * configure.ac: New conditional have_EXEEXT. + * Makefile.am (libkpathsea_la_CPPFLAGS): Define EXEEXT for + systems with a non-vanishing executable extension. + * progname.[ch]: New function kpse_program_basename(). + * version.ac: Update version number 6.1.1 => 6.2.0dev. + + Adapt kpathsea headers to C++. + * absolute.h, cnf.h, concatn.h, config.h, debug.h, expand.h, + hash.h, knj.h, lib.h, line.h, magstep.h, mingw32.h, + pathsearch.h, proginit.h, progname.h, readable.h, str-list.h, + str-llist.h, tex-file.h, tex-glyph.h, tex-hush.h, tex-make.h, + types.h, variable.h, version.h, win32lib.h: When compiling C++ + surround all declarations by 'extern "C" {' ... '}'. + +2013-06-15 Peter Breitenlohner + + * cnf.c, kpsewhich.c: Drop redundant + (in ). + +2013-06-11 Peter Breitenlohner + + * xrealloc.c: Drop redundant extern (in ). + +2013-06-05 Peter Breitenlohner + + * Makefile.am (*_la_LDFLAGS): Add -bindir for MinGW DLL. + + * win32lib.h.mugica (removed): Unused and unmaintained. + * Makefile.am: Adapt. + +2013-05-30 Karl Berry + + * Version 6.1.1 for TeX Live 2013. + +2013-04-15 Karl Berry + + * texmf.cnf (TEXINPUTS.lamed): there is no lamed directory and + never has been, as far as I can tell, so don't look in it. + + * texmf.cnf (TEXMFCACHE): new variable for lualatex font cache; + same value as ConTeXt MkIV's variable of the same name in + texmfcnf.lua. + +2013-04-10 Karl Berry + + * texmf.cnf (TEXMFCNF): still look in texmf/ subdirs after all; + needed for non-TL ConTeXt and likely others. Report from + Mojca/Hans. + +2013-04-05 Karl Berry + + * other files: 2013 in copyright year list. + + * kpsewhich.c, + * NEWS, + * version.ac: 6.1.1 and 2013 to prepare for TL'13 pretest. + + * texmf.cnf (TEXMFCNF): likewise prepare to use texmf-dist instead + of texmf. From Akira. + +2013-04-03 Karl Berry + + * texmf.cnf (TEXMFMAIN): make it the same as $TEXMFDIST, + and do not use it. That is, as of TL 2013, everything will be in + texmf-dist, not split between texmf and texmf-dist. See the + thread including + http://tug.org/mailman/htdig/tex-live/2013-January/032888.html. + + Also change 2012 to 2013. + +2013-03-26 Karl Berry + + * tex-make.c (kpathsea_make_tex): specify fn name in warnings + about invalid fontnames. + +2013-03-14 Karl Berry + + * texmf.cnf (save_size): increase to 100000 (from 50000), + for perldoc-all.texi (http://www.gnu.org/software/perl/manual). + +2013-02-08 Peter Breitenlohner + + * Makefile.am (web2cdir): Change texmf => texmf-dist. + +2013-01-30 Peter Breitenlohner + + * configure.ac: Use KPSE_COND_MINGW32. + +2013-01-29 Akira Kakuto + + * progname.c, types.h, win32lib.c, win32lib.h: Simplify win32_popen. + +2012-12-16 Peter Breitenlohner + + * Makefile.am (kpathsea.h): Enable silent rules. + +2012-12-13 Peter Breitenlohner + + Resolve remaining const related problems. + * db.[ch] (kpathsea_db_search_list): Make arg3 non-const. + * pathsearch.[ch] (kpathsea_path_search_list_generic, + dir_list_search_list): Make arg3 non-const. + * tex-file.c: Remove casts 'string*' => 'const_string*'. + * readable.[ch] (kpathsea_readable_file): Make arg non-const. + Include code to truncate too-long filename components. + + * truncate.[ch] (kpathsea_truncate_filename): Files removed. + * Makefile.am: Drop truncate.c and truncate.h. + +2012-12-12 Peter Breitenlohner + + Somewhat disentangle path search functions. + * db.c (kpathsea_init_db): + Directly call kpathsea_path_search_list_generic() + instead of the kpathsea_all_path_search_list() wrapper. + * pathsearch.c: Rename the static function search_list() into + the non-static kpathsea_path_search_list_generic() and drop + the former kpathsea_path_search_list_generic() wrapper. + * pathsearch.[ch]: Drop the now unused *_path_search_list(). + +2012-12-11 Peter Breitenlohner + + Resolve some const related problems. + * str-list.[ch]: Add cstr_list_type and cstr_list_add() for + const strings. Define [c]str_list_init() as static inline. + * kpathsea.c: Move definition of KPATHSEA_CAN_FREE from here ... + * hash.h: ... to here. + * hash.[ch]: Define hash_free() only if KPATHSEA_CAN_FREE!=0. + (hash_lookup): Change return type 'string*' => 'const_string*'. + * cnf.[ch] (kpathsea_cnf_get, kpse_cnf_get): + Change return type 'string*' => 'const_string*'. + * dir.c (kpathsea_dir_links): Adapt. + * rm-suffix.c (remove_suffix): Adapt. + * db.c, fontmap.c: Remove casts 'string*' => 'const_string*'. + +2012-12-10 Peter Breitenlohner + + * mingw32.c: Remove look_for_cmd(). + +2012-12-10 Akira Kakuto + + * win32lib.c: remove look_for_cmd(). + +2012-12-08 Peter Breitenlohner + + * mingw32.c (look_for_cmd): Do not compute unused value. + * win32lib.c (look_for_cmd, kpathsea_win32_popen): Same. + +2012-11-28 Peter Breitenlohner + + * texmf.cnf: Increase main_memory, font_mem_size, hash_extra, + and pool_size. + +2012-11-20 Peter Breitenlohner + + * Makefile.am: Avoid use of deprecated INCLUDES. + +2012-10-03 Peter Breitenlohner + + * mingw32.c: use stat in static int is_dir (). + +2012-10-02 Akira Kakuto + + * win32lib.c: use stat in static int is_dir (). + +2012-10-01 Akira Kakuto + + * win32lib.c: remove _osver since it is obsolete. + +2012-09-28 Akira Kakuto + + * win32lib.h: remove definition of mkdir. + * c-proto.h: introduce NO_KPSE_DLL as in getopt.h. + +2012-08-11 Peter Breitenlohner + + * c-std.h: Define M_PI if not defined by (old MSVC). + +2012-08-08 Peter Breitenlohner + + * Makefile.am: Use ../am/bin_links.am. + +2012-08-02 Akira Kakuto + + * win32lib.h: remove definition of pipe. + +2012-08-01 Peter Breitenlohner + + * configure.ac: Bail out for a badly broken snprintf() + (hopefully this will not happen). + Check if we need (v)snprintf wrapper functions. + * config.h: If needed, declare (v)snprintf wrapper functions. + * progname.c (kpathsea_set_program_name): Check snprintf sanity. + +2012-07-25 Peter Breitenlohner + + * configure.ac: Add AC_CHECK_SIZEOF([long]). + * types.h: #include and if they exist. + If necessary #define PRId64 & Co. + +2012-07-25 Peter Breitenlohner + + * getopt.c [WIN32 && ! __CYGWIN__]: Use __CYGWIN__ instead of + __CYGWIN32__ which is deprecated and may be removed. + Mail from Ken Brown , Tue, 24 Jul 2012. + +2012-07-23 Peter Breitenlohner + + * mingw32.h (win32_popen): Static inline wrapper for _popen() + to use always binary mode. + +2012-07-23 Akira Kakuto + + * win32lib.c: rewrite kpathsea_win32_popen to use always binary + mode. + +2012-07-13 Peter Breitenlohner + + * Makefile.am (libkpathsea_la_SOURCES): Skip compilation of + xfseeko.c and xftello.c for MSVC. + * win32lib.h: Drop xfseeko() and xftello() prototypes, they will + subsequently be defined in lib.h. + +2012-07-09 Peter Breitenlohner + + * version.ac: Update version number 6.1.0 => 6.1.1dev. + +2012-05-29 Akira Kakuto + + * win32lib.c: rewrite win32_system. + +2012-05-22 Karl Berry + + * mktexmf: test $name for csso12*, not $rootname. + From Debian via Norbert, 21 May 2012 10:11:08. + +2012-05-16 Peter Breitenlohner + + * cnf.[ch]: Add KPSEDLL to kpathsea_cnf_get(), and reintroduce + kpse_cnf_get(). + * Makefile.am: Do install cnf.h. + +2012-05-06 Peter Breitenlohner + + * Makefile.am (rebuild): Depend on 'all-am' instead of 'all' to + avoid an infinite loop. + +2012-05-05 Peter Breitenlohner + + * win32lib.[ch]: Copyright 2012. + +2012-05-05 Akira Kakuto + + * win32lib.c: rewrite xftell64 for W32. + +2012-05-04 Akira Kakuto + + * win32lib.c: rewrite xftell64 and xfseek64 for W32. + +2012-04-30 Akira Kakuto + + * win32lib.c: further rewrite win32_system(). + +2012-04-23 Peter Breitenlohner + + * Makefile.am (rebuild): Touch libkpathsea.la to avoid an + infinite loop when only mingw32.h or win32lib.h is changed. + +2012-04-23 Akira Kakuto + + * win32lib.h, win32lib.c: rewrite win32_system(). + +2012-04-17 Akira Kakuto + + * texmf.cnf: erase "ptexgeneric". + +2012-04-16 Karl Berry + + * texmf.cnf (TEXMFCNF): spell out every directory explicitly, + so we can include $SELFAUTOPARENT/../texmf-local/web2c. + +2012-04-09 Peter Breitenlohner + + * cnf.[ch]: Drop KPSEDLL from kpathsea_cnf_get(), and remove + kpse_cnf_get(). + * db.h: Drop KPSEDLL from kpathsea_db_insert(). + * Makefile.am: Do not install cnf.h. + * mingw32.h: Add a copyright statement. + + * configure.ac: Subst tex_live_version from ../../version.ac + as WEB2CVERSION for WIN32 programs. + +2012-04-09 Karl Berry + + * getopt.h (getopt) [!__cplusplus]: do not declare when compiling + with C++, since g++ 4.7.0 introduced an incompatible declaration. + http://bugs.debian.org/667392 + + * c-std.h (popen, pclose) [!VMS]: remove these decls to avoid + conflicts, hoping they are now always in the system libraries. + http://bugs.debian.org/64524 + +2012-04-07 Karl Berry + + * texmf.cnf (glob_str_size): increase from 5000 to 20000 per Akira, + 06 Apr 2012 10:25:18. + +2012-04-04 Peter Breitenlohner + + * c-unistd.h: Declare getopt() (via ) only + for Mingw and Cygwin; for other systems using the GNU C library + g++-4.7 might choke on incompatible exception specifications. + +2012-03-11 Karl Berry + + * *.c: prepend kpathsea: to warnings. + +2012-03-04 Peter Breitenlohner + + Avoid 'the address of XXX will always evaluate as true' warnings. + * lib.h (STREQ): Test '(s) != NULL' instead of '(s)'. + Gcc >=4.3 produces identical code but -Wall yields no warning. + +2012-03-01 Peter Breitenlohner + + * c-unistd.h: Declare getopt() (via ) but + not getopt_long(). + + * getopt.h: With __need_getopt declare only getopt() but not + getopt_long() (with 'struct option'). + + * getopt.[ch]: Drop pre-ANSI C non-prototype declarations. + +2012-02-27 Peter Breitenlohner + + * c-unistd.h [CYGWIN]: Explicitly #include + such that from Cygwin will be skipped. + +2012-02-27 Ken Brown + + * getopt.h: Cygwin requires getopt() prototype. + +2011-12-22 Karl Berry + + * texmf.cnf (TEX.pmpost, TEXINPUTS.(e)up(la)tex): new definitions, + from Norbert. + +2011-12-06 Peter Breitenlohner + + * Makefile.am: Replace ${prefix}/texmf => $(datarootdir)/texmf. + +2011-10-27 Karl Berry + + * texmf.cnf (FONTCONFIG_*): doc+formatting fix. + +2011-10-06 Akira Kakuto + + * win32lib.c, win32lib.h: use const char * in system() and popen(). + +2011-09-30 Karl Berry + + * types.h (kpse_{ris,bltxml}_format): new types. + * tex-file.c ({RIS,BLTXML}_ENVS): new defines. + (kpse_init_format): initialize them. + * texmf.cnf ({RIS,BLTXML}INPUTS): new definitions. + Request from Phil Kime, tex-k 25 Sep 2011 16:46:07. + +2011-08-28 Karl Berry + + * texmf.cnf (LUAINPUTS.lualatex, LUAINPUTS.dvilualatex): new defns. + (LUAINPUTS): duplicate value of TEXINPUTS.luatex, instead + of using $TEXINPUTS. + Report from Herbert Voss, 15 Aug 2011 23:53:45, + among others. + +2011-08-12 Peter Breitenlohner + + * version.ac: Update version number 6.0.2dev => 6.1.0dev. + +2011-08-09 Peter Breitenlohner + + * Makefile.am (SUBDIRS): Add win32 to build C programs from + Akira's W32TeX as WIN32 replacements for the shell scripts. + +2011-08-08 Peter Breitenlohner + + * progname.c (fix_selfdir): Simplified to not modify arg. + (remove_dots): Somewhat clarify the code (suggested by Karl). + * progname.h [WIN32]: Don't declare {kpathsea,kpse)_selfdir(). + + * progname.c [TEST]: Update and extend the test program. + * Makefile.am (progname-test): Add rules to build the standalone + test program. + +2011-08-08 Karl Berry + + * cnf-to-paths.awk: preserve values starting with /, + so distro maintainers can edit texmf.cnf with absolute + paths and not have them replaced with /nonesuch. + Suggestion from Norbert. + +2011-08-05 Karl Berry + + * dir.c, + * getopt.c, + * hash.h, + * pathsearch.h, + * progname.h, + * truncate.h: copyright 2011. + +2011-08-05 Peter Breitenlohner + + * cnf.c, fontmap.c: Do not #include . + * Makefile.am (kpseinclude_HEADERS): Remove recorder.h. + * recorder.h (removed): Empty file. + + * Makefile.am: Do not install kpathsea internal headers. + + * xdirtest.c: Additional test data. + +2011-08-04 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * xbasename.c: Test for 2-Byte Kanji (CP 932, SJIS) codes and + for Unc names. + * xdirname.c: Test for 2-Byte Kanji (CP 932, SJIS) codes and + slashify the result. + + * xdirtest.c (new): Standalone program to test xdirname() and + xbasename(), based on code moved to here ... + * xdirname.c [TEST]: ... from here. + +2011-08-03 Akira Kakuto + + * db.c (db_build): No need to slashify lines from db_file. + +2011-08-03 Peter Breitenlohner + + * mingw32.[ch] (dostounix_filename): Remove unused function. + (texlive_gs_init): New function copied from win32lib.[ch]. + +2011-08-03 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * db.c (ignore_dir_p, db_build, match), + kpsewhich.c (subdir_match): Slashify and test for 2-Byte Kanji + (CP 932, SJIS) codes. + +2011-08-03 Akira Kakuto + + * win32lib.h: #include for _getcwd. + +2011-08-02 Peter Breitenlohner + + Unexport kpathsea internal functions, remove unused ones. + * db.[ch] (kpse_db_insert, kpse_init_db, kpse_db_search, + kpse_db_search_list): All removed. + * default.h (kpathsea_expand_default): Internal use only. + * default.h, kdefault.c (kpse_expand_default): Removed. + * elt-dirs.c (kpse_normalize_path, kpse_element_dirs): Removed. + * expand.[ch] (kpathsea_expand): Internal use only. + (kpse_expand): Removed. + * fn.h (fn_init, fn_copy0, fn_free, fn_1grow, fn_grow, + fn_str_grow, fn_shrink_to): ALL internal use only. + * hash.h (hash_insert_normalized): Internal use only. + * path-elt.c (kpse_path_element): Removed. + * pathsearch.[ch] (kpathsea_path_element, kpathsea_element_dirs, + kpathsea_path_search_list, kpathsea_path_search_list_generic, + kpathsea_all_path_search_list): Internal use only. + (kpse_path_element, kpse_filename_component, + kpse_normalize_path, kpse_element_dirs, kpse_path_search_list, + kpse_path_search_list_generic, kpse_all_path_search_list): + Removed. + * fontmap.h, tilde.h, truncate.h, xstat.h: Whole files internal + use only. + +2011-08-02 Akira Kakuto + + * win32lib.h: follow mingw32.h for boolean and move definitions + for win32 functions from lib.h. + * win32lib.c: change definitions of xfseek64 and xftell64 to match + with xfseeko and xftello. + +2011-08-02 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * elt-dirs.c (dir_list_add, do_subdir, expand_elt): Replace + IS_DIR_SEP by IS_DIR_SEP_CH. + + * getopt.h: Add (non-ANSI) declaration for getopt(). + * mingw32.h: #define off_t as off64_t for ftello64 and fseeko64. + +2011-08-01 Peter Breitenlohner + + * win32lib.h.mugica: Renamed from win32lib.h. + * win32lib.[ch]: New files, yet to be filled in. + + * knj.c (is_cp932_system): No KPSEDLL in knj.c, only in knj.h. + +2011-07-31 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * c-pathch.h: IS_DIR_SEP_CH macro to be used with `slashified' + filenames without need to test for 2-Byte Kanji codes. + + * elt-dirs.c (kpathsea_normalize_path): Slashify, reformulate, + and test for 2-Byte Kanji (CP 932, SJIS) codes. + (kpathsea_element_dirs): First call kpathsea_normalize_path() + which might modify `elt' and then test for cached answer. + + * progname.c: Make sure SELFAUTO* is not just / only for WIN32. + +2011-07-30 Peter Breitenlohner + + * dir.c (kpathsea_dir_p, dir_p), lib.h: Unconstify string parms. + * elt-dirs.c (dir_list_add, checked_dir_list_add, do_subdir, + expand_elt): Unconstify string parms and local vars. + * progname.c (kpathsea_selfdir): Don't uselessly initialize ret. + + * mingw32.c: #include . + * mingw32.h [IS_DIR_SEP, IS_DEVICE_SEP, IS_UNC_NAME]: Do not + duplicate them here, use definitions from c-pathch.h. + +2011-07-29 Akira Kakuto + + * tilde.c [WIN32]: Use kpathsea_getpwnam(). + +2011-07-28 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * db.c, find-suffix.c, xbasename.c: + Reformulate and test for 2-Byte Kanji (CP 932, SJIS) codes. + + * expand.c, make-suffix.c, tilde.c: Slashify, reformulate, + and test for 2-Byte Kanji (CP 932, SJIS) codes. + + * progname.c: Make sure SELFAUTO{LOC,DIR,PARENT} is not just /. + + * types.h (kpathsea_instance): Merge TL and W32TeX. + +2011-07-27 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * progname.c (kpathsea_set_program_name): Merge TL and W32TeX. + +2011-07-26 Peter Breitenlohner + + More diffs between TeX Live and W32TeX. + * knj.[ch]: New files from Akira's W32TeX. + * progname.c (kpathsea_set_program_name): Set is_cp932_system. + * Makefile.am, config.h: Adapt. + + * db.c, expand.c, hash, path-elt.c, tilde.c, truncate.c, + variable.c, xdirname.c, xgetcwd.c: + Test for 2-Byte Kanji (CP 932, SJIS) codes. + + * db.c (kpathsea_db_search, kpathsea_db_search_list), + tex-file.c (kpathsea_set_suffixes_va_list, init_maketex): + Cast arg to `void *' because MSVC warns for a `const_string *' + arg when expecting `void *'. + + * config.h, db.c, hash.c: #define and use TRANSFORM. + +2011-07-25 Peter Breitenlohner + + Minor changes to reduce diffs between TeX Live and W32TeX. + * c-ctype.h [WIN32]: Never #define isascii. + * c-fopen.h: Always write text files with Unix line endings. + * tex-glyph.c (bitmap_specs) [WIN32]: Add DOS_BITMAP_SPEC. + * win32lib.h: #define strncasecmp as _strnicmp. + * readable.c: Replace #elif WIN32 => #elif defined (WIN32). + * magstep.c, pathsearch.h, xftell.c: Adjust whitespace. + +2011-07-22 Peter Breitenlohner + + * kpathsea.c, progname.c, tex-file.c, types.h: + Drop #if defined(__MINGW32__) already implied by defined(WIN32). + + * kpathsea.c (kpathsea_finish): Free suffixlist. + +2011-07-15 Peter Breitenlohner + + * version.ac: New file defining the kpathsea version. + Update version number 6.0.1 => 6.0.2dev. + * configure.ac: Adapt. Use KPSE_LT_VERSION. + +2011-07-12 Peter Breitenlohner + + * ac/web2c.ac renamed into ac/mktex.ac. + * ac/withenable.ac, configure.ac: web2c.ac => mktex.ac. + * configure.ac: KPSE_WEB2C_PREPARE => KPSE_MKTEX_PREPARE. + +2011-06-29 Peter Breitenlohner + + * tex-make.c [WIN32]: Do not #include + from here (already done from config.h). + +2011-06-28 Karl Berry + + * mktexlsr: need to shift when arg is not a directory. + Found by Luigi Scarso, tex-k mail 28 Jun 2011 00:21:14. + +2011-06-19 Karl Berry + + * texmf.cnf (OPENTYPEFONTS): a duplicate entry was created :(. + +2011-06-18 Peter Breitenlohner + + * progname.c (remove_dots): Correctly handle dir="/foo/../bar". + +2011-06-17 Peter Breitenlohner + + Reduce memory leaks. + + * types.h (kpse_format_info_type): Declare path as non-const. + * tex-file.c (init_path): Free old value of path when assigning + a new value. + + * progname.c (kpathsea_selfdir): Free strings no longer used. + + * kpsewhich.c (lookup): Free string no longer used. + +2011-06-16 Peter Breitenlohner + + * fontmap.c (kpathsea_fontmap_lookup), kpsewhich.c (find_dpi), + progname.c (kpathsea_set_program_name): Allow find_suffix() to + return a const string. + + * find-suffix.c, lib.h: Declare find_suffix() as const. + * find-suffix.c: Explain that NAME+(find_suffix(NAME)-NAME) is + equivalent to find_suffix(NAME) but not necessarily const. + + * progname.c (remove_dots): Somewhat reorganize (initialize + ret as `NULL' instead of `(string)""'). + +2011-06-16 Peter Breitenlohner + + * tex-glyph.c (try_size, try_fontmap, kpathsea_find_glyph), + tex-glyph.h (kpse_glyph_file_type): Declare font name as const. + +2011-06-16 Peter Breitenlohner + + * xgetcwd.c: Fix #include directives (depend on GETCWD_FORKS). + (xgetcwd): The returned string may be long lived, so malloc() + only as needed. + Do not print path when getcwd(path, size) or getwd(path) fail, + the contents is undefined. + +2011-06-13 Manuel P\'egour\'e-Gonnard + + * db.c (match): ensure that we are at a dir separator in + the filename before checking for being at the final component. + (We were erroneously matching "foobar" to "foo" in some cases.) + Report from Manuel, tex-k mail 12 Jun 2011 21:29:55. + +2011-06-10 Karl Berry + + * configure.ac (AC_PROG_AWK): new test. + * Makefile.am (stamp-paths): use $(AWK). + This is to avoid broken Solaris /usr/bin/awk, which does + not have sub(). + Report from Ettore Aldrovandi, 8 Jun 2011 23:36:44. + +2011-06-09 Karl Berry + + * mktexlsr: write directory args to a file and read them back, + so we can support spaces (though not newlines) in the directory names. + Reword some error messages. + +2011-06-08 Akira Kakuto + + * hash.c: leave original letter cases also on win32. + +2011-06-06 Karl Berry + + * texmf.cnf (TEXINPUTS.context): No trailing comma, per Taco. + +2011-06-03 Peter Breitenlohner + + * mingw32.c (normalize_filename): Use memmove() instead of + memcpy() for overlapping objects. + +2011-05-29 Akira Kakuto + + * texmf.cnf: add "shell_escape.initex = f" and + "parse_first_line.initex = f", since we have initex in TL 2011. + Otherwise the banner of initex is "This is TeXk, ..." + +2011-05-27 Peter Breitenlohner + + * extend-fname.c: Remove the `generic const warning'. + * readable.c, rm-suffix.c: Adjust the `generic const warning'. + +2011-05-26 Peter Breitenlohner + + * db.c (kpathsea_db_search): Add `free (dir_part)'. + (kpathsea_db_search{,_list}): Declare a few strings as const. + (kpathsea_db_insert): Use pointer arith to avoid const warning. + +2011-05-24 Peter Breitenlohner + + * Makefile.am (EXTRA_DIST): Add the new cnf-to-paths.awk script. + +2011-05-24 Karl Berry + + * tex-file.c (TRUETYPE_SUFFIXES): add .dfont. + Request from Dohyun Kim, 23 May 2011 16:09:03. + * doc/kpathsea.texi (Supported file formats): mention it. + +2011-05-23 Karl Berry + + * cnf-to-paths.awk: new awk script. + * Makefile.am (stamp-paths): use it instead of the inline sed. + Also, change the generated paths.h so that all non-SELFAUTO paths + become a constant string "/nonesuch". That way, if the definitions + change, the binaries don't all uselessly change with them. + +2011-05-22 Karl Berry + + * texmf.cnf: doc fixes. + +2011-05-15 Peter Breitenlohner + + * absolute.c: Partially revert the minor rewrite. + +2011-05-12 Peter Breitenlohner + + * absolute.c: Minor rewrite. + + * NEWS, progname.[ch]: Finally remove kpse_set_progname + (deprecated since 1998). + +2011-05-06 Karl Berry + + * texmf.cnf (TEXINPUTS.eplatex): no longer needed per Akira. + (platex will always use eptex.) + +2011-05-03 Peter Breitenlohner + + * kpsewhich.c (find_format): Drop unused variable 'try_len'. + +2011-04-28 Karl Berry + + * kpsewhich.c (try_suffix): new fn, checking entire string for + format names. + (TRY_SUFFIX): change macro to just call the fn. + Report from Philipp Stephani, tex-live mail 25 Apr 2011 16:38:47. + + * NEWS, + * kpsewhich.c (read_command_line), + * doc/kpathsea.texi, + * texmf.cnf: 2011. + +2011-04-14 Peter Breitenlohner + + * configure.ac: Update version number 6.0.1dev => 6.0.1. + +2011-04-11 Peter Breitenlohner + + * texmf.cnf (TEXEDIT): Document Unix and Windows defaults. + + * tex-file.c (executable_filep): Avoid using strcpy() for + overlapping strings. + +2011-03-22 Karl Berry + + * texmf.cnf (TEXINPUTS.eptex, TEXINPUTS.eplatex): define, + same as .p(la)tex. From Akira. + +2011-03-07 Peter Breitenlohner + + * types.h: Rename the variables program_invocation_name and + program_invocation_short_name into kpse_invocation_name and + kpse_invocation_short_name repectively, (1) in order to avoid + conflicts with /usr/include/sys/errno.h from Cygwin, and (2) + because they are not the same as those from the GNU C library. + + Problem reported by Ken Brown . + +2011-03-03 Peter Breitenlohner + + * lib.h, xftell.c (xftell): Change return type from unsigned to + signed and use ftell() instead of ftello(). + +2011-03-01 Karl Berry + + * texmf.cnf: be more explicit that all trees, including TEXMFHOME, + must follow the TDS. + +2011-03-01 Peter Breitenlohner + + * mingw32.[ch]: Drop win32_system(); this was a workaround for a + bug in system() under Win9x. + +2011-03-01 Peter Breitenlohner + + * man/{kpsewhich,mktexlsr,mktexmf,mktexpk,mktextfm}.man: Drop + useless '.rb' macros. + * man/{kpseaccess,kpsereadlink,kpsestat}.man: The same. + Also remove `additional' from `following additional options'. + +2011-02-28 Peter Breitenlohner + + * Makefile.in.orig, common.ac.orig, withenable.ac: Remove + ancient files. + * Makefile.am (EXTRA_DIST): Adapt. + +2011-02-08 Peter Breitenlohner + + * man/Makefile.am: Use ../am/man1_links.am for manpage links. + +2011-02-02 Karl Berry + + * texmf.cnf (TEXMFROOT): new variable, $SELFAUTOPARENT by default, + to minimize redistributors' patches with a new Perl updmap. + +2011-01-06 Karl Berry + + * tex-file.c (LUA_SUFFIXES): add .tlu, + luatex mail from t34www, 6 Jan 2011 22:04:45. + +2011-01-01 Karl Berry + + * texmf.cnf (TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL): doc fixes. + +2010-12-27 Peter Breitenlohner + + * Makefile.am (install-exec-hook): Check symlink creation. + * man/Makefile.am (install-data-hook): The same. + +2010-12-24 Karl Berry + + * Makefile.am (stamp-paths): ensure that grep is not completely + broken, e.g., from GREP_OPTIONS, in which case we'd generate a + useless paths.h. + +2010-12-18 Peter Breitenlohner + + * Makefile.am [WIN32]: Skip mktex{lsr,mf,pk,tfm} shell scripts + and texhash->mktexlsr symlink. + +2010-12-01 Peter Breitenlohner + + * tex-make.c (maketex): Factor out common WIN32 & Unix code. + [WIN32]: Avoid compiler warnings. + +2010-12-01 Akira Kakuto + + * tex-make.c (maketex): [WIN32] spawnvp(_P_NOWAIT, ...) and pipe. + +2010-11-29 Karl Berry + + * doc/kpathsea.texi (Brace expansion): no longer derived from Bash. + +2010-11-27 Taco Hoekwater + + * db.c (kpathsea_db_search_list): one return list for everything, + else kpsewhich --all plain returns nothing, even though + kpsewhich plain works. Report from Paul Isambert, + 25 Nov 2010 19:09:21. + +2010-11-27 Karl Berry + + * kpsewhich.test: test this. + +2010-11-18 Peter Breitenlohner + + * tex-glyph.c (try_format): Drop unused params fontname and dpi; + mention the use of $KPATHSEA_{NAME,DPI} from environment. + +2010-11-10 Peter Breitenlohner + + * configure.ac: Update version number to 6.0.1dev. + +2010-11-10 Mathias Kende + + * tex-file.c (kpathsea_set_suffixes_va_list): new fn. + (kpse_set_suffixes, kpathsea_set_suffixes): call it. + Avoids passing variable argument list, which is not portable. + http://bugs.debian.org/602566. + +2010-11-07 Karl Berry + + * cnf.c (do_line): remove trailing comment and preceding + whitespace, so they do not appear as part of the value. + From Akira. + * doc/kpathsea.texi (Config files): document this. + * texmf.cnf: doc fixes. + +2010-10-02 Peter Breitenlohner + + * Makefile.am (libkpathsea_la_LDFLAGS): Add -no-undefined. + +2010-09-24 Karl Berry + + * texmf.cnf (TTFONTS): also read opentype//. + (OPENTYPEFONTS): also read truetype//. + Because common practice is to use .ttf/.ttc for TrueType-flavored + OpenType fonts (and .otf only for PostScript-flavored OpenType). + +2010-09-18 Karl Berry + + * texmf.cnf (DVIPDFMXINPUTS): do not include ., so attackers + cannot create a dvipdfmx.cfg with, e.g., xetex. + Report from Heiko, 16 Sep 2010 22:32:25. + +2010-09-09 Karl Berry + + * mktexlsr (vc_dirs): remove CVS and RCS from the list, + for compatibility with the corresponding change on Windows, + made so that rcs/rcs.sty is not ignored. + +2010-06-13 Karl Berry + + * doc/unixtex.texi: reduce to current reality. + +2010-06-10 Peter Breitenlohner + + * getopt.h [NO_KPSE_DLL]: Allow use of this file for chktex. + From Karl Berry, 9 Jun 2010 15:36:44. + +2010-06-06 Karl Berry + + * getopt.h (getopt) [! __STDC__]: remove decl since AIX/Solaris + compilers complain (vvv, tlbuild 07 Jun 2010 01:30:47). + +2010-06-04 Karl Berry + + * configure.ac (kpse_lib_devel): empty for TeX Live 2010 + (pretest 2, maybe final). + +2010-05-30 Karl Berry + + * texmf.cnf (shell_escape_commands): turns out fc-list is not + needed after all. + +2010-05-30 Manuel Pégourié-Gonnard + + * texmf.cnf: relax LUAINPUTS not to require and extra "lua" + subdirectory for modules in texmfscripts. + * texmf.cnf: enlarge trie_size to fit with latest hyph-utf8 release. + +2010-05-27 Karl Berry + + * getopt.h (getopt) [!__GNU_LIBRARY__]: do not declare at all. + Previous conditional on __cplusplus did not work with Sun CC. + Maybe all systems we compile on have getopt now? We'll see. + +2010-05-25 Karl Berry + + * texmf.cnf (shell_escape_commands): include fc-list for + the luaotfload font cache. + +2010-05-24 Karl Berry + + * texmf.cnf (font_mem_size): doc fix. + +2010-05-21 Karl Berry + + * mktexpk: help msg, mention map files in error. + +2010-05-20 Karl Berry + + * mktexdir, + * mktexupd, + * mktex.opt, + * mktexnam.opt: systematize header comments. + +2010-05-20 Peter Breitenlohner + + * kpseaccess.test: Allow for unexpected test results. + +2010-05-18 Karl Berry + + * texmf.cnf (shell_escape): set to p. Trying restricted shells again. + (shell_escape_commands): bibtex, bibtex8, + kpsewhich, makeindex, repstopdf. Don't plan to add anything + else for TL'10. + + * NEWS, + * kpsewhich.c (read_command_line), + * texmf.cnf (TEXMFCONFIG, TEXMFVAR): 2010. + +2010-05-16 Peter Breitenlohner + + * access.c: Adapt comment to facts. + * man/kpseaccess.man: Adapt to facts. + +2010-05-16 Akira Kakuto + + *absolute.c, c-fopen.h, c-stat.h, config.h, debug.h, dir.c, + elt-dirs.c, expand.c, getopt.c, getopt.h, getopt1.c, hash.c, + kpsewhich.c, lib.h, mingw32.c, path-elt.c, pathsearch.c, + progname.c, putenv.c, readable.c, strcasecmp.c, strstr.c, + strtol.c, tex-file.c, tex-glyph.h, + types.h, win32lib.h: untabify. + +2010-05-15 Peter Breitenlohner + + * kpseaccess.test, kpsereadlink.test, kpsestat.test, + kpsewhich.test: New shell scripts to test the programs. + * configure.ac (LT_OBJDIR): AC_SUBST for kpsereadlink.test. + * Makefile.am (TESTS, TESTS_ENVIRONMENT): Add the tests. + +2010-05-15 Akira Kakuto + + *absolute.c: avoid late declaration. add support of UNC names (WIN32). + *db.c: try ls-R only on WIN32. + *debug.c: avoid late declaration. + *elt-dirs.c: remove trailing whitespace. + *lib.h: add variables in prototype. + *pathsearch.c, tex-file.c: remove some spaces. + *tex-glyph.c: add some spaces. + +2010-05-15 Akira Kakuto + + *absolute.c, access.c, atou.c, c-ctype.h, c-pathch.h, c-std.h, cnf.c, + concatn.c, config.h, db.c, db.h, debug.h, default.h, dir.c, + elt-dirs.c, expand.c, extend-fname.c, find-suffix.c, fn.c, + fontmap.c, getopt.c, kpathsea.c, kpsestat.c, kpsewhich.c, lib.h, + line.c, magstep.c, magstep.h, make-suffix.c, mingw32.c, mingw32.h, + path-elt.c, pathsearch.c, pathsearch.h, proginit.c, proginit.h, + progname.c, readable.c, readable.h, readlink.c, rm-suffix.c, + str-list.c, str-llist.c, strstr.c, tex-file.c, tex-glyph.c, + tex-glyph.h, tex-hush.c, tex-make.c, tex-make.h, truncate.c, + uppercasify.c, variable.h, version.c, win32lib.h, xbasename.c, + xcalloc.c, xdirname.c, xfopen.c, xftell.c, xftello.c, xgetcwd.c, + xopendir.c, xrealloc.c, xstat.c: remove trailing spaces. + +2010-05-10 Peter Breitenlohner + + * c-fopen.h [SET_BINARY]: Add cast to void. + +2010-05-09 Peter Breitenlohner + + * progname.c (kpathsea_set_program_name): Drop superfluous cast. + + * extend-fname.c, lib.h: Change return type of extend_filename() + from 'string' to 'const_string'. + * fontmap.[ch]: Change return type of kpathsea_fontmap_lookup() + from 'string *' to 'const_string *', drop kpse_fontmap_lookup. + * tex-file.c (target_fontmaps), tex-glyph.c (try_fontmap): Adjust. + +2010-04-27 Manuel Pégourié-Gonnard + + * texmf.cnf: - s/pdf(lua(la)?tex)/dvi\1/ + - add luatex before generic (for generic package specific to luatex) and + similarly for xetex. + +2010-04-22 Karl Berry + + * doc/kpathsea.texi, + * doc/bugs.texi: Avoid over/underfull boxes. + +2010-04-19 Peter Breitenlohner + + * texmf.cnf (max_strings.pbibtex): New defn. + +2010-04-15 Karl Berry + + * kpsewhich.c (format_abbr_type): new type. + (format_abbrs): new array. + (format_abbr): new fn to use them. + (find_format): call it. + + (help_message): new fn, including the abbreviations. + +2010-04-12 Peter Breitenlohner + + * Makefile.am (EXTRA_DIST): Add bsnl.awk. + +2010-04-11 Karl Berry + + * texmf.cnf ({TEXINPUTS,BIBINPUTS}.{ptex,platex,pbibtex}): new defns. + +2010-04-11 Javier Mugica + + * getopt.c, getopt1.c: ANSIfy all fns. + +2010-04-10 Karl Berry + + * progname.c (c-pathmx.h): #include unconditionally. + * c-pathmx.h (PATH_MAX) [MAX_PATH]: #define PATH_MAX as MAX_PATH + for Windows. + * win32lib.h: include io.h, fcntl.h, direct.h. + From Javier Mugica, 9 Apr 2010 22:04:46. + +2010-04-09 Karl Berry + + * types.h: doc fixes. + +2010-04-07 Peter Breitenlohner + + * man/kpseaccess.man, man/kpsestat.man, man/mktexpk.man, + man/mktextfm.man: Uniform manpage formatting: bold for literals, + italic for variable items, roman for meta items. + +2010-04-05 Karl Berry + + * progname.h: doc fix. + +2010-04-04 Karl Berry + + * bsnl.awk: tiny awk program to eliminate \-newline sequences. + * Makefile.am (stamp-paths): call it. + * texmf.cnf (TEXMF_RESTRICTED_SCRIPTS): use \-newline again. + +2010-03-29 Peter Breitenlohner + + * lib.h, xcalloc.c, xmalloc.c, xrealloc.c: Change type of size + arguments of xcalloc(), xmalloc, and xrealloc() from unsigned + to size_t (incompatible change of ABI). + + Update version numbers to 6.0.0. + +2010-03-24 Peter Breitenlohner + + * texmf.cnf (TEXMF_RESTRICTED_SCRIPTS): The make rules used to + create paths.h can't handle backslash-newline (FIXME?). + +2010-03-24 Karl Berry + + * texmf.cnf (TEXMFSCRIPTS): progname before engine, for consistency, + and because the former is more specific. + (TEXMF_RESTRICTED_SCRIPTS): new definition, for the w32 wrapper. + + (TEXMFDBS): reorder in file to be next to TEXMF, to make the + relationship more apparent. No change in definition. + +2010-03-23 Peter Breitenlohner + + * texmf.cnf (ent_str_size, glob_str_size): New for size of + BibTeX (entry and global) strings. + +2010-03-19 Peter Breitenlohner + + * texmf.cnf (BIBTEX_CSFILE): Default codepage and sort order + file for BibTeX8. + (max_strings): Also for BibTeX8 and BibTeXU. + +2010-03-18 Karl Berry + + * texmf.cnf (TEXDOCS): remove .; better for texdoc not + to be confused by files randomly in the current directory. + +2010-03-11 Peter Breitenlohner + + * texmf.cnf: Append '.mf' to Metafont specific parameters. + Add 'max_strings.bibtex', also for hash_size and hash_prime. + +2010-03-09 Peter Breitenlohner + + * texmf.cnf: Append '.gftype' to GFtype specific parameters. + * progname.h: Remove kpse_set_progname from exported API. + Deprecated since 1998. Kept in library for Versions 5.x.y. + +2010-03-08 Peter Breitenlohner + + * xrealloc.c (xrealloc): Allocate 1 byte if passed size 0. + * xcalloc.c (xcalloc): Use 1 if passed nelem 0 or elsize 0. + +2010-03-05 Peter Breitenlohner + + * texmf.cnf (line_length, max_rows, max_cols): GFtype parameters + settable at runtime (used to be fixed values in gftype.ch). + +2010-03-03 Peter Breitenlohner + + * texmf.cnf (screen_width, screen_depth): Increase Metafont + screen size (used to be fixed values in mf.ch). + +2010-03-01 Karl Berry + + * texmf.cnf (TW_LIBPATH, TW_INIPATH): TeXworks config/settings. + +2010-02-26 Peter Breitenlohner + + * mingw32.c (dostounix_filename): Reactivate as extern KPSEDLL, + used for gsftopk. + +2010-02-23 Peter Breitenlohner + + * dir.c (kpathsea_dir_p), tex-make.c (maketex): [WIN32]: Cast + the result of GetLastError() to int (may be or is DWORD). + * tex-make.c (kpathsea_make_tex) [WIN32]: Avoid initialized ret. + * mingw32.c (look_for_cmd): Declare suffixes and s as const. + + * config.h [WIN32]: Ensure that __STDC__ is #defined. + #include , not . + Diffs from Akira, 11 Feb 2010 11:03:39. + + * strstr.c (str): Add empty statement after label at the end of + a block. From Javier Mugica, 23 Feb 2010 12:25:55. + + * mingw32.c (win32_get_long_filename): Declare extern KPSEDLL. + +2010-02-20 Peter Breitenlohner + + * mingw32.c (win32_system): Declare as non-static, for web2c. + * mingw32.h (win32_system): Declare as extern KPSEDLL. + + * c-proto.h, getopt.h (KPSE_DLL): Automatically #define for + native WIN32 but not for MinGW32. + +2010-02-18 Peter Breitenlohner + + * absolute.c (kpathsea_absolute_p): Unused param. + * truncate.[ch] (kpse_truncate_filename): Removed. + +2010-02-15 Karl Berry + + * tex-make.c [DJGPP]: change conditionals to __DJGPP__ for + consistency. + + * progname.c () [__MINGW32__]: remove + #include, it's redundant with kpathsea/config.h. + () [__DJGPP__]: change conditional from DJGPP. + Suggestion from Javier Mugica, 13 Feb 2010 20:46:12. + +2010-02-14 Peter Breitenlohner + + * variable.c (kpathsea_var_value, expand): Treat strings + returned by getenv() and kpathsea_cnf_get() as const. + Replace kpathsea_var_expand() plus kpathsea_tilde_expand() by + kpathsea_expand() and include expand.h instead of tilde.h. + + * tilde.[ch] (kpathsea_tilde_expand): Now used only in expand.c + by kpathsea_expand(). Declare string param as non-const. + (kpse_tilde_expand): Removed. + + * hash.[ch]: Adjust comments and remove trailing whitespace. + +2010-02-13 Peter Breitenlohner + + * xopendir.c [WIN32]: Define neither xopendir nor xclosedir. + * mingw32.[ch], progname.c: Remove set_home_warning(). + From Akira. + + * xopendir.[ch] (xopendir): Declare string param as const. + Declare prototypes if and only if functions are defined. + + * kdefault.c, tex-file.h, xputenv.c: + Formatting, trailing whitespace. + +2010-02-12 Peter Breitenlohner + + * dir.c (kpathsea_dir_p), elt-dirs.c (kpathsea_normalize_path), + pathsearch.c (log_search, search, search_list), + tex-file.c (kpathsea_find_file_generic): + Add '#ifdef KPSE_DEBUG' to allow compilation with '-DNO_DEBUG'. + + * dir.c (kpathsea_dir_p): Replace kpse_normalize_path() by + kpathsea_normalize_path(). + +2010-02-11 Peter Breitenlohner + + * db.h (kpathsea_init_db, kpse_init_db, kpathsea_db_search, + kpse_db_search, kpathsea_db_search_list, kpse_db_search_list), + * fontmap.h (kpathsea_fontmap_lookup, kpse_fontmap_lookup), + * getopt.h (_getopt_internal), + * hash.h (hash_print, hash_free), + * mingw32.h (init_user_info, set_home_warning, + win32_get_long_filename, look_for_cmd, quote_args), + * pathsearch.h (kpathsea_filename_component, + kpse_filename_component, kpathsea_normalize_path, + kpse_normalize_path), + * str-list.h (str_list_init, str_list_concat, str_list_free, + * str_list_concat_elements, str_list_uniqify), + * str-llist.h (str_llist_add, str_llist_float), + * tex-file.h (kpathsea_init_fallback_resolutions, + kpse_init_fallback_resolutions), + * tilde.h (kpathsea_tilde_expand, kpse_tilde_expand), + * truncate.h (kpathsea_truncate_filename, + kpse_truncate_filename), + * xopendir.h (xopendir, xclosedir), + * xstat.h (xstat, xlstat): Declare prototypes only within + libkpathsea. + +2010-02-10 Peter Breitenlohner + + * mingw32.c (get_home_directory, _parse_root, + normalize_filename, dostounix_filename, unixtodos_filename, + crlf_to_lf, parse_cmdline, build_cmdline, win32_system): + Declare as static. + (dostounix_filename, crlf_to_lf): Drop unused functions. + (win32_system): Drop unused code for look_for_cmd() with 3 args. + * mingw32.h: Remove decl of get_home_directory(), add + quote_args(), use explicit 'extern'. + * tex-make.c (maketex): Drop nested extern decl of quote_args(). + + * tex-make.h ({kpathsea,kpse}_make_tex), + str-list.h (str_list_add): need KPSEDLL (from Akira). + +2010-02-08 Peter Breitenlohner + + * mingw32.c (look_for_cmd): remove unused variable new_cmd, + declare p and q as const and remove cast. + +2010-02-07 Taco Hoekwater + + * mingw32.c (look_for_cmd): remove unused variable new, + clean up preprocessor conditionals. + Report by Hib Eris, tex-k 3 Feb 2010 12:11:42. + +2010-02-01 Peter Breitenlohner + + * Makefile.am (kpseinclude_HEADERS): Add win32lib.h. + +2010-02-01 Karl Berry + + * strstr.c, + * strcasecmp.c, + * getopt.c, + * getopt.h, + * getopt1.c: remove all redefinitions of const. + +2010-01-31 Javier Mugica + + Support compilation with MSVC 7.1: + * config.h (win32lib.h) [_WIN32 && !__MINGW32__]: include. + (__STDC__) [WIN32]: do not define ourselves. + * getopt.h (__STDC__): do not define ourselves. Instead, define + const. + * c-stat.h (oldnames.h) [WIN32]: is gone. + * c-ctype.h (isascii): no oldnames.h here either. + * win32lib.h: reinstate. + +2010-01-25 Peter Breitenlohner + + * xputenv.c (kpathsea_xputenv): Don't use value of XRETALLOC(), + XRETALLOC(addr, n, t) already assigns the new pointer to addr. + +2010-01-22 Peter Breitenlohner + + * tex-make.c (maketex): Replace kpse_readable_file(fn) by + kpathsea_readable_file(kpse,fn) also for WIN32. + +2010-01-11 Taco Hoekwater + + * types.h (kpse_clua_format): new type. + (kpse_def, kpse_def_inst): need KPSEDLL (from Akira). + * tex-file.c (CLUA_ENVS): new define. + (kpse_init_format): initialize it. + * texmf.cnf (CLUAINPUTS): new definition. + This implies using, e.g., bin/i386-linux/lib/luatex/lua/*.so + in TL. + +2010-01-05 Peter Breitenlohner + + * tex-file.c: Add alt_suffix ".pl" for kpse_opl_format and + ".vpl" for kpse_ovp_format (for C version of opl2ofm/ovp2ovf). + +2009-12-24 Karl Berry + + * HIER, INSTALL, README.CONFIGURE: remove, stale. + * Makefile.am (EXTRA_DIST): change accordingly. + * README, PROJECTS, + access.c, readlink.c, + mktex.opt, mktexdir, mktexdir.opt, mktexmf, mktexnam, + mktexnam.opt, mktextfm, mktexupd: doc/email updates. + +2009-12-21 Karl Berry + + * kpsewhich.c (find_format): had forgotten to increment the loop + variable, hence the hang. From Akira. + +2009-12-20 Karl Berry + + * kpsewhich.c (find_format): restore checking of kpse_fmt_format + last, since a hang was reported by Angelo Graziosi, + http://tug.org/pipermail/tlbuild/2009q4/001222.html. + +2009-12-17 Karl Berry + + * c-proto.h (KPSE_DLL) [WIN32]: #define in this case, per Akira. + +2009-12-15 Karl Berry + + * kpsewhich.c (-safe-in-name, -safe-out-name): new options. + * doc/kpathsea.texi: document them. + * tex-file.c (kpathsea_name_ok): introduce silent argument; + change callers. + * tex-file.h (kpathsea_{in,out}_name_ok_silent): declare these, + now used in kpsewhich. + +2009-12-14 Karl Berry + + * kpsewhich.c (separator): remove never-used variable/option. + + * kpsewhich.c (find_format): remove rearrangement of checking + kpse_fmt_format last, since it doesn't have any special extensions + now (what were they?). + +2009-12-11 Alexander Cherepanov + + * tex-file.c (kpathsea_name_ok): correct check for /../ so that + "file..txt" is still allowed. + tlsec mail, 05 Dec 2009 12:33:35. + +2009-12-05 Karl Berry + + Suggested/reported by Daniel Luecking, 16 Nov 2009 11:58:00: + + * kpsewhich.c (init_more): split out lengthier initializations + to own fn. Initialize all mktex programs to false, so that + cnf/env settings such as MKTEXPK=1 don't apply to kpsewhich. + (read_command_line) <--[no-]mktex>: set must_exist, since + otherwise the mktex program is never called. + * doc/kpathsea.texi (Path searching options): minimally describe this. + +2009-12-04 Karl Berry + + * tex-file.c (kpathsea_name_ok): not_ok if /..foobar. + Report/patches from Alexander and Akira. + +2009-12-03 Karl Berry + + * absolute.c, * absolute.h, * cnf.c, * db.c, * dir.c, * elt-dirs.c, + * expand.c, * kdefault.c, * kpsewhich.c, * lib.h, * magstep.h, + * pathsearch.c, * pathsearch.h, * proginit.c, * progname.c, + * readable.h, * tex-file.c, * tex-file.h, * tex-glyph.c, * tex-glyph.h, + * tex-make.c, * types.h, * xputenv.c: formatting/doc fixes. + +2009-12-01 Karl Berry + + * tex-file.c (kpathsea_name_ok): formatting, doc fixes, start + error message on a new line. + +2009-12-01 Alexander Cherepanov + + * BUGS, + * doc/bugs.texi: typo fix. + +2009-11-18 Peter Breitenlohner + + * tex-file.c (target_fontmaps, target_asis_name, + target_suffixed_names, kpathsea_find_file_generic): + Revised handling of const to avoid warnings. + +2009-11-18 Peter Breitenlohner + + * tex-file.c (kpathsea_out_name_ok): Also disallow writing files + in dotted directories. + From Akira Kakuto . + +2009-11-17 Peter Breitenlohner + + * types.h (kpathsea_instance): For W32/Mingw/Cygwin declare + suffixlist, listing the executable file suffixes. + * progname.c (kpathsea_set_program_name): Build suffixlist. + * tex-file.c (kpathsea_out_name_ok): Use suffixlist. + From Akira Kakuto . + + * kpathsea.c: Remove obsolete initializer. + (kpathsea_finish): Destroy suffixlist (not yet used). + +2009-11-14 Peter Breitenlohner + + * tex-file.c (kpathsea_out_name_ok): Allow writing of .pl files. + From Akira Kakuto . + +2009-11-13 Peter Breitenlohner + + * tex-file.c (kpathsea_out_name_ok): On Windows disallow writing + to executable files (.com, .exe, .bat, etc). + From Akira Kakuto . + +2009-11-07 Peter Breitenlohner + + * doc/kpathsea.texi (Calling sequence): Document the new + functions kpathsea_out_name_ok and kpathsea_in_name_ok. + Recommend Automake in addition to Autoconf; update URL for both. + +2009-10-24 Peter Breitenlohner + + * tex-file[ch] ({kpathsea,kpse}_{in,out}_name_ok): New fuctions + renamed and moved from ../web2c/lib/texmfmp.c to here. + + Update version numbers to 5.1.0. + +2009-10-24 Peter Breitenlohner + + * Makefile.am (bin_links, install-exec-hook, uninstall-hook), + man/Makefile.am (man1_links, install-data-hook, uninstall-hook): + Moved handling of texhash symlinks from ../tetex/ to here. + +2009-10-20 Karl Berry + + * texmf.cnf (shell_escape): doc fixes to discourage shell_escape=p. + +2009-10-19 Manuel Pégourié-Gonnard + + * texmf.cnf: set shell_escape back to 'f': 'p' is broken on Unix. + +2009-10-15 Manuel Pégourié-Gonnard + + * texmf.cnf (shell_escape_commands): add repstopdf, a version of + epstopdf with restrictions intended to make it safer. + Remove bibtex & makeindex for now, they don't respect openout_any. + +2009-10-13 Karl Berry + + * texmf.cnf (shell_escape_commands): remove the ps-to-pdf programs + for now, they don't respect openout_any. + +2009-10-09 Karl Berry + + * texmf.cnf (TEXDOC): omit now-unneeded man for texdoc (from mpg). + +2009-09-22 Peter Breitenlohner + + * tex-file.c: Add .vf to regcognized suffixes for kpse_ovf_format. + +2009-09-21 Karl Berry + + * texmf.cnf (shell_escape_commands): remove pygmentize, as intended. + +2009-09-04 Peter Breitenlohner + + * lib.h (xfseek, xfseeko, xftell, xftello), xfseek.c, xfseeko.c, + xftell.c, xftello.c: Constify string param filename. + +2009-09-03 Karl Berry + + * kpsewhich.c (find_format): remove dvipdfmx.cfg, since there is + no special path for it, and add texglyphlist.txt. + +2009-08-22 Peter Breitenlohner + + * version.[ch] (kpathsea_version_string, kpathsea_bug_address): + Constify these strings. + +2009-08-18 Peter Breitenlohner + + * tex-file.c (TRY_ENV): remove unused macro. + +2009-08-15 Karl Berry + + * texmf.cnf (shell_escape_commands): remove many more, + mail from Heiko, 14 Aug 2009 07:58:02 et al. + +2009-07-23 Karl Berry + + * mktexlsr: update help msg. + + * texmf.cnf (shell_escape_commands): remove tex programs (too + dangerous?), add other indexing programs, change pdfcrop to + rpdfcrop, convert to imgconvert. + +2009-07-22 Taco Hoekwater + + * texmf.cnf (sizes): fix some documentation strings for MetaPost, + which nowadays uses and needs just a handful of the array size + variables. + +2009-07-07 Karl Berry + + * texmf.cnf (MAKEMPX): remove, this causes btex..etex to fail + in current mpost. + +2009-07-02 Peter Breitenlohner + + * Makefile.am (kpathsea.h): simplify, no more grep. + +2009-06-30 Peter Breitenlohner + + * Makefile.am (kpathsea.h): avoid GNU grep specific code. + +2009-06-30 Karl Berry + + * variable.c (expand): make boolean, to return whether there + actually was a variable that got expanded. + (kpathsea_var_expand): if no variable was expanded, insert the + unexpanded $foo in the result, so we can read variable names with + dollar signs. Bug report from Gerben Wierda. + +2009-06-25 Peter Breitenlohner + + * version.h (new): header file for definitions in version.c. + * version.c: #include . + * Makefile.am: add version.h. + + * kpsewhich.c: #include . + +2009-06-23 Peter Breitenlohner + + * concatn.[ch], tex-file.[ch]: use ANSI C function declarations + and prototypes instead of PVAR?[CH] macros. + #include , not #include . + + * c-vararg.h (removed): no longer used. + * kpathsea.h (removed): no longer distributed. + * Makefile.am: remove c-vararg.h, rebuild kpathsea.h. + + * c-proto.h: assume HAVE_PROTOTYPES, remove AA, P?[CH] macros. + +2009-06-22 Peter Breitenlohner + + * getopt.c (_getopt_internal): + explicit braces to avoid ambiguous 'else'. + +2009-06-19 Peter Breitenlohner + + * Makefile.am: enable compiler warnings. + * kpathsea.c (KPATHSEA_CAN_FREE): disable not yet used code. + (str_llist_free, cache_free): declare as static, not yet used. + (kpathsea_finish): avoid warning about not yet used variables. + * tex-glyph.c (try_size): avoid uninitialized warning. + * mingw32.c: avoid unused static variable. + +2009-06-15 Karl Berry + + * texmf.cnf (TEXINPUTS.jadetex,pdfjadetex): search latex, not plain. + Thus we find the latex fonttext.cfg before cslatex's, and thus + we can build the format using latex.ltx, and thus + we can avoid & in fmtutil.cnf, and thus + we can avoid painful infinite loops on failure, or something. + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=427562 + +2009-06-10 Karl Berry + + * ac/web2c.ac (mktexfmt): default to yes. + +2009-06-02 Karl Berry + + * types.h (kpse_file_format_type): add kpse_mlbib_format, + kpse_mlbst_format for Jean-Michel Hufflen and MlBibTeX. + * texmf.cnf (MLBIBINPUTS, MLBSTINPUTS): define default paths. + * tex-file.c (kpathsea_init_format): initialize them. + * doc/kpathsea.texi: document this. + +2009-06-01 Karl Berry + + * Update version numbers to 5.0.0. + + * kpsewhich.c (lookup): translate ; to : in user_path, + for consistency. Also do path expansions as promised in the + documentation. Report from Tomek T. + +2009-05-15 Peter Breitenlohner + + * absolute.c, hash.c: Avoid C99isms (variable declaration not at + the beginning of a block). + From Vladimir Volovich. + +2009-05-12 Karl Berry + + * tex-file.c (kpathsea_init_format): set suffix_search_only + for sfd, otf, and lig. Output binmode value for debugging. + +2009-05-11 Karl Berry + + * Makefile.am (paths.h): depend on stamp-paths, instead of + recursively invoking it. Else it does not get invoked once it is + created. + +2009-05-11 Karl Berry + + * types.h (kpse_file_format_type): add kpse_fea_format, + kpse_cid_format for Hans/Taco. + * texmf.cnf: define default paths (fonts/fea// and fonts/cid//). + * tex-file.c (kpathsea_init_format): initialize them. + Also, for kpse_enc_format, set suffix_search_only=true. + * doc/kpathsea.texi: document this. + +2009-04-18 Karl Berry + + * texmf.cnf (shell_escape_commands): add fc-match, request + from Elie Roux, 17 Apr 2009 17:22:55. + +2009-04-05 Taco Hoekwater + + * doc/kpathsea.texi, + * doc/bugs.texi: updates for new reentrant API, mostly for + kpse->debug replacing the global kpathsea_debug. + +2009-04-02 Peter Breitenlohner + + * config.h: For __MINGW32__ temporarily define eof as macro + while including . + + From Taco Hoekwater . + +2009-03-19 Peter Breitenlohner + + * kpathsea.c: Do not use initializer for kpse_def_inst (FIXME: + to be completely removed). + +2009-03-17 Taco Hoekwater + + * types.h: Define kpse_debug_hash_lookup_int. + +2009-03-17 Peter Breitenlohner + + * c-std.h, getopt.h: Avoid non-prototype declarations for C++. + +2009-03-16 Peter Breitenlohner + + * db.c, debug.c, debug.h, dir.c, elt-dirs.c, hash.c, pathsearch.c, + progname.c, tex-file.c, variable.c: + Rename KPSE_DEBUG_P into KPATHSEA_DEBUG_P (using kpse->debug) + Define KPSE_DEBUG_SET and KPSE_DEBUG_P (using kpathsea_debug) + compatible with old API. + +2009-03-12 Taco Hoekwater + + New Kpathsea API: Make libkpathsea reenterable. + + * extend-fname.c, file-p.c, xftello.c, make-suffix.c, xcalloc.c, + line.c, readlink.c, concat3.c, line.h, str-llist.c, kpsestat.c, + xmalloc.c, str-llist.h, xbasename.c, xfseeko.c, xgetcwd.c, + concat.c, xstat.h, atou.c, rm-suffix.c, str-list.c, + find-suffix.c, hash.c, xfseek.c, debug.c, str-list.h, hash.h, + xopendir.c, uppercasify.c, debug.h, xopendir.h, xftell.c, + xfopen.c, access.c, fn.c, xdirname.c, fn.h, xstrdup.c, + xrealloc.c, xstat.c: + All of these files have stopped using the PxC and PxH macros. + + Besides this change, there are a few extra changes to specific + files. + + * debug.c: add a guard that disables debug reporting if + the oldinterface is not compiled in the library, and uses the + kpse_def_inst structure otherwise. + + * hash.c (hash_free): new function. + + * concat3.c: now allows the second and third argument to be NULL + + * tex-hush.h, tex-make.c, progname.h, dir.c, + absolute.c, expand.c, tex-make.h, tex-glyph.c, tex-file.h, + absolute.h, expand.h, truncate.c, variable.c, tex-glyph.h, + default.h, variable.h, truncate.h, kdefault.c, readable.c, + tilde.c, fontmap.c, readable.h, tilde.h, cnf.c, fontmap.h, + cnf.h, path-elt.c, pathsearch.c, elt-dirs.c, db.c, pathsearch.h, + db.h, proginit.c, magstep.c, proginit.h, magstep.h, tex-hush.c: + All of these files have stopped using the PxC and PxH macros. + + In all of these files, the exported functions whose names + started with 'kpse_' have been renamed to use the prefix + 'kpathsea_' instead, and they now required an extra argument + that is a kpathsea instance structure. New one-line functions + with the old exported names have been added that use a default + kpathsea instance. The functions are build and exported only if + the preprocessor macro KPSE_COMPAT_API is defined (which it + usually is, though). + + Besides these changes, there are a few extra changes to speficic + files. + + * progname.c: Removed the variables program_invocation_name and + program_invocation_short_name, these are now part of the + kpathsea instance (in renamed form) + + * progname.c, xputenv.c, lib.h: Some extra preprocessor macros + (LIB_FATALx) are added and a few others are changed so that + the library functions can give the proper invocation_name + in fatal error messages + + * tex-file.c: The default instance variable is moved to the new + file kpathsea.c + + * kpathsea.c: New file containing the default + instance variables and the new functions kpathsea_new() and + kpathsea_finish() + + * version.c: Variable kpse_bug_address renamed + to kpathsea_bug_address. + + * types.h: + Added a preprocessor define KPSE_COMPAT_API, used throughout the + library. If it is undefined then the old-style functions and + definitions are not compiled. + Removed the w32-specific 'cached_home_directory' and 'volumes' + variables from the instance structure. + Added 'invocation_name' and 'invocation_short_name' variables to + the instance structure. + Removed the 'kpse_' prefix from the instance variables fallback_font, + fallback_resolutions_string, fallback_resolutions, and format_info. + Added prototypes for kpathsea_new() and kpathsea_finish(). + Added #defines for kpse_bug_address, kpse_fallback_font, + kpse_fallback_resolutions_string, kpse_fallback_resolutions, + kpse_format_info, program_invocation_name, and + program_invocation_short_name + + * mingw32.c: + Disabled home directory caching: removed the function + uncache_home_directory() and the cached_home_directory + structure item. + Disabled volume queries: removed win32_volumes typedef, + the static functions lookup_volume_info(), add_volume_info(), + and GetCachedVolumeInformation(), as well as the functions + get_volume_info() and is_fat_volume(). + + * mingw32.h: Removed volume_user_date typedef + and added declaration for get_home_directory() + + * kpsewhich.c: stop using PxC macros and + switch to new API interface + + * configure.ac: Bump the version numbers to 5.0.0 (provisionally) + + * Makefile.am: Add kpathsea.c + +2009-03-05 Peter Breitenlohner + + Part 2 of patches from Taco Hoekwater for __MINGW32__ + * mingw32.c: new file. + * mingw32.h (look_for_cmd): use only two arguments. + * tex-make.c (maketex): arg4 of ReadFile is DOWRD, not int. + +2009-03-04 Peter Breitenlohner + + Part 1 of patches from Taco Hoekwater for __MINGW32__ + * mingw32.h: new. + * c-ctype.h, c-stat.h: do not #include . + * config.h: #include , not + * progname.c: do #include . + * xopendir.c: do build xopendir for __MINGW32__. + + * progname.c, progname.h: changed static function selfdir() + into exported function kpse_selfdir() for use in luatex. + +2009-02-28 Karl Berry + + * texmf.cnf (shell_escape_commands): add pstopdf and convert per + Dick Koch. + +2009-02-26 Karl Berry + + * texmf.cnf (shell_escape): set to new possibility p. + (shell_escape_commands): first cut at allow list. + +2009-02-21 Karl Berry + + * tex-file.c: doc fixes. + +2009-02-12 Peter Breitenlohner + + * xputenv.c: prototype for putenv() if !HAVE_DECL_PUTENV. + +2009-02-06 Karl Berry + + * texmf.cnf (TEXINPUTS.lua*): add definitions for + luatex, lualatex, pdfluatex, pdflualatex. + +2008-12-31 Karl Berry + + * kpsewhich.c (find_format): special-case XDvi to + kpse_program_text_file ("other text files"). + +2008-12-15 Karl Berry + + * kpsewhich.c (main): warn if the explicit --user-format string + is not recognized. + +2008-12-13 Karl Berry + + * elt-dirs.c (do_subdir): only do the st_nlink trick if st_nlink + is exactly 2; Cygwin sets st_nlink to 1 now. Remove special case + for the Amiga. + * kpathsea.texi (Subdirectory expansion): correct preprocessor + name to ST_NLINK_TRIC. + Report from Ken Brown, tlbuild mail 12 Dec 2008 13:42:19. + +2008-11-10 Karl Berry + + * kpsewhich.c (USAGE): mention need for -engine when looking up + format files. Some reformatting. + +2008-09-20 Karl Berry + + * texmf.cnf: strongly warn that customizations in this file will + be lost by later updates. + +2008-08-05 Karl Berry + + * mktextfm (MAG): set back to 1. mag=0 fails with larm1000.mf, + and we're not going to fix the fonts. + +2008-07-08 Karl Berry + + * configure.in: version 3.5.7. + +2008-07-06 Karl Berry + + * withenable.ac (texmfmain): do not bother with long verbose + complaint when the tree can't be found, since this is normal in TL. + +2008-07-05 Karl Berry + + * mktextfm (MAG): set to 0; why were we using MAG=1? Left + over from when we included pregenerated pk's in the distribution? + +2008-07-04 Karl Berry + + * texmf.cnf (max_strings): increase to 500000. + ctt posting from Benno Puetz, http://groups.google.com/group/comp.text.tex/browse_thread/thread/2c3aa2d09b4625e3 + + * progname.c [HAVE_PROGRAM_INVOCATION_NAME]: remove all #ifdef's + except around the declaration, so that we always use our own code + to compute them. This avoids painful system dependencies. + +2008-07-02 Karl Berry + + * mktexlsr: doc fix. + + * kpathsea.texi (Path searching options): mention --engine=/ trick. + +2008-06-16 Karl Berry + + * texmf.cnf (TEXMFDOC): new var. + (TEXMFDBS): use it, so ls-R gets created there. + (TEXMFDOCDIR): use it. + [Reminder: the texmf.cnf here in Build/ is slaved to the one in + Master/.] + +2008-06-15 Karl Berry + + * mktexlsr: once again respect dir names given on cmd line. + +2008-06-12 Karl Berry + + * tex-file.c () : cmap files (texmf/fonts/cmap) + do not have the .cmap suffix. (t1.cmap, et al., are TeX files, + not cmap files.) So remove the SUFFIXES definition. + +2008-05-31 Karl Berry + + * elt-dirs.c (kpse_normalize_path): only output debug line if + value is not 1. Reformat. + + * tex-file.c (INIT_FORMAT): construct human-formatted list of + envvars that are considered for each format, as requested by + Nelson Beebe and others over the years. + (init_format) [KPSE_DEBUG]: include it in the debugging output. + (concatn_with_spaces): the function to make the list. + + * tex-make.c: concatn.h unused, removed. + + * db.c (DB_HASH_SIZE): 32003 seems a better compromise between the + tiny texmf (~1300 entries) and huge texmf-dist (~62000 entries). + +2008-05-29 Karl Berry + + * db.c (DB_HASH_SIZE): increase to 75000+, the actual size of + current ls-R. + + * cnf.c: doc fixes. + + * Makefile.in (stamp-paths): change var substitutions to use /nonesuch. + (texmf.sed, texmf.cnf): remove targets, we will juse use texmf.cnf. + (install-data): texmf.cnf is in srcdir now. + + * texmf.in: remove. + * texmf.cnf: new file, slave to Master/texmf/web2c/texmf.cnf. + +2008-05-28 Karl Berry + + * mktexlsr: support --quiet/--silent. + +2008-05-24 Karl Berry + + * kpathsea.texi (Specially-recognized files): new node to + document the special filenames kpsewhich now knows about. + +2008-05-23 Karl Berry + + * tex-file.c (init_path): do not free the translated env_value, + else raw_path ends up pointing to that freed memory. + + * default.h: mention that result is always in new memory. + * kpsewhich.c: recognize texmf.cnf as kpse_cnf_format. + + * kpsewhich.c (find_format): use the right formats for texmf.cnf, + dvipdfmx.cfg, fmtutil.cnf, mktex.cnf, and updmap.cfg (as well as + config.ps, earlier). Same values as texmf/texconfig/tcfmgr.map. + +2008-05-18 Karl Berry + + * mktexlsr (vc_dirs): ignore more than just .svn. + Original suggestion from Michael Schutte, Debian bug 481371, + 16 May 2008 11:31:20. + +2008-05-05 Karl Berry + + * recorder.h: declare our fn variables extern as they should be. + * cnf.c: make the definitions here. + +2008-05-04 Karl Berry + + * finish changing license notices to use FSF url instead of + physical address, other minor consistency changes. + +2008-05-01 Karl Berry + + * tex-file.c (ALT_SOURCES_SUFFIXES): new macro (.dtx, .ins). + (kpse_init_format) : use it. + +2008-04-30 Karl Berry + + * kpsewhich.c (read_command_line): leave two spaces before alt + suffixes, just so they can be distinguished. + + * tex-file.c (ALT_TEX_SUFFIXES): define this (rather belatedly) + to check for .sty, .cls, etc. + Rename other *_SUFFIXES to ALT_*_SUFFIXES. + + * kpathsea.texi (File lookup): Document this. + * tex-file.c: (target_fontmaps, target_asis_name, + target_suffixed_names): new fns. + (kpse_find_file_generic): call them, respecting new cnf value + try_std_extension_first. + +2008-04-29 Karl Berry + + * Makefile.in (install-data): do not cd $(srcdir) in any rule, + that fails when the install program is specified by a relative path. + +2008-03-27 Karl Berry + + * tex-make.c: start "running" on a new line, tweak other msgs. + +2008-03-07 Peter Breitenlohner + + * kpsewhich.c (main): change type of value from string to + const_string, to avoid warning. + * progname.c (selfdir): change type of elt from string to + const_string, to avoid warning. + * xputenv.c: change type of saved_env from const_string to + string, to avoid warning. + +2008-03-06 Peter Breitenlohner + + * access.c, readlink.c: removed `#include ' preceeding + `#include ' (which in turn includes stdio.h). + + * xfseek.c, xftell.c: reverted to state before 2008-02-21. + * xfseeko.c, xftello.c (both new): new functions using off_t + instead of long, and fseeko instead of fseek. + * lib.h: prototypes for xfseek, xfseeko, xftell, and xftello. + * Makefile.in (objects): added xfseeko.lo and xftello.lo. + + * configure.in: construct package and (shared) library version + from m4_define'd parts, subtitute KPSE_LT_VERS ... + * Makefile.in ($(kpathsea)): ... here. + +2008-03-04 Peter Breitenlohner + + * common.ac: add AC_SYS_LARGEFILE and AC_FUNC_FSEEKO. + +2008-03-02 Karl Berry + + * cnf.c (read_all_cnf): change warning text when texmf.cnf is not + found to make it clear we are giving it, and keep it on one line. + +2008-01-29 Peter Breitenlohner + + * common.ac: replace the private macro KPSE_STRUCT_ST_MTIM + by AC_CHECK_MEMBERS([struct stat.st_mtim]). + + * common.ac: use AC_CHECK_DECLS([strstr]) and ... + * lib.h: ... replace `#ifndef HAVE_STRSTR' by + `#if !HAVE_DECL_STRSTR'. + + * common.ac: Move AC_CONFIG_HEADERS from here ... + * configure.in: ... to here and replace PACKAGE_... by + KPSE_PACKAGE_... in c-auto.h, to avoid conflicts with other + packages. + + * configure.in: use AH_TOP, AH_BOTTOM, and AC_DEFINE's third + argument to provide autoheader templates ... + * common.ac: m4 code to generate AC_DEFINE with a third argument + for MAKE_..._BY_DEFAULT and set them to 0 or 1 ... + * withenable.ac: use AC_DEFINE's third argument to provide + autoheader templates ... + * acconfig.h: ... removed. + +2008-02-24 Martin Schröder + + * lib.h: systypes.h instead of c-std.h + +2008-02-23 Martin Schröder + + * lib.h: include c-std.h to get off_t from stdio.h + +2008-02-21 Martin Schröder + + * lib.h, xfseek.c, xftell.c: LFS support: use off_t instead of long + and fseeko instead of fseek + +2008-02-14 Karl Berry + + * texmf.in (font_mem_size): increase to 3000000. + (font_max): increase to 5000 (max_font_max increased in tex.ch). + +2008-02-11 Karl Berry + + * install.texi: mention mktexfmt, other mktex updates. + (Bug report from Ken Brooks, 03 Aug 2006 15:15:03.) + +2008-02-08 Karl Berry + + * texmf.in: texlive2008 to match texmf/web2c/texmf.cnf. + +2008-01-29 Peter Breitenlohner + + Convert from autoconf-2.13 to autoconf-2.59+: + * Makefile.in: Add @configure_input@ line. + * aclocal.m4 (new): Generated (aclocal -I ../m4). + * configure: Regenerated (autoconf). + +2008-01-25 Karl Berry + + * variable.c (expand): do ~ expansion here too, for --expand-var, + or mktexnam fails. + Report from Werner Lemberg, 24 Jan 2008 02:19:49. + * kpathsea.texi (Auxiliary tasks): document this. + +2008-01-21 Karl Berry + + * kpsewhich.c, kpathsea.texi: document --all and --subdir. + + * db.c through tex-file.c: replace FSF physical address with url. + +2008-01-18 Karl Berry + + * kpsewhich.c (subdir_match): XRETALLOC is a statement not a function. + * pathsearch.c (search_list): remove unused variable uniq_list. + +2008-01-16 Karl Berry + + * absolute.c through config.h: replace FSF physical address with url. + +2008-01-15 Karl Berry + + * variable.c (kpse_var_value): only free if new memory. + + * tex-file.c (kpse_find_file_generic): call kpse_make_tex if the + first element of the list is NULL, not the list itself. + +2008-01-14 Karl Berry + + * variable.c (kpse_var_value): also do ~ expansion. + * variable.h: adjust comments. + * kpathsea.texi (Auxiliary tasks): document this. + + * tilde.c (HOMEVAR): new #define; "USERPROFILE" on Windows, + "HOME" else. + * tilde.h: adjust comments. + * kpathsea.texi (Tilde expansion): document this. + +2008-01-13 Karl Berry + + * remote.c-no: remove this stub. Suggestion from Martin. + + * mktexpk: use $MT_MKTEXDIR in the error message if making + PKDESTDIR fails, instead of hardwiring mktexdir. + From Javier, 7 Jan 2008 11:33:18. + + * kpsewhich.c (subdir_match): protect again loc going infinitely + negative. Found by dak, 8 Jan 2008 14:51:08. + +2008-01-05 Karl Berry + + * texmf.in (progname, engine): distinguish the unset values. + (main_memory): increase to 3M. + (font_mem_size): increase to 2.5M. + (trie_size): increase to 400K. + (save_size): increase to 50K. + These size changes per gwtex (except a bit more). + +2008-01-02 Karl Berry + + * c-std.h (ALLOC_RETURN_TYPE) [!STDC_HEADERS]: just use void in + the unlikely event we're declaring *alloc ourselves. No modern + system uses char * for them. + +2007-12-23 Karl Berry + + * kpsewhich.c (subdir_match): new fn. + (lookup): call it if requested. + (subdir_paths): new global. + (read_command_line): new option --subdir. + +2007-12-22 Karl Berry + + * kpsewhich.c (lookup): handle --all for regular lookups as well + as user-specific paths. + * pathsearch.c (search_list): uniqify list before returning. + (kpse_path_search_list_generic): new fn. + (kpse_all_path_search_list, kpse_path_search_list): rewrite to + call ..._generic. + * pathsearch.h (kpse_path_search_list_generic): declare it. + * str-list.c (str_list_uniqify): new fn. + * str-list.h (str_list_uniqify): declare it. + * tex-file.c (kpse_find_file_generic): new name for kpse_find_file + code, with addition of argument to find all. + (kpse_find_file): rewrite to call ..._generic. + * tex-file.h (kpse_find_file_generic): declare it. + +2007-12-17 Karl Berry + + * kpathsea.texi (Path searching options): clarify --expand-path doc. + +2007-12-15 Karl Berry + + * kpsewhich.c (read_command_line, USAGE): improve --version and + --help messages. + +2007-12-01 Karl Berry + + * texmf.in (MPMEMS, MFBASES, TEXFORMATS): switch to /$engine, + to try to avoid finding a format for the wrong engine. + From Akira. + +2007-11-05 Karl Berry + + * texmf.in (allow_multiple_suffixes): unimplemented. + Reported by Akira, 17 Feb 2007 15:44:39. + +2007-10-24 Karl Berry + + * mktexpk (MODE) <720>: epscszz. From Akira. + (PKDESTDIR): Quote. From Paul Vojta, + tex-k 22 Oct 2007 17:38:56. + +2007-09-11 Karl Berry + + * texmf.in (TRFONTS): don't recurse through /usr. + Report from Michail Vidiassov, mp-i 10 Sep 2007 12:55:10. + +2007-08-27 Karl Berry + + * fontmap.c (map_file_parse): free the original pointer, not the + potentially moved one (after whitespace skipping). + From: "George N. White III", 25 Jul 2007 11:27:12. + +2007-07-29 Karl Berry + + * depend.mk: regenerate again. + +2007-07-24 Karl Berry + + * recorder.h (kpse_input, kpse_output): use const_string as + argument, not just char *, to avoid warning. + + * fontmap.c (map_file_parse): kpse_record_input if requested. + From Akira, 23 Jul 2007 10:20:58 (original report from George + White). + +2007-07-15 Karl Berry + + * depend.mak: update. + +2007-07-06 Karl Berry + + * tex-file.c (init_path) : let's make the format + name be lua rather than luatex; otherwise kpsewhich -format=luatex + finds kpse_tex_format sometimes, and it seems unnecessary to debug + that just now. + Also, set suffix_search_only=true. + (LUA_SUFFIXES): put compiled suffixes first. + +2007-07-05 Karl Berry + + * tex-file.h (kpse_file_format_type): define kpse_lua_format. + * tex-file.c (LUA_ENVS, LUA_SUFFIXES): new macros + (init_path): initialize kpse_lua_format. + + * texmf.in (LUAINPUTS): add $TEXINPUTS per Hans and Taco. + +2007-06-14 Karl Berry + + * texmf.in: doc fix ({a,b} is not deprecated). + +2007-05-19 Karl Berry + + * texmf.in (SYSTEXMF): add TEXMFSYSVAR (thread around 7mar07). + +2007-05-05 Karl Berry + + * kpsewhich.c (find_format): hardware kpse_dvips_config_format for + config.ps. + + * texmf.in (TEXMFMAIN, TEXMFDIST, TEXMFLOCAL, TEXMFSYSVAR, + TEXMFSYSCONFIG, VARTEXFONTS, MIMELIBDIR, MAILCAPLIBDIR, TEXMFNCF): + use @texmf@ etc. expansions so that (hopefully) + --disable-multiplatform works again. For TEXMFCNF, restore + inclusion of $TEXMF/web2c, too. Reported by Peter M. + +2007-03-21 Karl Berry + + * install.texi (Shared library): remove mention of klibtool. + +2007-03-09 Akira Kakuto + + * tex-file.c (kpse_init_format): reduce to just .fmt; + and allow both .t42 and .T42. + +2007-02-26 Karl Berry + + * bugs.texi (Logging): mention pdftex -recorder and strace et al. + (Bug checklist): Remove my old physical address. + +2007-02-02 Karl Berry + + * texmf.in (OVFFONTS): search for vf. + (OFMFONTS): explicitly adding TFMFONTS seems unnecessary. + From Hans and Taco, 25 Jan 2007. + +2006-12-30 Karl Berry + + * configure.in (KPSEVERSION): 3.5.6. + +2006-12-29 Karl Berry + + * tex-make.c (set_maketex_mag): deleted wrong extra arg; + do not generate args with spaces for mf. From Akira. + +2006-12-26 Karl Berry + + * tex-make.c: (set_maketex_mag): remove spurious extra argument + `r' to sprintf. + (maketex): remove unused variable status. + +2006-12-25 Karl Berry + + * mktexlsr: support --verbose. + +2006-12-14 Karl Berry + + * texmf.in: unify with TL texmf.cnf to make only real differences + show up. + +2006-12-09 Karl Berry + + * c-memstr.h (strings.h): don't include if HAVE_STRING_H (as all + systems should, these days). Reported by vvv. + +2006-07-15 Karl Berry + + * expand.c (kpse_expand_kpse_dot): omit empty path elements from + TEXMFCNF, per http://bugs.debian.org/358330. Patch from Julian + Gilbey, tex-k/tex-live mail 27 Mar 2006 19:32:43 +0100. + +2006-02-03 Karl Berry + + * mktexlsr: ignore .svn directories. + +2005-08-13 Olaf Weber + + * kpsewhich.c: Update copyright message. + +2005-08-03 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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. Don't 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 + + * mktexmf: Patterns for cbgreek weren't inclusive enough. From + Thomas. + +2005-07-10 Olaf Weber + + * tex-file.c (kpse_init_format): Revive .otf extension for + kpse_opentype_format, requested by Akira Kakuto + . + + * tex-make.c (maketex): Print the name of the failing command + instead of always mktexpk. From Karl berry + . + + * 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 + + * tex-make.c: Metafont doesn't like literals larger than anout + 4000, so try to avoid them when specifying magnifications. From + Werner Fink . + + * hash.h [KPSE_DEBUG]: Add KPSEDLL to declaration of + kpse_debug_hash_lookup_int. From Jan Nieuwenhuizen + . + +2005-06-26 Olaf Weber + + * 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 + + * 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 + + * mktexlsr: Re-export PATH after changing it. Some shells require + this. Reported by Albert Chin . + + * 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 . + + * 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 + + * 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 + + * 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 + + * kpsereadlink.man: Correct banner: READLINK -> KPSEREADLINK. + +2005-02-05 Olaf Weber + + * 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 + + * mktexmf: Don't redirect output of cd, Ultrix doesn't like that. + +2005-01-21 Olaf Weber + + * 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 . + +2005-01-07 Olaf Weber + + * 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 + + * 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 + + * 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 + + * texmf.in: For XeTeX: TEXINPUTS.xetex, TEXINPUTS.xelatex, + OTFFONTS. + +2004-12-19 Olaf Weber + + * 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 + . + + * mktexpk: Add guesses for dpi 360 and 720. From Frank Küster + (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 + + * 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 . + +2004-10-05 Olaf Weber + + * texmf.in: Add TEXINPUTS.lamed (Aleph's version of lambda) and + TEXINPUTS.uft8mex (utf8 variation of mex). + +2004-08-24 Olaf Weber + + * mktex.opt: Correct syntax error. Reported by Staszek + Wawrykiewicz . + +2004-08-23 Olaf Weber + + * texmf.in: The TEXINPUTS.pdftexinfo entry in obsolete, and will + be removed in the future. Alert by Vladimir Volovich + . + + * 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 . + + * 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 + + * mktexlsr, mktex.opt: Use "test ... || test ..." instead of + "test ... -o ...". + +2004-08-06 Olaf Weber + + * xdirname.c: Cygwin also understands UNC names. From Jan + Nieuwenhuizen . + + * config.h: Do not define DOSISH for Cygwin. After Jan + Nieuwenhuizen . + + * mktex.opt: Refine the test of $COMPSEC a bit, to accomodate + Cygwin. After Jan Nieuwenhuizen . + + * mktexlsr: Refine the test for $COMSPEC a bit, to accomodate + Cygwin. After Jan Nieuwenhuizen . + + * Makefile.in: Define MAKE_KPSE_DLL when compiling the library to + support ugly windows declspec stuff. From Jan Nieuwenhuizen + . + + * c-proto.h: Clean up the defines for KPSEDLL a bit. From Jan + Nieuwenhuizen . + + * getopt.h: Clean up defines for KPSEDLL a bit. From Jan + Nieuwenhuizen . + +2004-08-01 Olaf Weber + + * 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 + + * texmf.in: Adapt TRFONTS to Linux groff path, which is the most + useful variant these days. + +2004-07-21 Olaf Weber + + * 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 . + + * texmf.in: Updates/simplifications to paths, from Thomas. + +2004-07-19 Olaf Weber + + * db.c (kpse_db_search_list): Add cast to suppress warning about + discarding "const". + +2004-07-03 Olaf Weber + + * 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 + + * 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 + + * 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 + + * install.texi: Karl Berry pointed out that GNU fileutils is now + GNU coreutils. + +2004-06-14 Olaf Weber + + * kpathsea.texi: Make it more obvious that applications will often + just want to use rather than pick and choose + headers. + +2004-06-11 Olaf Weber + + * kpsewhich.c: Update copyright dates. + +2004-05-28 Olaf Weber + + * mktexlsr: Rename readlink to kpsereadlink to avoid name clash. + + * Makefile.in: Rename readlink to kpsereadlink to avoid name + clash. + +2004-05-26 Olaf Weber + + * 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 + + * Makefile.in (mostlyclean): access -> kpseaccess. From Thomas. + +2004-05-08 Olaf Weber + + * mktexlsr: Widen the matches for the lsR-pattern, so we omit the + temporary directory we used. + +2004-05-07 Olaf Weber + + * 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 + + * 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 + + * 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 + . + +2004-04-17 Olaf Weber + + * 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 + + * mktexpk: Use dpdfezzz if given 8000 for BDPI. Apparently this + is what -Ppdf ends up giving the script. + +2004-03-26 Olaf Weber + + * Makefile.in (install): access -> kpseaccess + +2004-03-23 Olaf Weber + + * 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 . + + * unixtex.texi: Update from Karl Berry. + +2004-03-21 Olaf Weber + + * 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 for xdvik. + +2004-03-16 Olaf Weber + + * texmf.in: Add file_line_error_style variable, default to false. + +2004-02-26 Olaf Weber + + * tex-make.c (maketex): Clean up unused variables. + + * texmf.in: Update link in comment for TEXFONTMAPS. + +2004-02-25 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * Makefile.in (stamp-paths): Add TEXMFDIST. Suggested by Thomas. + + * texmf.in: Add TEXMFDIST, suggested by Thomas. + +2004-01-09 Olaf Weber + + * 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 + + * texmf.in: Modifications to several paths suggested by Thomas. + +2003-12-17 Olaf Weber + + * tex-make.c (kpse_make_tex): Allow '+' is font names as well. + Reported by Hartmut Henkel . + +2003-12-14 Olaf Weber + + * 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 + + * mktexmf: csso12[0-5][0-9] are from CJK package; unsupported by + mktexmf. Fix by Werner Lemberg . + +2003-02-19 Olaf Weber + + * 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 + . + +2003-02-17 Olaf Weber + + * configure.in: Version 3.5.1. + + * kpathsea.texi: Version 3.5.1. + +2003-02-15 Olaf Weber + + * 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 . + + * Makefile.in: From klibtool to libtool. Based on patches from + Albert Chin-A-Young . + + * 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 + + * 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 + . + +2003-02-07 Olaf Weber + + * 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 + + * lib.h: Add include of c-proto.h. Suggested by Peter + Breitenlohner. + +2003-01-29 Olaf Weber + + * kpathsea.version: Version 3.4.5. + + * kpathsea.texi: Version 3.4.5. + + * configure.in: Version 3.4.5. + +2003-01-24 Olaf Weber + + * 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 + + * 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 + + * 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 + + * kpathsea.version: Version 3.4.3. + + * kpathsea.texi: Version 3.4.3. + + * configure.in: Version 3.4.3. + +2003-01-08 Olaf Weber + + * texmf.in: Add TEXPSHEADERS.dvipdfm, from Thomas. + +2002-12-25 Olaf Weber + + * tex-file.c (kpse_init_format): Add ".web" to the suffixes + recognized for cweb. + +2002-12-23 Olaf Weber + + * 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 + . + + * 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 . + +2002-12-20 Olaf Weber + + * 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 + + * tex-make.c (maketex): Be sure to set ret to NULL if there's + nothing to return. From Akira Kakuto + . + +2002-12-15 Olaf Weber + + * tex-file.c: Properly terminate MKTEXPK_ARGS with a NULL. + Spotted by Akira Kakuto . + +2002-12-14 Olaf Weber + + * 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 + + * kpathsea.version: To 3.3.11. + + * kpathsea.texi: To 3.3.11. + + * configure.in: To 3.3.11. + +2002-11-12 Olaf Weber + + * cnf.c (do_line): First check whether len-1 exists, then access + it, rather than the other way round. Spotted by Joern Clausen + . + + * 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 + + * 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 + + * 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 + requested this. + +2002-10-22 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * mktex.opt: Limit permissions on $TEMPDIR. + + * mktexlsr: Limit permissions on tmp directory. + +2002-06-04 Olaf Weber + + * 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 + + * mktexdir: Guard $KPSE_DOT with quotes. From Emmanuel_Thomé + . + +2002-04-01 Olaf Weber + + * 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 + + * kpathsea.texi: Version 3.3.7. + + * configure.in: Version 3.3.7. + +2001-11-25 Olaf Weber + + * 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 + + * line.c (read_line): Add prototype. + +2001-11-18 Olaf Weber + + * 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 + + * 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 // + as well as //. + + * access.c (main): Prototype. + +2001-11-10 Olaf Weber + + * 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 + + * 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 + + * 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 + + * common.ac [kb_cv_func_putenv_malloc]: Add declaration for + malloc, which testing on IA64 revealed to be missing. + +2000-08-25 Olaf Weber + + * mktexlsr: Changed the fix for NeXT. + +2000-08-05 Olaf Weber + + * 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 + + * lib.h [MONOCASE_FILENAMES]: Parenthesis was omitted in + FILESTRNCASEEQ. Found by Fabrice. + +2000-04-26 Olaf Weber + + * unixtex.texi: Added notes that web2c is bare-bones, and that the + texk/texklib packages may contain older components. + +2000-04-21 Olaf Weber + + * 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 + + * 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 . + + * texmf.in: Document the use of TEX_HUSH = none. + +2000-04-03 Olaf Weber + + * 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 + + * xopendir.c [WIN32]: Define neither xopendir nor xclosedir. From + Han The Thanh . + + * 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 . + + [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. + + * c-ctype.h [WIN32]: On Windows, get isascii from oldnames.h. + After Fabrice Popineau . + + * access.c: Replace WIN32 code with generic code. + +2000-01-31 Olaf Weber + + * mktexlsr: Fix possible symlink exploit. By Thomas Esser + . + +1999-06-28 Olaf Weber + + * 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 + . + + * 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 + . + + * 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 + + * 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 . + +1999-05-29 Olaf Weber + + * 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 . + + * readlink.c: Corrected a bug in the help string (wrong program + name), reported by several people. + +1999-03-26 Olaf Weber + + * kpathsea.version: Set MINOR to 3. + + * configure.in: Bumped KPSEVERSION to 3.3. + +1999-03-23 Olaf Weber + + * 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 + + * 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 + . + +1999-03-15 Olaf Weber + + * win32lib.h: Patch from Fabrice. + + * variable.c (kpse_var_value, expand): Handle the VAR_progname + construct. After Julian Gilbey . + + * tex-file.c: Fixes to the code that forces an update of the + paths. After Julian Gilbey . + + * mktexmf: Changes to support CB font family. From Kimon + Kontovasilis . + + * 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 . + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 . + + * 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 + + * 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 + + * 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 + + * kpsestat.c (main): Replace use of S_IFMT with an octal literal. + +1999-01-14 Olaf Weber + + * 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 + + * 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 + + * mktexlsr: Trap more signals, make script hold up better under + 'sh -e', from Werner Fink . + + * mktex.opt: Trap more signals, suggested by several people, + particularly Thomas Gellekum. + +1998-08-03 Olaf Weber + + * progname.c (selfdir): Interpret empty PATH element as "." + +1998-07-26 Olaf Weber + + * 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 . + +Sun Jun 21 14:43:44 1998 Olaf Weber + + * 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 + + * 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 + + * 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" . + +Tue Apr 7 19:46:07 1998 Olaf Weber + + * 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 + + * 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 + + * c-proto.h: Add P7H and P7C macros. + +Sat Mar 14 00:10:20 1998 Olaf Weber + + * win32lib.h: Patch from Fabrice. + + * c-dir.h [WIN32]: Patch from Fabrice. + +Fri Mar 13 23:23:33 1998 Olaf Weber + + * texmf.in: Added XDVIINPUTS and TEX4HTINPUTS. + +Thu Mar 12 08:04:50 1998 Olaf Weber + + * win32lib.c: New version from Fabrice Popineau. + +Wed Mar 11 19:55:10 1998 Olaf Weber + + * install.texi: Correction for description of dosnames behaviour + on MS-DOS. From Eli Zaretskii. + +Mon Mar 9 07:22:23 1998 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * withenable.ac: Replace use of -a in test with && and second + test. From Thomas Esser . + +Tue Feb 24 13:16:56 1998 Olaf Weber + + * Makefile.in: Corrections for building/installing outside source + dir. From Vladimir Volovich . + + * 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 + + * 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 + + * 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 + and Melissa O'Neill + 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * readable.c: Correct typo: '#elsif' -> '#elif'. + +Tue Feb 3 17:08:34 1998 Olaf Weber + + * kpathsea.texi: Update for changes to kpsewhich. + +Mon Feb 2 21:12:06 1998 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * mktexpk, mktextfm: Only move $NAME.log file if it exists and is + not empty. + +Mon Jan 12 06:22:59 1998 Olaf Weber + + * kpathsea.texi: Fixes from Gerd Neugebauer . + +Sun Jan 11 18:26:56 1998 Olaf Weber + + * 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 + + * tex-hush.c: A null pointer could be fed to strcmp. + +Fri Jan 9 21:08:45 1998 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * texmf.in: Add TEXINPUTS.mltex and TEXINPUTS.mllatex. + +Tue Dec 2 12:58:04 1997 Olaf Weber + + * Makefile.in (distclean): Add stamp-paths. From Sebastian Rahtz + . + + * 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 + + * 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 instead of + "../win32/win32-compat.h". From Fabrice Popineau. + + * access.c: Include . 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * c-proto.h: Restored AA macro, needed by revised web2c. + +Thu Nov 20 14:23:33 1997 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * progname.c (expand_symlinks): Don't call fclose on a NULL + pointer. After Gary Jennejohn . + +Wed Nov 12 16:20:02 1997 Olaf Weber + + * 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 that 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 and 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 + + * configure.in (KPSEVERSION): version 3.1. + +Thu Nov 6 20:25:49 1997 Olaf Weber + + * 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 + + * 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 + + * c-fopen.h [!DOSISH]: Guard against redefining O_BINARY. From + Andreas Scherer . + +Mon Oct 27 17:25:19 1997 Olaf Weber + + * install.texi: Update for new MakeTeX* scripts. + + * MakeTeXnames: Handling of empty namepart. + +Fri Oct 24 14:23:58 1997 Olaf Weber + + * 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 + + * MakeTeXnames: Corrected bug in assignemnt to stdfontpath. + +Wed Oct 22 17:36:57 1997 Olaf Weber + + * 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 + + * 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 + + * 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 + + * 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 . + + * readable.c (READABLE) [__DJGPP__]: Use `access' instead of + `stat', since `stat' is expensive on MS-DOS. Eli Zaretskii + . + + * 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 . + + * path-elt.c (main): Use ENV_SEP_STRING instead of explicit ":". + From Eli Zaretskii . + + * kpsewhich.c (path_expand): Handle file names with device + letters. + (read_command_line): Use ENV_SEP_STRING instead of explicit ":". + After Eli Zaretskii . + + * kdefault.c (main): Use ENV_SEP_STRING instead of explicit ":" + (which is only true on Unix). From Eli Zaretskii + . + + * cnf.c (do_line) [__DJGPP__]: Don't convert semi-colons to + colons, even though DJGPP defines `unix'. From Eli Zaretskii + . + + * absolute.c (kpse_absolute_p) [DOSISH]: Don't assume the drive + letter is alphanumeric. From Eli Zaretskii . + + * xgetcwd.c (xgetcwd) [DOSISH]: Prepend drive letter before path. + From Eli Zaretskii . + + * 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 . + + * 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 . + + * lib.h (FILESTRNCASEEQ): New macro, for partial compares of + filenames. From Eli Zaretskii . + + * 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 . + + * 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 . + +Thu Oct 16 10:22:42 1997 Olaf Weber + + * 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 + + * 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 + + + * 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 + + * 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 + + * 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 + + * elt-dirs.c (main) [TEST, AMIGA]: Changed test code for Amiga. + From Andreas Scherer . + +Mon Oct 6 16:36:50 1997 Olaf Weber + + * install.texi: Document --enable-maintainer-mode switch. + +Sat Oct 4 19:27:22 1997 Olaf Weber + + * 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 + + * 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 + , 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 + + * texmf.cnf.in [buf_size]: Increased from 3000 to 10000. + + * tex-file.h (enum kpse_src_type): removed trailing comma. From + Ezra Peisach . + + * 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 . + * variable.c (kpse_var_value): Add code to report how variables + were expanded. From Nicolai Langfeldt . + + * progname.c (selfdir) [!AMIGA]: Directories were mistaken for + executables. From Matthias Clasen + + + * 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 + + * 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 + + * 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 + + * 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 + + * db.c (match): Repaired several off-by-one bugs. + +Wed Sep 17 21:09:56 1997 Olaf Weber + + * withenable.ac: Added the --enable-maintainer-mode option. + +Tue Aug 5 17:26:16 1997 Karl Berry + + * 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 + + * install.texi: simple.tex doesn't exist in LaTeX 2e; it's sample2e. + From: "Jonathan I. Kamens" and others. + + * db.c (kpse_db_search): Preprocessor # commands must start in + column 1 for DEC OSF/1 2.0 cc. + From: Andrew Komornicki . + + * common.ac (program_inv_name): Correct usage of AC_TRY_LINK. + From: "John W. Eaton" . + + * Makefile.in (.SUFFIXES): Put before the .c.lo rule for the sake + of FreeBSD 2.1.7 make. + From: Hiroto Kagotani . + +Thu Apr 17 17:35:37 1997 Karl Berry + + * Makefile.in (paths.h): Replace $web2cdir too, + for the sake of DEFAULT_TEXMFCNF. + From: M G Berberich . + +Tue Apr 1 17:48:18 1997 Karl Berry + + * 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" + +Sun Mar 23 16:44:21 1997 Karl Berry + + * 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" . + +Fri Mar 21 16:09:47 1997 Karl Berry + + * 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 + + * withenable.ac: `enableval' should have been `withval', + and value must be quoted. + + * MakeTeXTFM: Exit if mf fails, a la MakeTeXPK. + From: Julian Gilbey . + +Thu Feb 13 16:08:30 1997 Karl Berry + + * texmf.cnf.in (latex2*_inputs): Put $dbtex/generic before the + ``other'' latex version. + From: Olaf Weber . + + * progname.c (selfdir): Protect against argv0 being dir/exename, + not found in PATH. Happens under Solaris. + From: Ross Alexander (and many others). + +Sun Feb 09 15:27:15 1997 Fabrice POPINEAU + + * progname.c (kpse_set_progname): Added braces around Win32 code, + because of variables declaration. + +Fri Feb 7 11:53:09 1997 Karl Berry + + * 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 + + * 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 (infinite loop). + From Fabrice and Richard. + +Tue Feb 4 13:20:09 1997 Karl Berry + + * 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 + + * 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 + + * kpsewhich.c (read_command_line): Check for -1, not EOF, + per new getopt. + +Sun Feb 2 16:06:42 1997 Karl Berry + + * 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 + + * 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 + + * elt-dirs.c: Doc fixes. + + * db.c (match): Don't return false just because the path element + ended in /. + Bug from: Richard Walker . + + * expand.c (kpse_path_expand): Do variable expansion before + splitting on path elements. + Bug from: Richard Walker . + + * tilde.c [TEST]: Function name changed. + From: Richard Walker . + + * texmf.cnf.in (MAILCAPLIBDIR): Rename from MAILCAPDIR. + From Ulrik. + +Tue Jan 21 09:34:20 1997 Fabrice POPINEAU + + * 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 + + * progname.c: Amiga patch from Andreas. + +Sun Jan 19 14:29:00 1997 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * c-std.h (calloc, malloc, realloc) [!STDC_HEADERS]: Only declare + in this case. + +Tue Jan 7 17:44:01 1997 Karl Berry + + * MakeTeXPK: Doc fix. + + * texmf.cnf.in (KPSE_DOT): Define. + + * c-memstr.h: Doc fix. + +Wed Jan 1 16:58:02 1997 Karl Berry + + * 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 + + * 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 + + * 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 . + + * types.h (boolean): Protect with #ifndef HAVE_BOOLEAN, for NeXT. + From: Raf Schietekat + +Sat Dec 28 07:18:48 1996 Karl Berry + + * progname.c [AMIGA]: Add code for this case from Andreas S. + +Fri Dec 27 17:38:43 1996 Karl Berry + + * progname.c (S_IX{USR,GRP,OTH}): Define if not defined, for the NeXT. + From: Gregor Hoffleit . + + * texmf.cnf.in (TEXMFCNF): Rewrite using /.'s etc. From Thomas. + +Sun Dec 15 06:21:22 1996 Karl Berry + + * 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 + + * 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 + + * expand.h: Doc fix. + +Thu Dec 12 17:25:25 1996 Karl Berry + + * xputenv.c [WIN32]: Work around putenv ("FOO=") unsetting + FOO under NT. From Fabrice. + +Mon Dec 9 23:27:45 MET 1996 Thomas Esser + + * 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 + + * readable.c (READABLE): Check !S_ISDIR instead of S_ISREG, + to allow fifo's. + Suggestion from: Krzysio Leszczynski . + + * 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 + + * c-proto.h (DllImport): Define here. + * config.h (DllImport): Instead of here. + * kpsewhich.c: Other DllImport changes. + * line.c [WIN32]: Include . + * 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 . + +Sat Dec 7 22:12:26 MET 1996 Thomas Esser + + * 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 + + * 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 . + + * texmf.cnf.in: Use fonts// consistently, + instead of fonts/. + + * 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 . + +Tue Dec 3 14:57:52 1996 Karl Berry + + * Makefile.in (objects): Remove strtol.lo, that's generated by + configure. + From: Gregor Hoffleit . + +Mon Dec 2 09:05:54 1996 Karl Berry + + * MakeTeXcommon: Set KPSE_DOT before the trap. From Thomas. + +Tue Dec 3 18:02:08 1996 Ulrik Vieth + + * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost + indepent of $prefix. + +Mon Dec 9 00:28:58 1996 Ulrik Vieth + + * 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 + + * texmf.cnf.in (TRFONTS): Set this to /usr/lib/font/devpost + indepent of $prefix. + +Thu Nov 28 16:33:35 1996 Karl Berry + + * 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 + + * 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 + + * Makefile.in (texmf.sed): Replace all $(texmf) with `$TEXMF' + except on the TEXMF line itself. + +Sun Nov 24 10:06:35 1996 Karl Berry + + * 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 + + * xt.ac (with_x): Remove spurious ;;. + +Fri Nov 22 18:00:41 1996 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * xt.ac: New file so web2c and xdvi treat --with-x-toolkit uniformly. + From Ulrik. + +Thu Oct 31 15:38:48 1996 Karl Berry + + * 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 + + * 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 + + * 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 + + * Makefile.in (distdir): No need to distribute copying.texi. + +Mon Oct 14 11:32:51 1996 Karl Berry + + * Changes for NT from: Fabrice POPINEAU . + + * xputenv.c (putenv) [WIN32]: #include 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 , 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 + * c-stat.h [WIN32]: #include and #define stat _stat. + +Sat Oct 12 11:10:45 1996 Karl Berry + + * 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 + + * 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 + + * version.c: Doc fix. + +Sat Oct 5 17:06:54 1996 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * texmf.cnf.in (PKFONTS*, GFFONTS): Need another / to match TDS. + +Sat Aug 10 15:46:46 1996 Karl Berry + + * 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 + + * 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 + + * texmf.cnf.in (TEXCONFIG, INDEXSTYLE): Use //, just in case there + are subdirectories. From Thomas. + +Tue Aug 6 13:59:03 1996 Karl Berry + + * kpsewhich.c (lookup): Handle user_path case. + +Mon Aug 5 17:23:56 1996 Karl Berry + + * 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 + + * kpsewhich.c (read_command_line): Change Usage: line to conform. + +Fri Aug 2 11:57:23 1996 Karl Berry + + * db.c (db_build): Test len > 0 before evaluating len - 1. + From: "Peter Henderson, Syrinx Speech Systems P/L, Tel: (+61-2) + 956-6540" . + +Sat Jul 27 14:35:17 1996 Karl Berry + + * 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 + + * 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 + + * unixtex.texi: Rename from obtain.texi. + +Fri Jun 7 19:10:52 1996 K. Berry + + * common.ac: Include ../kpathsea/withenable.ac. + +Thu Jun 6 16:34:43 1996 K. Berry + + * 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 + + * MakeTeX*: Add RCS info for version strings. + +Thu May 30 13:46:46 1996 Karl Berry + + * 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 + + * 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 + + * MakeTeXnames: Doc fix. + +Fri May 3 13:34:51 1996 Karl Berry + + * 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 + + * 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 + + * texmf.cnf.in (latex2e_inputs): Use just `latex', not `latex2e'. + From: David Carlisle . + (TEXINPUTS, etc.): Also rewrite to make !! support easier to add. + From: Joachim Schrod . + + * install.texi: Document ksh/ash/Ultrix sh lossage, in favor of + bash/bsh/sh5. + +Sun Apr 28 15:02:55 1996 Karl Berry + + * acconfig.h (ASM_NEEDS_UNDERSCORE): New define. + From: Peter Breitenlohner . + + * Makefile.in (sharedlib_version): Remove unused variable. + +Sat Apr 27 17:15:14 1996 Karl Berry + + * texmf.cnf.in (hyph_size): Add this. + +Tue Apr 23 07:34:05 1996 Karl Berry + + * 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 + + * MakeTeXnames.conf: Rename to MakeTeXnames.cnf. + * MakeTeXnames: Change call. + * Makefile.in (install-exec): Change install. + +Sun Apr 21 12:09:06 1996 Karl Berry + + * 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 + + * 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 + + * MakeTeXPK: Restore check for mismatched mode and bdpi. From Thomas. + +Sun Mar 10 14:17:14 1996 Karl Berry + + * MakeTeXnames.conf: Rename VARFONTS to VARTEXFONTS. + + * MakeTeXcommon (trap): Oops, cd $KPSE_DOT before testing $STDOUT. + +Sat Mar 9 17:57:02 1996 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * withenable.ac (maketex{mf,pk,tfm}-default): Move here from + web2c/withenable.ac. + +Wed Feb 7 16:52:08 1996 Karl Berry + + * 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 $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 + + * 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 + + * Makefile.in (DEFS): Move to common.make. + +Mon Jan 29 17:01:44 1996 Karl Berry + + * MakeTeXls-R: Doc fix. + +Mon Jan 8 17:17:42 1996 Karl Berry + + * tex-file.c: Doc fix. + + * fontmap.c (MAP_NAME, MAP_HASH_SIZE): Conditionalize these #defines. + +Sun Jan 7 17:38:00 1996 Karl Berry + + * db.c (DB_HASH_SIZE, DB_NAME): Conditionalize these. + + * MakeTeXcommon (dcfontdir, tsfontdir): Use supplier `jknappen'. + +Mon Jan 1 15:14:42 1996 Karl Berry + + * Makefile.in (distdir): Don't bother including freedom.texi. + +Fri Dec 29 17:17:08 1995 Karl Berry + + * Makefile.in: misc.make is now clean.make. + +Tue Dec 26 14:21:08 1995 Karl Berry + + * 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 + + * kpsewhich.c: Call kpse_init_format when necessary in the + --format case. + +Mon Dec 11 14:42:13 1995 Karl Berry + + * common.ac: --disable-shared should not act like --enable-shared. + From Ulrik. + +Sun Dec 10 15:35:15 1995 Karl Berry + + * 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 + + * xopenfile.c: Doc fix. + +Mon Dec 4 17:23:34 1995 Karl Berry + + * Makefile.in (check): Extra $ missing. + +Sun Dec 3 13:42:54 1995 Karl Berry + + * tex-file.c (TEX_SUFFIXES): Add .dtx. + +Sun Nov 19 16:19:37 1995 Karl Berry + + * MakeTeX*: Use MakeTeXupdate, mkdir, etc. in $TEXMFCNF_DIR, not + along PATH. From John I. + +Sat Nov 18 17:03:46 1995 Karl Berry + + * tex-file.c (TEX_SUFFIXES): Add .txi. + +Fri Nov 17 15:12:03 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * find-suffix.c: Remove spurious + 1. + +Sun Nov 12 13:42:51 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * acconfig.h (EDITOR): Missing %. From Tim Murphy. + +Sat Oct 7 17:44:41 1995 Karl Berry + + * 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 + + * 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 + + * Makefile.in (tex-file.o): CPPFLAGS is now ALL_CPPFLAGS. + +Mon Sep 25 15:05:32 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * tex-file.c: Add .ltx, .texi, and .texinfo as alternate suffices + for kpse_tex_format. + +Tue Sep 19 17:12:10 1995 Karl Berry + + * texmf.cnf.in: Changes for TDS. + + * MakeTeX*: New scripts from Thomas. + +Sat Sep 16 17:30:46 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * acconfig.h (HYPERXDVI): Don't need this after all, Autoconf's + default actions are better. + +Thu Sep 7 15:11:17 1995 Karl Berry + + * acconfig.h (HYPERXDVI): Define this. + +Mon Sep 4 17:14:25 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * Makefile.in: Add sharedlib variables. + +Sun Aug 27 13:27:01 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 . + + * 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 . + + * MakeTeXPK.in: Unset DISPLAY and MFTERM. + From: Yves Arrouye . + + * 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 . + +Sat Aug 19 12:57:54 1995 Karl Berry + + * 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 . + + * 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 . + + * 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 + + * 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 + + * 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 + + * 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 + + * tex-file.c (kpse_init_fallback_resolutions): Complain if sizes + aren't sorted, and ignore offending sizes. + From: Manuel Fahndrich . + +Tue Aug 1 13:53:53 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * *.c, *.h: The FSF has a new address. + + * kpsewhich.c: Give error if no args. + +Wed Jul 19 17:34:26 1995 Karl Berry + + * texmf.cnf.in: Document limits on error_line et al. + +Mon Jul 17 13:09:05 1995 Karl Berry + + * acconfig.h (NO_FMTBASE_SHARE): Rename to NO_DUMP_SHARE. + +Sun Jul 16 14:17:16 1995 Karl Berry + + * acconfig.h (IPC, FUNNY_CORE_DUMP, NO_FMTBASE_SHARE): Include these. + +Sat Jul 15 12:45:51 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * lib.h (FATAL5): Define this. + +Sat Jun 10 15:52:41 1995 Karl Berry + + * 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" . + +Fri Jun 9 19:11:34 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * config.h (DOSISH) [DOS || OS2]: Define this. + +Tue May 30 15:43:56 1995 Karl Berry + + * 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 + + * 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 + + * 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 + + * xfopen.c: Assert non-null filenames. + +Mon May 15 17:40:27 1995 Karl Berry + + * kpsewhich.c (USAGE): Add one-line description to the help message. + +Sun Apr 16 14:25:06 1995 Karl Berry + + * line.c (BLOCK_SIZE): Increase to 56, to avoid realloc's. + +Fri Apr 14 15:56:13 1995 Karl Berry + + * Makefile.in (objects): Add xfseek and xftell, from fontutils. + +Mon Mar 13 20:05:02 1995 Karl Berry + + * MakeTeXPK.in: Don't egrep in a file that doesn't exist. + +Fri Mar 10 10:49:28 1995 Karl Berry + + * 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 + + * 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 + + * texmf.cnf.in (TEXFORMATS): Doc fix. + +Fri Feb 24 16:40:23 1995 Karl Berry + + * MakeTeXPK.in: `generate rootname' with no trailing punctuation + for the dc fonts. + +Mon Feb 20 15:23:05 1995 Karl Berry + + * tex-file.h (kpse_find_mf): New abbreviation. + +Sat Feb 11 13:06:23 1995 Karl Berry + + * 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 . + +Fri Feb 10 15:49:49 1995 Karl Berry + + * 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 + + * 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 . + +Sun Jan 8 12:14:47 1995 Karl Berry + + * Version 2.6. + +Wed Jan 4 14:44:34 1995 Karl Berry + + * Makefile.in (mostlyclean): Remove kpsewhich. + +Tue Jan 3 11:48:40 1995 Karl Berry + + * kpsewhich.c (long_options): Can't make this automatic. + + * basename.c: Include 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 + + * 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 + + * 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 + + * 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 + + * Makefile.in (objects): Don't put @LIBOBJS@ on a line by itself. + From Joachim. + +Mon Dec 26 07:55:40 1994 Karl Berry + + * common.ac (AC_FUNC_CLOSEDIR_VOID): Call this. Reported by + Timothy Murphy . + + * tex-file.c (init_path): If a variable is set to an empty value, + ignore it. Suggested by Stephen Gildea . + + * 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 + + * install.texi: Mention how to do optimization. + +Mon Dec 19 13:18:04 1994 Karl Berry + + * tex-file.h: Doc fix. + +Wed Dec 14 14:46:47 1994 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * progname.c (kpse_set_progname): Use basename. + +Fri Nov 11 19:12:23 1994 Karl Berry + + * acconfig.h (HAVE_SIGIO): Add this. + +Tue Nov 8 19:14:12 1994 Karl Berry + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * kpathsea.texi: Make it clear that names of debugging bits can + never be used. + +Fri Oct 14 10:31:35 1994 Karl Berry + + * Version 2.2. + + * hash.c (hash_lookup) [DEBUG]: Cast to long, not int. + +Thu Oct 13 15:39:34 1994 Karl Berry + + * 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 + + * 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 + + * 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 + + * kdefault.c: Rename from default.c. + * Makefile.in (objects): Likewise. + +Fri Oct 7 12:58:33 1994 Karl Berry + + * 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 + + * magstep.c: Doc fix. + +Sun Sep 25 17:11:40 1994 Karl Berry + + * Makefile.in: Include library.make. + +Thu Sep 22 15:34:40 1994 Karl Berry + + * 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 . 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 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 . + * 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 , 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 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 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 + and . + +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/src/texsourc/kpathsea/kpathsea/Makefile.am b/src/texsourc/kpathsea/kpathsea/Makefile.am new file mode 100644 index 0000000..de98f01 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/Makefile.am @@ -0,0 +1,322 @@ +## Makefile.am for the TeX Live subdirectory texk/kpathsea/ +## +## Copyright (C) 2009-2014 Peter Breitenlohner +## You may freely use, modify and/or distribute this file. +## +ACLOCAL_AMFLAGS = -I ../../m4 + +SUBDIRS = . doc man + +EXTRA_DIST = BUGS PROJECTS + +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. +AM_CFLAGS = $(WARNING_CFLAGS) + +lib_LTLIBRARIES = libkpathsea.la + +libkpathsea_la_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_KPSE_DLL +if have_EXEEXT +libkpathsea_la_CPPFLAGS += -DEXEEXT=\"$(EXEEXT)\" +endif have_EXEEXT + +libkpathsea_la_LDFLAGS = -bindir @bindir@ -no-undefined -version-info $(KPSE_LT_VERSINFO) + +libkpathsea_la_LIBADD = $(LTLIBOBJS) + +BUILT_SOURCES = paths.h + +## Put tex-file.c first, because it's what depends on the paths, and may +## reduce frustration if the paths are wrong by doing it first. +libkpathsea_la_SOURCES = \ + tex-file.c \ + absolute.c \ + atou.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 \ + hash.c \ + kdefault.c \ + kpathsea.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 \ + tex-glyph.c \ + tex-hush.c \ + tex-make.c \ + tilde.c \ + uppercasify.c \ + variable.c \ + version.c \ + xbasename.c \ + xcalloc.c \ + xdirname.c \ + xfopen.c \ + xfseek.c \ + xftell.c \ + xgetcwd.c \ + xmalloc.c \ + xopendir.c \ + xputenv.c \ + xrealloc.c \ + xstat.c \ + xstrdup.c + +if !MINGW32 +libkpathsea_la_SOURCES += \ + getopt.c \ + getopt1.c +endif !MINGW32 + +if WIN32 +if MINGW32 +libkpathsea_la_SOURCES += \ + mingw32.c \ + xfseeko.c \ + xftello.c +else !MINGW32 +libkpathsea_la_SOURCES += \ + win32lib.c +endif !MINGW32 +libkpathsea_la_SOURCES += \ + knj.c +SUBDIRS += win32 +else !WIN32 +libkpathsea_la_SOURCES += \ + xfseeko.c \ + xftello.c +endif !WIN32 + +$(libkpathsea_la_OBJECTS): paths.h kpathsea.h + +EXTRA_DIST += \ + putenv.c \ + strcasecmp.c \ + strtol.c \ + strstr.c + +kpseincludedir = ${includedir}/kpathsea + +nodist_kpseinclude_HEADERS = \ + c-auto.h \ + kpathsea.h \ + paths.h + +kpseinclude_HEADERS = $(special_headers) $(normal_headers) + +# Headers treated specially when building kpathsea.h +# +special_headers = \ + config.h \ + knj.h \ + mingw32.h \ + win32lib.h + +normal_headers = \ + absolute.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 \ + cnf.h \ + concatn.h \ + debug.h \ + expand.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 \ + types.h \ + variable.h \ + version.h + +noinst_HEADERS = \ + db.h \ + default.h \ + fn.h \ + fontmap.h \ + tilde.h \ + xopendir.h \ + xstat.h + +## Handle backslash continuations, then null out comments and +## leading/trailing whitespace. An awk script does the rest. +## +## We don't want to rewrite paths.h when we have only changed comments +## in texmf.cnf that have no effect on paths.h, since that would cause +## almost everything to be rebuilt. +## +paths.h: stamp-paths +stamp-paths: texmf.cnf bsnl.awk cnf-to-paths.awk +# ensure grep is not completely broken, e.g., from GREP_OPTIONS. + echo a | grep -v b >/dev/null || { echo "*** grep broken, goodbye."; exit 1; } +# +# generate paths.h without build machine directories. + echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp + $(AWK) -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \ + | sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' \ + | $(AWK) -f $(srcdir)/cnf-to-paths.awk \ + >>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 >$@ + +## Similarly we don't want to rewrite kpathsea.h when only Makefile has +## been remade but kpathsea.h remains the same. +## +kpathsea.h: stamp-kpathsea +stamp-kpathsea: Makefile paths.h + $(AM_V_GEN)rm -f $@; \ + ( echo '/* This is a generated file */'; \ + echo '/* collecting all public kpathsea headers. */'; \ + for f in config.h c-auto.h paths.h $(normal_headers); do \ + echo "#include "; \ + done ) >kpathsea.tmp + @if cmp -s kpathsea.h kpathsea.tmp 2>/dev/null; then \ + echo "kpathsea.h is unchanged"; \ + else \ + echo "cp kpathsea.tmp kpathsea.h"; \ + cp kpathsea.tmp kpathsea.h; \ + fi + rm -f kpathsea.tmp + date >$@ + +EXTRA_DIST += bsnl.awk cnf-to-paths.awk + +DISTCLEANFILES = paths.h stamp-paths kpathsea.h + +## The programs +bin_PROGRAMS = kpseaccess kpsereadlink kpsestat kpsewhich + +kpseaccess_SOURCES = access.c + +kpsereadlink_SOURCES = readlink.c + +kpsewhich_LDADD = libkpathsea.la + +EXTRA_PROGRAMS = progname-test xdirtest + +progname_test_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_KPSE_DLL -DTEST +progname_test_SOURCES = progname.c +progname_test_LDADD = libkpathsea.la + +xdirtest_LDADD = libkpathsea.la + +## The scripts and their data +web2cdir = $(datarootdir)/texmf-dist/web2c + +dist_web2c_SCRIPTS = mktexdir mktexnam mktexupd + +dist_web2c_DATA = mktex.opt mktexdir.opt mktexnam.opt + +dist_noinst_SCRIPTS = mktexlsr mktexmf mktexpk mktextfm + +dist_noinst_DATA = texmf.cnf + +install-exec-local: installdirs-am +if !WIN32 + @for f in $(dist_noinst_SCRIPTS); do \ + if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1 \ + || test ! -r "$(DESTDIR)$(bindir)/$$f"; then \ + echo " $(INSTALL_SCRIPT) '$(srcdir)/$$f' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_SCRIPT) "$(srcdir)/$$f" "$(DESTDIR)$(bindir)/$$f"; \ + else :; fi; \ + done +endif !WIN32 + +install-data-local: installdirs-am + @for f in $(dist_noinst_DATA); do \ + if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1 \ + || test ! -r "$(DESTDIR)$(web2cdir)/$$f"; then \ + echo " $(INSTALL_DATA) '$(srcdir)/$$f' '$(DESTDIR)$(web2cdir)/$$f'"; \ + $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)$(web2cdir)/$$f"; \ + else :; fi; \ + done + +uninstall-local: +if !WIN32 + @for f in $(dist_noinst_SCRIPTS); do \ + if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + else :; fi; \ + done +endif !WIN32 + @for f in $(dist_noinst_DATA); do \ + if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \ + echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \ + rm -f "$(DESTDIR)$(web2cdir)/$$f"; \ + else :; fi; \ + done + +bin_links = mktexlsr:texhash + +include $(top_srcdir)/../../am/bin_links.am + +install-exec-hook: install-bin-links + +uninstall-hook: uninstall-bin-links + +## The tests +TESTS = tests/cnfnewline.test tests/kpseaccess.test +TESTS += tests/kpsereadlink.test tests/kpsestat.test tests/kpsewhich.test +TESTS_ENVIRONMENT = LN_S='$(LN_S)' LT_OBJDIR='$(LT_OBJDIR)' +EXTRA_DIST += $(TESTS) +EXTRA_DIST += tests/cnfnewline/texmf.cnf + +# Rebuild +rebuild_prereq = +rebuild_target = all-am +CLEANFILES = + +include $(srcdir)/../../am/rebuild.am + +## Not used +## +EXTRA_DIST += mktex.cnf + diff --git a/src/texsourc/kpathsea/kpathsea/Makefile.in b/src/texsourc/kpathsea/kpathsea/Makefile.in new file mode 100644 index 0000000..9dda897 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/Makefile.in @@ -0,0 +1,2314 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@have_EXEEXT_TRUE@am__append_1 = -DEXEEXT=\"$(EXEEXT)\" +@MINGW32_FALSE@am__append_2 = \ +@MINGW32_FALSE@ getopt.c \ +@MINGW32_FALSE@ getopt1.c + +@MINGW32_TRUE@@WIN32_TRUE@am__append_3 = \ +@MINGW32_TRUE@@WIN32_TRUE@ mingw32.c \ +@MINGW32_TRUE@@WIN32_TRUE@ xfseeko.c \ +@MINGW32_TRUE@@WIN32_TRUE@ xftello.c + +@MINGW32_FALSE@@WIN32_TRUE@am__append_4 = \ +@MINGW32_FALSE@@WIN32_TRUE@ win32lib.c + +@WIN32_TRUE@am__append_5 = \ +@WIN32_TRUE@ knj.c + +@WIN32_TRUE@am__append_6 = win32 +@WIN32_FALSE@am__append_7 = \ +@WIN32_FALSE@ xfseeko.c \ +@WIN32_FALSE@ xftello.c + +bin_PROGRAMS = kpseaccess$(EXEEXT) kpsereadlink$(EXEEXT) \ + kpsestat$(EXEEXT) kpsewhich$(EXEEXT) +EXTRA_PROGRAMS = progname-test$(EXEEXT) xdirtest$(EXEEXT) +DIST_COMMON = $(top_srcdir)/../../am/bin_links.am \ + $(srcdir)/../../am/rebuild.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(srcdir)/c-auto.in putenv.c strtol.c \ + strcasecmp.c strstr.c $(dist_noinst_SCRIPTS) \ + $(dist_web2c_SCRIPTS) $(top_srcdir)/../../build-aux/depcomp \ + $(dist_noinst_DATA) $(dist_web2c_DATA) $(kpseinclude_HEADERS) \ + $(noinst_HEADERS) $(top_srcdir)/../../build-aux/test-driver \ + AUTHORS ChangeLog NEWS README ../../build-aux/compile \ + ../../build-aux/config.guess ../../build-aux/config.sub \ + ../../build-aux/depcomp ../../build-aux/install-sh \ + ../../build-aux/missing ../../build-aux/texinfo.tex \ + ../../build-aux/ylwrap ../../build-aux/ltmain.sh \ + $(top_srcdir)/../../build-aux/compile \ + $(top_srcdir)/../../build-aux/config.guess \ + $(top_srcdir)/../../build-aux/config.sub \ + $(top_srcdir)/../../build-aux/install-sh \ + $(top_srcdir)/../../build-aux/ltmain.sh \ + $(top_srcdir)/../../build-aux/missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-lib-version.m4 \ + $(top_srcdir)/../../m4/kpse-mktex.m4 \ + $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 \ + $(top_srcdir)/../../m4/libtool.m4 \ + $(top_srcdir)/../../m4/ltoptions.m4 \ + $(top_srcdir)/../../m4/ltsugar.m4 \ + $(top_srcdir)/../../m4/ltversion.m4 \ + $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \ + $(top_srcdir)/../../version.ac $(top_srcdir)/ac/mktex.ac \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = c-auto.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(web2cdir)" "$(DESTDIR)$(web2cdir)" \ + "$(DESTDIR)$(kpseincludedir)" "$(DESTDIR)$(kpseincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libkpathsea_la_DEPENDENCIES = $(LTLIBOBJS) +am__libkpathsea_la_SOURCES_DIST = tex-file.c absolute.c atou.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 \ + hash.c kdefault.c kpathsea.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 tex-glyph.c tex-hush.c \ + tex-make.c tilde.c uppercasify.c variable.c version.c \ + xbasename.c xcalloc.c xdirname.c xfopen.c xfseek.c xftell.c \ + xgetcwd.c xmalloc.c xopendir.c xputenv.c xrealloc.c xstat.c \ + xstrdup.c getopt.c getopt1.c mingw32.c xfseeko.c xftello.c \ + win32lib.c knj.c +@MINGW32_FALSE@am__objects_1 = libkpathsea_la-getopt.lo \ +@MINGW32_FALSE@ libkpathsea_la-getopt1.lo +@MINGW32_TRUE@@WIN32_TRUE@am__objects_2 = libkpathsea_la-mingw32.lo \ +@MINGW32_TRUE@@WIN32_TRUE@ libkpathsea_la-xfseeko.lo \ +@MINGW32_TRUE@@WIN32_TRUE@ libkpathsea_la-xftello.lo +@MINGW32_FALSE@@WIN32_TRUE@am__objects_3 = libkpathsea_la-win32lib.lo +@WIN32_TRUE@am__objects_4 = libkpathsea_la-knj.lo +@WIN32_FALSE@am__objects_5 = libkpathsea_la-xfseeko.lo \ +@WIN32_FALSE@ libkpathsea_la-xftello.lo +am_libkpathsea_la_OBJECTS = libkpathsea_la-tex-file.lo \ + libkpathsea_la-absolute.lo libkpathsea_la-atou.lo \ + libkpathsea_la-cnf.lo libkpathsea_la-concat.lo \ + libkpathsea_la-concat3.lo libkpathsea_la-concatn.lo \ + libkpathsea_la-db.lo libkpathsea_la-debug.lo \ + libkpathsea_la-dir.lo libkpathsea_la-elt-dirs.lo \ + libkpathsea_la-expand.lo libkpathsea_la-extend-fname.lo \ + libkpathsea_la-file-p.lo libkpathsea_la-find-suffix.lo \ + libkpathsea_la-fn.lo libkpathsea_la-fontmap.lo \ + libkpathsea_la-hash.lo libkpathsea_la-kdefault.lo \ + libkpathsea_la-kpathsea.lo libkpathsea_la-line.lo \ + libkpathsea_la-magstep.lo libkpathsea_la-make-suffix.lo \ + libkpathsea_la-path-elt.lo libkpathsea_la-pathsearch.lo \ + libkpathsea_la-proginit.lo libkpathsea_la-progname.lo \ + libkpathsea_la-readable.lo libkpathsea_la-rm-suffix.lo \ + libkpathsea_la-str-list.lo libkpathsea_la-str-llist.lo \ + libkpathsea_la-tex-glyph.lo libkpathsea_la-tex-hush.lo \ + libkpathsea_la-tex-make.lo libkpathsea_la-tilde.lo \ + libkpathsea_la-uppercasify.lo libkpathsea_la-variable.lo \ + libkpathsea_la-version.lo libkpathsea_la-xbasename.lo \ + libkpathsea_la-xcalloc.lo libkpathsea_la-xdirname.lo \ + libkpathsea_la-xfopen.lo libkpathsea_la-xfseek.lo \ + libkpathsea_la-xftell.lo libkpathsea_la-xgetcwd.lo \ + libkpathsea_la-xmalloc.lo libkpathsea_la-xopendir.lo \ + libkpathsea_la-xputenv.lo libkpathsea_la-xrealloc.lo \ + libkpathsea_la-xstat.lo libkpathsea_la-xstrdup.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) +libkpathsea_la_OBJECTS = $(am_libkpathsea_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libkpathsea_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libkpathsea_la_LDFLAGS) $(LDFLAGS) -o \ + $@ +PROGRAMS = $(bin_PROGRAMS) +am_kpseaccess_OBJECTS = access.$(OBJEXT) +kpseaccess_OBJECTS = $(am_kpseaccess_OBJECTS) +kpseaccess_LDADD = $(LDADD) +am_kpsereadlink_OBJECTS = readlink.$(OBJEXT) +kpsereadlink_OBJECTS = $(am_kpsereadlink_OBJECTS) +kpsereadlink_LDADD = $(LDADD) +kpsestat_SOURCES = kpsestat.c +kpsestat_OBJECTS = kpsestat.$(OBJEXT) +kpsestat_LDADD = $(LDADD) +kpsewhich_SOURCES = kpsewhich.c +kpsewhich_OBJECTS = kpsewhich.$(OBJEXT) +kpsewhich_DEPENDENCIES = libkpathsea.la +am_progname_test_OBJECTS = progname_test-progname.$(OBJEXT) +progname_test_OBJECTS = $(am_progname_test_OBJECTS) +progname_test_DEPENDENCIES = libkpathsea.la +xdirtest_SOURCES = xdirtest.c +xdirtest_OBJECTS = xdirtest.$(OBJEXT) +xdirtest_DEPENDENCIES = libkpathsea.la +SCRIPTS = $(dist_noinst_SCRIPTS) $(dist_web2c_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libkpathsea_la_SOURCES) $(kpseaccess_SOURCES) \ + $(kpsereadlink_SOURCES) kpsestat.c kpsewhich.c \ + $(progname_test_SOURCES) xdirtest.c +DIST_SOURCES = $(am__libkpathsea_la_SOURCES_DIST) \ + $(kpseaccess_SOURCES) $(kpsereadlink_SOURCES) kpsestat.c \ + kpsewhich.c $(progname_test_SOURCES) xdirtest.c +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(dist_noinst_DATA) $(dist_web2c_DATA) +HEADERS = $(kpseinclude_HEADERS) $(nodist_kpseinclude_HEADERS) \ + $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope check recheck distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)c-auto.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/../../build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +DIST_SUBDIRS = . doc man win32 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KPSEVERSION = @KPSEVERSION@ +KPSE_LT_VERSINFO = @KPSE_LT_VERSINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_OBJDIR = @LT_OBJDIR@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WEB2CVERSION = @WEB2CVERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I ../../m4 +SUBDIRS = . doc man $(am__append_6) +EXTRA_DIST = BUGS PROJECTS putenv.c strcasecmp.c strtol.c strstr.c \ + bsnl.awk cnf-to-paths.awk $(TESTS) tests/cnfnewline/texmf.cnf \ + mktex.cnf +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. +AM_CFLAGS = $(WARNING_CFLAGS) +lib_LTLIBRARIES = libkpathsea.la +libkpathsea_la_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_KPSE_DLL \ + $(am__append_1) +libkpathsea_la_LDFLAGS = -bindir @bindir@ -no-undefined -version-info $(KPSE_LT_VERSINFO) +libkpathsea_la_LIBADD = $(LTLIBOBJS) +BUILT_SOURCES = paths.h +libkpathsea_la_SOURCES = tex-file.c absolute.c atou.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 hash.c \ + kdefault.c kpathsea.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 tex-glyph.c tex-hush.c \ + tex-make.c tilde.c uppercasify.c variable.c version.c \ + xbasename.c xcalloc.c xdirname.c xfopen.c xfseek.c xftell.c \ + xgetcwd.c xmalloc.c xopendir.c xputenv.c xrealloc.c xstat.c \ + xstrdup.c $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_7) +kpseincludedir = ${includedir}/kpathsea +nodist_kpseinclude_HEADERS = \ + c-auto.h \ + kpathsea.h \ + paths.h + +kpseinclude_HEADERS = $(special_headers) $(normal_headers) + +# Headers treated specially when building kpathsea.h +# +special_headers = \ + config.h \ + knj.h \ + mingw32.h \ + win32lib.h + +normal_headers = \ + absolute.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 \ + cnf.h \ + concatn.h \ + debug.h \ + expand.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 \ + types.h \ + variable.h \ + version.h + +noinst_HEADERS = \ + db.h \ + default.h \ + fn.h \ + fontmap.h \ + tilde.h \ + xopendir.h \ + xstat.h + +DISTCLEANFILES = paths.h stamp-paths kpathsea.h +kpseaccess_SOURCES = access.c +kpsereadlink_SOURCES = readlink.c +kpsewhich_LDADD = libkpathsea.la +progname_test_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_KPSE_DLL -DTEST +progname_test_SOURCES = progname.c +progname_test_LDADD = libkpathsea.la +xdirtest_LDADD = libkpathsea.la +web2cdir = $(datarootdir)/texmf-dist/web2c +dist_web2c_SCRIPTS = mktexdir mktexnam mktexupd +dist_web2c_DATA = mktex.opt mktexdir.opt mktexnam.opt +dist_noinst_SCRIPTS = mktexlsr mktexmf mktexpk mktextfm +dist_noinst_DATA = texmf.cnf +bin_links = mktexlsr:texhash +TESTS = tests/cnfnewline.test tests/kpseaccess.test \ + tests/kpsereadlink.test tests/kpsestat.test \ + tests/kpsewhich.test +TESTS_ENVIRONMENT = LN_S='$(LN_S)' LT_OBJDIR='$(LT_OBJDIR)' + +# Rebuild +rebuild_prereq = +rebuild_target = all-am +CLEANFILES = rebuild.stamp +all: $(BUILT_SOURCES) c-auto.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../../am/bin_links.am $(srcdir)/../../am/rebuild.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/../../am/bin_links.am $(srcdir)/../../am/rebuild.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +c-auto.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status c-auto.h +$(srcdir)/c-auto.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f c-auto.h stamp-h1 + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libkpathsea.la: $(libkpathsea_la_OBJECTS) $(libkpathsea_la_DEPENDENCIES) $(EXTRA_libkpathsea_la_DEPENDENCIES) + $(AM_V_CCLD)$(libkpathsea_la_LINK) -rpath $(libdir) $(libkpathsea_la_OBJECTS) $(libkpathsea_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +kpseaccess$(EXEEXT): $(kpseaccess_OBJECTS) $(kpseaccess_DEPENDENCIES) $(EXTRA_kpseaccess_DEPENDENCIES) + @rm -f kpseaccess$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kpseaccess_OBJECTS) $(kpseaccess_LDADD) $(LIBS) + +kpsereadlink$(EXEEXT): $(kpsereadlink_OBJECTS) $(kpsereadlink_DEPENDENCIES) $(EXTRA_kpsereadlink_DEPENDENCIES) + @rm -f kpsereadlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kpsereadlink_OBJECTS) $(kpsereadlink_LDADD) $(LIBS) + +kpsestat$(EXEEXT): $(kpsestat_OBJECTS) $(kpsestat_DEPENDENCIES) $(EXTRA_kpsestat_DEPENDENCIES) + @rm -f kpsestat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kpsestat_OBJECTS) $(kpsestat_LDADD) $(LIBS) + +kpsewhich$(EXEEXT): $(kpsewhich_OBJECTS) $(kpsewhich_DEPENDENCIES) $(EXTRA_kpsewhich_DEPENDENCIES) + @rm -f kpsewhich$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kpsewhich_OBJECTS) $(kpsewhich_LDADD) $(LIBS) + +progname-test$(EXEEXT): $(progname_test_OBJECTS) $(progname_test_DEPENDENCIES) $(EXTRA_progname_test_DEPENDENCIES) + @rm -f progname-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(progname_test_OBJECTS) $(progname_test_LDADD) $(LIBS) + +xdirtest$(EXEEXT): $(xdirtest_OBJECTS) $(xdirtest_DEPENDENCIES) $(EXTRA_xdirtest_DEPENDENCIES) + @rm -f xdirtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xdirtest_OBJECTS) $(xdirtest_LDADD) $(LIBS) +install-dist_web2cSCRIPTS: $(dist_web2c_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(dist_web2c_SCRIPTS)'; test -n "$(web2cdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(web2cdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(web2cdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(web2cdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(web2cdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-dist_web2cSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(dist_web2c_SCRIPTS)'; test -n "$(web2cdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(web2cdir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/putenv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strstr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kpsestat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kpsewhich.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-absolute.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-atou.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-cnf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-concat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-concat3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-concatn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-db.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-debug.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-dir.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-elt-dirs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-expand.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-extend-fname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-file-p.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-find-suffix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-fn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-fontmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-getopt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-getopt1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-hash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-kdefault.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-knj.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-kpathsea.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-line.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-magstep.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-make-suffix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-mingw32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-path-elt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-pathsearch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-proginit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-progname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-readable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-rm-suffix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-str-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-str-llist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-tex-file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-tex-glyph.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-tex-hush.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-tex-make.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-tilde.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-uppercasify.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-variable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-win32lib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xbasename.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xcalloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xdirname.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xfopen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xfseek.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xfseeko.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xftell.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xftello.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xgetcwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xmalloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xopendir.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xputenv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xrealloc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xstat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkpathsea_la-xstrdup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname_test-progname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdirtest.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libkpathsea_la-tex-file.lo: tex-file.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-tex-file.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-tex-file.Tpo -c -o libkpathsea_la-tex-file.lo `test -f 'tex-file.c' || echo '$(srcdir)/'`tex-file.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-tex-file.Tpo $(DEPDIR)/libkpathsea_la-tex-file.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tex-file.c' object='libkpathsea_la-tex-file.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-tex-file.lo `test -f 'tex-file.c' || echo '$(srcdir)/'`tex-file.c + +libkpathsea_la-absolute.lo: absolute.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-absolute.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-absolute.Tpo -c -o libkpathsea_la-absolute.lo `test -f 'absolute.c' || echo '$(srcdir)/'`absolute.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-absolute.Tpo $(DEPDIR)/libkpathsea_la-absolute.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='absolute.c' object='libkpathsea_la-absolute.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-absolute.lo `test -f 'absolute.c' || echo '$(srcdir)/'`absolute.c + +libkpathsea_la-atou.lo: atou.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-atou.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-atou.Tpo -c -o libkpathsea_la-atou.lo `test -f 'atou.c' || echo '$(srcdir)/'`atou.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-atou.Tpo $(DEPDIR)/libkpathsea_la-atou.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atou.c' object='libkpathsea_la-atou.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-atou.lo `test -f 'atou.c' || echo '$(srcdir)/'`atou.c + +libkpathsea_la-cnf.lo: cnf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-cnf.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-cnf.Tpo -c -o libkpathsea_la-cnf.lo `test -f 'cnf.c' || echo '$(srcdir)/'`cnf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-cnf.Tpo $(DEPDIR)/libkpathsea_la-cnf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cnf.c' object='libkpathsea_la-cnf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-cnf.lo `test -f 'cnf.c' || echo '$(srcdir)/'`cnf.c + +libkpathsea_la-concat.lo: concat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-concat.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-concat.Tpo -c -o libkpathsea_la-concat.lo `test -f 'concat.c' || echo '$(srcdir)/'`concat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-concat.Tpo $(DEPDIR)/libkpathsea_la-concat.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concat.c' object='libkpathsea_la-concat.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-concat.lo `test -f 'concat.c' || echo '$(srcdir)/'`concat.c + +libkpathsea_la-concat3.lo: concat3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-concat3.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-concat3.Tpo -c -o libkpathsea_la-concat3.lo `test -f 'concat3.c' || echo '$(srcdir)/'`concat3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-concat3.Tpo $(DEPDIR)/libkpathsea_la-concat3.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concat3.c' object='libkpathsea_la-concat3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-concat3.lo `test -f 'concat3.c' || echo '$(srcdir)/'`concat3.c + +libkpathsea_la-concatn.lo: concatn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-concatn.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-concatn.Tpo -c -o libkpathsea_la-concatn.lo `test -f 'concatn.c' || echo '$(srcdir)/'`concatn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-concatn.Tpo $(DEPDIR)/libkpathsea_la-concatn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='concatn.c' object='libkpathsea_la-concatn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-concatn.lo `test -f 'concatn.c' || echo '$(srcdir)/'`concatn.c + +libkpathsea_la-db.lo: db.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-db.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-db.Tpo -c -o libkpathsea_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-db.Tpo $(DEPDIR)/libkpathsea_la-db.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='db.c' object='libkpathsea_la-db.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c + +libkpathsea_la-debug.lo: debug.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-debug.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-debug.Tpo -c -o libkpathsea_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-debug.Tpo $(DEPDIR)/libkpathsea_la-debug.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='libkpathsea_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c + +libkpathsea_la-dir.lo: dir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-dir.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-dir.Tpo -c -o libkpathsea_la-dir.lo `test -f 'dir.c' || echo '$(srcdir)/'`dir.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-dir.Tpo $(DEPDIR)/libkpathsea_la-dir.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dir.c' object='libkpathsea_la-dir.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-dir.lo `test -f 'dir.c' || echo '$(srcdir)/'`dir.c + +libkpathsea_la-elt-dirs.lo: elt-dirs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-elt-dirs.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-elt-dirs.Tpo -c -o libkpathsea_la-elt-dirs.lo `test -f 'elt-dirs.c' || echo '$(srcdir)/'`elt-dirs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-elt-dirs.Tpo $(DEPDIR)/libkpathsea_la-elt-dirs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elt-dirs.c' object='libkpathsea_la-elt-dirs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-elt-dirs.lo `test -f 'elt-dirs.c' || echo '$(srcdir)/'`elt-dirs.c + +libkpathsea_la-expand.lo: expand.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-expand.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-expand.Tpo -c -o libkpathsea_la-expand.lo `test -f 'expand.c' || echo '$(srcdir)/'`expand.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-expand.Tpo $(DEPDIR)/libkpathsea_la-expand.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expand.c' object='libkpathsea_la-expand.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-expand.lo `test -f 'expand.c' || echo '$(srcdir)/'`expand.c + +libkpathsea_la-extend-fname.lo: extend-fname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-extend-fname.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-extend-fname.Tpo -c -o libkpathsea_la-extend-fname.lo `test -f 'extend-fname.c' || echo '$(srcdir)/'`extend-fname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-extend-fname.Tpo $(DEPDIR)/libkpathsea_la-extend-fname.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extend-fname.c' object='libkpathsea_la-extend-fname.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-extend-fname.lo `test -f 'extend-fname.c' || echo '$(srcdir)/'`extend-fname.c + +libkpathsea_la-file-p.lo: file-p.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-file-p.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-file-p.Tpo -c -o libkpathsea_la-file-p.lo `test -f 'file-p.c' || echo '$(srcdir)/'`file-p.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-file-p.Tpo $(DEPDIR)/libkpathsea_la-file-p.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file-p.c' object='libkpathsea_la-file-p.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-file-p.lo `test -f 'file-p.c' || echo '$(srcdir)/'`file-p.c + +libkpathsea_la-find-suffix.lo: find-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-find-suffix.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-find-suffix.Tpo -c -o libkpathsea_la-find-suffix.lo `test -f 'find-suffix.c' || echo '$(srcdir)/'`find-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-find-suffix.Tpo $(DEPDIR)/libkpathsea_la-find-suffix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='find-suffix.c' object='libkpathsea_la-find-suffix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-find-suffix.lo `test -f 'find-suffix.c' || echo '$(srcdir)/'`find-suffix.c + +libkpathsea_la-fn.lo: fn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-fn.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-fn.Tpo -c -o libkpathsea_la-fn.lo `test -f 'fn.c' || echo '$(srcdir)/'`fn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-fn.Tpo $(DEPDIR)/libkpathsea_la-fn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fn.c' object='libkpathsea_la-fn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-fn.lo `test -f 'fn.c' || echo '$(srcdir)/'`fn.c + +libkpathsea_la-fontmap.lo: fontmap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-fontmap.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-fontmap.Tpo -c -o libkpathsea_la-fontmap.lo `test -f 'fontmap.c' || echo '$(srcdir)/'`fontmap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-fontmap.Tpo $(DEPDIR)/libkpathsea_la-fontmap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fontmap.c' object='libkpathsea_la-fontmap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-fontmap.lo `test -f 'fontmap.c' || echo '$(srcdir)/'`fontmap.c + +libkpathsea_la-hash.lo: hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-hash.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-hash.Tpo -c -o libkpathsea_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-hash.Tpo $(DEPDIR)/libkpathsea_la-hash.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libkpathsea_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c + +libkpathsea_la-kdefault.lo: kdefault.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-kdefault.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-kdefault.Tpo -c -o libkpathsea_la-kdefault.lo `test -f 'kdefault.c' || echo '$(srcdir)/'`kdefault.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-kdefault.Tpo $(DEPDIR)/libkpathsea_la-kdefault.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kdefault.c' object='libkpathsea_la-kdefault.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-kdefault.lo `test -f 'kdefault.c' || echo '$(srcdir)/'`kdefault.c + +libkpathsea_la-kpathsea.lo: kpathsea.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-kpathsea.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-kpathsea.Tpo -c -o libkpathsea_la-kpathsea.lo `test -f 'kpathsea.c' || echo '$(srcdir)/'`kpathsea.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-kpathsea.Tpo $(DEPDIR)/libkpathsea_la-kpathsea.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kpathsea.c' object='libkpathsea_la-kpathsea.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-kpathsea.lo `test -f 'kpathsea.c' || echo '$(srcdir)/'`kpathsea.c + +libkpathsea_la-line.lo: line.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-line.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-line.Tpo -c -o libkpathsea_la-line.lo `test -f 'line.c' || echo '$(srcdir)/'`line.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-line.Tpo $(DEPDIR)/libkpathsea_la-line.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='line.c' object='libkpathsea_la-line.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-line.lo `test -f 'line.c' || echo '$(srcdir)/'`line.c + +libkpathsea_la-magstep.lo: magstep.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-magstep.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-magstep.Tpo -c -o libkpathsea_la-magstep.lo `test -f 'magstep.c' || echo '$(srcdir)/'`magstep.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-magstep.Tpo $(DEPDIR)/libkpathsea_la-magstep.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='magstep.c' object='libkpathsea_la-magstep.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-magstep.lo `test -f 'magstep.c' || echo '$(srcdir)/'`magstep.c + +libkpathsea_la-make-suffix.lo: make-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-make-suffix.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-make-suffix.Tpo -c -o libkpathsea_la-make-suffix.lo `test -f 'make-suffix.c' || echo '$(srcdir)/'`make-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-make-suffix.Tpo $(DEPDIR)/libkpathsea_la-make-suffix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='make-suffix.c' object='libkpathsea_la-make-suffix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-make-suffix.lo `test -f 'make-suffix.c' || echo '$(srcdir)/'`make-suffix.c + +libkpathsea_la-path-elt.lo: path-elt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-path-elt.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-path-elt.Tpo -c -o libkpathsea_la-path-elt.lo `test -f 'path-elt.c' || echo '$(srcdir)/'`path-elt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-path-elt.Tpo $(DEPDIR)/libkpathsea_la-path-elt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='path-elt.c' object='libkpathsea_la-path-elt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-path-elt.lo `test -f 'path-elt.c' || echo '$(srcdir)/'`path-elt.c + +libkpathsea_la-pathsearch.lo: pathsearch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-pathsearch.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-pathsearch.Tpo -c -o libkpathsea_la-pathsearch.lo `test -f 'pathsearch.c' || echo '$(srcdir)/'`pathsearch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-pathsearch.Tpo $(DEPDIR)/libkpathsea_la-pathsearch.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathsearch.c' object='libkpathsea_la-pathsearch.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-pathsearch.lo `test -f 'pathsearch.c' || echo '$(srcdir)/'`pathsearch.c + +libkpathsea_la-proginit.lo: proginit.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-proginit.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-proginit.Tpo -c -o libkpathsea_la-proginit.lo `test -f 'proginit.c' || echo '$(srcdir)/'`proginit.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-proginit.Tpo $(DEPDIR)/libkpathsea_la-proginit.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proginit.c' object='libkpathsea_la-proginit.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-proginit.lo `test -f 'proginit.c' || echo '$(srcdir)/'`proginit.c + +libkpathsea_la-progname.lo: progname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-progname.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-progname.Tpo -c -o libkpathsea_la-progname.lo `test -f 'progname.c' || echo '$(srcdir)/'`progname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-progname.Tpo $(DEPDIR)/libkpathsea_la-progname.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progname.c' object='libkpathsea_la-progname.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-progname.lo `test -f 'progname.c' || echo '$(srcdir)/'`progname.c + +libkpathsea_la-readable.lo: readable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-readable.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-readable.Tpo -c -o libkpathsea_la-readable.lo `test -f 'readable.c' || echo '$(srcdir)/'`readable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-readable.Tpo $(DEPDIR)/libkpathsea_la-readable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readable.c' object='libkpathsea_la-readable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-readable.lo `test -f 'readable.c' || echo '$(srcdir)/'`readable.c + +libkpathsea_la-rm-suffix.lo: rm-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-rm-suffix.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-rm-suffix.Tpo -c -o libkpathsea_la-rm-suffix.lo `test -f 'rm-suffix.c' || echo '$(srcdir)/'`rm-suffix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-rm-suffix.Tpo $(DEPDIR)/libkpathsea_la-rm-suffix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rm-suffix.c' object='libkpathsea_la-rm-suffix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-rm-suffix.lo `test -f 'rm-suffix.c' || echo '$(srcdir)/'`rm-suffix.c + +libkpathsea_la-str-list.lo: str-list.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-str-list.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-str-list.Tpo -c -o libkpathsea_la-str-list.lo `test -f 'str-list.c' || echo '$(srcdir)/'`str-list.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-str-list.Tpo $(DEPDIR)/libkpathsea_la-str-list.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str-list.c' object='libkpathsea_la-str-list.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-str-list.lo `test -f 'str-list.c' || echo '$(srcdir)/'`str-list.c + +libkpathsea_la-str-llist.lo: str-llist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-str-llist.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-str-llist.Tpo -c -o libkpathsea_la-str-llist.lo `test -f 'str-llist.c' || echo '$(srcdir)/'`str-llist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-str-llist.Tpo $(DEPDIR)/libkpathsea_la-str-llist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str-llist.c' object='libkpathsea_la-str-llist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-str-llist.lo `test -f 'str-llist.c' || echo '$(srcdir)/'`str-llist.c + +libkpathsea_la-tex-glyph.lo: tex-glyph.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-tex-glyph.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-tex-glyph.Tpo -c -o libkpathsea_la-tex-glyph.lo `test -f 'tex-glyph.c' || echo '$(srcdir)/'`tex-glyph.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-tex-glyph.Tpo $(DEPDIR)/libkpathsea_la-tex-glyph.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tex-glyph.c' object='libkpathsea_la-tex-glyph.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-tex-glyph.lo `test -f 'tex-glyph.c' || echo '$(srcdir)/'`tex-glyph.c + +libkpathsea_la-tex-hush.lo: tex-hush.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-tex-hush.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-tex-hush.Tpo -c -o libkpathsea_la-tex-hush.lo `test -f 'tex-hush.c' || echo '$(srcdir)/'`tex-hush.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-tex-hush.Tpo $(DEPDIR)/libkpathsea_la-tex-hush.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tex-hush.c' object='libkpathsea_la-tex-hush.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-tex-hush.lo `test -f 'tex-hush.c' || echo '$(srcdir)/'`tex-hush.c + +libkpathsea_la-tex-make.lo: tex-make.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-tex-make.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-tex-make.Tpo -c -o libkpathsea_la-tex-make.lo `test -f 'tex-make.c' || echo '$(srcdir)/'`tex-make.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-tex-make.Tpo $(DEPDIR)/libkpathsea_la-tex-make.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tex-make.c' object='libkpathsea_la-tex-make.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-tex-make.lo `test -f 'tex-make.c' || echo '$(srcdir)/'`tex-make.c + +libkpathsea_la-tilde.lo: tilde.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-tilde.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-tilde.Tpo -c -o libkpathsea_la-tilde.lo `test -f 'tilde.c' || echo '$(srcdir)/'`tilde.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-tilde.Tpo $(DEPDIR)/libkpathsea_la-tilde.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tilde.c' object='libkpathsea_la-tilde.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-tilde.lo `test -f 'tilde.c' || echo '$(srcdir)/'`tilde.c + +libkpathsea_la-uppercasify.lo: uppercasify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-uppercasify.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-uppercasify.Tpo -c -o libkpathsea_la-uppercasify.lo `test -f 'uppercasify.c' || echo '$(srcdir)/'`uppercasify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-uppercasify.Tpo $(DEPDIR)/libkpathsea_la-uppercasify.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uppercasify.c' object='libkpathsea_la-uppercasify.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-uppercasify.lo `test -f 'uppercasify.c' || echo '$(srcdir)/'`uppercasify.c + +libkpathsea_la-variable.lo: variable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-variable.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-variable.Tpo -c -o libkpathsea_la-variable.lo `test -f 'variable.c' || echo '$(srcdir)/'`variable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-variable.Tpo $(DEPDIR)/libkpathsea_la-variable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='variable.c' object='libkpathsea_la-variable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-variable.lo `test -f 'variable.c' || echo '$(srcdir)/'`variable.c + +libkpathsea_la-version.lo: version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-version.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-version.Tpo -c -o libkpathsea_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-version.Tpo $(DEPDIR)/libkpathsea_la-version.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='version.c' object='libkpathsea_la-version.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-version.lo `test -f 'version.c' || echo '$(srcdir)/'`version.c + +libkpathsea_la-xbasename.lo: xbasename.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xbasename.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xbasename.Tpo -c -o libkpathsea_la-xbasename.lo `test -f 'xbasename.c' || echo '$(srcdir)/'`xbasename.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xbasename.Tpo $(DEPDIR)/libkpathsea_la-xbasename.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xbasename.c' object='libkpathsea_la-xbasename.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xbasename.lo `test -f 'xbasename.c' || echo '$(srcdir)/'`xbasename.c + +libkpathsea_la-xcalloc.lo: xcalloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xcalloc.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xcalloc.Tpo -c -o libkpathsea_la-xcalloc.lo `test -f 'xcalloc.c' || echo '$(srcdir)/'`xcalloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xcalloc.Tpo $(DEPDIR)/libkpathsea_la-xcalloc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xcalloc.c' object='libkpathsea_la-xcalloc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xcalloc.lo `test -f 'xcalloc.c' || echo '$(srcdir)/'`xcalloc.c + +libkpathsea_la-xdirname.lo: xdirname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xdirname.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xdirname.Tpo -c -o libkpathsea_la-xdirname.lo `test -f 'xdirname.c' || echo '$(srcdir)/'`xdirname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xdirname.Tpo $(DEPDIR)/libkpathsea_la-xdirname.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xdirname.c' object='libkpathsea_la-xdirname.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xdirname.lo `test -f 'xdirname.c' || echo '$(srcdir)/'`xdirname.c + +libkpathsea_la-xfopen.lo: xfopen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xfopen.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xfopen.Tpo -c -o libkpathsea_la-xfopen.lo `test -f 'xfopen.c' || echo '$(srcdir)/'`xfopen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xfopen.Tpo $(DEPDIR)/libkpathsea_la-xfopen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfopen.c' object='libkpathsea_la-xfopen.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xfopen.lo `test -f 'xfopen.c' || echo '$(srcdir)/'`xfopen.c + +libkpathsea_la-xfseek.lo: xfseek.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xfseek.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xfseek.Tpo -c -o libkpathsea_la-xfseek.lo `test -f 'xfseek.c' || echo '$(srcdir)/'`xfseek.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xfseek.Tpo $(DEPDIR)/libkpathsea_la-xfseek.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfseek.c' object='libkpathsea_la-xfseek.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xfseek.lo `test -f 'xfseek.c' || echo '$(srcdir)/'`xfseek.c + +libkpathsea_la-xftell.lo: xftell.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xftell.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xftell.Tpo -c -o libkpathsea_la-xftell.lo `test -f 'xftell.c' || echo '$(srcdir)/'`xftell.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xftell.Tpo $(DEPDIR)/libkpathsea_la-xftell.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xftell.c' object='libkpathsea_la-xftell.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xftell.lo `test -f 'xftell.c' || echo '$(srcdir)/'`xftell.c + +libkpathsea_la-xgetcwd.lo: xgetcwd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xgetcwd.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xgetcwd.Tpo -c -o libkpathsea_la-xgetcwd.lo `test -f 'xgetcwd.c' || echo '$(srcdir)/'`xgetcwd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xgetcwd.Tpo $(DEPDIR)/libkpathsea_la-xgetcwd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xgetcwd.c' object='libkpathsea_la-xgetcwd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xgetcwd.lo `test -f 'xgetcwd.c' || echo '$(srcdir)/'`xgetcwd.c + +libkpathsea_la-xmalloc.lo: xmalloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xmalloc.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xmalloc.Tpo -c -o libkpathsea_la-xmalloc.lo `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xmalloc.Tpo $(DEPDIR)/libkpathsea_la-xmalloc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='libkpathsea_la-xmalloc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xmalloc.lo `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c + +libkpathsea_la-xopendir.lo: xopendir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xopendir.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xopendir.Tpo -c -o libkpathsea_la-xopendir.lo `test -f 'xopendir.c' || echo '$(srcdir)/'`xopendir.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xopendir.Tpo $(DEPDIR)/libkpathsea_la-xopendir.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xopendir.c' object='libkpathsea_la-xopendir.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xopendir.lo `test -f 'xopendir.c' || echo '$(srcdir)/'`xopendir.c + +libkpathsea_la-xputenv.lo: xputenv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xputenv.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xputenv.Tpo -c -o libkpathsea_la-xputenv.lo `test -f 'xputenv.c' || echo '$(srcdir)/'`xputenv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xputenv.Tpo $(DEPDIR)/libkpathsea_la-xputenv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xputenv.c' object='libkpathsea_la-xputenv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xputenv.lo `test -f 'xputenv.c' || echo '$(srcdir)/'`xputenv.c + +libkpathsea_la-xrealloc.lo: xrealloc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xrealloc.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xrealloc.Tpo -c -o libkpathsea_la-xrealloc.lo `test -f 'xrealloc.c' || echo '$(srcdir)/'`xrealloc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xrealloc.Tpo $(DEPDIR)/libkpathsea_la-xrealloc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xrealloc.c' object='libkpathsea_la-xrealloc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xrealloc.lo `test -f 'xrealloc.c' || echo '$(srcdir)/'`xrealloc.c + +libkpathsea_la-xstat.lo: xstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xstat.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xstat.Tpo -c -o libkpathsea_la-xstat.lo `test -f 'xstat.c' || echo '$(srcdir)/'`xstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xstat.Tpo $(DEPDIR)/libkpathsea_la-xstat.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xstat.c' object='libkpathsea_la-xstat.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xstat.lo `test -f 'xstat.c' || echo '$(srcdir)/'`xstat.c + +libkpathsea_la-xstrdup.lo: xstrdup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xstrdup.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xstrdup.Tpo -c -o libkpathsea_la-xstrdup.lo `test -f 'xstrdup.c' || echo '$(srcdir)/'`xstrdup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xstrdup.Tpo $(DEPDIR)/libkpathsea_la-xstrdup.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xstrdup.c' object='libkpathsea_la-xstrdup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xstrdup.lo `test -f 'xstrdup.c' || echo '$(srcdir)/'`xstrdup.c + +libkpathsea_la-getopt.lo: getopt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-getopt.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-getopt.Tpo -c -o libkpathsea_la-getopt.lo `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-getopt.Tpo $(DEPDIR)/libkpathsea_la-getopt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='libkpathsea_la-getopt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-getopt.lo `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c + +libkpathsea_la-getopt1.lo: getopt1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-getopt1.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-getopt1.Tpo -c -o libkpathsea_la-getopt1.lo `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-getopt1.Tpo $(DEPDIR)/libkpathsea_la-getopt1.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt1.c' object='libkpathsea_la-getopt1.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-getopt1.lo `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c + +libkpathsea_la-mingw32.lo: mingw32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-mingw32.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-mingw32.Tpo -c -o libkpathsea_la-mingw32.lo `test -f 'mingw32.c' || echo '$(srcdir)/'`mingw32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-mingw32.Tpo $(DEPDIR)/libkpathsea_la-mingw32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mingw32.c' object='libkpathsea_la-mingw32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-mingw32.lo `test -f 'mingw32.c' || echo '$(srcdir)/'`mingw32.c + +libkpathsea_la-xfseeko.lo: xfseeko.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xfseeko.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xfseeko.Tpo -c -o libkpathsea_la-xfseeko.lo `test -f 'xfseeko.c' || echo '$(srcdir)/'`xfseeko.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xfseeko.Tpo $(DEPDIR)/libkpathsea_la-xfseeko.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfseeko.c' object='libkpathsea_la-xfseeko.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xfseeko.lo `test -f 'xfseeko.c' || echo '$(srcdir)/'`xfseeko.c + +libkpathsea_la-xftello.lo: xftello.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-xftello.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-xftello.Tpo -c -o libkpathsea_la-xftello.lo `test -f 'xftello.c' || echo '$(srcdir)/'`xftello.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-xftello.Tpo $(DEPDIR)/libkpathsea_la-xftello.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xftello.c' object='libkpathsea_la-xftello.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-xftello.lo `test -f 'xftello.c' || echo '$(srcdir)/'`xftello.c + +libkpathsea_la-win32lib.lo: win32lib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-win32lib.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-win32lib.Tpo -c -o libkpathsea_la-win32lib.lo `test -f 'win32lib.c' || echo '$(srcdir)/'`win32lib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-win32lib.Tpo $(DEPDIR)/libkpathsea_la-win32lib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='win32lib.c' object='libkpathsea_la-win32lib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-win32lib.lo `test -f 'win32lib.c' || echo '$(srcdir)/'`win32lib.c + +libkpathsea_la-knj.lo: knj.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkpathsea_la-knj.lo -MD -MP -MF $(DEPDIR)/libkpathsea_la-knj.Tpo -c -o libkpathsea_la-knj.lo `test -f 'knj.c' || echo '$(srcdir)/'`knj.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkpathsea_la-knj.Tpo $(DEPDIR)/libkpathsea_la-knj.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='knj.c' object='libkpathsea_la-knj.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkpathsea_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkpathsea_la-knj.lo `test -f 'knj.c' || echo '$(srcdir)/'`knj.c + +progname_test-progname.o: progname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(progname_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT progname_test-progname.o -MD -MP -MF $(DEPDIR)/progname_test-progname.Tpo -c -o progname_test-progname.o `test -f 'progname.c' || echo '$(srcdir)/'`progname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/progname_test-progname.Tpo $(DEPDIR)/progname_test-progname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progname.c' object='progname_test-progname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(progname_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o progname_test-progname.o `test -f 'progname.c' || echo '$(srcdir)/'`progname.c + +progname_test-progname.obj: progname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(progname_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT progname_test-progname.obj -MD -MP -MF $(DEPDIR)/progname_test-progname.Tpo -c -o progname_test-progname.obj `if test -f 'progname.c'; then $(CYGPATH_W) 'progname.c'; else $(CYGPATH_W) '$(srcdir)/progname.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/progname_test-progname.Tpo $(DEPDIR)/progname_test-progname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='progname.c' object='progname_test-progname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(progname_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o progname_test-progname.obj `if test -f 'progname.c'; then $(CYGPATH_W) 'progname.c'; else $(CYGPATH_W) '$(srcdir)/progname.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-dist_web2cDATA: $(dist_web2c_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(web2cdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(web2cdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(web2cdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(web2cdir)" || exit $$?; \ + done + +uninstall-dist_web2cDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(web2cdir)'; $(am__uninstall_files_from_dir) +install-kpseincludeHEADERS: $(kpseinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(kpseinclude_HEADERS)'; test -n "$(kpseincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(kpseincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(kpseincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kpseincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(kpseincludedir)" || exit $$?; \ + done + +uninstall-kpseincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(kpseinclude_HEADERS)'; test -n "$(kpseincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(kpseincludedir)'; $(am__uninstall_files_from_dir) +install-nodist_kpseincludeHEADERS: $(nodist_kpseinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_kpseinclude_HEADERS)'; test -n "$(kpseincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(kpseincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(kpseincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kpseincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(kpseincludedir)" || exit $$?; \ + done + +uninstall-nodist_kpseincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_kpseinclude_HEADERS)'; test -n "$(kpseincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(kpseincludedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ + $(HEADERS) c-auto.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(web2cdir)" "$(DESTDIR)$(web2cdir)" "$(DESTDIR)$(kpseincludedir)" "$(DESTDIR)$(kpseincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local install-dist_web2cDATA \ + install-dist_web2cSCRIPTS install-kpseincludeHEADERS \ + install-nodist_kpseincludeHEADERS + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-exec-local \ + install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-dist_web2cDATA \ + uninstall-dist_web2cSCRIPTS uninstall-kpseincludeHEADERS \ + uninstall-libLTLIBRARIES uninstall-local \ + uninstall-nodist_kpseincludeHEADERS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: $(am__recursive_targets) all check check-am install install-am \ + install-exec-am install-strip uninstall-am + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-TESTS check-am clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-data-local install-dist_web2cDATA \ + install-dist_web2cSCRIPTS install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook \ + install-exec-local install-html install-html-am install-info \ + install-info-am install-kpseincludeHEADERS \ + install-libLTLIBRARIES install-man \ + install-nodist_kpseincludeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-dist_web2cDATA \ + uninstall-dist_web2cSCRIPTS uninstall-hook \ + uninstall-kpseincludeHEADERS uninstall-libLTLIBRARIES \ + uninstall-local uninstall-nodist_kpseincludeHEADERS + + +$(libkpathsea_la_OBJECTS): paths.h kpathsea.h + +paths.h: stamp-paths +stamp-paths: texmf.cnf bsnl.awk cnf-to-paths.awk +# ensure grep is not completely broken, e.g., from GREP_OPTIONS. + echo a | grep -v b >/dev/null || { echo "*** grep broken, goodbye."; exit 1; } +# +# generate paths.h without build machine directories. + echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp + $(AWK) -f $(srcdir)/bsnl.awk $(srcdir)/texmf.cnf \ + | sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' \ + | $(AWK) -f $(srcdir)/cnf-to-paths.awk \ + >>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 >$@ + +kpathsea.h: stamp-kpathsea +stamp-kpathsea: Makefile paths.h + $(AM_V_GEN)rm -f $@; \ + ( echo '/* This is a generated file */'; \ + echo '/* collecting all public kpathsea headers. */'; \ + for f in config.h c-auto.h paths.h $(normal_headers); do \ + echo "#include "; \ + done ) >kpathsea.tmp + @if cmp -s kpathsea.h kpathsea.tmp 2>/dev/null; then \ + echo "kpathsea.h is unchanged"; \ + else \ + echo "cp kpathsea.tmp kpathsea.h"; \ + cp kpathsea.tmp kpathsea.h; \ + fi + rm -f kpathsea.tmp + date >$@ + +install-exec-local: installdirs-am +@WIN32_FALSE@ @for f in $(dist_noinst_SCRIPTS); do \ +@WIN32_FALSE@ if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1 \ +@WIN32_FALSE@ || test ! -r "$(DESTDIR)$(bindir)/$$f"; then \ +@WIN32_FALSE@ echo " $(INSTALL_SCRIPT) '$(srcdir)/$$f' '$(DESTDIR)$(bindir)/$$f'"; \ +@WIN32_FALSE@ $(INSTALL_SCRIPT) "$(srcdir)/$$f" "$(DESTDIR)$(bindir)/$$f"; \ +@WIN32_FALSE@ else :; fi; \ +@WIN32_FALSE@ done + +install-data-local: installdirs-am + @for f in $(dist_noinst_DATA); do \ + if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1 \ + || test ! -r "$(DESTDIR)$(web2cdir)/$$f"; then \ + echo " $(INSTALL_DATA) '$(srcdir)/$$f' '$(DESTDIR)$(web2cdir)/$$f'"; \ + $(INSTALL_DATA) "$(srcdir)/$$f" "$(DESTDIR)$(web2cdir)/$$f"; \ + else :; fi; \ + done + +uninstall-local: +@WIN32_FALSE@ @for f in $(dist_noinst_SCRIPTS); do \ +@WIN32_FALSE@ if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \ +@WIN32_FALSE@ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ +@WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \ +@WIN32_FALSE@ else :; fi; \ +@WIN32_FALSE@ done + @for f in $(dist_noinst_DATA); do \ + if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \ + echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \ + rm -f "$(DESTDIR)$(web2cdir)/$$f"; \ + else :; fi; \ + done +.PHONY: install-bin-links uninstall-bin-links + +install-bin-links: +@WIN32_FALSE@ @cd $(DESTDIR)$(bindir) && \ +@WIN32_FALSE@ for s in $(bin_links); do \ +@WIN32_FALSE@ link=`echo $$s | sed 's,.*:,,'`; \ +@WIN32_FALSE@ file=`echo $$s | sed 's,:.*,,'`; \ +@WIN32_FALSE@ rm -f $$link; \ +@WIN32_FALSE@ echo "creating link '$$link' -> '$$file'"; \ +@WIN32_FALSE@ $(LN_S) $$file $$link || exit 1; \ +@WIN32_FALSE@ done + +uninstall-bin-links: +@WIN32_FALSE@ @for s in $(bin_links); do \ +@WIN32_FALSE@ link=`echo $$s | sed 's,.*:,,'`; \ +@WIN32_FALSE@ rm -f $(DESTDIR)$(bindir)/$$link; \ +@WIN32_FALSE@ done + +install-exec-hook: install-bin-links + +uninstall-hook: uninstall-bin-links +rebuild.stamp: $(rebuild_target) + echo timestamp >$@ + +.PHONY: rebuild +rebuild: $(rebuild_prereq) + @dry=; for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=*|--*);; \ + *n*) dry=:;; \ + esac; \ + done; \ + if test -f rebuild.stamp; then :; else \ + $$dry trap 'rm -rf rebuild.lock' 1 2 13 15; \ + if $$dry mkdir rebuild.lock 2>/dev/null; then \ + $(MAKE) $(AM_MAKEFLAGS) rebuild.stamp; \ + $$dry rmdir rebuild.lock; \ + else \ + while test -d rebuild.lock && test -z "$$dry"; do sleep 1; done; \ + fi; \ + $$dry test -f rebuild.stamp; exit $$?; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/texsourc/kpathsea/kpathsea/NEWS b/src/texsourc/kpathsea/kpathsea/NEWS new file mode 100644 index 0000000..e933562 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/NEWS @@ -0,0 +1,351 @@ +This file records noteworthy changes. (Public domain.) + +6.1.1 (for TeX Live 2013, 30 May 2013) +* just one tree: merge texmf into texmf-dist. +6.1.0 (for TeX Live 2012, 1 July 2012) +* texmf.cnf is found in the great-grandparent's texmf-local, + corresponding to the default TeX Live installation. +* New formats for .ris, .bltxml. +* Merge with W32TeX. + +6.0.1 (for TeX Live 2011, 5 July 2011) +* Trailing comments and whitespace omitted from config values. +* Add .tlu to type lua suffixes, and .dfont to truetype suffixes. +* Prefix program_invocation{,_short}_name with kpse_. +* Finally remove kpse_set_progname (deprecated since 1998). + +6.0.0 (for TeX Live 2010, 4 June 2010) +* Change xmalloc and friends to use size_t, unfortunately changing the ABI. + +5.0.0 (for TeX Live 2009, 13 October 2009) +* Make shared library version and general package version the same. +* Make library re-entrant, thus unavoidable binary API changes. +* Change build system to Automake. + +3.5.7 (for TeX Live 2008, 8 July 2008) +* kpsewhich has new options --all (to report all matches) and --subdir + (to limit matches). +* more file suffixes (.dtx, et al.) and special files (updmap.cfg, et al.) + found automatically. +* add basic Lua support. +* add 64-bit functions for pdftex. +* autoconf support finally modernized. + +3.5.6 (for TeX Live 2006-07, 30 December 2006) +* longstanding minor portability/warnings problems. + +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/src/texsourc/kpathsea/kpathsea/PROJECTS b/src/texsourc/kpathsea/kpathsea/PROJECTS new file mode 100644 index 0000000..c8f2bef --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/PROJECTS @@ -0,0 +1,23 @@ +Here are some ideas for improvements. If you would like to contribute, +please send mail to tex-k@tug.org 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/src/texsourc/kpathsea/kpathsea/README b/src/texsourc/kpathsea/kpathsea/README new file mode 100644 index 0000000..3335704 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/README @@ -0,0 +1,17 @@ +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 `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. + +Karl Berry diff --git a/src/texsourc/kpathsea/kpathsea/absolute.c b/src/texsourc/kpathsea/kpathsea/absolute.c new file mode 100644 index 0000000..6fc386b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/absolute.c @@ -0,0 +1,96 @@ +/* absolute.c: test if a filename is absolute or explicitly relative. + + Copyright 1993, 1994, 1995, 2008, 2009, 2010, 2011 Karl Berry. + Copyright 1997, 2002, 2005 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, see . */ + +#include + +#include +#include + +/* Sorry this is such a system-dependent mess, but I can't see any way + to usefully generalize. */ + +boolean +kpathsea_absolute_p (kpathsea kpse, const_string filename, boolean relative_ok) +{ +#ifdef VMS +#include + (void)kpse; /* currenty not used */ + return strcspn (filename, "]>:") != strlen (filename); +#else /* not VMS */ + boolean absolute; + boolean explicit_relative; + + absolute = IS_DIR_SEP (*filename) +#ifdef DOSISH + /* Novell allows non-alphanumeric drive letters. */ + || (*filename && IS_DEVICE_SEP (filename[1])) +#endif /* DOSISH */ +#ifdef WIN32 + /* UNC names */ + || (*filename == '\\' && filename[1] == '\\') + || (*filename == '/' && filename[1] == '/') +#endif /* WIN32 */ +#ifdef AMIGA + /* Colon anywhere means a device. */ + || strchr (filename, ':') +#endif /* AMIGA */ + ; + 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])))); + + (void)kpse; /* currenty not used */ + /* 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 */ +} + +#if defined (KPSE_COMPAT_API) +boolean +kpse_absolute_p (const_string filename, boolean relative_ok) +{ + return kpathsea_absolute_p (kpse_def, filename, relative_ok); +} +#endif + +#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 */ + +/* +Local variables: +standalone-compile-command: "gcc -g -I. -I.. -DTEST absolute.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/absolute.h b/src/texsourc/kpathsea/kpathsea/absolute.h new file mode 100644 index 0000000..a75b3b4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/absolute.h @@ -0,0 +1,44 @@ +/* absolute.h: declare absolute filename predicate. + + Copyright 1993, 1994, 2008, 2009 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_ABSOLUTE_H +#define KPATHSEA_ABSOLUTE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* True if FILENAME is absolute (/foo) or, if RELATIVE_OK is true, + explicitly relative (./foo, ../foo), else false (foo). */ + +extern KPSEDLL boolean kpathsea_absolute_p (kpathsea kpse, + const_string filename, boolean relative_ok); + +#if defined(KPSE_COMPAT_API) +extern KPSEDLL boolean kpse_absolute_p (const_string filename, + boolean relative_ok); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_ABSOLUTE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/ac/kpathsea.ac b/src/texsourc/kpathsea/kpathsea/ac/kpathsea.ac new file mode 100644 index 0000000..fc90d33 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/ac/kpathsea.ac @@ -0,0 +1,11 @@ +## texk/kpathsea/ac/kpathsea.ac: configure.ac fragment for the TeX Live subdirectory texk/kpathsea/ +dnl +dnl Copyright (C) 2009 Peter Breitenlohner +dnl You may freely use, modify and/or distribute this file. +dnl +## basic check of system kpathsea +KPSE_TRY_LIB([kpathsea], + [#include +#include ], + [const char *version = kpathsea_version_string; +kpse_set_program_name("prog", "name");]) diff --git a/src/texsourc/kpathsea/kpathsea/ac/mktex.ac b/src/texsourc/kpathsea/kpathsea/ac/mktex.ac new file mode 100644 index 0000000..fe8deeb --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/ac/mktex.ac @@ -0,0 +1,20 @@ +## texk/kpathsea/ac/mktex.ac: configure.ac fragment for the TeX Live +## subdirectory texk/kpathsea. +dnl +dnl Copyright (C) 2009, 2011 Peter Breitenlohner +dnl You may freely use, modify and/or distribute this file. +dnl +## configure defaults for mktexfmt & Co. +m4_define_default([kpse_indent_26], [26])[]dnl +m4_define([kpse_mktex_opts], [dnl +[[mktexmf], [yes], [MF source], [TEX_MF]], +[[mktexpk], [yes], [PK font], [TEX_PK]], +[[mktextfm], [yes], [TFM file], [TEX_TFM]], +[[mkocp], [yes], [OCP file], [OMEGA_OCP]], +[[mkofm], [yes], [OFM file], [OMEGA_OFM]], +[[mktexfmt], [yes], [format file], [TEX_FMT]], +[[mktextex], [no], [TeX source], [TEX_TEX]], +])[]dnl +m4_foreach([Kpse_Mktex], [kpse_mktex_opts], + [m4_ifset([Kpse_Mktex], + [KPSE_WITH_MKTEX(Kpse_Mktex)])])[]dnl diff --git a/src/texsourc/kpathsea/kpathsea/ac/withenable.ac b/src/texsourc/kpathsea/kpathsea/ac/withenable.ac new file mode 100644 index 0000000..1dfc285 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/ac/withenable.ac @@ -0,0 +1,8 @@ +## texk/kpathsea/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/kpathsea/ +dnl +dnl Copyright (C) 2009-2011 Peter Breitenlohner +dnl You may freely use, modify and/or distribute this file. +dnl +## configure options and TL libraries required for kpathsea +KPSE_WITH_TEXLIB([kpathsea]) +m4_include(kpse_TL[texk/kpathsea/ac/mktex.ac]) diff --git a/src/texsourc/kpathsea/kpathsea/access.c b/src/texsourc/kpathsea/kpathsea/access.c new file mode 100644 index 0000000..e6fb911 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/access.c @@ -0,0 +1,90 @@ +/* access -- test for access permissions of a file. + + Copyright 2008, 2009 Karl Berry. + 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 software; if not, see . */ + +#include +#include +#include + +/* + * 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 (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@tug.org.\n", stdout); + exit(0); + } else if (argc > 1 && strcmp (argv[1], "--version") == 0) { + printf ("%s (%s)\n\ +Copyright (C) 2009 Olaf Weber & Karl 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 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. The mode must be + * specified as a single parameter: an optional '-' followed by + * zero or more letters 'r', 'w', or 'x'. This 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/src/texsourc/kpathsea/kpathsea/aclocal.m4 b/src/texsourc/kpathsea/kpathsea/aclocal.m4 new file mode 100644 index 0000000..664e3d5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/aclocal.m4 @@ -0,0 +1,1195 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([../../m4/kpse-common.m4]) +m4_include([../../m4/kpse-lib-version.m4]) +m4_include([../../m4/kpse-mktex.m4]) +m4_include([../../m4/kpse-warnings.m4]) +m4_include([../../m4/kpse-win32.m4]) +m4_include([../../m4/libtool.m4]) +m4_include([../../m4/ltoptions.m4]) +m4_include([../../m4/ltsugar.m4]) +m4_include([../../m4/ltversion.m4]) +m4_include([../../m4/lt~obsolete.m4]) diff --git a/src/texsourc/kpathsea/kpathsea/atou.c b/src/texsourc/kpathsea/kpathsea/atou.c new file mode 100644 index 0000000..78afdfe --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/atou.c @@ -0,0 +1,28 @@ +/* atou.c: like atoi, but if the number is negative, abort. + + Copyright 1992, 1995, 2008 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, see . */ + +#include "config.h" + +unsigned +atou (const_string s) +{ + int i = atoi (s); + + if (i < 0) + FATAL1 ("I expected a positive number, not %d", i); + return i; +} diff --git a/src/texsourc/kpathsea/kpathsea/bsnl.awk b/src/texsourc/kpathsea/kpathsea/bsnl.awk new file mode 100644 index 0000000..5464628 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/bsnl.awk @@ -0,0 +1,17 @@ +# bsnl.awk - eliminate backslash-newline sequences +# Public domain. Originally written 2010, Karl Berry. + +# on a line ending with a backslash, save it (minus the backslash). +/\\$/ { + buf = buf substr ($0, 1, length ($0) - 1); + next; + } + +# on other lines, print the buffer if there is one, then the regular line. + { + if (buf) { + printf "%s", buf; # don't print a newline + buf = ""; + } + print; + } diff --git a/src/texsourc/kpathsea/kpathsea/c-auto.h b/src/texsourc/kpathsea/kpathsea/c-auto.h new file mode 100644 index 0000000..00d2150 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-auto.h @@ -0,0 +1,157 @@ +/* c-auto.h. Generated automatically by configure. */ +/* 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. */ + +/* Guard against double inclusion. */ +#ifndef KPATHSEA_C_AUTO_H +#define KPATHSEA_C_AUTO_H + +/* kpathsea: the version string. */ +#define KPSEVERSION "kpathsea version 6.2.0dev" + +/* 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. */ +#define HAVE_PUTENV 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRTOL 1 +#define HAVE_STRSTR 1 +#define HAVE_DECL_STRSTR 1 + +/* 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. */ +#define STDC_HEADERS 1 + +/* Define if your compiler understands prototypes. */ +#define HAVE_PROTOTYPES 1 + +/* 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 1 +#define MAKE_TEX_PK_BY_DEFAULT 1 +#define MAKE_TEX_TEX_BY_DEFAULT 0 +#define MAKE_TEX_TFM_BY_DEFAULT 1 +#define MAKE_TEX_FMT_BY_DEFAULT 1 +#define MAKE_OMEGA_OFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OCP_BY_DEFAULT 0 + +/* Define if you have the bcmp function. */ +/* #define HAVE_BCMP 1 */ + +/* Define if you have the bcopy function. */ +/* #define HAVE_BCOPY 1 */ + +/* Define if you have the bzero function. */ +/* #define HAVE_BZERO 1 */ + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getwd function. */ +/* #define HAVE_GETWD 1 */ + +/* Define if you have the index function. */ +/* #define HAVE_INDEX 1 */ + +/* Define if you have the memcmp function. */ +#define HAVE_MEMCMP 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the rindex function. */ +/* #define HAVE_RINDEX 1 */ + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strrchr function. */ +#define HAVE_STRRCHR 1 + +/* Define if you have the strstr function. */ +#define HAVE_STRSTR 1 + +/* Define if you have the strtol function. */ +#define HAVE_STRTOL 1 + +/* Define if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #define HAVE_PWD_H 1 */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_PARAM_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_UNISTD_H 1 */ + +#define strcasecmp stricmp +/* Define if you have the m library (-lm). */ +/* #undef HAVE_LIBM */ + +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 + +#endif /* !KPATHSEA_C_AUTO_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-auto.in b/src/texsourc/kpathsea/kpathsea/c-auto.in new file mode 100644 index 0000000..60d6c1c --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-auto.in @@ -0,0 +1,249 @@ +/* c-auto.in. Generated from configure.ac by autoheader. */ + +/* c-auto.h: defines for kpathsea, as determined by configure. + + Copyright 1994-97, 2008, 2009, 2010 Karl Berry. + Copyright 1997-99, 2002, 2005 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, see . */ + +/* Guard against double inclusion. */ +#ifndef KPATHSEA_C_AUTO_H +#define KPATHSEA_C_AUTO_H + +/* kpathsea: the version string. */ +#define KPSEVERSION "kpathsea version 6.2.0dev" + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to 1 if getcwd is 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 to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the declaration of `putenv', and to 0 if you don't. + */ +#undef HAVE_DECL_PUTENV + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#undef HAVE_DECL_STRSTR + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `getwd' function. */ +#undef HAVE_GETWD + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `memcmp' function. */ +#undef HAVE_MEMCMP + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the `mktemp' function. */ +#undef HAVE_MKTEMP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if `st_mtim' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_MTIM + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to 1 if you want to run mkocp if OCP file is missing, and to 0 if + you don't */ +#undef MAKE_OMEGA_OCP_BY_DEFAULT + +/* Define to 1 if you want to run mkofm if OFM file is missing, and to 0 if + you don't */ +#undef MAKE_OMEGA_OFM_BY_DEFAULT + +/* Define to 1 if you want to run mktexfmt if format file is missing, and to 0 + if you don't */ +#undef MAKE_TEX_FMT_BY_DEFAULT + +/* Define to 1 if you want to run mktexmf if MF source is missing, and to 0 if + you don't */ +#undef MAKE_TEX_MF_BY_DEFAULT + +/* Define to 1 if you want to run mktexpk if PK font is missing, and to 0 if + you don't */ +#undef MAKE_TEX_PK_BY_DEFAULT + +/* Define to 1 if you want to run mktextex if TeX source is missing, and to 0 + if you don't */ +#undef MAKE_TEX_TEX_BY_DEFAULT + +/* Define to 1 if you want to run mktextfm if TFM file is missing, and to 0 if + you don't */ +#undef MAKE_TEX_TFM_BY_DEFAULT + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if we need (v)snprintf wrapper functions. */ +#undef WRAP_SNPRINTF + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +#undef _LARGEFILE_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +#endif /* !KPATHSEA_C_AUTO_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-ctype.h b/src/texsourc/kpathsea/kpathsea/c-ctype.h new file mode 100644 index 0000000..1a80197 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-ctype.h @@ -0,0 +1,85 @@ +/* c-ctype.h: ASCII-safe versions of the macros. + + Copyright 1992, 1994, 2008, 2010, 2011 Karl Berry. + Copyright 1998, 2000, 2005 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, see . */ + +#ifndef KPATHSEA_C_CTYPE_H +#define KPATHSEA_C_CTYPE_H + +#include + +/* Be sure we have `isascii', even if wrong. */ +#ifndef WIN32 +#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 , 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 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 and define and use your + own versions of the ctype macros. + + A pretty clean approach to using 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/src/texsourc/kpathsea/kpathsea/c-dir.h b/src/texsourc/kpathsea/kpathsea/c-dir.h new file mode 100644 index 0000000..ae177fa --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-dir.h @@ -0,0 +1,52 @@ +/* c-dir.h: directory headers. + + Copyright 1992, 1993, 1994, 2008 Karl Berry. + Copyright 1998, 2005 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, see . */ + +#ifndef KPATHSEA_C_DIR_H +#define KPATHSEA_C_DIR_H + +#ifdef WIN32 + +#include + +#else /* not WIN32 */ + +/* Use struct dirent instead of struct direct. */ +#ifdef HAVE_DIRENT_H +#include +#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 +#endif + +#ifdef HAVE_SYS_DIR_H +#include +#endif + +#ifdef HAVE_NDIR_H +#include +#endif + +#endif /* not DIRENT */ + +#endif /* not WIN32 */ + +#endif /* not KPATHSEA_C_DIR_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-errno.h b/src/texsourc/kpathsea/kpathsea/c-errno.h new file mode 100644 index 0000000..27380ec --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-errno.h @@ -0,0 +1,27 @@ +/* c-errno.h: and the errno variable. + + Copyright 1992, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef KPATHSEA_C_ERRNO_H +#define KPATHSEA_C_ERRNO_H + +#include +#ifndef errno +extern int errno; +#endif + +#endif /* not KPATHSEA_C_ERRNO_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-fopen.h b/src/texsourc/kpathsea/kpathsea/c-fopen.h new file mode 100644 index 0000000..7b64ef4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-fopen.h @@ -0,0 +1,77 @@ +/* c-fopen.h: how to open files with fopen. + + Copyright 1992, 1994, 1995, 1996, 2008, 2011 Karl Berry. + Copyright 1998, 2005 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, see . */ + +#ifndef C_FOPEN_H +#define C_FOPEN_H + +/* How to open a text file: */ +/* From Akira: + I'm using Unix style line ending character to write text files. + I find it is easiest to define FOPEN_W_MODE == FOPEN_WBIN_MODE etc. for + my purpose. */ +#ifndef FOPEN_A_MODE +#define FOPEN_A_MODE "ab" +#endif + +#ifndef FOPEN_R_MODE +#define FOPEN_R_MODE "r" +#endif + +#ifndef FOPEN_W_MODE +#define FOPEN_W_MODE "wb" +#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. + We never use the value return by setmode(). */ +#include +#ifdef DOSISH +#include +#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) (void)setmode((f), O_BINARY) +#endif +#else /* not DOSISH */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif +#define SET_BINARY(f) (void)0 +#endif /* not DOSISH */ + +#endif /* not C_FOPEN_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-limits.h b/src/texsourc/kpathsea/kpathsea/c-limits.h new file mode 100644 index 0000000..6a639a6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-limits.h @@ -0,0 +1,36 @@ +/* c-limits.h: include the system parameter file. + + Copyright 1992, 1993, 1996, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef C_LIMITS_H +#define C_LIMITS_H + +#ifdef HAVE_LIMITS_H +#include +#else +#include +#ifdef HAVE_SYS_PARAM_H +#include +#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 +#endif + +#endif /* not C_LIMITS_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-memstr.h b/src/texsourc/kpathsea/kpathsea/c-memstr.h new file mode 100644 index 0000000..e8e107a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-memstr.h @@ -0,0 +1,63 @@ +/* c-memstr.h: memcpy, strchr, etc. + + Copyright 1992-2013 Karl Berry and 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, see . */ + +#ifndef KPATHSEA_C_MEMSTR_H +#define KPATHSEA_C_MEMSTR_H + +/* tries to declare bcopy etc., which can only conflict. */ +#define _XFUNCS_H_ + +#ifdef HAVE_STRING_H +#include +#else +/* don't ever want both string.h and strings.h; fails on AIX. */ +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + +/* An ANSI string.h and pre-ANSI memory.h might conflict. */ +#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) +#include +#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ + +/* For ancient systems that lack the system V/ANSI version of the + string functions we express them in terms of the BSD versions. */ +#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 + +#if !defined(HAVE_STRING_H) +extern char *strtok (); +#ifndef strstr +extern char *strstr (); +#endif +#endif + +#endif /* not KPATHSEA_C_MEMSTR_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-minmax.h b/src/texsourc/kpathsea/kpathsea/c-minmax.h new file mode 100644 index 0000000..7181c44 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-minmax.h @@ -0,0 +1,84 @@ +/* c-minmax.h: define INT_MIN, etc. Assume a 32-bit machine if the + values aren't defined. + + Copyright 1992, 1993, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef KPATHSEA_C_MINMAX_H +#define KPATHSEA_C_MINMAX_H + +#include + +/* Declared in 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 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/src/texsourc/kpathsea/kpathsea/c-namemx.h b/src/texsourc/kpathsea/kpathsea/c-namemx.h new file mode 100644 index 0000000..690f13d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-namemx.h @@ -0,0 +1,36 @@ +/* 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 1992, 1993, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef KPATHSEA_C_NAME_MX_H +#define KPATHSEA_C_NAME_MX_H + +#include + +/* 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/src/texsourc/kpathsea/kpathsea/c-pathch.h b/src/texsourc/kpathsea/kpathsea/c-pathch.h new file mode 100644 index 0000000..76352f8 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-pathch.h @@ -0,0 +1,100 @@ +/* c-pathch.h: define the characters which separate components of + filenames and environment variable paths. + + Copyright 1992, 1993, 1995, 1997, 2008 Karl Berry. + Copyright 1997, 1999, 2001, 2005 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, see . */ + +#ifndef C_PATHCH_H +#define C_PATHCH_H + +#include + +/* What separates filename components? */ +#ifndef DIR_SEP +# if defined(VMS) +# define DIR_SEP ':' +# define DIR_SEP_STRING ":" +# elif defined(DOSISH) /* not VMS */ +/* 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) == '\\') +# ifdef WIN32 +/* On win32, UNC names are authorized */ +# define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name) \ + && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2))) +/* Used after converting '\\' into '/' */ +# define IS_DIR_SEP_CH(ch) ((ch) == '/') +# endif +# elif defined(AMIGA) /* not DOSISH */ +# define DIR_SEP '/' +# define DIR_SEP_STRING "/" +# define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':') +# define IS_DEVICE_SEP(ch) ((ch) == ':') +# elif defined(VMCMS) /* not AMIGA */ +# define DIR_SEP ' ' +# define DIR_SEP_STRING " " +# else /* not VMCMS */ +# define DIR_SEP '/' +# define DIR_SEP_STRING "/" +# endif /* not VMCMS */ +#endif /* not DIR_SEP */ + +#ifndef IS_DIR_SEP +#define IS_DIR_SEP(ch) ((ch) == DIR_SEP) +#endif +#ifndef IS_DIR_SEP_CH +#define IS_DIR_SEP_CH(ch) IS_DIR_SEP(ch) +#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 "," +#elif defined (DOSISH) +# define ENV_SEP ';' +# define ENV_SEP_STRING ";" +#elif defined (AMIGA) +# define ENV_SEP ';' +# define ENV_SEP_STRING ";" +#elif defined (VMCMS) +# define ENV_SEP ' ' +# define ENV_SEP_STRING " " +#else +# define ENV_SEP ':' +# define ENV_SEP_STRING ":" +#endif +#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/src/texsourc/kpathsea/kpathsea/c-pathmx.h b/src/texsourc/kpathsea/kpathsea/c-pathmx.h new file mode 100644 index 0000000..8b63023 --- /dev/null +++ b/src/texsourc/kpathsea/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 (pace GNU Hurd), these constants should + not actually be used; filenames should be dynamically grown as + needed. Most of Kpathsea does this now, but not all, and not all + programs using it. + + Copyright 1992, 1993, 2008, 2010 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef KPATHSEA_C_PATH_MX_H +#define KPATHSEA_C_PATH_MX_H + +#include + +/* Cheat and define this as a manifest constant no matter what, instead + of using pathconf. Maybe it is too big otherwise on Hurd? */ + +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX 255 +#endif + +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#elif defined (MAX_PATH) +#define PATH_MAX MAX_PATH +#else +#define PATH_MAX _POSIX_PATH_MAX +#endif +#endif /* not PATH_MAX */ + +#endif /* not KPATHSEA_C_PATH_MAX_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-proto.h b/src/texsourc/kpathsea/kpathsea/c-proto.h new file mode 100644 index 0000000..f2fb8ea --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-proto.h @@ -0,0 +1,36 @@ +/* c-proto.h: macros to include or discard prototypes. + + Copyright 1992, 1993, 1995, 1996, 2008, 2009 Karl Berry. + Copyright 1999, 2000, 2001, 2003, 2004, 2005 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, see . */ + +#ifndef KPATHSEA_C_PROTO_H +#define KPATHSEA_C_PROTO_H + +#if defined (WIN32) && !defined (__MINGW32__) && !defined (NO_KPSE_DLL) +#define KPSE_DLL 1 +#endif /* WIN32 && ! __MINGW32__ */ + +#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 + +#endif /* not KPATHSEA_C_PROTO_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-stat.h b/src/texsourc/kpathsea/kpathsea/c-stat.h new file mode 100644 index 0000000..084c3a3 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-stat.h @@ -0,0 +1,56 @@ +/* c-stat.h: declarations for using stat(2). + + Copyright 1993, 1996, 2008, 2010 Karl Berry. + Copyright 1998, 2000, 2005 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, see . */ + +#ifndef KPATHSEA_STAT_H +#define KPATHSEA_STAT_H + +#include +#include + +/* 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/src/texsourc/kpathsea/kpathsea/c-std.h b/src/texsourc/kpathsea/kpathsea/c-std.h new file mode 100644 index 0000000..2ebacf6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-std.h @@ -0,0 +1,95 @@ +/* c-std.h: the first header files. + + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2008, 2012 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#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 MSVC bug : it can't be declared + extern "C" in a c++ source file. */ +#ifndef __cplusplus +#include +/* apparently M_PI isn't defined by under older VC */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#endif +#include + +/* Be sure we have constants from . */ +#include + +#ifdef HAVE_STDLIB_H +#include +/* Include before , to help avoid NULL + redefinitions on some systems. (We don't include + ourselves any more, but FYI.) */ +#else +/* It's impossible to say for sure what the system will deign to put in + , but let's hope it's at least this. */ +extern char *getenv (); +#endif /* not HAVE_STDLIB_H */ + +#ifdef WIN32 +#include +#else +#ifndef STDC_HEADERS +#ifndef ALLOC_RETURN_TYPE +#define ALLOC_RETURN_TYPE void +#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 + +/* Error numbers and errno declaration. */ +#include + +/* Numeric minima and maxima. */ +#include + +/* Assertions are too useful to not make generally available. */ +#ifdef HAVE_ASSERT_H +#include +#else +#define assert(expr) /* as nothing */ +#endif + +#ifdef VMS +#include +#include +#endif /* not VMS */ + +#endif /* not KPATHSEA_C_STD_H */ diff --git a/src/texsourc/kpathsea/kpathsea/c-unistd.h b/src/texsourc/kpathsea/kpathsea/c-unistd.h new file mode 100644 index 0000000..1f5f2fc --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/c-unistd.h @@ -0,0 +1,57 @@ +/* c-unistd.h: ensure we have constants from . Included from + c-std.h. + + Copyright 1992, 1993, 2008, 2012 Karl Berry. + Copyright 2005 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, see . */ + +#ifndef KPATHSEA_C_UNISTD_H +#define KPATHSEA_C_UNISTD_H + +/* is allowed to depend on . */ +#include + +#if HAVE_UNISTD_H +#if defined (WIN32) || defined (__CYGWIN__) +# define __need_getopt +#include +#endif +#include +#endif + +#include + +/* 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/src/texsourc/kpathsea/kpathsea/cnf-to-paths.awk b/src/texsourc/kpathsea/kpathsea/cnf-to-paths.awk new file mode 100644 index 0000000..939f54d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/cnf-to-paths.awk @@ -0,0 +1,58 @@ +# $Id: cnf-to-paths.awk 23442 2011-08-07 22:50:24Z karl $ +# cnf-to-paths.awk - convert texmf.cnf assignments to paths.h #define's. +# Public domain. Originally written 2011, Karl Berry. + +# We assume comments have been stripped. +# +# we only care about definitions with a valid C identifier (e.g., +# TEXINPUTS, not TEXINPUTS.latex), that is, lines that look like this: +# = +# (whitespace around the = is optional) +# +/^[ \t]*[A-Z0-9_]+[ \t]*=/ { + # On these lines, we distinguish three cases: + # + # 1) definitions referring to SELFAUTO*, which we want to keep. In + # particular, this is how the compile-time TEXMFCNF gets defined and + # thus how texmf.cnf gets found. + # + # 2) definitions starting with a /, which we also want to keep. Here + # we assume a distro maintainer has changed a variable, e.g., + # TEXMFMAIN=/usr/share/texmf, so keep it. (This also preserves the + # default values for OSFONTDIR and TRFONTS, but that's ok.) + # + # 3) anything else, which we want to convert to a constant /nonesuch. + # That way, the binaries don't get changed just because we change + # definitions in texmf.cnf. + # + # The definition of DEFAULT_TEXMF (and other variables) + # that winds up in the final paths.h will not be used. + + # Extract the identifier and the value from the line. Since + # gawk's subexpression matching is an extension, do it with copies. + ident = $0; + sub(/^[ \t]*/, "", ident); + sub(/[ \t]*=.*/, "", ident); + + val = $0; + sub(/^.*=[ \t]*/, "", val); + sub(/[ \t]*$/, "", val); + #print "got ident", ident, "and val", val >"/dev/stderr"; + + if (val ~ /\$SELFAUTO/) { + # Replace all semicolons with colons in the SELFAUTO paths we're keeping. + # (The path-splitting code should be changed to understand both.) + gsub(/;/, ":", val); + } else if (val ~ /^\//) { + # If the value starts with /, presume we're compiling with changes + # made for a distro, and keep it. Likewise switch to :. + gsub(/;/, ":", val); + } else { + val = "/nonesuch"; + } + + print "#ifndef DEFAULT_" ident; + print "#define DEFAULT_" ident " \"" val "\""; + print "#endif"; + print ""; +} diff --git a/src/texsourc/kpathsea/kpathsea/cnf.c b/src/texsourc/kpathsea/kpathsea/cnf.c new file mode 100644 index 0000000..578e42a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/cnf.c @@ -0,0 +1,281 @@ +/* cnf.c: read config files. + + Copyright 1994, 1995, 1996, 1997, 2008, 2009, 2011, 2012 Karl Berry. + Copyright 1997-2005 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, see . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* 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. */ + +#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 [.] [=] . Do + this even if the 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 (kpathsea kpse, 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; + + /* Remove trailing comment: a % or # preceded by whitespace. Also + remove any whitespace before that. For example, the value for + foo = a#b %something + is a#b. */ + value = line + strlen (line) - 1; /* start at end of line */ + while (value > line) { + if (*value == '%' || *value == '#') { + value--; /* move before comment char */ + while (ISSPACE (*value)) + *value-- = 0; /* wipe out as much preceding whitespace + continue; (and comment) as we find */ + } + value--; /* move before the new null byte */ + } + + /* 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 (&(kpse->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 (kpathsea kpse) +{ + string *cnf_files; + string *cnf; + const_string cnf_path = kpathsea_init_format (kpse, kpse_cnf_format); + + kpse->cnf_hash = hash_create (CNF_HASH_SIZE); + + cnf_files = kpathsea_all_path_search (kpse, cnf_path, CNF_NAME); + if (cnf_files && *cnf_files) { + for (cnf = cnf_files; *cnf; cnf++) { + string line; + FILE *cnf_file = xfopen (*cnf, FOPEN_R_MODE); + if (kpse->record_input) + kpse->record_input (*cnf); + + 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 ("kpathsea: %s: Last line of file ends with \\", *cnf); + } else { + string new_line; + new_line = concat (line, next_line); + free (line); + line = new_line; + len = strlen (line); + } + } + + do_line (kpse, line); + free (line); + } + + xfclose (cnf_file, *cnf); + free (*cnf); + } + free (cnf_files); + } else { + string warn = getenv ("KPATHSEA_WARNING"); + if (!(warn && STREQ (warn, "0"))) { + WARNING1 + ("kpathsea: configuration file texmf.cnf not found in these directories: %s", + cnf_path); + } + } +} + +/* 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. */ + +const_string +kpathsea_cnf_get (kpathsea kpse, const_string name) +{ + string ctry; + const_string ret, *ret_list; + + /* 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. Except this + code is not sufficient, somehow the ls-R path needs to be + computed when initializing the cnf path. Better to ensure that the + compile-time path does not contain variable references. */ + if (kpse->doing_cnf_init) + return NULL; + + if (kpse->cnf_hash.size == 0) { + /* Read configuration files and initialize databases. */ + kpse->doing_cnf_init = true; + read_all_cnf (kpse); + kpse->doing_cnf_init = false; + + /* Since `kpse_init_db' 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. */ + kpathsea_init_db (kpse); + } + + /* First look up NAME.`kpse->program_name', then NAME. */ + assert (kpse->program_name); + ctry = concat3 (name, ".", kpse->program_name); + ret_list = hash_lookup (kpse->cnf_hash, ctry); + free (ctry); + if (ret_list) { + ret = *ret_list; + free (ret_list); + } else { + ret_list = hash_lookup (kpse->cnf_hash, name); + if (ret_list) { + ret = *ret_list; + free (ret_list); + } else { + ret = NULL; + } + } + + return ret; +} + +#if defined(KPSE_COMPAT_API) +const_string +kpse_cnf_get (const_string name) +{ + return kpathsea_cnf_get(kpse_def, name); +} +#endif + diff --git a/src/texsourc/kpathsea/kpathsea/cnf.h b/src/texsourc/kpathsea/kpathsea/cnf.h new file mode 100644 index 0000000..44c9668 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/cnf.h @@ -0,0 +1,43 @@ +/* cnf.h: runtime config files. + + Copyright 1994, 1995, 2008, 2012 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_CNF_H +#define KPATHSEA_CNF_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 const_string kpathsea_cnf_get (kpathsea kpse, const_string name); + +#if defined(KPSE_COMPAT_API) +extern KPSEDLL const_string kpse_cnf_get (const_string var); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_CNF_H */ diff --git a/src/texsourc/kpathsea/kpathsea/concat.c b/src/texsourc/kpathsea/kpathsea/concat.c new file mode 100644 index 0000000..fe5298f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/concat.c @@ -0,0 +1,35 @@ +/* concat.c: dynamic string concatenation. + + Copyright 1992, 1993, 2008 Karl Berry. + Copyright 2002, 2005 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, see . */ + +#include + + +/* Return the concatenation of S1 and S2. See `concatn.c' for a + `concatn', which takes a variable number of arguments. */ + +string +concat (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/src/texsourc/kpathsea/kpathsea/concat3.c b/src/texsourc/kpathsea/kpathsea/concat3.c new file mode 100644 index 0000000..6e98a13 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/concat3.c @@ -0,0 +1,33 @@ +/* concat3.c: concatenate three strings. + + Copyright 1992, 2008 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, see . */ + +#include + + +string +concat3 (const_string s1, const_string s2, const_string s3) +{ + int s2l = s2 ? strlen (s2) : 0; + int s3l = s3 ? strlen (s3) : 0; + string answer + = (string) xmalloc (strlen(s1) + s2l + s3l + 1); + strcpy (answer, s1); + if (s2) strcat (answer, s2); + if (s3) strcat (answer, s3); + + return answer; +} diff --git a/src/texsourc/kpathsea/kpathsea/concatn.c b/src/texsourc/kpathsea/kpathsea/concatn.c new file mode 100644 index 0000000..4e0b9eb --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/concatn.c @@ -0,0 +1,72 @@ +/* concatn.c: concatenate an arbitrary number of strings. + + Copyright 1993, 1995, 2008, 2009 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#include + +#include + + +/* 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 (const_string str1, ...) +{ + string arg; + string ret; + va_list ap; + + if (!str1) + return NULL; + + ret = xstrdup (str1); + + va_start (ap, 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/src/texsourc/kpathsea/kpathsea/concatn.h b/src/texsourc/kpathsea/kpathsea/concatn.h new file mode 100644 index 0000000..7614027 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/concatn.h @@ -0,0 +1,41 @@ +/* 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 . The declarations for + the other concat routines are in lib.h. + + Copyright 1993, 1996, 2008 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_CONCATN_H +#define KPATHSEA_CONCATN_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Concatenate a null-terminated list of strings and return the result + in malloc-allocated memory. */ +extern KPSEDLL string concatn(const_string str1, ...); + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_CONCATN_H */ diff --git a/src/texsourc/kpathsea/kpathsea/config.h b/src/texsourc/kpathsea/kpathsea/config.h new file mode 100644 index 0000000..067777a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/config.h @@ -0,0 +1,235 @@ +/* config.h: master configuration file, included first by all compilable + source files (not headers). + + Copyright 1993, 1995, 1996, 1997, 2008, 2010, 2011 Karl Berry. + Copyright 2000, 2003, 2004, 2005 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, see . */ + +#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. */ + +#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 + +#if defined (WIN32) && !defined (__STDC__) +#define __STDC__ 1 +#endif + +/* System dependencies that are figured out by `configure'. */ +#include + +#ifdef __DJGPP__ +#include /* for long filenames' stuff */ +#include /* for `getdisk' */ +#include /* for `setmode' */ +#endif + +/* Some drivers have partially integrated kpathsea changes. */ +#ifndef KPATHSEA +#define KPATHSEA 34 +#endif + +#ifdef __MINGW32__ +/* In mingw32, the eof() function is part of the !_NO_OLDNAMES section + of , that is read in automatically via . We cannot + allow that because web2c/lib/eofeoln.c defines a private, + incompatible function named eof(). + But many of the other things defined via !_NO_OLDNAMES are needed, + so #define _NO_OLDNAMES cannot be used. So, temporarily define eof + as a macro. +*/ +#define eof saved_eof +#include /* , , etc. */ +#undef eof +#else +#include /* , , etc. */ +#endif + +#include /* Macros to discard or keep prototypes. */ + +/* + This must be included after "c-proto.h" + but before "lib.h". FP. +*/ +#if defined (WIN32) || defined (_WIN32) +#include +#ifdef __MINGW32__ +#include +#else +#include +#endif +#endif + +#if defined(WIN32) || defined(WRAP_SNPRINTF) +/* All Unix systems known to us have snprintf() and vsnprintf(), + while all known Windows systems have _snprintf() and _vsnprintf(). + + Consider a call + RET = snprintf(BUF, SIZE, FMT, ...) + and let LEN be the number that would be written to BUF if SIZE were + sufficiently large (not counting the trailing null byte). + + C99 requires that snprintf + (A) modifies at most the first SIZE bytes of BUF, + (B) writes a trailing null byte except when SIZE=0, and + (C) always returns LEN. + + All known implementations (except some ancient buggy ones, e.g., for + 64-bit Solaris 7 from Oct. 1998) satisfy (A). As long as LEN=SIZE by some older + implementations (SUSv2, glibc <= 2.0.6, etc.) and for Windows even + (B) is violated.. + + TeX Live does not require the full C99 semantics, but will need that + (1) there is always a trailing null byte, and + (2) for LEN>=SIZE the return value is either >=SIZE or <0, i.e., + (unsigned)RET >= (unsigned)SIZE. + + A violation of (2) is detected by configure (except when cross + compiling) and by a runtime check in the initialization routine + kpathsea_set_program_name. + + A violation of (1) is handled here through static inline wrapper + functions. */ + +#include + +#undef snprintf +#undef vsnprintf + +#ifdef __cplusplus +extern "C" { +#endif + +static inline int +kpse_vsnprintf (char *str, size_t size, const char *format, va_list ap) +{ +#ifdef WIN32 + int ret = _vsnprintf (str, size, format, ap); +#else + int ret = vsnprintf (str, size, format, ap); +#endif + if (size > 0 && (unsigned)ret >= (unsigned)size) + str [size - 1] = '\0'; + return ret; +} + +static inline int +kpse_snprintf (char *str, size_t size, const char *format, ...) +{ + int ret; + va_list ap; + + va_start (ap, format); + ret = kpse_vsnprintf (str, size, format, ap); + va_end (ap); + return ret; +} + +#ifdef __cplusplus +} +#endif + +#define snprintf kpse_snprintf +#define vsnprintf kpse_vsnprintf + +#endif /* WIN32 || WRAP_SNPRINTF */ + +/* Transform filename characters for use in hash tables. */ +#if defined(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 + +#include /* Runtime tracing. */ +#include /* STREQ, etc. */ +#include /* , boolean, string, etc. */ +#include /* for kpse_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/src/texsourc/kpathsea/kpathsea/configure b/src/texsourc/kpathsea/kpathsea/configure new file mode 100644 index 0000000..299689b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/configure @@ -0,0 +1,16081 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for Kpathsea 6.2.0dev. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and tex-k@tug.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='Kpathsea' +PACKAGE_TARNAME='kpathsea' +PACKAGE_VERSION='6.2.0dev' +PACKAGE_STRING='Kpathsea 6.2.0dev' +PACKAGE_BUGREPORT='tex-k@tug.org' +PACKAGE_URL='' + +ac_unique_file="pathsearch.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +have_EXEEXT_FALSE +have_EXEEXT_TRUE +LT_OBJDIR +MINGW32_FALSE +MINGW32_TRUE +WIN32_FALSE +WIN32_TRUE +LIBOBJS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +OBJDUMP +DLLTOOL +AS +WARNING_CFLAGS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +WEB2CVERSION +KPSE_LT_VERSINFO +KPSEVERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_dependency_tracking +enable_compiler_warnings +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_largefile +enable_mktexmf_default +enable_mktexpk_default +enable_mktextfm_default +enable_mkocp_default +enable_mkofm_default +enable_mktexfmt_default +enable_mktextex_default +with_snprintf_wrapper +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures Kpathsea 6.2.0dev to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/kpathsea] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of Kpathsea 6.2.0dev:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-compiler-warnings=[no|min|yes|max|all] + Turn on compiler warnings [default: yes if + maintainer-mode, min otherwise] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-largefile omit support for large files + --disable-mktexmf-default do not run mktexmf if MF source missing + --disable-mktexpk-default do not run mktexpk if PK font missing + --disable-mktextfm-default + do not run mktextfm if TFM file missing + --disable-mkocp-default do not run mkocp if OCP file missing + --disable-mkofm-default do not run mkofm if OFM file missing + --disable-mktexfmt-default + do not run mktexfmt if format file missing + --enable-mktextex-default run mktextex if TeX source missing + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-snprintf-wrapper use (v)snprintf wrapper functions [automatic for + native compilation or Windows] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +Kpathsea configure 6.2.0dev +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------- ## +## Report this to tex-k@tug.org ## +## ---------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by Kpathsea $as_me 6.2.0dev, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../build-aux \"$srcdir\"/../../build-aux" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +KPSEVERSION=6.2.0dev + + +KPSE_LT_VERSINFO=8:0:2 + + + + WEB2CVERSION=2014/dev + + +am__api_version='1.14' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Check whether --enable-compiler-warnings was given. +if test "${enable_compiler_warnings+set}" = set; then : + enableval=$enable_compiler_warnings; +fi +case $enable_compiler_warnings in #( + no | min | yes | max | all) : + ;; #( + *) : + if test "x$enable_maintainer_mode" = xyes; then : + enable_compiler_warnings=yes +else + enable_compiler_warnings=min +fi ;; +esac + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-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 +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test 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 + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='kpathsea' + VERSION='6.2.0dev' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler accepts prototypes" >&5 +$as_echo_n "checking whether the compiler accepts prototypes... " >&6; } +if ${kb_cv_c_prototypes+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +extern void foo(int i,...); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + kb_cv_c_prototypes=yes +else + kb_cv_c_prototypes=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_c_prototypes" >&5 +$as_echo "$kb_cv_c_prototypes" >&6; } +if test "x$kb_cv_c_prototypes" = xno; then + as_fn_error $? "Sorry, your compiler does not understand prototypes." "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5 +$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; } +if ${kpse_cv_warning_cflags+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$GCC" = xyes; then + kpse_cv_warning_cflags= +if test "x$enable_compiler_warnings" != xno; then + kpse_cv_warning_cflags="-Wimplicit -Wreturn-type" + case `$CC -dumpversion` in #( + 3.4.* | 4.*) : + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #( + *) : + ;; +esac + case `$CC -dumpversion` in #( + 3.[234].* | 4.*) : + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #( + *) : + ;; +esac + if test "x$enable_compiler_warnings" != xmin; then + kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags" + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations" + if test "x$enable_compiler_warnings" != xyes; then + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith" + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings" + case `$CC -dumpversion` in #( + 3.4.* | 4.*) : + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #( + *) : + ;; +esac + if test "x$enable_compiler_warnings" != xmax; then + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow" + fi + fi + fi +fi +elif test "x$enable_compiler_warnings" = xno; then + kpse_cv_warning_cflags= +else + kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_warning_cflags" >&5 +$as_echo "$kpse_cv_warning_cflags" >&6; } +WARNING_CFLAGS=$kpse_cv_warning_cflags + + + + + + + + + + + + +# Set options +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + 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; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$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 + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + 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. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_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' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${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 $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + 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 + else + ld_shlibs=no + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "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' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$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. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # 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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + 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}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; 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' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + 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 + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent 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 "$_LT_TAGVAR(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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; 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 + + + + + + + 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 + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "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" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$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 <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$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 + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +$as_echo_n "checking whether closedir returns void... " >&6; } +if ${ac_cv_func_closedir_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_closedir_void=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +$as_echo "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +$as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h + +fi + +for ac_header in assert.h float.h limits.h pwd.h stdlib.h sys/param.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_func in putenv strcasecmp strtol strstr +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in getcwd getwd memcmp memcpy mkstemp mktemp strchr strrchr +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +case :$ac_cv_c_int64_t:$ac_cv_c_int64_t: in #( + *':no:'*) : + as_fn_error $? "Sorry, your compiler does not support 64-bit integer types." "$LINENO" 5 ;; #( + *) : + ;; +esac +ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_MTIM 1 +_ACEOF + + +fi + + + +## texk/kpathsea/ac/mktex.ac: configure.ac fragment for the TeX Live +## subdirectory texk/kpathsea. +## configure defaults for mktexfmt & Co. +# Check whether --enable-mktexmf-default was given. +if test "${enable_mktexmf_default+set}" = set; then : + enableval=$enable_mktexmf_default; +fi +# Check whether --enable-mktexpk-default was given. +if test "${enable_mktexpk_default+set}" = set; then : + enableval=$enable_mktexpk_default; +fi +# Check whether --enable-mktextfm-default was given. +if test "${enable_mktextfm_default+set}" = set; then : + enableval=$enable_mktextfm_default; +fi +# Check whether --enable-mkocp-default was given. +if test "${enable_mkocp_default+set}" = set; then : + enableval=$enable_mkocp_default; +fi +# Check whether --enable-mkofm-default was given. +if test "${enable_mkofm_default+set}" = set; then : + enableval=$enable_mkofm_default; +fi +# Check whether --enable-mktexfmt-default was given. +if test "${enable_mktexfmt_default+set}" = set; then : + enableval=$enable_mktexfmt_default; +fi +# Check whether --enable-mktextex-default was given. +if test "${enable_mktextex_default+set}" = set; then : + enableval=$enable_mktextex_default; +fi + + +case $enable_mktexmf_default in #( + yes | no) : + ;; #( + *) : + enable_mktexmf_default=yes ;; +esac +if test "x$enable_mktexmf_default" = xyes; then : + +$as_echo "#define MAKE_TEX_MF_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_TEX_MF_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mktexpk_default in #( + yes | no) : + ;; #( + *) : + enable_mktexpk_default=yes ;; +esac +if test "x$enable_mktexpk_default" = xyes; then : + +$as_echo "#define MAKE_TEX_PK_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_TEX_PK_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mktextfm_default in #( + yes | no) : + ;; #( + *) : + enable_mktextfm_default=yes ;; +esac +if test "x$enable_mktextfm_default" = xyes; then : + +$as_echo "#define MAKE_TEX_TFM_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_TEX_TFM_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mkocp_default in #( + yes | no) : + ;; #( + *) : + enable_mkocp_default=yes ;; +esac +if test "x$enable_mkocp_default" = xyes; then : + +$as_echo "#define MAKE_OMEGA_OCP_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_OMEGA_OCP_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mkofm_default in #( + yes | no) : + ;; #( + *) : + enable_mkofm_default=yes ;; +esac +if test "x$enable_mkofm_default" = xyes; then : + +$as_echo "#define MAKE_OMEGA_OFM_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_OMEGA_OFM_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mktexfmt_default in #( + yes | no) : + ;; #( + *) : + enable_mktexfmt_default=yes ;; +esac +if test "x$enable_mktexfmt_default" = xyes; then : + +$as_echo "#define MAKE_TEX_FMT_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_TEX_FMT_BY_DEFAULT 0" >>confdefs.h + +fi +case $enable_mktextex_default in #( + yes | no) : + ;; #( + *) : + enable_mktextex_default=no ;; +esac +if test "x$enable_mktextex_default" = xyes; then : + +$as_echo "#define MAKE_TEX_TEX_BY_DEFAULT 1" >>confdefs.h + +else + $as_echo "#define MAKE_TEX_TEX_BY_DEFAULT 0" >>confdefs.h + +fi + +# So we can use reasonable awk in the Makefile. +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + +ac_fn_c_check_decl "$LINENO" "putenv" "ac_cv_have_decl_putenv" "$ac_includes_default" +if test "x$ac_cv_have_decl_putenv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTENV $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default" +if test "x$ac_cv_have_decl_strstr" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSTR $ac_have_decl +_ACEOF + +ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" +if test "x$ac_cv_func_putenv" = xyes; then : + $as_echo "#define HAVE_PUTENV 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" putenv.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS putenv.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes; then : + $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strcasecmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes; then : + $as_echo "#define HAVE_STRTOL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtol.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtol.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes; then : + $as_echo "#define HAVE_STRSTR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strstr.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strstr.$ac_objext" + ;; +esac + +fi + + + +if test "x$ac_cv_func_getcwd" = xyes; then +# We only need to run this if we have getcwd. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd uses fork or vfork" >&5 +$as_echo_n "checking whether getcwd uses fork or vfork... " >&6; } +if ${kb_cv_func_getcwd_forks+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + kb_cv_func_getcwd_forks=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int fork() { exit(1); } + int vfork() { exit(1); } + extern char *getcwd(); + char path[100]; +int +main () +{ +getcwd(path,100); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + kb_cv_func_getcwd_forks=no +else + kb_cv_func_getcwd_forks=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_func_getcwd_forks" >&5 +$as_echo "$kb_cv_func_getcwd_forks" >&6; } +if test "x$kb_cv_func_getcwd_forks" = xyes; then + +$as_echo "#define GETCWD_FORKS 1" >>confdefs.h + +fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native WIN32 or MINGW32" >&5 +$as_echo_n "checking for native WIN32 or MINGW32... " >&6; } +if ${kpse_cv_have_win32+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef WIN32 + choke me +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __MINGW32__ + choke me +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + kpse_cv_have_win32=mingw32 +else + kpse_cv_have_win32=native +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + kpse_cv_have_win32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_win32" >&5 +$as_echo "$kpse_cv_have_win32" >&6; } + + if test "x$kpse_cv_have_win32" != xno; then + WIN32_TRUE= + WIN32_FALSE='#' +else + WIN32_TRUE='#' + WIN32_FALSE= +fi + + + if test "x$kpse_cv_have_win32" = xmingw32; then + MINGW32_TRUE= + MINGW32_FALSE='#' +else + MINGW32_TRUE='#' + MINGW32_FALSE= +fi + + + +LT_OBJDIR="$lt_cv_objdir" + + +# Checking snprintf and vsnprintf + +# Check whether --with-snprintf-wrapper was given. +if test "${with_snprintf_wrapper+set}" = set; then : + withval=$with_snprintf_wrapper; kpse_cv_wrap_snprintf=$withval +else + test "x$kpse_cv_have_win32" != xno && kpse_cv_wrap_snprintf=yes +fi +if test "x$kpse_cv_have_win32" = xno; then + snfunc=snprintf vsnfunc=vsnprintf +else + snfunc=_snprintf vsnfunc=_vsnprintf +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $snfunc and $vsnfunc" >&5 +$as_echo_n "checking for $snfunc and $vsnfunc... " >&6; } +if ${kpse_cv_have_snfuncs+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + char buf[16]; + va_list ap; +int +main () +{ +$snfunc (buf, 16, "%s", "abc"); + $vsnfunc (buf, 16, "%s", ap); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + kpse_cv_have_snfuncs=yes +else + kpse_cv_have_snfuncs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_snfuncs" >&5 +$as_echo "$kpse_cv_have_snfuncs" >&6; } +if test "x$kpse_cv_have_snfuncs" != xyes; then + as_fn_error $? "Sorry, you need $snfunc and $vsnfunc." "$LINENO" 5 +fi +if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +char buf[4] = "abc"; +int +main () +{ +if ($snfunc (buf, 1, "%s", "x") == 0 || buf[1] != 'b') + return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + as_fn_error $? "Sorry, your $snfunc is badly broken." "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need (v)snprintf wrapper functions" >&5 +$as_echo_n "checking if we need (v)snprintf wrapper functions... " >&6; } +if ${kpse_cv_wrap_snprintf+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + kpse_cv_wrap_snprintf=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +char buf[4] = "abc"; +int +main () +{ +$snfunc (buf, 3, "xyz"); + if (buf[2] != 0) return 1; + $snfunc (buf, 2, "xyz"); + if (buf[1] != 0) return 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + kpse_cv_wrap_snprintf=no +else + kpse_cv_wrap_snprintf=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_wrap_snprintf" >&5 +$as_echo "$kpse_cv_wrap_snprintf" >&6; } +if test "x$kpse_cv_wrap_snprintf" = xyes; then + +$as_echo "#define WRAP_SNPRINTF 1" >>confdefs.h + +fi + + if test -n "$EXEEXT"; then + have_EXEEXT_TRUE= + have_EXEEXT_FALSE='#' +else + have_EXEEXT_TRUE='#' + have_EXEEXT_FALSE= +fi + + +ac_config_headers="$ac_config_headers c-auto.h:c-auto.in" + + + + + +ac_config_files="$ac_config_files Makefile doc/Makefile man/Makefile win32/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then + as_fn_error $? "conditional \"WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MINGW32_TRUE}" && test -z "${MINGW32_FALSE}"; then + as_fn_error $? "conditional \"MINGW32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${have_EXEEXT_TRUE}" && test -z "${have_EXEEXT_FALSE}"; then + as_fn_error $? "conditional \"have_EXEEXT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by Kpathsea $as_me 6.2.0dev, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +Kpathsea config.status 6.2.0dev +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "c-auto.h") CONFIG_HEADERS="$CONFIG_HEADERS c-auto.h:c-auto.in" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "c-auto.h":H) sed -e 's/^#define PACKAGE/#define KPSE_PACKAGE/' \ + -e 's/^#define VERSION/#define KPSE_VERSION/' c-auto.h >c-auto.tmp && mv -f c-auto.tmp c-auto.h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/src/texsourc/kpathsea/kpathsea/configure.ac b/src/texsourc/kpathsea/kpathsea/configure.ac new file mode 100644 index 0000000..e18a79a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/configure.ac @@ -0,0 +1,146 @@ +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright (C) 2009-2014 Peter Breitenlohner +dnl +dnl This file is free software; the copyright holder +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +m4_include([version.ac])[] dnl define kpse_version +AC_INIT([Kpathsea], kpse_version, [tex-k@tug.org]) +AC_PREREQ([2.65]) +AC_CONFIG_SRCDIR([pathsearch.c]) +AC_CONFIG_AUX_DIR([../../build-aux]) +AC_CONFIG_MACRO_DIR([../../m4]) + +AC_SUBST([KPSEVERSION], [kpse_version]) +KPSE_LT_VERSION([kpse]) + +m4_include([../../version.ac])[] dnl define tex_live_version +AC_SUBST([WEB2CVERSION], [tex_live_version]) + +dnl Common code for all programs using libkpathsea. +KPSE_COMMON([kpathsea]) +dnl Include additional code for kpathsea. +KPSE_MKTEX_PREPARE +m4_sinclude([ac/mktex.ac]) + +dnl Generate MAKE_TEX_*_BY_DEFAULT and MAKE_OMEGA_*_BY_DEFAULT defines. +m4_foreach([Kpse_Mktex], [kpse_mktex_opts], + [m4_ifset([Kpse_Mktex], + [KPSE_MKTEX_DEFINE(Kpse_Mktex)])])[]dnl + +# So we can use reasonable awk in the Makefile. +AC_PROG_AWK + +AC_CHECK_SIZEOF([long]) + +dnl Replacement functions that may be required on ancient broken system. +AC_CHECK_DECLS([putenv, strstr]) +AC_REPLACE_FUNCS([putenv strcasecmp strtol strstr]) + +if test "x$ac_cv_func_getcwd" = xyes; then +# We only need to run this if we have getcwd. +AC_CACHE_CHECK([whether getcwd uses fork or vfork], + [kb_cv_func_getcwd_forks], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[int fork() { exit(1); } + int vfork() { exit(1); } + extern char *getcwd(); + char path[100];]], + [[getcwd(path,100);]])], + [kb_cv_func_getcwd_forks=no], + [kb_cv_func_getcwd_forks=yes], + [kb_cv_func_getcwd_forks=no])]) +if test "x$kb_cv_func_getcwd_forks" = xyes; then + AC_DEFINE([GETCWD_FORKS], 1, + [Define to 1 if getcwd is implemented using fork or vfork. + Let me know if you have to add this by hand because configure + failed to detect it.]) +fi +fi + +KPSE_COND_MINGW32 + +AC_SUBST([LT_OBJDIR], ["$lt_cv_objdir"]) + +# Checking snprintf and vsnprintf +AC_ARG_WITH([snprintf-wrapper], + AS_HELP_STRING([--with-snprintf-wrapper], + [use (v)snprintf wrapper functions @<:@automatic + for native compilation or Windows@:>@]), + [kpse_cv_wrap_snprintf=$withval], + [test "x$kpse_cv_have_win32" != xno && kpse_cv_wrap_snprintf=yes])[]dnl +if test "x$kpse_cv_have_win32" = xno; then + snfunc=snprintf vsnfunc=vsnprintf +else + snfunc=_snprintf vsnfunc=_vsnprintf +fi +AC_CACHE_CHECK([for $snfunc and $vsnfunc], + [kpse_cv_have_snfuncs], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + char buf[16]; + va_list ap;]], + [[$snfunc (buf, 16, "%s", "abc"); + $vsnfunc (buf, 16, "%s", ap);]])], + [kpse_cv_have_snfuncs=yes], + [kpse_cv_have_snfuncs=no])]) +if test "x$kpse_cv_have_snfuncs" != xyes; then + AC_MSG_ERROR([Sorry, you need $snfunc and $vsnfunc.]) +fi +AC_RUN_IFELSE([AC_LANG_PROGRAM([[char buf[4] = "abc";]], + [[if ($snfunc (buf, 1, "%s", "x") == 0 || buf[1] != 'b') + return 1;]])], + [], + [AC_MSG_ERROR([Sorry, your $snfunc is badly broken.])], + [:]) +AC_CACHE_CHECK([if we need (v)snprintf wrapper functions], + [kpse_cv_wrap_snprintf], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[char buf[4] = "abc";]], + [[$snfunc (buf, 3, "xyz"); + if (buf[2] != 0) return 1; + $snfunc (buf, 2, "xyz"); + if (buf[1] != 0) return 1;]])], + [kpse_cv_wrap_snprintf=no], + [kpse_cv_wrap_snprintf=yes], + [kpse_cv_wrap_snprintf=no])]) +if test "x$kpse_cv_wrap_snprintf" = xyes; then + AC_DEFINE([WRAP_SNPRINTF], 1, + [Define to 1 if we need (v)snprintf wrapper functions.]) +fi + +AM_CONDITIONAL([have_EXEEXT], [test -n "$EXEEXT"]) + +dnl Write output here, instead of putting a zillion -D's on the command line. +AC_CONFIG_HEADERS([c-auto.h:c-auto.in], + [sed -e 's/^#define PACKAGE/#define KPSE_PACKAGE/' \ + -e 's/^#define VERSION/#define KPSE_VERSION/' c-auto.h >c-auto.tmp && mv -f c-auto.tmp c-auto.h]) + +AH_TOP([/* c-auto.h: defines for kpathsea, as determined by configure. + + Copyright 1994-97, 2008, 2009, 2010 Karl Berry. + Copyright 1997-99, 2002, 2005 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, see . */ + +/* Guard against double inclusion. */ +#ifndef KPATHSEA_C_AUTO_H +#define KPATHSEA_C_AUTO_H + +/* kpathsea: the version string. */ +#define KPSEVERSION "kpathsea version] kpse_version["]) +AH_BOTTOM([#endif /* !KPATHSEA_C_AUTO_H */]) + +AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile win32/Makefile]) + +AC_OUTPUT diff --git a/src/texsourc/kpathsea/kpathsea/db.c b/src/texsourc/kpathsea/kpathsea/db.c new file mode 100644 index 0000000..41aeb80 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/db.c @@ -0,0 +1,744 @@ +/* db.c: an external database to avoid filesystem lookups. + + Copyright 1994, 1995, 1996, 1997, 2008, 2009, 2011, 2012 Karl Berry. + Copyright 1997-2005 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, see . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef DB_HASH_SIZE +/* Based on the size of 2008 texmf-dist/ls-R, about 62000 entries. But + we don't want to make it too big, since texmf/ls-R only has about + 1300 entries. We should dynamically adapt the size. */ +#define DB_HASH_SIZE 32003 +#endif +#ifndef DB_NAME +#define DB_NAME "ls-R" +#endif +#ifndef DB_NAME_LC +#define DB_NAME_LC "ls-r" +#endif + +static char db_name[] = DB_NAME; +#ifndef WIN32 +static char db_name_lc[] = DB_NAME_LC; +#endif + +/* read ls-R only on WIN32 */ +static string db_names[] = { + db_name, +#ifndef WIN32 + db_name_lc, +#endif + NULL +}; + +#ifndef ALIAS_NAME +#define ALIAS_NAME "aliases" +#endif +#ifndef ALIAS_HASH_SIZE +#define ALIAS_HASH_SIZE 1009 +#endif + + +/* 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 (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_CH (dot_pos[-1]) && dot_pos[1] && !IS_DIR_SEP_CH (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 (kpathsea kpse, 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); +#if defined(WIN32) + string pp; +#endif + + strncpy (top_dir, db_filename, len); + top_dir[len] = 0; + + if (db_file) { + while ((line = read_line (db_file)) != NULL) { + len = strlen (line); + +#if defined(WIN32) + for (pp = line; *pp; pp++) { + if (IS_KANJI(pp)) + pp++; + else + *pp = TRANSFORM(*pp); + } +#endif + + /* 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] == ':' + && kpathsea_absolute_p (kpse, 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: %s: No usable entries in ls-R", db_filename); + WARNING ("kpathsea: See the manual for how to generate ls-R"); + db_file = NULL; + } else { + str_list_add (&(kpse->db_dir_list), xstrdup (top_dir)); + } + +#ifdef KPSE_DEBUG + if (KPATHSEA_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 +kpathsea_db_insert (kpathsea kpse, 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 (kpse->db.buckets) { + const_string dir_part; + string fname = xstrdup (passed_fname); + string baseptr = fname + (xbasename (fname) - 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 (&(kpse->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 (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_CH (*path_elt) /* at // */ + && original_filename < filename && IS_DIR_SEP_CH (path_elt[-1])) { + while (IS_DIR_SEP_CH (*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_CH (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 (that is, no directory separators remaining); + only then have we matched. */ + if (!matched && *path_elt == 0) { + /* Typically PATH_ELT ends with, say, `vf', and FILENAME ends with + `vf/ptmr.vf'. In that case, we'll be at the /. 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 sep in FILENAME, skip it. */ + if (IS_DIR_SEP_CH (*filename)) + filename++; + + /* Here are the basic possibilities for the check on being at the + last component: + 1) PATH_ELT is empty and FILENAME is `ptmr.vf' => match. + (we now have original_filename == filename) + 2) PATH_ELT is empty and FILENAME is `foo/ptmr.vf' => no match. + (we now have original_filename == filename) + 3) PATH_ELT is `vf/' and FILENAME is `vf/ptmr.vf' + (we are now after the / in each) => match. + 4) PATH_ELT is `vf' and FILENAME is `vfoo.ext' + (we are now after the f in each) => no match. + + When (the original) PATH_ELT was the empty string, we want to match + a FILENAME without dir seps. (This could be argued, and may never + happen in practice, but is the historical behavior.) */ + /* if original_filename != filename then original_filename < filename */ + if (original_filename == filename || IS_DIR_SEP_CH (filename[-1])) { + while (*filename && !IS_DIR_SEP_CH (*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 (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 (kpathsea kpse, 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 (KPATHSEA_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 found, set kpse->db.buckets to NULL. */ + +void +kpathsea_init_db (kpathsea kpse) +{ + boolean ok = false; + const_string db_path; + string *db_files; + string *orig_db_files; + + assert (sizeof(DB_NAME) == sizeof(DB_NAME_LC)); + + db_path = kpathsea_init_format (kpse, kpse_db_format); + db_files = kpathsea_path_search_list_generic (kpse, db_path, db_names, true, true); + orig_db_files = db_files; + + /* Must do this after the path searching (which ends up calling + kpse_db_search recursively), so kpse->db.buckets stays NULL. */ + kpse->db = hash_create (DB_HASH_SIZE); + + while (db_files && *db_files) { + if (db_build (kpse, &(kpse->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 (kpse->db.buckets); + kpse->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 = kpathsea_all_path_search (kpse, db_path, ALIAS_NAME); + orig_db_files = db_files; + + kpse->alias_db = hash_create (ALIAS_HASH_SIZE); + + while (db_files && *db_files) { + if (alias_build (kpse, &(kpse->alias_db), *db_files)) + ok = true; + free (*db_files); + db_files++; + } + + if (!ok) { + free (kpse->alias_db.buckets); + kpse->alias_db.buckets = NULL; + } + + free (orig_db_files); +} + +/* Avoid doing anything if this PATH_ELT is irrelevant to the databases. */ +str_list_type * +kpathsea_db_search (kpathsea kpse, const_string name, + const_string orig_path_elt, boolean all) +{ + const_string *db_dirs, *orig_dirs; + const_string last_slash, path_elt; + string temp_str = NULL; + boolean done; + unsigned e; + str_list_type *ret = NULL; + const_string *aliases, *r; + boolean relevant = false; + + /* If we failed to build the database (or if this is the recursive + call to build the db path), quit. */ + if (kpse->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 = temp_str = concat3 (orig_path_elt, "/", dir_part); + name = last_slash + 1; + free (dir_part); + } else + path_elt = 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 (kpse->db_dir_list); e++) { + relevant = elt_in_db (STR_LIST_ELT (kpse->db_dir_list, e), path_elt); + } + if (!relevant) + return NULL; + + /* If we have aliases for this name, use them. */ + if (kpse->alias_db.buckets) + aliases = hash_lookup (kpse->alias_db, name); + else + aliases = NULL; + + if (!aliases) { + aliases = XTALLOC1 (const_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++; + /* This is essentially + XRETALLOC (aliases, len + 1, const_string); + except that MSVC warns without the cast to `void *'. */ + aliases = (const_string *) xrealloc ((void *) aliases, + (len + 1) * sizeof(const_string)); + for (i = len; i > 0; i--) { + aliases[i] = aliases[i - 1]; + } + aliases[0] = name; + } + + done = false; + for (r = aliases; !done && *r; r++) { + const_string ctry = *r; + + /* We have an ls-R db. Look up `try'. */ + orig_dirs = db_dirs = hash_lookup (kpse->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 (KPATHSEA_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 (kpathsea_readable_file (kpse, db_file)) { + found = db_file; + + } else { + const_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 (kpathsea_readable_file (kpse, 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 ((void *) aliases); + + /* If we had to break up NAME, free the TEMP_STR. */ + if (temp_str) + free (temp_str); + + return ret; +} + +str_list_type * +kpathsea_db_search_list (kpathsea kpse, string* names, + const_string path_elt, boolean all) +{ + const_string *db_dirs, *orig_dirs; + const_string last_slash, name, path; + string temp_str = NULL; + boolean done; + unsigned e; + const_string *aliases, *r; + int n; + str_list_type *ret = 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 (kpse->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 (kpse->db_dir_list); e++) { + relevant = elt_in_db (STR_LIST_ELT (kpse->db_dir_list, e), path_elt); + } + if (!relevant) + return NULL; + + done = false; + ret = XTALLOC1 (str_list_type); + *ret = str_list_init (); + + /* Handle each name. */ + for (n = 0; !done && names[n]; n++) { + name = names[n]; + + /* Absolute names should have been caught in our caller. */ + if (kpathsea_absolute_p(kpse, 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 = temp_str = 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 (kpse->alias_db.buckets) + aliases = hash_lookup (kpse->alias_db, name); + else + aliases = NULL; + + if (!aliases) { + aliases = XTALLOC1 (const_string); + aliases[0] = NULL; + } + { /* Push aliases up by one and insert the original name at front. */ + unsigned i; + unsigned len = 1; /* Have NULL element already allocated. */ + for (r = aliases; *r; r++) + len++; + aliases = (const_string *) xrealloc ((void *) aliases, + (len + 1) * sizeof(const_string)); + for (i = len; i > 0; i--) { + aliases[i] = aliases[i - 1]; + } + aliases[0] = name; + } + + for (r = aliases; !done && *r; r++) { + const_string ctry = *r; + + /* We have an ls-R db. Look up `try'. */ + orig_dirs = db_dirs = hash_lookup (kpse->db, ctry); + + /* 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 (KPATHSEA_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 (kpathsea_readable_file (kpse, db_file)) { + found = db_file; + + } else { + const_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 (kpathsea_readable_file (kpse, 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 ((void *) aliases); + if (temp_str) + free (temp_str); + } + + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/db.h b/src/texsourc/kpathsea/kpathsea/db.h new file mode 100644 index 0000000..b77b1f0 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/db.h @@ -0,0 +1,53 @@ +/* db.h: lookups in an externally built db file. + + Copyright 1994, 1995, 2008, 2010, 2011 Karl Berry. + Copyright 1999, 2003, 2005 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, see . */ + +#ifndef KPATHSEA_DB_H +#define KPATHSEA_DB_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include +#include + +/* Initialize the database. Until this is called, no ls-R matches will + be found. */ +extern void kpathsea_init_db (kpathsea kpse); + +/* 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 *kpathsea_db_search (kpathsea kpse, const_string name, + const_string path_elt, boolean all); + +/* Note: NAMES[i] is not modified. */ +extern str_list_type *kpathsea_db_search_list (kpathsea kpse, + string* names, + const_string path_elt, + boolean all); + +/* Insert the filename FNAME into the database. + Called by mktex() in tex-make.c. */ +extern void kpathsea_db_insert (kpathsea kpse, const_string fname); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not KPATHSEA_DB_H */ diff --git a/src/texsourc/kpathsea/kpathsea/debug.c b/src/texsourc/kpathsea/kpathsea/debug.c new file mode 100644 index 0000000..5e4af3b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/debug.c @@ -0,0 +1,55 @@ +/* debug.c: help the user discover what's going on. + + Copyright 1993, 1994, 2008 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, see . */ + +#include + +#ifdef KPSE_DEBUG /* whole file */ + +/* If the real definitions of fopen or fclose are macros, we lose -- the + #undef won't restore them. */ + +FILE * +fopen (const char *filename, const char *mode) +{ +#if defined (KPSE_COMPAT_API) + kpathsea kpse = kpse_def; +#endif +#undef fopen + FILE *ret = fopen (filename, mode); +#if defined (KPSE_COMPAT_API) + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) + DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret); +#endif + return ret; +} + +int +fclose (FILE * f) +{ +#if defined (KPSE_COMPAT_API) + kpathsea kpse = kpse_def; +#endif +#undef fclose + int ret = fclose (f); +#if defined (KPSE_COMPAT_API) + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) + DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret); +#endif + return ret; +} + +#endif /* KPSE DEBUG */ diff --git a/src/texsourc/kpathsea/kpathsea/debug.h b/src/texsourc/kpathsea/kpathsea/debug.h new file mode 100644 index 0000000..38c54e4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/debug.h @@ -0,0 +1,109 @@ +/* debug.h: runtime tracing. + + Copyright 1993, 1994, 1995, 1996, 2008 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_DEBUG_H +#define KPATHSEA_DEBUG_H + +/* If NO_DEBUG is defined (not recommended), skip all this. */ +#ifndef NO_DEBUG + +#include +#include +#include + +#if defined(WIN32) +#if defined(_DEBUG) +/* This was needed at some time for catching errors in pdftex. */ +#include +#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 + +/* Test if a bit is on. */ +#define KPATHSEA_DEBUG_P(bit) (kpse->debug & (1 << (bit))) + +#if defined (KPSE_COMPAT_API) + +/* 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))) + +#endif /* KPSE_COMPAT_API */ + +#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 () + +#ifdef __cplusplus +extern "C" { +#endif + +#undef fopen +#define fopen kpse_fopen_trace +extern KPSEDLL FILE *fopen (const char *filename, const char *mode); +#undef fclose +#define fclose kpse_fclose_trace +extern KPSEDLL int fclose (FILE *); + +#ifdef __cplusplus +} +#endif + +#endif /* not NO_DEBUG */ + +#endif /* not KPATHSEA_DEBUG_H */ diff --git a/src/texsourc/kpathsea/kpathsea/default.h b/src/texsourc/kpathsea/kpathsea/default.h new file mode 100644 index 0000000..a84d874 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/default.h @@ -0,0 +1,36 @@ +/* default.h: declare default path expander. + + Copyright 1993, 1994, 2008, 2011 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, see . */ + +#ifndef KPATHSEA_DEFAULT_H +#define KPATHSEA_DEFAULT_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include + + +/* 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. The result is always in new memory. */ + +extern string kpathsea_expand_default (kpathsea kpse, const_string path, + const_string dflt); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not KPATHSEA_DEFAULT_H */ diff --git a/src/texsourc/kpathsea/kpathsea/dir.c b/src/texsourc/kpathsea/kpathsea/dir.c new file mode 100644 index 0000000..f2b4eaf --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/dir.c @@ -0,0 +1,146 @@ +/* dir.c: directory operations. + + Copyright 1992, 1993, 1994, 1995, 2008-2012 Karl Berry. + Copyright 2000, 2002, 2005 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, see . */ + +#include + +#include +#include +#include +#include + +/* Return true if FN is a directory or a symlink to a directory, + false if not. */ + +boolean +kpathsea_dir_p (kpathsea kpse, 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; + + kpathsea_normalize_path(kpse, fn); + fa = GetFileAttributes(fn); + +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_STAT)) { + if (fa == 0xFFFFFFFF) { + fprintf(stderr, "failed to get file attributes for %s (%d)\n", + fn, (int)(GetLastError())); + } else { + fprintf(stderr, "path %s %s a directory\n", + fn , (fa & FILE_ATTRIBUTE_DIRECTORY) ? + "is" : "is not"); + } + } +#endif /* KPSE_DEBUG */ + return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY)); +#else /* !WIN32 */ + struct stat stats; + return stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode); +#endif /* !WIN32 */ +} + +#if defined(KPSE_COMPAT_API) +boolean +dir_p (string fn) +{ + return kpathsea_dir_p (kpse_def, fn); +} +#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 +kpathsea_dir_links (kpathsea kpse, const_string fn, long nlinks) +{ + const_string *hash_ret; + + if (kpse->link_table.size == 0) + kpse->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 (KPATHSEA_DEBUG_P (KPSE_DEBUG_HASH)) + kpse->debug_hash_lookup_int = true; +#endif + + hash_ret = hash_lookup (kpse->link_table, fn); + +#ifdef KPSE_DEBUG + if (KPATHSEA_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(&(kpse->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(&(kpse->link_table), xstrdup(fn), (const_string)nlinks); +#endif + +#ifdef KPSE_DEBUG + if (KPATHSEA_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; +} + +#if defined (KPSE_COMPAT_API) +int +dir_links (const_string fn, long nlinks) +{ + return kpathsea_dir_links (kpse_def, fn, nlinks); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/dirent.c b/src/texsourc/kpathsea/kpathsea/dirent.c new file mode 100644 index 0000000..95b2048 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/dirent.c @@ -0,0 +1,146 @@ +/* +Public domain. No warranty. Akira Kakuto +*/ + +/* +DIR * opendir(char *name); +struct dirent * readdir(DIR * dirp); +int closedir(DIR * dirp); + + to be used on VC++ 2.0 + ( by A. Kakuto, 1995 ) + rewritten on Jan. 18, 1997 ( A.K. ) + + dirent.h should be included +*/ + +#include +#include +#include +#include +#include "kpathsea/dirent.h" + +static int find(DIR *dp, char *name) +{ + HANDLE h; + WIN32_FIND_DATA *pfd; + + pfd = (WIN32_FIND_DATA *)(dp->_d_buf); + if((h = FindFirstFile(name,pfd)) == INVALID_HANDLE_VALUE) + return -1; + dp->_d_hdir = (unsigned)h; + pfd->dwReserved1 = strlen(pfd->cFileName); + dp->_d_magic = pfd->dwFileAttributes; + pfd->dwReserved0 = (dp->_d_magic & FILE_ATTRIBUTE_DIRECTORY) ? 1 : 0; + dp->_d_direntptr = (struct dirent *)&(pfd->dwReserved0); + dp->_d_nfiles = 0; + return 0; +} + +static int findn(DIR *dp) +{ + BOOL res; + HANDLE h; + WIN32_FIND_DATA *pfd; + + h = (HANDLE)dp->_d_hdir; + pfd = (WIN32_FIND_DATA *)(dp->_d_buf); + if((res = FindNextFile(h,pfd)) == FALSE) + return -1; + pfd->dwReserved1 = strlen(pfd->cFileName); + dp->_d_magic = pfd->dwFileAttributes; + pfd->dwReserved0 = (dp->_d_magic & FILE_ATTRIBUTE_DIRECTORY) ? 1 : 0; + dp->_d_direntptr = (struct dirent *)&(pfd->dwReserved0); + + return 0; +} + +DIR *opendir(char *fname) +{ + DIR *dirptr; + char nbuf[512]; + char *name, *lastpos; + + if(!(dirptr = (DIR *)malloc(sizeof(DIR)))) + return NULL; + strcpy(nbuf,fname); + name = nbuf; + + if(*name != '\0' && *(name+1) == ':') + name += 2; + + if(*name == '\0') { + *name='/'; *(name+1)='\0'; goto add_ast; + } + if(*(name+1) == '\0' && (*name == '/' || *name == '\\')) { + *name='/'; goto add_ast; + } + + lastpos = nbuf; + while(*lastpos) + lastpos++; + lastpos--; + if(*lastpos == '/' || *lastpos == '\\') { + *lastpos = '\0'; lastpos--; + } + + if(*name == '.' && name[1] == '\0') { + name[1]='/'; name[2]='\0'; goto add_ast; + } + if(*name == '.' && name[1] == '.' && name[2] == '\0') { + name[2]='/'; name[3]='\0'; goto add_ast; + } + if(*lastpos == '.' && (*(lastpos-1) == '/' || *(lastpos-1) == '\\')) { + *(lastpos+1)='/'; *(lastpos+2)='\0'; goto add_ast; + } + if(*lastpos == '.' && *(lastpos-1) == '.' && + (*(lastpos-2) == '/' || *(lastpos-2) == '\\')) { + *(lastpos+1)='/'; *(lastpos+2)='\0'; goto add_ast; + } + + if(find(dirptr, nbuf) != 0) { + free(dirptr); + return NULL; + } + if(strpbrk(name,"*?") == NULL) { + if(dirptr->_d_magic & FILE_ATTRIBUTE_DIRECTORY) { + FindClose((HANDLE)dirptr->_d_hdir); + strcat(name, "/"); + add_ast: + strcat(name,"*"); + if(find(dirptr,nbuf) != 0) { + free(dirptr); + return NULL; + } + } + } + dirptr->_d_nfiles = 0; + return dirptr; +} + +int closedir(DIR *dirp) +{ + HANDLE h; + BOOL res; + + h = (HANDLE)dirp->_d_hdir; + res = FindClose(h); + if( res == FALSE) { + free(dirp); + return -1; + } + free(dirp); + return 0; +} + +struct dirent * readdir(DIR *dirp) +{ + if(dirp == NULL) + return NULL; + if(++(dirp->_d_nfiles) == 1) { + return (dirp->_d_direntptr); + } + if(findn(dirp) != 0) + return NULL; + return (dirp->_d_direntptr); +} diff --git a/src/texsourc/kpathsea/kpathsea/dirent.h b/src/texsourc/kpathsea/kpathsea/dirent.h new file mode 100644 index 0000000..64950e4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/dirent.h @@ -0,0 +1,53 @@ +/* dirent.h + + Definitions for UNIX like directory operations. + +*/ + +/* + for VC++2.0 ( by A. K., 1995 ) +*/ + +#ifndef __DIRENTAK_H +#define __DIRENTAK_H + +#include + +#ifndef NULL +#define NULL 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* dirent structure returned by readdir(). + */ +struct dirent +{ + int d_isdir; + int d_namlen; + char d_name[260]; +}; + +/* DIR type returned by opendir(). The members of this structure + must not be accessed by application programs. +*/ +typedef struct +{ + unsigned _d_hdir; /* directory handle */ + struct dirent *_d_direntptr; /* directory entry pointer */ + unsigned _d_magic; /* file attribute */ + unsigned _d_nfiles; /* access count */ + char _d_buf[318]; /* buffer (WIN32_FIND_DATA) */ +} DIR; + +KPSEDLL DIR *opendir(char *__dirname); +KPSEDLL struct dirent *readdir(DIR *__dir); +KPSEDLL int closedir(DIR *__dir); + +#ifdef __cplusplus +} +#endif +#endif /* __DIRENTAK_H */ diff --git a/src/texsourc/kpathsea/kpathsea/doc/Makefile.am b/src/texsourc/kpathsea/kpathsea/doc/Makefile.am new file mode 100644 index 0000000..57bea3f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/Makefile.am @@ -0,0 +1,8 @@ +## Makefile.am for the TeX Live subdirectory texk/kpathsea/doc/ +## +## Copyright (C) 2009-2013 Peter Breitenlohner +## You may freely use, modify and/or distribute this file. +## +info_TEXINFOS = kpathsea.texi +kpathsea_TEXINFOS = bugs.texi hier.texi install.texi unixtex.texi + diff --git a/src/texsourc/kpathsea/kpathsea/doc/Makefile.in b/src/texsourc/kpathsea/kpathsea/doc/Makefile.in new file mode 100644 index 0000000..dc856ad --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/Makefile.in @@ -0,0 +1,753 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(kpathsea_TEXINFOS) $(top_srcdir)/../../build-aux/texinfo.tex +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-lib-version.m4 \ + $(top_srcdir)/../../m4/kpse-mktex.m4 \ + $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 \ + $(top_srcdir)/../../m4/libtool.m4 \ + $(top_srcdir)/../../m4/ltoptions.m4 \ + $(top_srcdir)/../../m4/ltsugar.m4 \ + $(top_srcdir)/../../m4/ltversion.m4 \ + $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \ + $(top_srcdir)/../../version.ac $(top_srcdir)/ac/mktex.ac \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/c-auto.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) +am__v_DVIPS_0 = @echo " DVIPS " $@; +am__v_DVIPS_1 = +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; +am__v_MAKEINFO_1 = +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) +am__v_INFOHTML_0 = @echo " INFOHTML" $@; +am__v_INFOHTML_1 = +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; +am__v_TEXI2DVI_1 = +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; +am__v_TEXI2PDF_1 = +AM_V_texinfo = $(am__v_texinfo_@AM_V@) +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) +am__v_texinfo_0 = -q +am__v_texinfo_1 = +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) +am__v_texidevnull_0 = > /dev/null +am__v_texidevnull_1 = +INFO_DEPS = $(srcdir)/kpathsea.info +TEXINFO_TEX = $(top_srcdir)/../../build-aux/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/../../build-aux +DVIS = kpathsea.dvi +PDFS = kpathsea.pdf +PSS = kpathsea.ps +HTMLS = kpathsea.html +TEXINFOS = kpathsea.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__installdirs = "$(DESTDIR)$(infodir)" +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KPSEVERSION = @KPSEVERSION@ +KPSE_LT_VERSINFO = @KPSE_LT_VERSINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_OBJDIR = @LT_OBJDIR@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WEB2CVERSION = @WEB2CVERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +info_TEXINFOS = kpathsea.texi +kpathsea_TEXINFOS = bugs.texi hier.texi install.texi unixtex.texi +all: all-am + +.SUFFIXES: +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +.texi.info: + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + $(am__cd) $(srcdir); \ + else \ + rc=$$?; \ + $(am__cd) $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc + +.texi.dvi: + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.pdf: + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ + $< + +.texi.html: + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ + else \ + rm -rf $(@:.html=.htp); exit 1; \ + fi +$(srcdir)/kpathsea.info: kpathsea.texi $(kpathsea_TEXINFOS) +kpathsea.dvi: kpathsea.texi $(kpathsea_TEXINFOS) +kpathsea.pdf: kpathsea.texi $(kpathsea_TEXINFOS) +kpathsea.html: kpathsea.texi $(kpathsea_TEXINFOS) +.dvi.ps: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + $(DVIPS) $(AM_V_texinfo) -o $@ $< + +uninstall-dvi-am: + @$(NORMAL_UNINSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ + rm -f "$(DESTDIR)$(dvidir)/$$f"; \ + done + +uninstall-html-am: + @$(NORMAL_UNINSTALL) + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ + done + +uninstall-info-am: + @$(PRE_UNINSTALL) + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ + done; \ + else :; fi + @$(NORMAL_UNINSTALL) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ + done + +uninstall-pdf-am: + @$(NORMAL_UNINSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ + done + +uninstall-ps-am: + @$(NORMAL_UNINSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ + rm -f "$(DESTDIR)$(psdir)/$$f"; \ + done + +dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ + if test -f $$file; then \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f "$(distdir)/$$relfile" || \ + cp -p $$file "$(distdir)/$$relfile"; \ + else :; fi; \ + done; \ + done + +mostlyclean-aminfo: + -rm -rf kpathsea.t2d kpathsea.t2p + +clean-aminfo: + -test -z "kpathsea.dvi kpathsea.pdf kpathsea.ps kpathsea.html" \ + || rm -rf kpathsea.dvi kpathsea.pdf kpathsea.ps kpathsea.html + +maintainer-clean-aminfo: + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ + done +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-info +check-am: all-am +check: check-am +all-am: Makefile $(INFO_DEPS) +installdirs: + for dir in "$(DESTDIR)$(infodir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: $(DVIS) + +html: html-am + +html-am: $(HTMLS) + +info: info-am + +info-am: $(INFO_DEPS) + +install-data-am: install-info-am + +install-dvi: install-dvi-am + +install-dvi-am: $(DVIS) + @$(NORMAL_INSTALL) + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ + done +install-exec-am: + +install-html: install-html-am + +install-html-am: $(HTMLS) + @$(NORMAL_INSTALL) + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ + $(am__strip_dir) \ + d2=$$d$$p; \ + if test -d "$$d2"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ + else \ + list2="$$list2 $$d2"; \ + fi; \ + done; \ + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done; } +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ + fi; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + echo "$$ifile"; \ + else : ; fi; \ + done; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done + @$(POST_INSTALL) + @if $(am__can_run_installinfo); then \ + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: $(PDFS) + @$(NORMAL_INSTALL) + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done +install-ps: install-ps-am + +install-ps-am: $(PSS) + @$(NORMAL_INSTALL) + @list='$(PSS)'; test -n "$(psdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: $(PDFS) + +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-pdf-am uninstall-ps-am + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-aminfo clean-generic \ + clean-libtool cscopelist-am ctags-am dist-info distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-pdf-am uninstall-ps-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/texsourc/kpathsea/kpathsea/doc/bugs.texi b/src/texsourc/kpathsea/kpathsea/doc/bugs.texi new file mode 100644 index 0000000..43460f9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/bugs.texi @@ -0,0 +1,897 @@ +@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@@tug.org @r{(bug address)} +@cindex bug address +If you have problems or suggestions, please report them to +@email{tex-k@@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@@tug.org}. + +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. + +@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@@tug.org}. +@flindex tex-k-request@@tug.org +To join, email @email{tex-k-request@@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. + +@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 +@LaTeX{}, please use the mailing list @email{texhax@@tug.org} mailing +list (@url{http://lists.tug.org/texhax}) 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 kpse->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 kpse->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 instance variable @code{kpse->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. + +In addition to this Kpathsea-specific logging, @command{pdftex} +provides an option @option{-recorder} to write the names of all files +accessed during a run to the file @file{@var{basefile}.fls}. + +Finally, most systems provide a general tool to output each system +call, thus including opening and closing files. It might be named +@command{strace}, @command{truss}, @command{struss}, or something +else. + + +@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 +machines 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{} and GCC's @file{} have conflicting definitions +for @code{wchar_t}. + +The particulars: @file{} 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{}. 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{}, 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{}: +@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/src/texsourc/kpathsea/kpathsea/doc/hier.texi b/src/texsourc/kpathsea/kpathsea/doc/hier.texi new file mode 100644 index 0000000..007be80 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/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/src/texsourc/kpathsea/kpathsea/doc/install.texi b/src/texsourc/kpathsea/kpathsea/doc/install.texi new file mode 100644 index 0000000..b3eaa20 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/install.texi @@ -0,0 +1,1238 @@ +@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}. + +@cindex TDS +@cindex @TeX{} directory structure +@xref{TeX directory structure,, @TeX{} directory structure}, for a +description of the default arrangement of the input files that comprise +the @TeX{} system. + + +@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.) + + +@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}). These are collectively +known as @dfn{@code{mktex} scripts}, since most of them are named +@code{mktex...}. + +For example, this is 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. +Building all fonts in advance is therefore impractical, if not +impossible. + +It is also useful for the @TeX{} @samp{.fmt} (and Metafont +@samp{.base} and Metapost @samp{.mem} files, @pxref{Memory +dumps,,,Web2c,web2c}), where pre-generating every format consumes a +lot of both time and space. + +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 +* config: mktex configuration. +* names: mktex script names. +* args: 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 list of file types and program names that can run an external +program to create missing files is listed in the next section. 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-mktexfmt-default +@opindex --without-mktexmf-default +@opindex --without-mktexocp-default +@opindex --without-mktexofm-default +@opindex --without-mktexpk-default +@opindex --without-mktextfm-default +@opindex --with-mktextex-default +@example +--without-mktexfmt-default +--without-mktexmf-default +--without-mktexocp-default +--without-mktexofm-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 fmtutils.cnf +@code{mktexfmt} reads a file @file{fmtutil.cnf}, typically located in +@file{texmf/web2c/} to glean its configuration information. The rest +of the files and features in this section are primarily intended for +the font generation scripts. + +@flindex mktex.cnf +@flindex mktex.opt +@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 + +The following table shows the default name of the script for each +of the file types which support runtime generation. + +@table @file +@item mktexfmt +@pindex mktexfmt +@pindex fmtutil +(@samp{.fmt}, @samp{.base}, @samp{.mem}) @TeX{}/Metafont/MetaPost +formats. This script is also named @command{fmtutil}, and reads +@file{fmtutil.cnf} for configuration information. + +@item mktexmf +@pindex mktexmf +(@samp{.mf}) Metafont input files. + +@item mkocp +@pindex mkocp +(@samp{.ocp}) Omega compiled process files. + +@item mkofm +@pindex mkofm +(@samp{.ofm}) Omega font metric files. + +@item mktexpk +@pindex mktexpk +(@samp{pk}) Glyph fonts. + +@item mktextex +@pindex mktextex +(@samp{.tex}) @TeX{} input files (disabled by default). + +@item mktextfm +@pindex mktextfm +(@samp{.tfm}) TFM files. +@end table + +@vindex DVIPSMAKEPK +@vindex XDVIMAKEPK +@vindex DVILJMAKEPK +@noindent These names can be 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 ``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 + + +@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/src/texsourc/kpathsea/kpathsea/doc/kpathsea.info b/src/texsourc/kpathsea/kpathsea/doc/kpathsea.info new file mode 100644 index 0000000..4177819 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/kpathsea.info @@ -0,0 +1,4761 @@ +This is kpathsea.info, produced by makeinfo version 5.1 from +kpathsea.texi. + +This file documents the Kpathsea library for path searching. + + Copyright (C) 1996-2013 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 TeX Users Group. +INFO-DIR-SECTION TeX +START-INFO-DIR-ENTRY +* Kpathsea: (kpathsea). File lookup along search paths. +* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching. +* mktexfmt: (kpathsea)mktex scripts. Format (fmt/base/mem) generation. +* mktexlsr: (kpathsea)Filename database. Update ls-R. +* 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. +END-INFO-DIR-ENTRY + + +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 6.1.1, released in April +2013. + +* 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 6.1.1 of the Kpathsea library, +released in April 2013. + + 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 accompanying files 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, thanks!). 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. See + for information. + +* 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: + + These are the sources, which you will be compiling. + + + 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 (dvips)Installation::. If you have any color + printers, see *note (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 (dvips)Installation::. + * *Note (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 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. + + +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 +(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.) + + +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 +( 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::). These are collectively known +as "'mktex' scripts", since most of them are named 'mktex...'. + + For example, this is 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. +Building all fonts in advance is therefore impractical, if not +impossible. + + It is also useful for the TeX '.fmt' (and Metafont '.base' and +Metapost '.mem' files, *note (Web2c)Memory dumps::), where +pre-generating every format consumes a lot of both time and space. + + 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: + +* config: mktex configuration. +* names: mktex script names. +* args: mktex script arguments. + + +File: kpathsea.info, Node: mktex configuration, Next: mktex script names, Up: mktex scripts + +2.2.9.1 'mktex' configuration +............................. + +The list of file types and program names that can run an external +program to create missing files is listed in the next section. 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-mktexfmt-default + --without-mktexmf-default + --without-mktexocp-default + --without-mktexofm-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::). + + 'mktexfmt' reads a file 'fmtutil.cnf', typically located in +'texmf/web2c/' to glean its configuration information. The rest of the +files and features in this section are primarily intended for the font +generation scripts. + + 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 (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 of the +file types which support runtime generation. + +'mktexfmt' + ('.fmt', '.base', '.mem') TeX/Metafont/MetaPost formats. This + script is also named 'fmtutil', and reads 'fmtutil.cnf' for + configuration information. + +'mktexmf' + ('.mf') Metafont input files. + +'mkocp' + ('.ocp') Omega compiled process files. + +'mkofm' + ('.ofm') Omega font metric files. + +'mktexpk' + ('pk') Glyph fonts. + +'mktextex' + ('.tex') TeX input files (disabled by default). + +'mktextfm' + ('.tfm') TFM files. + +These names can be 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 "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 (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 (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 +(dvips)Option details::, the xdvi man page, and *note (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 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 , last updated 13 June 2010. +Also available as . Email + with comments or questions. + + The principal free TeX distribution for Unix-like systems is TeX +Live, on the web at . The pages there describe +many ways to acquire TeX, over the Internet or on physical media, both +the sources and precompiled binaries for many systems, either standalone +or as part of various operating system distributions. + + Web2C, Kpathsea, Dvips, and Dviljk are no longer released as a +separate packages. Their sources are now maintained as part of TeX +Live. + + The host ftp.cs.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 a larger +package. In any case, that ftp site is not the canonical source for +anything except what was created as part of Stanford TeX project, so do +not rely on the other files available there 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 + 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 . + + 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. + + * 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 + ). 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 +. To join, email 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 +. + + 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 are looking for general TeX help, such as how to use LaTeX, +please use the mailing list 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 instance variable 'kpse->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. + + In addition to this Kpathsea-specific logging, 'pdftex' provides an +option '-recorder' to write the names of all files accessed during a run +to the file 'BASEFILE.fls'. + + Finally, most systems provide a general tool to output each system +call, thus including opening and closing files. It might be named +'strace', 'truss', 'struss', or something else. + + +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 (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 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 (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 +(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 +machines 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 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 + (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 might very +well 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 not 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 any read permission (for +example, a 'lost+found' directory). 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 (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'. + + If Kpathsea cannot find any 'texmf.cnf' file, it reports a warning +including all the directories it checked. If you don't want to see this +warning, set the environment variable 'KPATHSEA_WARNING' to the single +character '0' (zero, not oh). + + 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 '%', either at the beginning of a line or + preceded by whitespace, and continue to the end of the line. That + is, as with most shells, a '%' in the "middle" of a value does not + start a comment. Examples: + + % this is a comment + var = a%b % but the value of var will be "a%b". + + * 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,bat,cmd,...}'. Most + notably, this allows different flavors of TeX to have different + search paths. + + * 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 Windows. + + * 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 + + 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. +However, there seemed little advantage in 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. On Windows, +the environment variable 'USERPROFILE' is checked instead of 'HOME'. + + 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 instead 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'. + + +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 'ST_NLINK_TRICK' 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, in practice searching +each possible directory in typical TeX installations takes an +excessively long time. + + Therefore, Kpathsea can use an externally-built "filename 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. +* Specially-recognized files:: Default formats for texmf.cnf, etc. +* Auxiliary tasks:: Path and variable expansion. +* Standard options:: -help and -version. + + +File: kpathsea.info, Node: Path searching options, Next: Specially-recognized files, 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. + + Various options alter the path searching behavior: + +'--all' + Report all matches found, one per line. By default, if there is + more than one match, just one will be reported (chosen effectively + at random). + +'--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. + + In particular, since the memory dump files ('.fmt'/'.base'/'.mem') + are now stored in subdirectories named for the engine ('tex', + 'pdftex', 'xetex', etc.), you must specify an engine name in order + to find them. For example, 'cont-en.fmt' typically exists for both + 'pdftex' and 'xetex'. With the default path settings, you can use + '--engine=/' to look for any dump file, regardless of engine; if a + dump file exists for more than one engine, it's indeterminate which + one is returned. (The '/' ends up specifying a normal recursive + search along the path where the dumps are stored, namely + '$TEXMF/web2c{/$engine,}'.) + +'--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. + + The strings in parentheses are abbreviations recognized only by + 'kpsewhich' (not the underlying library calls). They are provided + when it would otherwise require an argument containing a space to + specify the format, to simplify quoting of calls from shells. + + gf: gf + pk: pk + bitmap font (bitmapfont): + tfm: .tfm + afm: .afm + base: .base + bib: .bib + bst: .bst + cnf: .cnf + ls-R: ls-R ls-r + fmt: .fmt + map: .map + mem: .mem + mf: .mf + mfpool: .pool + mft: .mft + mp: .mp + mppool: .pool + MetaPost support (mpsupport): + ocp: .ocp + ofm: .ofm .tfm + opl: .opl .pl + otp: .otp + ovf: .ovf .vf + ovp: .ovp .vpl + graphic/figure: .eps .epsi + tex: .tex .sty .cls .fd .aux .bbl .def .clo .ldf + TeX system documentation (doc): + texpool: .pool + TeX system sources (source): .dtx .ins + PostScript header: .pro + Troff fonts (trofffont): + type1 fonts: .pfa .pfb + vf: .vf + dvips config (dvipsconfig): + ist: .ist + truetype fonts: .ttf .ttc .TTF .TTC .dfont + type42 fonts: .t42 .T42 + web2c files (web2c): + other text files (othertext): + other binary files (otherbin): + misc fonts (miscfont): + web: .web .ch + cweb: .w .web .ch + enc files: .enc + cmap files (cmap): + subfont definition files: .sfd + opentype fonts: .otf + pdftex config (pdftexconfig): + lig files: .lig + texmfscripts: + lua: .luc .luctex .texluc .lua .luatex .texlua + font feature files: .fea + cid maps: .cid .cidmap + mlbib: .mlbib .bib + mlbst: .mlbst .bst + clua: .dll .so + ris: .ris + bltxml: .bltxml + + 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. Usual + values for FILETYPE are 'pk', 'mf', 'tex', and 'tfm'. By default, + all are off in Kpsewhich, even if they are enabled for TeX. This + option implies setting '--must-exist'. *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 and running the 'mktex' scripts. 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' and '--show-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::). + +'--safe-in-name=NAME' +'--safe-out-name=NAME' + Exit successfully if NAME is safe to open for reading or writing, + respectively, else unsuccessfully. No output is written. These + tests take account of the related Kpathsea configuration settings + (*note Calling sequence::). + +'--subdir=STRING' + Report only those matches whose directory part _ends_ with STRING + (compared literally, except case is ignored on a case-insensitive + operating system). For example, suppose there are two matches for + a given name: + + kpsewhich foo.sty + => /some/where/foo.sty + /another/place/foo.sty + + Then we can narrow the result to what we are interested in with + '--subdir': + + kpsewhich --subdir=where foo.sty + => /some/where/foo.sty + + kpsewhich --subdir=place foo.sty + => /another/place/foo.sty + + The string to match must be at the end of the directory part of the + match, and it is taken literally, with no pattern matching: + + kpsewhich --subdir=another foo.sty + => + + The string to match may cross directory components: + + kpsewhich --subdir=some/where foo.sty + => /some/where/foo.sty + + '--subdir' implies '--all'; if there is more than one match, they + will all be reported (in our example, both 'where' and 'place' end + in 'e'): + + kpsewhich --subdir=e + => /some/where/foo.sty + /another/place/foo.sty + + Because of the above rules, the presence of a leading '/' is + important, since it "anchors" the match to a full component name: + + kpsewhich --subdir=/lace foo.sty + => + + However, a trailing '/' is immaterial (and ignored), since the + match always takes place at the end of the directory part: + + kpsewhich --subdir=lace/ foo.sty + => /another/place/foo.sty + + The purpose of these rules is to make it convenient to find results + only within a particular area of the tree. For instance, a given + script named 'foo.lua' might exist within both + 'texmf-dist/scripts/pkg1/' and 'texmf-dist/scripts/pkg2/'. By + specifying, say, '--subdir=/pkg1', you can be sure of getting the + one you are interested in. + + We only match at the end because a site might happen to install TeX + in '/some/coincidental/pkg1/path/', and we wouldn't want to match + 'texmf-dist/scripts/pkg2/' that when searching for '/pkg1'. + + +File: kpathsea.info, Node: Specially-recognized files, Next: Auxiliary tasks, Prev: Path searching options, Up: Invoking kpsewhich + +3.5.2 Specially-recognized files for 'kpsewhich' +------------------------------------------------ + +'kpsewhich' recognizes a few special filenames on the command line and +defaults to using the 'known' file formats for them, merely to save the +time and trouble of specifying the format. This is only a feature of +'kpsewhich'; when using the Kpathsea library itself, none of these +special filenames are recognized, and it's still up to the caller to +specify the desired format. + + Here is the list of special filenames to 'kpsewhich', along with +their corresponding format: + +'config.ps' + 'dvips config' + +'dvipdfmx.cfg' + 'other text files' + +'fmtutil.cnf' + 'web2c files' + +'glyphlist.txt' + 'map' + +'mktex.cnf' + 'web2c files' + +'pdfglyphlist.txt' + 'map' + +'pdftex.cfg' + 'pdftex config' (although 'pdftex.cfg' is not used any more; look + for the file 'pdftexconfig.tex' instead.) + +'texmf.cnf' + 'cnf' + +'XDvi' + 'other text files' + + A user-specified format will override the above defaults. + + Another useful configuration file in this regard is 'tcfmgr.map', +found in 'texmf/texconfig/tcfmgr.map', which records various information +about the above configuration files (among others). + + +File: kpathsea.info, Node: Auxiliary tasks, Next: Standard options, Prev: Specially-recognized files, Up: Invoking kpsewhich + +3.5.3 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' outputs the value of VARIABLE, expanding '$' + (*note Variable expansion:: and '~' (*note Tilde expansion::) + constructs, but not performing other expansions. + + * '--expand-braces=STRING' outputs the variable and brace expansion + of STRING. *Note Path expansion::. + + * '--expand-var=STRING' outputs the variable and tilde 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, + with each element separated by the usual path separator on the + current system (';' on Windows, ':' otherwise). This may be useful + to construct a custom search path for a format not otherwise + supported. To retrieve the search path for a format that is + already supported, see '--show-path', next. + + 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.4 Standard options +---------------------- + +Kpsewhich accepts the standard GNU options: + + * '--help' prints a help message on standard output and exits + successfully. + + * '--version' prints the Kpathsea version number and exits + successfully. + + +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 (dvips)Metric files::) 'AFMFONTS'; + suffix '.afm'. + +'base' + (Metafont memory dump, *note (web2c)Memory dumps::) 'MFBASES', + 'TEXMFINI'; suffix '.base'. + +'bib' + (BibTeX bibliography source, *note (web2c)bibtex invocation::) + 'BIBINPUTS', 'TEXBIB'; suffix '.bib'. + +'bst' + (BibTeX style, *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 (dvips)Config + files::) 'TEXCONFIG'. + +'enc files' + (encoding vectors) 'ENCFONTS'; suffix '.enc'. + +'fmt' + (TeX memory dump, *note (web2c)Memory dumps::) 'TEXFORMATS', + 'TEXMFINI'; suffix '.fmt'. + +'font cid map' + (CJK mapping) 'FONTCIDMAPS' suffix '.cid'. + +'font feature files' + (primarily for OpenType font features) 'FONTFEATURES' suffix + '.fea'. + +'gf' + (generic font bitmap, *note (dvips)Glyph files::) 'PROGRAMFONTS', + 'GFFONTS', 'GLYPHFONTS', 'TEXFONTS'; suffix 'gf'. + +'graphic/figure' + (Encapsulated PostScript figures, *note (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 (web2c)Memory dumps::) 'MPMEMS', + 'TEXMFINI'; suffix '.mem'. + +'MetaPost support' + (MetaPost support files, used by DMP; *note (web2c)dmp + invocation::) 'MPSUPPORT'. + +'mf' + (Metafont source, *note (web2c)mf invocation::) 'MFINPUTS'; suffix + '.mf'; dynamic creation program: 'mktexmf'. + +'mfpool' + (Metafont program strings, *note (web2c)pooltype invocation::) + 'MFPOOL', 'TEXMFINI'; suffix '.pool'. + +'mft' + ('MFT' style file, *note (web2c)mft invocation::) 'MFTINPUTS'; + suffix '.mft'. + +'misc fonts' + (font-related files that don't fit the other categories) + 'MISCFONTS' + +'mlbib' + (MlBibTeX bibliography source) 'MLBIBINPUTS', 'BIBINPUTS', + 'TEXBIB'; suffixes '.mlbib', '.mlbib'. + +'mlbst' + (MlBibTeX style) 'MLBSTINPUTS', 'BSTINPUTS'; suffixes '.mlbst', + '.bst'. + +'mp' + (MetaPost source, *note (web2c)mpost invocation::) 'MPINPUTS'; + suffix '.mp'. + +'mppool' + (MetaPost program strings, *note (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 (dvips)Glyph files::) 'PROGRAMFONTS' + (PROGRAM being 'XDVI', etc.), 'PKFONTS', 'TEXPKS', 'GLYPHFONTS', + 'TEXFONTS'; suffix 'pk'; dynamic creation program: 'mktexpk'. + +'PostScript header' + (downloadable PostScript, *note (dvips)Header files::) + 'TEXPSHEADERS', 'PSHEADERS'; additional suffix '.pro'. + +'subfont definition files' + (subfont definition files) 'SFDFONTS' suffix '.sfd'. + +'tex' + (TeX source, *note (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 + trees) 'TEXMFSCRIPTS'. + +'texpool' + (TeX program strings, *note (web2c)pooltype invocation::) + 'TEXPOOL', 'TEXMFINI'; suffix '.pool'. + +'tfm' + (TeX font metrics, *note (dvips)Metric files::) 'TFMFONTS', + 'TEXFONTS'; suffix '.tfm'; dynamic creation program: 'mktextfm'. + +'Troff fonts' + (Troff fonts, used by DMP; *note (web2c)DMP invocation::) + 'TRFONTS'. + +'truetype fonts' + (TrueType outline fonts) 'TTFONTS'; suffixes '.ttf' and '.TTF', + '.ttc' and '.TTC', '.dfont'. + +'type1 fonts' + (Type 1 PostScript outline fonts, *note (dvips)Glyph files::) + 'T1FONTS', 'T1INPUTS', 'TEXPSHEADERS', 'DVIPSHEADERS'; suffixes + '.pfa', '.pfb'. + +'type42 fonts' + (Type 42 PostScript outline fonts) 'T42FONTS'. + +'vf' + (virtual fonts, *note (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. Example: given 'foo.bar', look for + 'foo.bar.tex'. + + 2. Search for NAME, and if necessary for alternative names found in + the fontmaps. Example: given 'foo.bar', we also look for + 'foo.bar'. + + 3. If the file format defines a program to invoke to create missing + files, run it (*note mktex scripts::). + + The order in which we search for "suffixed" name (item 1) or the +"as-is" name (item 2) is controlled by the 'try_std_extension_first' +configuration value. The default set in 'texmf.cnf' is true, since +common suffixes are already recognized: 'babel.sty' will only look for +'babel.sty', not 'babel.sty.tex', regardless of this setting. + + When the suffix is unknown (e.g., 'foo.bar'), both names are always +tried; the difference is the order in which they are tried. + + 'try_std_extension_first' only affects names being looked up which +*already* have an extension. A name without an extension (e.g., 'tex +story') will always have an extension added first. + + This algorithm is implemented in the function 'kpathsea_find_file' in +the source file '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 'kpathsea_find_glyph' 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 +(). + + +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 +(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 calling 'kpathsea_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 that 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. + + When looking at these program sources, you should know that previous +versions of the library had a different programming interface, to +support re-entrancy. In that interface the library function names were +prefixed with 'kpse_' instead of 'kpathsea_', and they did not need an +instance variable as first argument. This change was made in 2009. +Some of the programs mentioned above may still be using the previous +interface. + + 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 ', 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 'kpathsea_new' to create a new library instance. This + variable must be passed as the first argument to all the following + library functions. The rest of this manual will be using 'kpse' as + a placeholder for the name of this variable. + + 2. Call 'kpathsea_set_program_name' with 'argv[0]' as the second + argument; the third argument is a string or 'NULL'. The third + argument is used by Kpathsea as the program name for the '.PROGRAM' + feature of config files (*note Config files::). If the third + argument is 'NULL', the value of the second argument is used. This + function must be called before any other use of the Kpathsea + library. + + 'kpathsea_set_program_name' always sets the variables + 'kpse->invocation_name' and 'kpse->invocation_short_name'. These + variables are used in the error message macros defined in + 'kpathsea/lib.h'. It sets the 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 environment 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. You can use 'kpsewhich --expand-var=\$SELFAUTOLOC', + etc., to see the values. + + 3. Set debugging options. *Note Debugging::. If your program doesn't + have a debugging option already, you can define one and set + 'kpse->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 'kpathsea_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 + 'kpathsea_find_file'. You can call 'kpathsea_find_file' after + doing only the first and second 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 routine is + 'kpathsea_find_glyph', defined in 'tex-glyph.h'. This returns 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 + 'kpathsea_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. + + 9. TeX can write output files, via the '\openout' primitive; this + opens a security hole vulnerable to Trojan horse attack: an + unwitting user could run a TeX program that overwrites, say, + '~/.rhosts'. Analogous security holes exist for many other + programs. To alleviate this, there is a configuration variable + 'openout_any', which selects one of three levels of security. When + it is set to 'a' (for "any"), no restrictions are imposed. When it + is set to 'r' (for "restricted"), filenames beginning with '.' are + disallowed (except '.tex' because LaTeX needs it). When it is set + to 'p' (for "paranoid") additional restrictions are imposed: an + absolute filename must refer to a file in (a subdirectory) of + 'TEXMFOUTPUT', and any attempt to go up a directory level is + forbidden (that is, paths may not contain a '..' component). The + paranoid setting is the default. (For backwards compatibility, 'y' + and '1' are synonyms of 'a', while 'n' and '0' are synonyms for + 'r'.) The function 'kpathsea_out_name_ok', with a filename as + second argument, returns 'true' if that filename is acceptable to + be opend for output or 'false' otherwise. + + 10. Similarly, the function 'kpathsea_in_name_ok', with a filename as + second argument, returns 'true' if that filename is acceptable to + be opend for input or 'false' otherwise, depending on the value of + the configuration variable 'openin_any' (with 'a' as default). + + 11. To close the kpathsea library instance you are using, call + 'kpathsea_finish'. This function closes any open log files and + frees the memory used by the instance. + + 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 and +probably Automake for configuring and building your software if you use +Kpathsea; I strongly recommend using Autoconf and Automake regardless. +They are available from . + + +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 formats, 'kpse_program_text_format' and +'kpse_program_binary_format', 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 +'kpathsea_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 +'kpathsea_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 'kpathsea_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 'kpathsea_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 +***** + +[index] +* Menu: + +* !! in path specifications: ls-R. (line 51) +* $ expansion: Variable expansion. (line 6) +* --all: Path searching options. + (line 12) +* --color=tty: ls-R. (line 21) +* --debug=NUM: Auxiliary tasks. (line 9) +* --disable-static: configure options. (line 31) +* --dpi=NUM: Path searching options. + (line 17) +* --enable options: configure options. (line 16) +* --enable-maintainer-mode: configure options. (line 34) +* --enable-shared: configure options. (line 27) +* --enable-shared <1>: Shared library. (line 6) +* --engine=NAME: Path searching options. + (line 21) +* --expand-braces=STRING: Auxiliary tasks. (line 16) +* --expand-path=STRING: Auxiliary tasks. (line 24) +* --expand-var=STRING: Auxiliary tasks. (line 19) +* --format=NAME: Path searching options. + (line 37) +* --help: Standard options. (line 8) +* --interactive: Path searching options. + (line 119) +* --mktex=FILETYPE: Path searching options. + (line 124) +* --mode=STRING: Path searching options. + (line 130) +* --must-exist: Path searching options. + (line 135) +* --no-mktex=FILETYPE: Path searching options. + (line 124) +* --path=STRING: Path searching options. + (line 140) +* --progname=NAME: Path searching options. + (line 148) +* --safe-in-name=NAME: Path searching options. + (line 154) +* --safe-out-name=NAME: Path searching options. + (line 154) +* --show-path=NAME: Auxiliary tasks. (line 41) +* --srcdir, for building multiple architectures: configure scenarios. + (line 18) +* --subdir=STRING: Path searching options. + (line 160) +* --var-value=VARIABLE: Auxiliary tasks. (line 12) +* --version: Standard options. (line 11) +* --with options: configure options. (line 16) +* --with-mktextex-default: mktex configuration. (line 12) +* --without-mktexfmt-default: mktex configuration. (line 12) +* --without-mktexmf-default: mktex configuration. (line 12) +* --without-mktexocp-default: mktex configuration. (line 12) +* --without-mktexofm-default: mktex configuration. (line 12) +* --without-mktexpk-default: mktex configuration. (line 12) +* --without-mktextfm-default: mktex configuration. (line 12) +* -1 debugging value: Debugging. (line 23) +* -A option to 'ls': ls-R. (line 33) +* -Bdynamic: ShellWidgetClass. (line 44) +* -Bstatic: ShellWidgetClass. (line 44) +* -D NUM: Path searching options. + (line 17) +* -dynamic: ShellWidgetClass. (line 42) +* -g, compiling without: configure scenarios. (line 32) +* -L option to 'ls': ls-R. (line 38) +* -O, compiling with: configure scenarios. (line 32) +* -static: ShellWidgetClass. (line 42) +* . 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) +* .cid: Supported file formats. + (line 58) +* .cmap: Supported file formats. + (line 36) +* .cnf: Supported file formats. + (line 39) +* .enc: Supported file formats. + (line 51) +* .eps: Supported file formats. + (line 69) +* .epsi: Supported file formats. + (line 69) +* .fea: Supported file formats. + (line 61) +* .fmt: Supported file formats. + (line 54) +* .ist: Supported file formats. + (line 74) +* .lig: Supported file formats. + (line 78) +* .map: Supported file formats. + (line 84) +* .mem: Supported file formats. + (line 87) +* .mf: Supported file formats. + (line 95) +* .mft: Supported file formats. + (line 103) +* .mlbib: Supported file formats. + (line 111) +* .mlbst: Supported file formats. + (line 115) +* .mp: Supported file formats. + (line 119) +* .ocp: Supported file formats. + (line 127) +* .ofm: Supported file formats. + (line 131) +* .opl: Supported file formats. + (line 138) +* .otp: Supported file formats. + (line 141) +* .ovf: Supported file formats. + (line 144) +* .ovp: Supported file formats. + (line 147) +* .pfa: Supported file formats. + (line 197) +* .pfb: Supported file formats. + (line 197) +* .pk: Supported file formats. + (line 154) +* .pool: Supported file formats. + (line 99) +* .pool <1>: Supported file formats. + (line 123) +* .pool <2>: Supported file formats. + (line 181) +* .pro: Supported file formats. + (line 159) +* .rhosts, writable by TeX: Security. (line 10) +* .sfd: Supported file formats. + (line 163) +* .tex: Supported file formats. + (line 166) +* .tex file, included in 'ls-R': ls-R. (line 33) +* .tfm: Supported file formats. + (line 185) +* .ttc: Supported file formats. + (line 193) +* .ttf: Supported file formats. + (line 193) +* .vf: Supported file formats. + (line 205) +* .w: Supported file formats. + (line 43) +* .web: Supported file formats. + (line 43) +* .web <1>: Supported file formats. + (line 209) +* / may not be /: Searching overview. (line 13) +* /, trailing in home directory: Tilde expansion. (line 19) +* //: 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 113) +* 2602gf: Unable to generate fonts. + (line 36) +* 8.3 filenames, using: mktex configuration. (line 68) +* : 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 37) +* \openin: Searching overview. (line 31) +* \special, suppressing warnings about: Suppressing warnings. + (line 31) +* { expansion: Brace expansion. (line 6) +* ~ expansion: Tilde expansion. (line 6) +* absolute filenames: Searching overview. (line 52) +* access warnings: Searching overview. (line 56) +* ac_include, Autoconf extension: Running configure. (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) +* all matches, finding: Path searching options. + (line 12) +* alphabetical order, not: Subdirectory expansion. + (line 6) +* Amiga support: Custom installation. (line 16) +* Andrew File System, installing with: Installing files. (line 32) +* announcement mailing list: Mailing lists. (line 6) +* ANSI C: TeX or Metafont failing. + (line 30) +* API, re-entrant: Programming overview. + (line 16) +* append-only directories and 'mktexpk': Security. (line 36) +* appendonlydir: mktex configuration. (line 60) +* 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 14) +* ash, losing with 'configure': configure shells. (line 19) +* autoconf, recommended: Calling sequence. (line 117) +* automounter, and configuration: configure scenarios. (line 29) +* automounter, and 'ls-R': ls-R. (line 40) +* auxiliary tasks: Auxiliary tasks. (line 6) +* Babel: Kpathsea application distributions. + (line 27) +* Babel <1>: Running make. (line 50) +* Bach, Johann Sebastian: Default expansion. (line 41) +* backslash-newline: Config files. (line 37) +* 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) +* BIBINPUTS <1>: Supported file formats. + (line 111) +* blank lines, in 'texmf.cnf': Config files. (line 35) +* brace expansion: Brace expansion. (line 6) +* BSD universe: Running make. (line 43) +* bsh, ok with 'configure': configure shells. (line 14) +* BSTINPUTS: Supported file formats. + (line 32) +* BSTINPUTS <1>: Supported file formats. + (line 115) +* 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 117) +* c-auto.h: Programming overview. + (line 33) +* 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) +* CFLAGS: configure environment. + (line 14) +* ChangeLog entry: Bug checklist. (line 55) +* 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 47) +* 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 86) +* 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 27) +* comments, in 'texmf.cnf': Config files. (line 27) +* comments, making: Introduction. (line 23) +* 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 25) +* 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 26) +* compiler options, specifying: configure environment. + (line 15) +* compiler, changing: Running make. (line 39) +* compiling on HP-UX: TeX or Metafont failing. + (line 30) +* conditions for use: Introduction. (line 27) +* config files: Config files. (line 6) +* config files, for Kpathsea-using programs: Calling sequence. + (line 47) +* config files, programming with: Programming with config files. + (line 6) +* config.h: Programming overview. + (line 33) +* config.log: Bug checklist. (line 27) +* config.ps: Specially-recognized files. + (line 16) +* config.ps, search path for: Supported file formats. + (line 47) +* config.status: Bug checklist. (line 30) +* configuration: Installation. (line 6) +* configuration bugs: Bug checklist. (line 30) +* configuration compiler options: configure environment. + (line 23) +* configuration file, source for path: Path sources. (line 17) +* configuration files as shell scripts.: Config files. (line 79) +* 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 12) +* configure, running: Running configure. (line 6) +* context diff: Bug checklist. (line 55) +* continuation character: Config files. (line 37) +* core dumps, reporting: Bug checklist. (line 61) +* CPPFLAGS: configure environment. + (line 22) +* crashes, reporting: Bug checklist. (line 61) +* 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 61) +* debugging: Debugging. (line 6) +* debugging options, in Kpathsea-using program: Calling sequence. + (line 39) +* 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 61) +* 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 51) +* 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) +* dlclose: dlopen. (line 6) +* dlopen: dlopen. (line 6) +* dlsym: dlopen. (line 6) +* dlsym.c: dlopen. (line 21) +* doc files: Supported file formats. + (line 171) +* DOS compatible names: mktex configuration. (line 68) +* DOS support: Custom installation. (line 16) +* dosnames: mktex configuration. (line 67) +* dot files: ls-R. (line 33) +* doubled colons: Default expansion. (line 6) +* dpiNNN directories: mktex configuration. (line 68) +* DVI drivers: Kpathsea application distributions. + (line 12) +* DVILJMAKEPK: mktex script names. (line 32) +* DVILJSIZES: Fallback font. (line 6) +* dvipdfmx.cfg: Specially-recognized files. + (line 19) +* DVIPSFONTS: Supported file formats. + (line 240) +* DVIPSHEADERS: Supported file formats. + (line 197) +* DVIPSMAKEPK: mktex script names. (line 32) +* 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) +* elt-dirs.c <1>: Subdirectory expansion. + (line 48) +* enabling 'mktex' scripts: mktex configuration. (line 6) +* ENCFONTS: Supported file formats. + (line 51) +* engine name: Path searching options. + (line 21) +* 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 22) +* excessive startup time: Slow path searching. (line 6) +* expand.c: Brace expansion. (line 26) +* expanding symlinks: Calling sequence. (line 31) +* 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) +* extensions, filename: File lookup. (line 24) +* 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 35) +* 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 39) +* 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) +* fmtutil: mktex script names. (line 10) +* fmtutil.cnf: Specially-recognized files. + (line 22) +* fmtutils.cnf: mktex configuration. (line 24) +* 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) +* FONTCIDMAPS: Supported file formats. + (line 58) +* FONTFEATURES: Supported file formats. + (line 61) +* fontmap files: Fontmap. (line 6) +* fontmaps: mktex configuration. (line 86) +* fontmaps <1>: mktex configuration. (line 87) +* fontname: mktex configuration. (line 87) +* fontnames, arbitrary length: Fontmap. (line 15) +* fonts, being created: Simple installation. (line 78) +* FOOINPUTS: Supported file formats. + (line 222) +* FOOINPUTS <1>: Supported file formats. + (line 225) +* fopen, redefined: Debugging. (line 54) +* format of external database: Database format. (line 6) +* FreeBSD 'configure' error: Empty Makefiles. (line 6) +* FreeBSD shells and 'configure': configure shells. (line 19) +* ftp.cs.stanford.edu: unixtex.ftp. (line 20) +* 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 61) +* generation of filename database: Filename database generation. + (line 6) +* get_applicationShellWidgetClass: ShellWidgetClass. (line 6) +* get_wmShellWidgetClass: ShellWidgetClass. (line 6) +* gf: Supported file formats. + (line 65) +* GFFONTS: Supported file formats. + (line 65) +* 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 65) +* GLYPHFONTS <1>: Supported file formats. + (line 154) +* glyphlist.txt: Specially-recognized files. + (line 25) +* GNU C compiler bugs: TeX or Metafont failing. + (line 19) +* GNU General Public License: Introduction. (line 27) +* 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 110) +* hash_summary_only variable for debugging: Debugging. (line 105) +* help, mailing list for general TeX: Mailing lists. (line 25) +* 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 47) +* illegal pointer combination warnings: Pointer combination warnings. + (line 6) +* include fontmap directive: Fontmap. (line 30) +* INDEXSTYLE: Supported file formats. + (line 74) +* info-tex@shsu.edu: Mailing lists. (line 25) +* input lines, reading: Calling sequence. (line 110) +* 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 119) +* interface, not frozen: Introduction. (line 23) +* 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: unixtex.ftp. (line 20) +* Korn shell, losing with 'configure': configure shells. (line 14) +* kpathsae_var_value: Programming with config files. + (line 10) +* Kpathsea config file, source for path: Path sources. (line 17) +* Kpathsea version number: Kpathsea application distributions. + (line 6) +* kpathsea.h: Programming overview. + (line 24) +* kpathsea/README.CONFIGURE: Running configure. (line 15) +* kpathsea_cnf_get: Programming with config files. + (line 23) +* KPATHSEA_DEBUG: Debugging. (line 18) +* KPATHSEA_DEBUG <1>: Calling sequence. (line 28) +* kpathsea_find_file: File lookup. (line 38) +* kpathsea_find_file <1>: Calling sequence. (line 62) +* kpathsea_find_glyph: Glyph lookup. (line 26) +* kpathsea_finish: Calling sequence. (line 106) +* kpathsea_init_prog: Fallback font. (line 15) +* kpathsea_init_prog <1>: Calling sequence. (line 53) +* kpathsea_in_name_ok: Calling sequence. (line 101) +* kpathsea_new: Calling sequence. (line 9) +* kpathsea_open_file: Calling sequence. (line 74) +* kpathsea_out_name_ok: Calling sequence. (line 82) +* kpathsea_set_program_name: Calling sequence. (line 14) +* KPATHSEA_WARNING: Config files. (line 18) +* kpse->debug: Debugging. (line 6) +* kpse->debug <1>: Debugging. (line 18) +* kpse->debug variable: Calling sequence. (line 39) +* kpse->format_info: Calling sequence. (line 47) +* kpse->invocation_name: Calling sequence. (line 22) +* kpse->invocation_short_name: Calling sequence. (line 22) +* kpse->program_name: Calling sequence. (line 22) +* kpsewhich: Invoking kpsewhich. (line 6) +* Kpsewhich, and debugging: Debugging. (line 31) +* KPSE_BITMAP_TOLERANCE: Basic glyph lookup. (line 15) +* 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_format_info_type: Debugging. (line 61) +* kpse_init_prog, and 'MAKETEX_MODE': Default path features. + (line 25) +* ksh, losing with 'configure': configure shells. (line 14) +* LaserJet drive: Kpathsea application distributions. + (line 13) +* last-resort font: Fallback font. (line 6) +* LaTeX help mailing list: Mailing lists. (line 25) +* 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 39) +* libraries, specifying additional: configure environment. + (line 43) +* LIBS: configure environment. + (line 42) +* libucb, avoiding: Running make. (line 43) +* license for using the library: Introduction. (line 27) +* LIGFONTS: Supported file formats. + (line 78) +* lines, reading arbitrary-length: Calling sequence. (line 110) +* Linux File System Standard: mktex configuration. (line 113) +* Linux shells and 'configure': configure shells. (line 19) +* lndir for building symlink trees: configure scenarios. (line 18) +* loader options: configure environment. + (line 39) +* loader options, final: Running make. (line 32) +* loader options, initial: Running make. (line 29) +* 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 81) +* 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) +* MacKenzie, David: History. (line 45) +* MacKenzie, David <1>: Subdirectory expansion. + (line 22) +* 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 35) +* 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 110) +* metafont driver files: mktex configuration. (line 93) +* Metafont failures: TeX or Metafont failing. + (line 6) +* Metafont installation: Unable to generate fonts. + (line 51) +* 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 95) +* MFPOOL: Supported file formats. + (line 99) +* MFTINPUTS: Supported file formats. + (line 103) +* MISCFONTS: Supported file formats. + (line 107) +* mismatched checksum warnings: Suppressing warnings. + (line 17) +* missfont.log: mktex script names. (line 35) +* MISSFONT_LOG: mktex script names. (line 40) +* missing character warnings: Suppressing warnings. + (line 20) +* mkocp: mktex script names. (line 18) +* mkofm: mktex script names. (line 21) +* '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 29) +* mktex.cnf <1>: Specially-recognized files. + (line 28) +* mktex.opt: mktex configuration. (line 29) +* mktex.opt <1>: mktex configuration. (line 39) +* mktexdir: mktex configuration. (line 61) +* mktexfmt: mktex script names. (line 10) +* mktexmf: mktex script names. (line 15) +* mktexpk: mktex script names. (line 24) +* mktexpk , initial runs: Simple installation. (line 78) +* 'mktexpk' can't guess mode: Unable to generate fonts. + (line 12) +* mktextex: mktex script names. (line 27) +* mktextfm: mktex script names. (line 30) +* MLBIBINPUTS: Supported file formats. + (line 111) +* MLBSTINPUTS: Supported file formats. + (line 115) +* mode directory, omitting: mktex configuration. (line 98) +* Morgan, Tim: History. (line 12) +* mostlyclean Make target: Cleaning up. (line 10) +* MPINPUTS: Supported file formats. + (line 119) +* MPMEMS: Supported file formats. + (line 87) +* MPPOOL: Supported file formats. + (line 123) +* MPSUPPORT: Supported file formats. + (line 91) +* MT_FEATURES: mktex configuration. (line 39) +* 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 25) +* NeXT 'sed' error: Empty Makefiles. (line 6) +* NeXT, lacking X11: Kpathsea application distributions. + (line 6) +* NFS and 'ls-R': ls-R. (line 40) +* nomfdrivers: mktex configuration. (line 92) +* nomode: mktex configuration. (line 97) +* non-English typesetting: Kpathsea application distributions. + (line 27) +* non-Unix operating systems: Custom installation. (line 16) +* none: Suppressing warnings. + (line 23) +* null pointers, dereferencing: Bug checklist. (line 61) +* numeric debugging values: Debugging. (line 34) +* obtaining TeX: unixtex.ftp. (line 6) +* OCPINPUTS: Supported file formats. + (line 127) +* OFMFONTS: Supported file formats. + (line 131) +* online Metafont display, spurious: Unable to generate fonts. + (line 36) +* OPENTYPEFONTS: Supported file formats. + (line 135) +* 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 16) +* OTPINPUTS: Supported file formats. + (line 141) +* overview of path searching: Searching overview. (line 6) +* overview of programming with Kpathsea: Programming overview. + (line 6) +* OVFFONTS: Supported file formats. + (line 144) +* OVPFONTS: Supported file formats. + (line 147) +* patches, Sun OpenWin: ShellWidgetClass. (line 28) +* 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: Changing search paths. + (line 6) +* paths, changing default <1>: Default path generation. + (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 24) +* pc Pascal compiler: History. (line 12) +* PCL driver: Kpathsea application distributions. + (line 13) +* PDF generation: Kpathsea application distributions. + (line 16) +* pdfglyphlist.txt: Specially-recognized files. + (line 31) +* pdftex.cfg: Specially-recognized files. + (line 34) +* PDFTEXCONFIG: Supported file formats. + (line 151) +* pdftexconfig.tex: Specially-recognized files. + (line 34) +* permission denied: Searching overview. (line 56) +* permissions, directory: Security. (line 51) +* permissions, file: Security. (line 47) +* PKFONTS: Supported file formats. + (line 154) +* 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) +* preprocessor options: configure environment. + (line 32) +* preprocessor options, additional: Running make. (line 23) +* 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 53) +* program-varying paths: Supported file formats. + (line 12) +* 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 159) +* pxp Pascal preprocessor: History. (line 12) +* quoting variable values: Variable expansion. (line 17) +* re-entrant API: Programming overview. + (line 16) +* readable: Suppressing warnings. + (line 26) +* reading arbitrary-length lines: Calling sequence. (line 110) +* README.CONFIGURE: Running configure. (line 15) +* 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 47) +* resolution, setting: Path searching options. + (line 17) +* resolutions, last-resort: Fallback font. (line 6) +* retrieving TeX: unixtex.ftp. (line 6) +* right-hand side of variable assignments: Config files. (line 56) +* Rokicki, Tom: History. (line 12) +* root user: Tilde expansion. (line 19) +* 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 31) +* SELFAUTOLOC: Calling sequence. (line 31) +* SELFAUTOPARENT: Calling sequence. (line 31) +* sending patches: Bug checklist. (line 55) +* setgid scripts: Security. (line 40) +* SFDFONTS: Supported file formats. + (line 163) +* sh5, ok with 'configure': configure shells. (line 25) +* shared library, making: Shared library. (line 6) +* shell scripts as configuration files: Config files. (line 79) +* shell variables: Variable expansion. (line 17) +* shells and 'configure': configure shells. (line 6) +* shell_escape, example for code: Programming with config files. + (line 10) +* simple installation: Simple installation. (line 6) +* site overrides for 'mktex...': mktex configuration. (line 29) +* 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 43) +* source files: Supported file formats. + (line 174) +* sources for search paths: Path sources. (line 6) +* special: Suppressing warnings. + (line 30) +* stack trace: Bug checklist. (line 61) +* 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 38) +* static linking and 'dlsym': dlopen. (line 6) +* string routines: Calling sequence. (line 110) +* strip: mktex configuration. (line 107) +* stripsupplier: mktex configuration. (line 101) +* striptypeface: mktex configuration. (line 104) +* st_nlink: Subdirectory expansion. + (line 26) +* ST_NLINK_TRICK: Subdirectory expansion. + (line 38) +* subdirectory searching: Subdirectory expansion. + (line 6) +* suffixes, filename: File lookup. (line 24) +* suggestions, making: Introduction. (line 23) +* Sun 2: History. (line 12) +* Sun OpenWin patches: ShellWidgetClass. (line 28) +* supplier directory, omitting: mktex configuration. (line 102) +* supplier directory, omitting <1>: mktex configuration. (line 108) +* 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 31) +* system C compiler bugs: TeX or Metafont failing. + (line 19) +* system dependencies: Running configure. (line 6) +* system V universe: Running make. (line 43) +* T1FONTS: Supported file formats. + (line 197) +* T1INPUTS: Supported file formats. + (line 197) +* T42FONTS: Supported file formats. + (line 202) +* tcfmgr.map: Specially-recognized files. + (line 46) +* TDS: Default path features. + (line 41) +* TDS <1>: TeX directory structure. + (line 6) +* testing, post-installation: Installation testing. + (line 6) +* tests, simple: Simple installation. (line 78) +* TeX directory structure: Default path features. + (line 41) +* TeX directory structure <1>: TeX directory structure. + (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 25) +* TeX hierarchy, one: configure scenarios. (line 13) +* TeX support: TeX support. (line 6) +* TeX Users Group: Introduction. (line 35) +* tex-file.c: File lookup. (line 38) +* tex-file.h: Programming overview. + (line 24) +* tex-glyph.c: Glyph lookup. (line 26) +* tex-glyph.h: Programming overview. + (line 24) +* tex-k-request@tug.org: Mailing lists. (line 7) +* tex-k@tug.org (bug address): Reporting bugs. (line 8) +* tex.web: unixtex.ftp. (line 20) +* TEXBIB: Supported file formats. + (line 28) +* TEXBIB <1>: Supported file formats. + (line 111) +* TEXCONFIG: Supported file formats. + (line 47) +* TEXDOCS: Supported file formats. + (line 171) +* TEXFONTMAPS: Supported file formats. + (line 84) +* TEXFONTS: Supported file formats. + (line 65) +* TEXFONTS <1>: Supported file formats. + (line 154) +* TEXFONTS <2>: Supported file formats. + (line 185) +* TEXFONTS <3>: Supported file formats. + (line 205) +* texfonts.map: Fontmap. (line 6) +* TEXFORMATS: Supported file formats. + (line 54) +* TEXINDEXSTYLE: Supported file formats. + (line 74) +* TEXINPUTS: Supported file formats. + (line 69) +* TEXINPUTS <1>: Supported file formats. + (line 166) +* TEXMF: TeX directory structure. + (line 6) +* texmf.cnf: Specially-recognized files. + (line 38) +* 'texmf.cnf' missing, warning about: Config files. (line 18) +* 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: Config files. (line 6) +* TEXMFCNF <1>: Supported file formats. + (line 39) +* TEXMFDBS: ls-R. (line 6) +* TEXMFDBS <1>: Supported file formats. + (line 81) +* TEXMFINI: Supported file formats. + (line 24) +* TEXMFINI <1>: Supported file formats. + (line 54) +* TEXMFINI <2>: Supported file formats. + (line 87) +* TEXMFLOG: Logging. (line 10) +* TEXMFOUTPUT: mktex script names. (line 40) +* TEXMFSCRIPTS: Supported file formats. + (line 177) +* texmfvar: mktex configuration. (line 122) +* TEXMFVAR: mktex configuration. (line 123) +* TEXPICTS: Supported file formats. + (line 69) +* TEXPKS: Supported file formats. + (line 154) +* TEXPOOL: Supported file formats. + (line 181) +* TEXPSHEADERS: Supported file formats. + (line 159) +* TEXPSHEADERS <1>: Supported file formats. + (line 197) +* TEXSIZES: Fallback font. (line 6) +* TEXSOURCES: Supported file formats. + (line 174) +* TEX_HUSH: Searching overview. (line 56) +* TEX_HUSH <1>: Suppressing warnings. + (line 6) +* TFMFONTS: Supported file formats. + (line 185) +* tilde expansion: Tilde expansion. (line 6) +* tilde.c: Tilde expansion. (line 25) +* 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 19) +* trailing colons: Default expansion. (line 6) +* TRFONTS: Supported file formats. + (line 189) +* trick for detecting leaf directories: Subdirectory expansion. + (line 22) +* trojan horse attack: Security. (line 10) +* try_std_extension_first: File lookup. (line 24) +* TTFONTS: Supported file formats. + (line 193) +* tug.org: unixtex.ftp. (line 6) +* typeface directory, omitting: mktex configuration. (line 105) +* typeface directory, omitting <1>: mktex configuration. (line 108) +* ucbinclude, avoiding: Running make. (line 43) +* 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 20) +* universe, BSD vs. system V: Running make. (line 43) +* 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) +* Usenet TeX newsgroup: Mailing lists. (line 25) +* USERPROFILE, as ~ expansion: Tilde expansion. (line 6) +* USE_TEXMFVAR: mktex configuration. (line 128) +* USE_VARTEXFONTS: mktex configuration. (line 118) +* varfonts: mktex configuration. (line 112) +* variable expansion: Variable expansion. (line 6) +* variable.c: Variable expansion. (line 32) +* variable.h: Programming with config files. + (line 10) +* VARTEXFONTS: mktex configuration. (line 113) +* VAX 11/750: History. (line 12) +* version number, of Kpathsea: Kpathsea application distributions. + (line 6) +* version numbers, determining: Bug checklist. (line 15) +* VF files, not found: Searching overview. (line 31) +* VFFONTS: Supported file formats. + (line 205) +* VMS support: Custom installation. (line 16) +* Vojta, Paul: History. (line 30) +* Walsh, Norman: History. (line 57) +* warning about unusable 'ls-R': ls-R. (line 45) +* warning, about missing 'texmf.cnf': Config files. (line 18) +* 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 213) +* Weber, Olaf: History. (line 74) +* WEBINPUTS: Supported file formats. + (line 209) +* whitespace, in fontmap files: Fontmap. (line 27) +* whitespace, not ignored on continuation lines: Config files. + (line 37) +* 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 25) +* XCPPFLAGS: Running make. (line 21) +* XDEFS: Running make. (line 22) +* XDvi: Specially-recognized files. + (line 41) +* XDVIFONTS: Supported file formats. + (line 240) +* XDVIMAKEPK: mktex script names. (line 32) +* XDVISIZES: Fallback font. (line 6) +* XLDFLAGS: Running make. (line 28) +* XLOADLIBES: Running make. (line 31) +* XMAKEARGS: Running make. (line 34) +* Xmu library problems: ShellWidgetClass. (line 13) +* XtStrings: XtStrings. (line 6) +* zuhn, david: History. (line 51) + + + +Tag Table: +Node: Top1480 +Node: Introduction2124 +Node: History3942 +Node: Installation8034 +Node: Simple installation8828 +Node: Custom installation12376 +Node: Disk space13697 +Node: Kpathsea application distributions14505 +Node: Changing search paths15619 +Node: Default path features16812 +Node: Default path generation18895 +Node: Running configure20338 +Node: configure shells21421 +Node: configure options22470 +Node: configure environment23976 +Node: configure scenarios25778 +Node: Shared library27364 +Node: Running make28378 +Node: Installing files30426 +Node: Cleaning up32370 +Node: Filename database generation33418 +Node: mktex scripts33982 +Node: mktex configuration35246 +Node: mktex script names41053 +Node: mktex script arguments42443 +Node: Installation testing43326 +Node: Security43681 +Node: TeX directory structure46206 +Node: unixtex.ftp50627 +Node: Reporting bugs51962 +Node: Bug checklist52700 +Node: Mailing lists56397 +Node: Debugging57606 +Node: Logging62692 +Node: Common problems64563 +Node: Unable to find files65394 +Node: Slow path searching67808 +Node: Unable to generate fonts69187 +Node: TeX or Metafont failing71667 +Node: Empty Makefiles73543 +Node: XtStrings74782 +Node: dlopen75618 +Node: ShellWidgetClass76436 +Node: Pointer combination warnings78048 +Node: Path searching78437 +Node: Searching overview79084 +Node: Path sources82479 +Node: Config files83537 +Node: Path expansion87464 +Node: Default expansion88413 +Node: Variable expansion90483 +Node: Tilde expansion91884 +Node: Brace expansion92864 +Node: KPSE_DOT expansion93789 +Node: Subdirectory expansion94302 +Node: Filename database96656 +Node: ls-R97710 +Node: Filename aliases100605 +Node: Database format101783 +Node: Invoking kpsewhich102796 +Node: Path searching options103740 +Node: Specially-recognized files111946 +Node: Auxiliary tasks113301 +Node: Standard options115126 +Node: TeX support115482 +Node: Supported file formats116773 +Node: File lookup123972 +Node: Glyph lookup125721 +Node: Basic glyph lookup126845 +Node: Fontmap127725 +Node: Fallback font130314 +Node: Suppressing warnings131226 +Node: Programming132331 +Node: Programming overview132844 +Node: Calling sequence135541 +Node: Program-specific files142071 +Node: Programming with config files143094 +Node: Index144406 + +End Tag Table diff --git a/src/texsourc/kpathsea/kpathsea/doc/kpathsea.texi b/src/texsourc/kpathsea/kpathsea/doc/kpathsea.texi new file mode 100644 index 0000000..03a32db --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/kpathsea.texi @@ -0,0 +1,2545 @@ +\input texinfo +@setfilename kpathsea.info +@settitle Kpathsea: A library for path searching + +@set version 6.1.1 +@set month-year April 2013 + +@copying +This file documents the Kpathsea library for path searching. + +Copyright @copyright{} 1996--2013 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 @TeX{} Users Group. +@end copying + +@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. +* mktexfmt: (kpathsea)mktex scripts. Format (fmt/base/mem) generation. +* mktexlsr: (kpathsea)Filename database. Update ls-R. +* 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. +@end direntry + + +@titlepage +@title Kpathsea library +@subtitle for version @value{version} +@subtitle @value{month-year} +@author Karl Berry +@author Olaf Weber +@author Taco Hoekwater +@author @url{http://tug.org/kpathsea} + +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + + +@contents + + +@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 +accompanying files 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, thanks!). 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. See @url{http://tug.org} for information. + +@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 +might very well 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 not 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 any read permission (for +example, a @file{lost+found} directory). 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}. + +@vindex KPATHSEA_WARNING +@cindex warning, about missing @file{texmf.cnf} +@cindex @file{texmf.cnf} missing, warning about +If Kpathsea cannot find any @file{texmf.cnf} file, it reports a +warning including all the directories it checked. If you don't want +to see this warning, set the environment variable +@env{KPATHSEA_WARNING} to the single character @samp{0} (zero, not +oh). + +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{%}, either at the beginning of a line or +preceded by whitespace, and continue to the end of the line. That is, +as with most shells, a @samp{%} in the ``middle'' of a value does not +start a comment. Examples: + +@example +% this is a comment +var = a%b % but the value of var will be "a%b". +@end example + +@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,bat,cmd,...@}}. Most notably, this allows +different flavors of @TeX{} to have different search paths. + +@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 Windows. + +@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. +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. However, there seemed little +advantage in 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} +@vindex USERPROFILE@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. On Windows, the environment variable @code{USERPROFILE} is +checked instead of @code{HOME}. + +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 instead 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}. + + +@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 ST_NLINK_TRICK +You can disable the trick by undefining @code{ST_NLINK_TRICK} 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, in practice searching +each possible directory in typical @TeX{} installations takes an +excessively long time. + +Therefore, Kpathsea can use an externally-built @dfn{filename +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. +* Specially-recognized files:: Default formats for texmf.cnf, 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. + +Various options alter the path searching behavior: + +@table @samp +@item --all +@opindex --all +@cindex all matches, finding +Report all matches found, one per line. By default, if there is more +than one match, just one will be reported (chosen effectively at random). + +@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. + +In particular, since the memory dump files +(@file{.fmt}/@file{.base}/@file{.mem}) are now stored in +subdirectories named for the engine (@file{tex}, @file{pdftex}, +@file{xetex}, etc.), you must specify an engine name in order to find +them. For example, @file{cont-en.fmt} typically exists for both +@file{pdftex} and @file{xetex}. With the default path settings, you +can use @samp{--engine=/} to look for any dump file, regardless of +engine; if a dump file exists for more than one engine, it's +indeterminate which one is returned. (The @samp{/} ends up specifying +a normal recursive search along the path where the dumps are stored, +namely @samp{$TEXMF/web2c@{/$engine,@}}.) + +@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. + +The strings in parentheses are abbreviations recognized only by +@code{kpsewhich} (not the underlying library calls). They are +provided when it would otherwise require an argument containing a +space to specify the format, to simplify quoting of calls from shells. + +@example +gf: gf +pk: pk +bitmap font (bitmapfont): +tfm: .tfm +afm: .afm +base: .base +bib: .bib +bst: .bst +cnf: .cnf +ls-R: ls-R ls-r +fmt: .fmt +map: .map +mem: .mem +mf: .mf +mfpool: .pool +mft: .mft +mp: .mp +mppool: .pool +MetaPost support (mpsupport): +ocp: .ocp +ofm: .ofm .tfm +opl: .opl .pl +otp: .otp +ovf: .ovf .vf +ovp: .ovp .vpl +graphic/figure: .eps .epsi +tex: .tex .sty .cls .fd .aux .bbl .def .clo .ldf +TeX system documentation (doc): +texpool: .pool +TeX system sources (source): .dtx .ins +PostScript header: .pro +Troff fonts (trofffont): +type1 fonts: .pfa .pfb +vf: .vf +dvips config (dvipsconfig): +ist: .ist +truetype fonts: .ttf .ttc .TTF .TTC .dfont +type42 fonts: .t42 .T42 +web2c files (web2c): +other text files (othertext): +other binary files (otherbin): +misc fonts (miscfont): +web: .web .ch +cweb: .w .web .ch +enc files: .enc +cmap files (cmap): +subfont definition files: .sfd +opentype fonts: .otf +pdftex config (pdftexconfig): +lig files: .lig +texmfscripts: +lua: .luc .luctex .texluc .lua .luatex .texlua +font feature files: .fea +cid maps: .cid .cidmap +mlbib: .mlbib .bib +mlbst: .mlbst .bst +clua: .dll .so +ris: .ris +bltxml: .bltxml +@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}. +Usual values for @var{filetype} are @samp{pk}, @samp{mf}, @samp{tex}, +and @samp{tfm}. By default, all are off in Kpsewhich, even if they +are enabled for @TeX{}. This option implies setting +@code{--must-exist}. @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 and running the @samp{mktex} scripts. 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} and @samp{--show-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}). + +@item --safe-in-name=@var{name} +@itemx --safe-out-name=@var{name} +@opindex --safe-in-name=@var{name} +@opindex --safe-out-name=@var{name} +Exit successfully if @var{name} is safe to open for reading or +writing, respectively, else unsuccessfully. No output is written. +These tests take account of the related Kpathsea configuration +settings (@pxref{Calling sequence}). + +@item --subdir=@var{string} +@opindex --subdir=@var{string} +Report only those matches whose directory part @emph{ends} with +@var{string} (compared literally, except case is ignored on a +case-insensitive operating system). For example, suppose there are +two matches for a given name: + +@example +kpsewhich foo.sty +@result{} /some/where/foo.sty +/another/place/foo.sty +@end example + +@noindent +Then we can narrow the result to what we are interested in with +@option{--subdir}: + +@example +kpsewhich --subdir=where foo.sty +@result{} /some/where/foo.sty + +kpsewhich --subdir=place foo.sty +@result{} /another/place/foo.sty +@end example + +@noindent +The string to match must be at the end of the directory part of the +match, and it is taken literally, with no pattern matching: + +@example +kpsewhich --subdir=another foo.sty +@result{} +@end example + +@noindent +The string to match may cross directory components: + +@example +kpsewhich --subdir=some/where foo.sty +@result{} /some/where/foo.sty +@end example + +@noindent +@option{--subdir} implies @option{--all}; if there is more than one +match, they will all be reported (in our example, both @samp{where} +and @samp{place} end in @samp{e}): + +@example +kpsewhich --subdir=e +@result{} /some/where/foo.sty +/another/place/foo.sty +@end example + +@noindent +Because of the above rules, the presence of a leading @samp{/} is +important, since it ``anchors'' the match to a full component name: + +@example +kpsewhich --subdir=/lace foo.sty +@result{} +@end example + +@noindent +However, a trailing @samp{/} is immaterial (and ignored), since the +match always takes place at the end of the directory part: + +@example +kpsewhich --subdir=lace/ foo.sty +@result{} /another/place/foo.sty +@end example + +@noindent +The purpose of these rules is to make it convenient to find results +only within a particular area of the tree. For instance, a given +script named @file{foo.lua} might exist within both +@file{texmf-dist/scripts/pkg1/} and @file{texmf-dist/scripts/pkg2/}. +By specifying, say, @samp{--subdir=/pkg1}, you can be sure of getting +the one you are interested in. + +We only match at the end because a site might happen to install @TeX{} +in @file{/some/coincidental/pkg1/path/}, and we wouldn't want to match +@file{texmf-dist/scripts/pkg2/} that when searching for @samp{/pkg1}. + +@end table + + +@node Specially-recognized files +@subsection Specially-recognized files for @command{kpsewhich} + +@command{kpsewhich} recognizes a few special filenames on the command +line and defaults to using the `known' file formats for them, merely +to save the time and trouble of specifying the format. This is only a +feature of @command{kpsewhich}; when using the Kpathsea library +itself, none of these special filenames are recognized, and it's still +up to the caller to specify the desired format. + +Here is the list of special filenames to @command{kpsewhich}, along +with their corresponding format: + +@table @file + +@flindex config.ps +@item config.ps +@code{dvips config} + +@flindex dvipdfmx.cfg +@item dvipdfmx.cfg +@samp{other text files} + +@flindex fmtutil.cnf +@item fmtutil.cnf +@samp{web2c files} + +@flindex glyphlist.txt +@item glyphlist.txt +@samp{map} + +@flindex mktex.cnf +@item mktex.cnf +@samp{web2c files} + +@flindex pdfglyphlist.txt +@item pdfglyphlist.txt +@samp{map} + +@flindex pdftex.cfg +@flindex pdftexconfig.tex +@item pdftex.cfg +@samp{pdftex config} (although @file{pdftex.cfg} is not used any more; +look for the file @file{pdftexconfig.tex} instead.) + +@flindex texmf.cnf +@item texmf.cnf +@samp{cnf} + +@flindex XDvi +@item XDvi +@samp{other text files} + +@end table + +A user-specified format will override the above defaults. + +@flindex tcfmgr.map +Another useful configuration file in this regard is @file{tcfmgr.map}, +found in @file{texmf/texconfig/tcfmgr.map}, which records various +information about the above configuration files (among others). + + +@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}} outputs the value of @var{variable}, +expanding @samp{$} (@pxref{Variable expansion} and @samp{~} (@pxref{Tilde +expansion}) constructs, but not performing other expansions. + +@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 and tilde +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}, with each element separated by the usual path separator +on the current system (@samp{;} on Windows, @samp{:} otherwise). +This may be useful to construct a custom search path for a format not +otherwise supported. To retrieve the search path for a format that is +already supported, see @samp{--show-path}, next. + +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 +successfully. + +@item +@opindex --version +@samp{--version} prints the Kpathsea version number and exits successfully. +@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, @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 font cid map +@flindex .cid +@vindex FONTCIDMAPS +(CJK mapping) +@code{FONTCIDMAPS} +suffix @samp{.cid}. + +@item font feature files +@flindex .fea +@vindex FONTFEATURES +(primarily for OpenType font features) +@code{FONTFEATURES} +suffix @samp{.fea}. + +@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 mlbib +@flindex .mlbib +@vindex MLBIBINPUTS +@vindex BIBINPUTS +@vindex TEXBIB +(MlBib@TeX{} bibliography source) +@code{MLBIBINPUTS}, @code{BIBINPUTS}, @code{TEXBIB}; +suffixes @samp{.mlbib}, @samp{.mlbib}. + +@item mlbst +@flindex .mlbst +@vindex MLBSTINPUTS +@vindex BSTINPUTS +(MlBib@TeX{} style) +@code{MLBSTINPUTS}, @code{BSTINPUTS}; +suffixes @samp{.mlbst}, @samp{.bst}. + +@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 trees) +@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} and +@samp{.TTF}, @samp{.ttc} and @samp{.TTC}, @samp{.dfont}. + +@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. Example: given @samp{foo.bar}, look for +@samp{foo.bar.tex}. + +@item +Search for @var{name}, and if necessary for alternative names found in +the fontmaps. Example: given @samp{foo.bar}, we also look for +@samp{foo.bar}. + +@item +If the file format defines a program to invoke to create missing files, +run it (@pxref{mktex scripts}). +@end enumerate + +@cindex extensions, filename +@cindex suffixes, filename +@vindex try_std_extension_first +The order in which we search for ``suffixed'' name (item@tie{}1) or +the ``as-is'' name (item@tie{}2) is controlled by the +@file{try_std_extension_first} configuration value. The default set +in @file{texmf.cnf} is true, since common suffixes are already +recognized: @samp{babel.sty} will only look for @samp{babel.sty}, not +@samp{babel.sty.tex}, regardless of this setting. + +When the suffix is unknown (e.g., @samp{foo.bar}), both names are +always tried; the difference is the order in which they are tried. + +@file{try_std_extension_first} only affects names being looked up +which *already* have an extension. A name without an extension (e.g., +@samp{tex story}) will always have an extension added first. + +@flindex tex-file.c +@findex kpathsea_find_file +This algorithm is implemented in the function +@code{kpathsea_find_file} in the source file +@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 kpathsea_find_glyph +This is implemented in @code{kpathsea_find_glyph} 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} +@findex kpathsea_init_prog +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 calling @code{kpathsea_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 that 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. + +@cindex re-entrant API +@cindex API, re-entrant +When looking at these program sources, you should know that previous +versions of the library had a different programming interface, to +support re-entrancy. In that interface the library function names +were prefixed with @code{kpse_} instead of @code{kpathsea_}, and they +did not need an instance variable as first argument. This change was +made in 2009. Some of the programs mentioned above may still be using +the previous interface. + +@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 +}, 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 kpathsea_new +Call @code{kpathsea_new} to create a new library instance. This variable +must be passed as the first argument to all the following library functions. +The rest of this manual will be using @code{kpse} as a placeholder for +the name of this variable. + +@item +@findex kpathsea_set_program_name +@vindex argv[0] +Call @code{kpathsea_set_program_name} with @code{argv[0]} as the second +argument; the third argument is a string or @code{NULL}. The third +argument is used by Kpathsea as the program name for the +@code{.@var{program}} feature of config files (@pxref{Config files}). +If the third argument is @code{NULL}, the value of the second argument +is used. This function must be called before any other use of the +Kpathsea library. + +@vindex kpse->invocation_name +@vindex kpse->invocation_short_name +@vindex kpse->program_name +@cindex error message macros +@code{kpathsea_set_program_name} always sets the variables +@code{kpse->invocation_name} and @code{kpse->invocation_short_name}. +These variables are used in the error message macros defined in +@file{kpathsea/lib.h}. It sets the variable +@code{kpse->program_name} to the program name it uses. + +@vindex KPATHSEA_DEBUG +It also initializes debugging options based on the environment +variable @code{KPATHSEA_DEBUG} (if that is set). + +@cindex SELFAUTOLOC +@cindex SELFAUTODIR +@cindex SELFAUTOPARENT +@cindex symlinks, resolving +@cindex expanding symlinks +Finally, it sets the environment 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. You +can use @samp{kpsewhich --expand-var=\$SELFAUTOLOC}, etc., to see the +values. + +@item +@vindex kpse->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{kpse->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 kpathsea_init_prog +@flindex proginit.h +Call @code{kpathsea_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 kpathsea_find_file +The routine to actually find a file of type @var{format} is +@file{kpathsea_find_file}. You can call +@code{kpathsea_find_file} after doing only the first and second 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 routine +is @code{kpathsea_find_glyph}, defined in +@file{tex-glyph.h}. This returns 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 kpathsea_open_file +To actually open a file, not just return a filename, call +@code{kpathsea_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. + +@item +@findex kpathsea_out_name_ok +@TeX{} can write output files, via the @code{\openout} primitive; this opens +a security hole vulnerable to Trojan horse attack: an unwitting user could +run a @TeX{} program that overwrites, say, @file{~/.rhosts}. Analogous +security holes exist for many other programs. To alleviate this, there is a +configuration variable @code{openout_any}, which selects one of three levels +of security. When it is set to @samp{a} (for ``any''), no restrictions are +imposed. When it is set to @samp{r} (for ``restricted''), filenames +beginning with @samp{.} are disallowed (except @file{.tex} because @LaTeX{} +needs it). When it is set to @samp{p} (for ``paranoid'') additional +restrictions are imposed: an absolute filename must refer to a file in (a +subdirectory) of @code{TEXMFOUTPUT}, and any attempt to go up a directory +level is forbidden (that is, paths may not contain a @samp{..} component). +The paranoid setting is the default. (For backwards compatibility, @samp{y} +and @samp{1} are synonyms of @samp{a}, while @samp{n} and @samp{0} are +synonyms for @samp{r}.) The function @code{kpathsea_out_name_ok}, with a +filename as second argument, returns @code{true} if that filename is +acceptable to be opend for output or @code{false} otherwise. + +@item +@findex kpathsea_in_name_ok +Similarly, the function @code{kpathsea_in_name_ok}, with a filename as +second argument, returns @code{true} if that filename is acceptable to be +opend for input or @code{false} otherwise, depending on the value of the +configuration variable @code{openin_any} (with @samp{a} as default). + +@item +@findex kpathsea_finish +To close the kpathsea library instance you are using, call +@code{kpathsea_finish}. This function closes any open log files and +frees the memory used by the instance. + +@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 and +probably Automake for configuring and building your software if you use +Kpathsea; I strongly recommend using Autoconf and Automake regardless. +They are available from @url{ftp://ftp.gnu.og/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 formats, @samp{kpse_program_text_format} and +@samp{kpse_program_binary_format}, 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{kpathsea_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 kpathsae_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{kpathsea_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{kpathsea_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 kpathsea_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{kpathsea_cnf_get} (declared in @file{kpathsea/cnf.h}) +with the string @var{var}. + +No initialization calls are needed. + + +@node Index +@unnumbered Index + +@printindex cp + +@bye diff --git a/src/texsourc/kpathsea/kpathsea/doc/unixtex.texi b/src/texsourc/kpathsea/kpathsea/doc/unixtex.texi new file mode 100644 index 0000000..b77e6ae --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/doc/unixtex.texi @@ -0,0 +1,45 @@ +@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 13 June +2010. Also available as @uref{http://www.tug.org/unixtex.ftp}. Email +@email{tex-k@@tug.org} with comments or questions. + +The principal free @TeX{} distribution for Unix-like systems is @TeX{} +Live, on the web at @url{http://tug.org/texlive}. The pages there +describe many ways to acquire @TeX{}, over the Internet or on physical +media, both the sources and precompiled binaries for many systems, +either standalone or as part of various operating system +distributions. + +Web2C, Kpathsea, Dvips, and Dviljk are no longer released as a +separate packages. Their sources are now maintained as part of @TeX{} +Live. + +@flindex ftp.cs.stanford.edu +@flindex tex.web +@cindex Knuth, Donald E., archive of programs by +The host @t{ftp.cs.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 a larger package. In any case, that ftp site is +not the canonical source for anything except what was created as part +of Stanford @TeX{} project, so do not rely on the other files available +there being up-to-date. diff --git a/src/texsourc/kpathsea/kpathsea/elt-dirs.c b/src/texsourc/kpathsea/kpathsea/elt-dirs.c new file mode 100644 index 0000000..6954494 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/elt-dirs.c @@ -0,0 +1,513 @@ +/* elt-dirs.c: Translate a path element to its corresponding director{y,ies}. + + Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009, 2010, 2011 Karl Berry. + Copyright 1997, 1998, 1999, 2000, 2005 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, see . */ + +#include + +#include +#include +#include +#include +#include + +/* 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 (str_llist_type *l, string dir) +{ + char last_char = dir[strlen (dir) - 1]; + string saved_dir + = IS_DIR_SEP_CH (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 (kpathsea kpse, str_llist_type *l, string dir) +{ + if (kpathsea_dir_p (kpse, 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. */ + +/* 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 (kpathsea kpse, const_string key, str_llist_type *value) +{ + kpse->cache_length++; + XRETALLOC (kpse->the_cache, kpse->cache_length, cache_entry); + kpse->the_cache[kpse->cache_length - 1].key = xstrdup (key); + kpse->the_cache[kpse->cache_length - 1].value = value; +} + + +/* To retrieve, just check the list in order. */ + +static str_llist_type * +cached (kpathsea kpse, const_string key) +{ + unsigned p; + + for (p = 0; p < kpse->cache_length; p++) + { + if (FILESTRCASEEQ (kpse->the_cache[p].key, key)) + return kpse->the_cache[p].value; + } + + return NULL; +} + +/* Handle the magic path constructs. */ + +/* Declare recursively called routine. */ +static void expand_elt (kpathsea, str_llist_type *, 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*2]; +static wchar_t dirnamew[MAX_PATH]; +static char *potname; +#endif + +static void +do_subdir (kpathsea kpse, str_llist_type *str_list_ptr, string elt, + unsigned elt_length, string post) +{ +#ifdef WIN32 + WIN32_FIND_DATAW 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_CH (elt[elt_length - 1]) + || IS_DEVICE_SEP (elt[elt_length - 1])); + +#if defined (WIN32) + strcpy(dirname, FN_STRING(name)); + strcat(dirname, "/*.*"); /* "*.*" or "*" -- seems equivalent. */ + get_wstring_from_fsyscp(dirname, dirnamew); + hnd = FindFirstFileW(dirnamew, &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 (kpse, str_list_ptr, FN_STRING (name), elt_length); + fn_shrink_to (&name, elt_length); + } + proceed = 1; + while (proceed) { + if (find_file_data.cFileName[0] != L'.') { + int links; + + /* Construct the potential subdirectory name. */ + potname = get_fsyscp_from_wstring(find_file_data.cFileName, potname=NULL); + fn_str_grow (&name, potname); + free(potname); + + /* Maybe we have cached the leafness of this directory. + The function will return 0 if unknown, + else the actual (Unix-like) value. */ + links = kpathsea_dir_links (kpse, 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 (kpse, 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 (kpse, 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 = FindNextFileW (hnd, &find_file_data); + } + /* Update the leafness of name. */ + kpathsea_dir_links(kpse, 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 (kpse, 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 = kpathsea_dir_links (kpse, 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 (kpse, 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 + /* 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. + Cygwin 1.7 also leaves st_nlink as 1: + http://cygwin.com/ml/cygwin-developers/2008-04/msg00110.html + */ + if (links != 2) +#endif /* ST_NLINK_TRICK */ + /* All criteria are met; find subdirectories. */ + do_subdir (kpse, 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 (kpathsea kpse, str_llist_type * str_list_ptr, string elt, + unsigned start) +{ + string dir = elt + start, post; + + while (*dir != 0) + { + if (IS_DIR_SEP_CH (*dir)) + { + /* If two or more consecutive /'s, find subdirectories. */ + if (IS_DIR_SEP_CH (dir[1])) + { + for (post = dir + 1; IS_DIR_SEP_CH (*post); post++) ; + do_subdir (kpse, 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 (kpse, str_list_ptr, elt); +} + +/* On win32 we slashify ELT, i.e., change '\\' to '/', and then can use + IS_DIR_SEP_CH instead of IS_DIR_SEP and need not test for the presence + of 2-Byte Kanji (CP 932, SJIS) codes. */ + +/* 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 (w32, 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. + - Remove multiple leading slashes to prevent expanding from the root + of a UNIX filesystem tree. */ + +unsigned +kpathsea_normalize_path (kpathsea kpse, string elt) +{ + unsigned ret; + unsigned i; + +#if defined(WIN32) + for (i = 0; elt[i]; i++) { + if (elt[i] == '\\') + elt[i] = '/'; + else if (IS_KANJI(elt + i)) + i++; + } +#endif + + if (NAME_BEGINS_WITH_DEVICE(elt)) { + if (*elt >= 'A' && *elt <= 'Z') + *elt += 'a' - 'A'; + ret = 2; + + } else if (IS_UNC_NAME(elt)) { + for (ret = 2; elt[ret] && !IS_DIR_SEP_CH(elt[ret]); ret++) + ; + + } else + ret = 0; + + for (i = ret; IS_DIR_SEP_CH(elt[i]); ++i) + ; + if (i > ret + 1) { +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_STAT)) + DEBUGF2 ("kpse_normalize_path (%s) => %u\n", elt, ret); +#endif /* KPSE_DEBUG */ + + memmove (elt + ret + 1, elt + i, strlen (elt + i) + 1); + } + + return ret; +} + +/* Here is the entry point. Returns directory list for ELT. */ + +str_llist_type * +kpathsea_element_dirs (kpathsea kpse, string elt) +{ + str_llist_type *ret; + unsigned i; + + /* If given nothing, return nothing. */ + if (!elt || !*elt) + return NULL; + + /* Normalize ELT before looking for a cached value. */ + i = kpathsea_normalize_path (kpse, elt); + + /* If we've already cached the answer for ELT, return it. */ + ret = cached (kpse, 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 (kpse, ret, elt, i); + + /* Remember the directory list we just found, in case future calls are + made with the same ELT. */ + cache (kpse, elt, ret); + +#ifdef KPSE_DEBUG + if (KPATHSEA_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 = kpathsea_element_dirs (kpse_def, 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: +standalone-compile-command: "gcc -g -I. -I.. -DTEST elt-dirs.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/expand.c b/src/texsourc/kpathsea/kpathsea/expand.c new file mode 100644 index 0000000..d9eadd4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/expand.c @@ -0,0 +1,409 @@ +/* expand.c: general expansion. + + Copyright 1993, 1994, 1995, 1996, 1997, 2005, 2008, 2009, 2011, + 2012 Karl Berry. + Copyright 1997-2005 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, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Do variable expansion first so ~${USER} works. (Besides, it's what the + shells do.) */ + +string +kpathsea_expand (kpathsea kpse, const_string s) +{ + string var_expansion = kpathsea_var_expand (kpse, s); + string tilde_expansion = kpathsea_tilde_expand (kpse, 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 (kpathsea, const_string*); + +/* If $KPSE_DOT is defined in the environment, prepend it to any relative + path components. */ + +static string +kpathsea_expand_kpse_dot (kpathsea kpse, 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 = kpathsea_path_element (kpse, path); elt; + elt = kpathsea_path_element (kpse, NULL)) { + string save_ret = ret; + boolean ret_copied = true; + /* We assume that the !! magic is only used on absolute components. + Single "." gets special treatment, as does "./" or its equivalent. */ + if (kpathsea_absolute_p (kpse, 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 if (*elt) { + ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL); +#endif + } else { + /* omit empty path elements from TEXMFCNF. + See http://bugs.debian.org/358330. */ + ret_copied = false; + } + if (ret_copied) + 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 +kpathsea_brace_expand_element (kpathsea kpse, const_string elt) +{ + unsigned i; + str_list_type expansions = brace_expand (kpse, &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 = kpathsea_expand (kpse, 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 = kpathsea_brace_expand_element (kpse, 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 +kpathsea_brace_expand (kpathsea kpse, 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 = kpathsea_var_expand (kpse, path); + string ret = (string)xmalloc (1); + *ret = 0; + + for (elt = kpathsea_path_element (kpse, xpath); elt; + elt = kpathsea_path_element (kpse, NULL)) { + string save_ret = ret; + /* Do brace expansion first, so tilde expansion happens in {~ka,~kb}. */ + string expansion = kpathsea_brace_expand_element (kpse, 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 = kpathsea_expand_kpse_dot (kpse, ret); + if (kpse_dot_expansion != ret) + free (ret); + + return kpse_dot_expansion; +} + +#if defined(KPSE_COMPAT_API) +string +kpse_brace_expand (const_string path) +{ + return kpathsea_brace_expand (kpse_def, path); +} +#endif + +/* Expand all special constructs in a path, and include only the actually + existing directories in the result. */ +string +kpathsea_path_expand (kpathsea kpse, const_string path) +{ + string ret; + string xpath; + string elt; + unsigned len; + const_string ypath; +#if defined(WIN32) + string zpath, p; +#endif + + /* Initialise ret to the empty string. */ + ret = (string)xmalloc (1); + *ret = 0; + len = 0; + +#if defined(WIN32) + zpath = xstrdup (path); + + for (p = zpath; *p; p++) + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + + ypath = zpath; +#else + ypath = path; +#endif + + /* Expand variables and braces first. */ + xpath = kpathsea_brace_expand (kpse, ypath); + +#if defined(WIN32) + free (zpath); +#endif + + /* Now expand each of the path elements, printing the results */ + for (elt = kpathsea_path_element (kpse, xpath); elt; + elt = kpathsea_path_element (kpse, 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 = kpathsea_element_dirs (kpse, 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; +} + +#if defined(KPSE_COMPAT_API) +string +kpse_path_expand (const_string path) +{ + return kpathsea_path_expand (kpse_def, path); +} +#endif + +/* ... */ +static void expand_append (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 (kpathsea kpse, 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(kpse, &p); + str_list_concat_elements(&partial, recurse); + str_list_free(&recurse); + /* Check for missing closing brace. */ + if (*p != '}') { + WARNING1 ("kpathsea: %s: Unmatched {", *text); + } + *text = p+1; + } else if (*p == '$') { + /* Skip ${VAR} */ + if (*(p+1) == '{') + for (p+=2; *p!='}';++p); + } +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif + } + expand_append(&partial, *text, p); + str_list_concat(&result, partial); + str_list_free(&partial); + *text = p; + return result; +} + + + +#if defined (TEST) +#include + +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 (int argc, char **argv) +{ + char example[256]; + kpse_set_program_name(argv[0], NULL); + + 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 = kpse_brace_expand (example); + + printf ("%s\n", result); + + } +} + + +#endif /* TEST */ + +/* +Local variables: +standalone-compile-command: "gcc -g -I. -I.. -DTEST expand.c kpathsea.a" +end: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/expand.h b/src/texsourc/kpathsea/kpathsea/expand.h new file mode 100644 index 0000000..cebeb74 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/expand.h @@ -0,0 +1,59 @@ +/* expand.h: general expansion. + + Copyright 1993, 1994, 1996, 2008, 2011 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_EXPAND_H +#define KPATHSEA_EXPAND_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Call kpse_var_expand and kpse_tilde_expand (in that order). Result + is always in fresh memory, even if no expansions were done. */ +extern string kpathsea_expand (kpathsea kpse, const_string s); + +#endif /* MAKE_KPSE_DLL */ + +/* 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 kpathsea_brace_expand (kpathsea kpse, 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 kpathsea_path_expand (kpathsea kpse, const_string path); + +#if defined(KPSE_COMPAT_API) +extern KPSEDLL string kpse_brace_expand (const_string path); +extern KPSEDLL string kpse_path_expand (const_string path); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_EXPAND_H */ diff --git a/src/texsourc/kpathsea/kpathsea/extend-fname.c b/src/texsourc/kpathsea/kpathsea/extend-fname.c new file mode 100644 index 0000000..b9938af --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/extend-fname.c @@ -0,0 +1,30 @@ +/* extend-fname.c: give a filename a suffix, if necessary. + + Copyright 1992, 1993, 2008, 2011 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, see . */ + +#include + + +const_string +extend_filename (const_string name, const_string default_suffix) +{ + const_string new_s; + const_string suffix = find_suffix (name); + + new_s = suffix == NULL ? concat3 (name, ".", default_suffix) + : name; + return new_s; +} diff --git a/src/texsourc/kpathsea/kpathsea/file-p.c b/src/texsourc/kpathsea/kpathsea/file-p.c new file mode 100644 index 0000000..23218c9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/file-p.c @@ -0,0 +1,36 @@ +/* file-p.c: file predicates. + + Copyright 1992, 1993, 1994, 2008 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, see . */ + +#include + +#include + + +/* 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 (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/src/texsourc/kpathsea/kpathsea/find-suffix.c b/src/texsourc/kpathsea/kpathsea/find-suffix.c new file mode 100644 index 0000000..3aad887 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/find-suffix.c @@ -0,0 +1,57 @@ +/* find-suffix.c: return the stuff after a dot. + + Copyright 1992, 1993, 1995, 2008, 2011 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, see . */ + +#include + +#include + + +/* 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. */ + +/* The the result of strrchr(NAME, '.'), when not NULL, is a non-const + pointer into the string NAME. However, this is cheating (motivated + by limitations of the C language) when the argument NAME is a + const string, because in that case the (technically non-const) result + from strrchr() is certainly not modifiable. + + We do not want to repeat this kind of cheating for find_suffix() and + therefore declare find_suffix(NAME) as const. When find_suffix(NAME) + is non-NULL and the argument NAME is modifiable (i.e., non-const) + then NAME+(find_suffix(NAME)-NAME) is an equivalent modifiable string + and the pointer arithmetic is optimized away by modern compilers. */ + +const_string +find_suffix (const_string name) +{ + const_string dot_pos = strrchr (name, '.'); + const_string p; + + if (dot_pos == NULL) + return NULL; + + for (p = dot_pos + 1; *p; p++) { + if (IS_DIR_SEP (*p)) + return NULL; +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif + } + + return dot_pos + 1; +} diff --git a/src/texsourc/kpathsea/kpathsea/fn.c b/src/texsourc/kpathsea/kpathsea/fn.c new file mode 100644 index 0000000..3464ced --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/fn.c @@ -0,0 +1,119 @@ +/* fn.c: arbitrarily long filenames or strings. + + Copyright 1993, 2008 Karl Berry. + Copyright 2001, 2005 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, see . */ + +#include + +#include + + +/* /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 (void) +{ + fn_type ret; + + FN_ALLOCATED (ret) = FN_LENGTH (ret) = 0; + FN_STRING (ret) = NULL; + + return ret; +} + + +fn_type +fn_copy0 (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 (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 (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 (fn_type *f, char c) +{ + grow (f, 1); + FN_STRING (*f)[FN_LENGTH (*f)] = c; + FN_LENGTH (*f)++; +} + + +void +fn_grow (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 (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 (fn_type *f, unsigned loc) +{ + assert (FN_LENGTH (*f) > loc); + FN_STRING (*f)[loc] = 0; + FN_LENGTH (*f) = loc + 1; +} diff --git a/src/texsourc/kpathsea/kpathsea/fn.h b/src/texsourc/kpathsea/kpathsea/fn.h new file mode 100644 index 0000000..e1bab8e --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/fn.h @@ -0,0 +1,71 @@ +/* fn.h: arbitrarily long filenames (or just strings). + + Copyright 2001, 2005 Olaf Weber. + Copyright 1993, 2008, 2011 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, see . */ + +#ifndef KPATHSEA_FN_H +#define KPATHSEA_FN_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include + +/* 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 fn_type fn_init (void); + +/* Create a new fn from the first LEN characters from S and a null. */ +extern fn_type fn_copy0 (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 void fn_free (fn_type *f); + +/* Append the character C to the fn F. Don't append trailing null. */ +extern void fn_1grow (fn_type *f, char c); + +/* Append LENGTH bytes from SOURCE to F. */ +extern void fn_grow (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 void fn_str_grow (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 void fn_shrink_to (fn_type *f, unsigned loc); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not KPATHSEA_FN_H */ diff --git a/src/texsourc/kpathsea/kpathsea/fontmap.c b/src/texsourc/kpathsea/kpathsea/fontmap.c new file mode 100644 index 0000000..019f330 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/fontmap.c @@ -0,0 +1,201 @@ +/* fontmap.c: read files for additional font names. + + Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2011-2013 Karl Berry. + Copyright 2001, 2002, 2005 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, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* We have one and only one fontmap, so may as well make it static + instead of passing it around. */ + +#ifndef MAP_NAME +#define MAP_NAME "texfonts.map" +#endif +#ifndef MAP_HASH_SIZE +#define MAP_HASH_SIZE 4001 +#endif + + +/* Return next whitespace-delimited token in STR or NULL if none. */ + +static string +token (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 (kpathsea kpse, const_string map_filename) +{ + char *orig_l; + unsigned map_lineno = 0; + FILE *f = xfopen (map_filename, FOPEN_R_MODE); + + if (kpse->record_input) + kpse->record_input (map_filename); + + while ((orig_l = read_line (f)) != NULL) { + string filename; + string l = orig_l; /* save for free() */ + 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 ("kpathsea: %s:%u: Filename argument for include directive missing", + map_filename, map_lineno); + } else { + string include_fname = kpathsea_path_search (kpse, + kpse->map_path, alias, false); + if (include_fname) { + map_file_parse (kpse, include_fname); + if (include_fname != alias) + free (include_fname); + } else { + WARNING3 ("kpathsea: %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 ("kpathsea: %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 by token(), so don't bother + with xstrdup. */ + hash_insert_normalized (&(kpse->map), alias, filename); + } + } + + free (orig_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 (kpathsea kpse) +{ + string *filenames; + + kpse->map_path = kpathsea_init_format (kpse, kpse_fontmap_format); + filenames = kpathsea_all_path_search (kpse, kpse->map_path, MAP_NAME); + + kpse->map = hash_create (MAP_HASH_SIZE); + + while (*filenames) { + map_file_parse (kpse, *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. */ + +const_string * +kpathsea_fontmap_lookup (kpathsea kpse, const_string key) +{ + const_string *ret; + const_string suffix = find_suffix (key); + + if (kpse->map.size == 0) { + read_all_maps (kpse); + } + + ret = hash_lookup (kpse->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 (kpse->map, base_key); + free (base_key); + } + } + + /* Append any original suffix. */ + if (ret && suffix) { + const_string *elt; + for (elt = ret; *elt; elt++) { + *elt = extend_filename (*elt, suffix); + } + } + + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/fontmap.h b/src/texsourc/kpathsea/kpathsea/fontmap.h new file mode 100644 index 0000000..6ac220c --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/fontmap.h @@ -0,0 +1,33 @@ +/* fontmap.h: declarations for reading a file to define additional font names. + + Copyright 1993, 1994, 1995, 2008, 2010, 2011 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, see . */ + +#ifndef FONTMAP_H +#define FONTMAP_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include +#include + +/* 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 const_string *kpathsea_fontmap_lookup (kpathsea kpse, const_string key); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not FONTMAP_H */ diff --git a/src/texsourc/kpathsea/kpathsea/getopt.c b/src/texsourc/kpathsea/kpathsea/getopt.c new file mode 100644 index 0000000..04c1e21 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/getopt.c @@ -0,0 +1,962 @@ +/* Getopt for GNU. + + Copyright 2008-2012 Karl Berry. + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 2000, 2010 + 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 libc. + 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, see . */ + + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include + +/* 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 +#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 +#include +#endif /* GNU C library. */ + +#ifdef VMS +#include +#if HAVE_STRING_H - 0 +#include +#endif +#endif + +#if defined (WIN32) && !defined (__CYGWIN__) +/* It's not Unix, really. See? Capital letters. */ +#include +#include +#undef getpid +#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 +# 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 +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char *my_index(const char *str, int chr) +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +#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. */ + +static void exchange(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. */ + +static const char *_getopt_initialize(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( + 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(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(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/src/texsourc/kpathsea/kpathsea/getopt.h b/src/texsourc/kpathsea/kpathsea/getopt.h new file mode 100644 index 0000000..8acf05f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/getopt.h @@ -0,0 +1,161 @@ +/* Declarations for getopt. + + Copyright 2008, 2010-2012 Karl Berry. + 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 libc. + 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, see . */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +#define _GETOPT_H 1 +#endif + +#if defined (WIN32) && !defined (__MINGW32__) && !defined (NO_KPSE_DLL) +#define KPSE_DLL 1 +#endif /* WIN32 && !__MINGW32__ && !NO_KPSE_DLL */ + +#if !defined (KPSEDLL) +#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 /* ! (KPSE_DLL && (WIN32 || __CYGWIN__)) */ +#endif /* ! KPSEDLL */ + +#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; + +#ifndef __need_getopt +/* 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 +{ + const char *name; + /* 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 +#endif /* need getopt */ + +#if defined(__GNU_LIBRARY__) || defined (WIN32) || defined (__CYGWIN__) +/* 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. And not when + compiling with C++; g++ 4.7.0 chokes on conflicting exception + specifications. */ +#if !defined (__cplusplus) +extern KPSEDLL int getopt (int argc, char *const *argv, const char *shortopts); +#endif +#if defined (__MINGW32__) || defined (__CYGWIN__) +#define __GETOPT_H__ /* Avoid that redeclares the getopt API. */ +#endif +#elif !defined (__cplusplus) +extern KPSEDLL int getopt (); +#endif + +#ifndef __need_getopt +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); + +#if defined (MAKE_KPSE_DLL) || defined (NO_KPSE_DLL) /* libkpathsea internal only */ + +/* 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); + +#endif /* MAKE_KPSE_DLL || NO_KPSE_DLL */ +#endif /* need getopt */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* _GETOPT_H */ diff --git a/src/texsourc/kpathsea/kpathsea/getopt1.c b/src/texsourc/kpathsea/kpathsea/getopt1.c new file mode 100644 index 0000000..f064984 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/getopt1.c @@ -0,0 +1,177 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + + Copyright 2008, 2010 Karl Berry. + 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, see . */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "getopt.h" + +#include + +/* 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 +#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 +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int getopt_long( + 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( + 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 + +int main(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/src/texsourc/kpathsea/kpathsea/hash.c b/src/texsourc/kpathsea/kpathsea/hash.c new file mode 100644 index 0000000..f1d81db --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/hash.c @@ -0,0 +1,265 @@ +/* hash.c: hash table operations. + + Copyright 1994-2000, 2002, 2005, 2008, 2012 + 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, see . */ + +#include +#include + +#include +#include + + +/* The hash function. We go for simplicity here. */ + +/* All our hash tables are related to filenames. */ + +static unsigned +hash (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) +#if defined(WIN32) + if (IS_KANJI(key)) { + n = (n + n + (unsigned)(*key++)) % table.size; + n = (n + n + (unsigned)(*key++)) % table.size; + } else +#endif + n = (n + n + TRANSFORM (*key++)) % table.size; + + return n; +} + +/* Identical has function as above, but does not normalize keys. */ +static unsigned +hash_normalized (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 (unsigned size) +{ + /* The was "static ..." since Oct3, 1997 to work around a gcc + optimizer bug for Alpha. That particular optimization bug + should be gone by now (Mar4, 2009). + */ + 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 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 (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 (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 KEY in TABLE, and return NULL-terminated list of all matching + values (not copies), in insertion order. If none, return NULL. */ + +const_string * +hash_lookup (hash_table_type table, const_string key) +{ + hash_element_type *p; + cstr_list_type ret; + unsigned n = hash (table, key); + ret = cstr_list_init (); + + /* Look at everything in this bucket. */ + for (p = table.buckets[n]; p != NULL; p = p->next) + if (FILESTRCASEEQ (key, p->key)) + cstr_list_add (&ret, p->value); + + /* If we found anything, mark end of list with null. */ + if (STR_LIST (ret)) + cstr_list_add (&ret, NULL); + +#ifdef KPSE_DEBUG +#if defined (KPSE_COMPAT_API) + { + kpathsea kpse = kpse_def; + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_HASH)) + { + DEBUGF1 ("hash_lookup(%s) =>", key); + if (!STR_LIST (ret)) + fputs (" (nil)\n", stderr); + else + { + const_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 +#endif + + return STR_LIST (ret); +} + +#ifdef KPSE_DEBUG +/* We only print nonempty buckets, to decrease output volume. */ + +void +hash_print (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); +} +#endif + +#if KPATHSEA_CAN_FREE +void +hash_free (hash_table_type table) +{ + struct hash_element_struct *p, *q; + p = (struct hash_element_struct *)table.buckets; + while (p != NULL) { + q = p->next; + free ((char *)p->key); + free ((char *)p->value); + free (p); + p = q; + } +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/hash.h b/src/texsourc/kpathsea/kpathsea/hash.h new file mode 100644 index 0000000..f54cd0f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/hash.h @@ -0,0 +1,96 @@ +/* hash.h: declarations for a hash table. + + Copyright 1994, 1995, 2008, 2010-2012 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef HASH_H +#define HASH_H + +#include +#include + +/* + * The code freeing strings and hash tables is enabled/disabled + * by KPATHSEA_CAN_FREE. + */ +/* At the moment can not free */ +#define KPATHSEA_CAN_FREE 0 + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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; + + +/* Create a hash table of size SIZE. */ +extern KPSEDLL hash_table_type hash_create (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 (hash_table_type *table, + const_string key, + const_string value); + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* 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 void hash_insert_normalized (hash_table_type *table, + const_string key, + const_string value); + +#endif /* MAKE_KPSE_DLL */ + +/* Remove the (KEY,VALUE) association from TABLE. */ +extern KPSEDLL void hash_remove (hash_table_type *table, const_string key, + const_string value); + +/* Look up KEY in TABLE, and return NULL-terminated list of all matching + values (not copies), in insertion order. If none, return NULL. */ +extern KPSEDLL const_string *hash_lookup (hash_table_type table, const_string key); + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Print TABLE to stderr. */ +extern void hash_print (hash_table_type table, boolean summary_only); + +#if KPATHSEA_CAN_FREE +/* Drop the TABLE */ +extern void hash_free (hash_table_type table); +#endif + +#endif /* MAKE_KPSE_DLL */ + +#ifdef __cplusplus +} +#endif + +#endif /* not HASH_H */ diff --git a/src/texsourc/kpathsea/kpathsea/kdefault.c b/src/texsourc/kpathsea/kpathsea/kdefault.c new file mode 100644 index 0000000..bc25a5c --- /dev/null +++ b/src/texsourc/kpathsea/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 1993, 1994, 1996, 2008, 2009, 2011 Karl Berry. + Copyright 2002, 2005 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, see . */ + +#include + +#include +#include + + +/* Check for leading colon first, then trailing, then doubled, since + that is fastest. Usually it will be leading or trailing. */ + +string +kpathsea_expand_default (kpathsea kpse, const_string path, + const_string fallback) +{ + unsigned path_length; + string expansion; + (void)kpse; /* currenty not used */ + + /* 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 = kpathsea_expand_default (kpse_def, 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 kdefault.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/knj.c b/src/texsourc/kpathsea/kpathsea/knj.c new file mode 100644 index 0000000..92116c0 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/knj.c @@ -0,0 +1,477 @@ +/* knj.c: check for 2-Byte Kanji (CP 932, SJIS) codes. + + Copyright 2010, 2014 Akira Kakuto. + Copyright 2013, 2014 TANAKA Takuji. + + 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, see . */ + +#include +#include +#include + +int is_cp932_system, file_system_codepage; + +int isknj(int c) +{ + c &= 0xff; + switch (is_cp932_system) { + case 932: + return((c>=0x81 && c<=0x9f) || (c>=0xe0 && c<=0xfc)); + case 936: + return(c>=0x81 && c<=0xfe); + case 950: + return((c>=0xa1 && c<=0xc6) || (c>=0xc9 && c<=0xf9)); + default: + return(0); + } +} + +int isknj2(int c) +{ + c &= 0xff; + switch (is_cp932_system) { + case 932: + return(c>=0x40 && c<=0xfc && c!=0x7f); + case 936: + return(c>=0x40 && c<=0xfe && c!=0x7f); + case 950: + return((c>=0x40 && c<=0x7e) || (c>=0xa1 && c<=0xfe)); + default: + return(0); + } +} + +/* + Get wide string from multibyte string. +*/ +wchar_t * +get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr) +{ + int len; + + len = MultiByteToWideChar(cp, 0, mbstr, -1, wstr, 0); + if (len==0) { + FATAL("cannot convert string to wide string"); + } + if (wstr==NULL) { + wstr = xmalloc(sizeof(wchar_t)*(len+1)); + } + len = MultiByteToWideChar(cp, 0, mbstr, -1, wstr, len+1); + if (len==0) { + FATAL("cannot convert multibyte string to wide string"); + } + return wstr; +} + +/* + Get multibyte string from wide string. +*/ +char * +get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr) +{ + int len; + + len = WideCharToMultiByte(cp, 0, wstr, -1, mbstr, 0, NULL, NULL); + if (len==0) { + FATAL("cannot convert string to multibyte string"); + } + if (mbstr==NULL) { + mbstr = xmalloc(len+1); + } + len = WideCharToMultiByte(cp, 0, wstr, -1, mbstr, len+1, NULL, NULL); + if (len==0) { + FATAL("cannot convert wide string to multibyte string"); + } + return mbstr; +} + +/* + xfopen by file system codepage +*/ +FILE * +fsyscp_xfopen (const char *filename, const char *mode) +{ + FILE *f; + wchar_t *fnamew, modew[4]; + int i; +#if defined (KPSE_COMPAT_API) + kpathsea kpse; +#endif + assert(filename && mode); + + fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL); + for(i=0; (modew[i]=(wchar_t)mode[i]); i++) {} /* mode[i] must be ASCII */ + f = _wfopen(fnamew, modew); + if (f == NULL) + FATAL_PERROR(filename); +#if defined (KPSE_COMPAT_API) + kpse = kpse_def; + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) { + DEBUGF_START (); + fprintf (stderr, "fsyscp_xfopen(%s [", filename); + WriteConsoleW( GetStdHandle( STD_ERROR_HANDLE ), fnamew, wcslen( fnamew ), NULL, NULL ); + fprintf (stderr, "], %s) => 0x%lx\n", mode, (unsigned long) f); + DEBUGF_END (); + } +#endif + free(fnamew); + + return f; +} + +/* + fopen by file system codepage +*/ +FILE * +fsyscp_fopen (const char *filename, const char *mode) +{ + FILE *f; + wchar_t *fnamew, modew[4]; + int i; +#if defined (KPSE_COMPAT_API) + kpathsea kpse; +#endif + assert(filename && mode); + + fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL); + for(i=0; (modew[i]=(wchar_t)mode[i]); i++) {} /* mode[i] must be ASCII */ + f = _wfopen(fnamew, modew); +#if defined (KPSE_COMPAT_API) + if (f != NULL) { + kpse = kpse_def; + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) { + DEBUGF_START (); + fprintf (stderr, "fsyscp_fopen(%s [", filename); + WriteConsoleW( GetStdHandle( STD_ERROR_HANDLE ), fnamew, wcslen( fnamew ), NULL, NULL ); + fprintf (stderr, "], %s) => 0x%lx\n", mode, (unsigned long) f); + DEBUGF_END (); + } + } +#endif + free(fnamew); + + return f; +} + +/* + popen by file system codepage +*/ +FILE * +fsyscp_popen (const char *command, const char *mode) +{ + FILE *f; + wchar_t *commandw, modew[4]; + int i; +#if defined (KPSE_COMPAT_API) + kpathsea kpse; +#endif + assert(command && mode); + + commandw = get_wstring_from_fsyscp(command, commandw=NULL); + for(i=0; (modew[i]=(wchar_t)mode[i]); i++) {} /* mode[i] must be ASCII */ + f = _wpopen(commandw, modew); +#if defined (KPSE_COMPAT_API) + if (f != NULL) { + kpse = kpse_def; + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN)) { + DEBUGF_START (); + fprintf (stderr, "fsyscp_popen(%s [", command); + WriteConsoleW( GetStdHandle( STD_ERROR_HANDLE ), commandw, wcslen( commandw ), NULL, NULL ); + fprintf (stderr, "], %s) => 0x%lx\n", mode, (unsigned long) f); + DEBUGF_END (); + } + } +#endif + free (commandw); +/* We use always binary mode on Windows */ + if(f) _setmode (fileno (f), _O_BINARY); + + return f; +} + +int +get_command_line_args_utf8 (const_string enc, int *p_ac, char ***p_av) +{ + int argc; + string *argv; + + if (!enc || !strncmp(enc,"",1)) return 0; + +#ifdef DEBUG + fprintf(stderr, "command_line_encoding (%s)\n", enc); +#endif /* DEBUG */ + if (!(strncmp(enc,"utf8",5) && strncmp(enc,"utf-8",6))) { + LPWSTR *argvw; + INT argcw, i; + string s; +#ifdef DEBUG + DWORD ret; + HANDLE hStderr; + hStderr = GetStdHandle( STD_ERROR_HANDLE ); +#endif /* DEBUG */ + file_system_codepage = CP_UTF8; + is_cp932_system = 0; + argvw = CommandLineToArgvW(GetCommandLineW(), &argcw); + argc = argcw; + argv = xmalloc(sizeof(char *)*(argcw+1)); + for (i=0; i=0) { + getc_buff[getc_len++]=(int)mbc[j--]; + } + } + return getc_buff[--getc_len]; +} + +int win32_ungetc(int c, FILE *fp) +{ + const int fd = fileno(fp); + + if (!(fd == fileno(stdin) && _isatty(fd) && file_system_codepage == CP_UTF8)) + return ungetc(c, fp); + + assert(getc_len < 4); + return getc_buff[getc_len++] = c; +} + +int win32_fputs(const char *str, FILE *fp) +{ + const int fd = fileno(fp); + HANDLE hStdout; + DWORD ret; + wchar_t *wstr; + + if (!((fd == fileno(stdout) || fd == fileno(stderr)) && _isatty(fd) + && file_system_codepage == CP_UTF8)) + return fputs(str, fp); + + hStdout = (fd == fileno(stdout)) ? + GetStdHandle(STD_OUTPUT_HANDLE) : GetStdHandle(STD_ERROR_HANDLE); + + wstr = get_wstring_from_utf8(str, wstr=NULL); + + if (WriteConsoleW(hStdout, wstr, wcslen(wstr), &ret, NULL) == 0) { + free(wstr); + return EOF; + } + + free(wstr); + return ret; +} + +int win32_puts(const char *str) +{ + if (win32_fputs(str, stdout)==EOF) { + return EOF; + } + return puts(""); +} + +int win32_putc(int c, FILE *fp) +{ + const int fd = fileno(fp); + HANDLE hStdout; + DWORD ret; + wchar_t wstr[3]; + static int len = 0; + static char buff[5], *str; + + if (!((fd == fileno(stdout) || fd == fileno(stderr)) && _isatty(fd) + && file_system_codepage == CP_UTF8)) + return putc(c, fp); + + hStdout = (fd == fileno(stdout)) ? + GetStdHandle(STD_OUTPUT_HANDLE) : GetStdHandle(STD_ERROR_HANDLE); + + c &= 0xff; + + if (c < 0x80) { + str = buff; + len = 1; + } + if (c < 0xc0) { /* ASCII or trailer */ + *str++ = c; + len--; + if (len == 0) { + *str = '\0'; + get_wstring_from_utf8(buff, wstr); + if (WriteConsoleW(hStdout, wstr, wcslen(wstr), &ret, NULL) == 0) { + len = 0; + return EOF; + } + } + else if (len < 0) return EOF; + return c; + } + else if (c < 0xc2) { len = 0; return EOF; } /* illegal */ + else if (c < 0xe0) len = 2; + else if (c < 0xf0) len = 3; + else if (c < 0xf5) len = 4; + else { len = 0; return EOF; } + + str = buff; + *str++ = c; + len--; + return c; +} diff --git a/src/texsourc/kpathsea/kpathsea/knj.h b/src/texsourc/kpathsea/kpathsea/knj.h new file mode 100644 index 0000000..d7dad8e --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/knj.h @@ -0,0 +1,62 @@ +/* knj.h: check for 2-Byte Kanji (CP 932, SJIS) codes. + + Copyright 2010, 2014 Akira Kakuto. + Copyright 2013, 2014 TANAKA Takuji. + + 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, see . */ + +#ifndef KPATHSEA_KNJ_H +#define KPATHSEA_KNJ_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern KPSEDLL int is_cp932_system; +extern KPSEDLL int file_system_codepage; + +extern KPSEDLL int isknj(int c); +extern KPSEDLL int isknj2(int c); + +extern KPSEDLL wchar_t* get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr); +extern KPSEDLL char* get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr); +extern KPSEDLL FILE* fsyscp_xfopen(const char *filename, const char *mode); +extern KPSEDLL FILE* fsyscp_fopen(const char *filename, const char *mode); +extern KPSEDLL FILE* fsyscp_popen(const char *command, const char *mode); +extern KPSEDLL int fsyscp_spawnvp(int mode, const char *command, const char* const *argv); +extern KPSEDLL int fsyscp_system(const char *cmd); +extern KPSEDLL int get_command_line_args_utf8(const char *enc, int *p_ac, char ***p_av); +extern KPSEDLL int win32_getc(FILE *fp); +extern KPSEDLL int win32_ungetc(int c, FILE *fp); +extern KPSEDLL int win32_fputs(const char *str, FILE *fp); +extern KPSEDLL int win32_puts(const char *str); +extern KPSEDLL int win32_putc(int c, FILE *fp); + +#ifdef __cplusplus +} +#endif + +/* True if P points to a 2-Byte Kanji (CP 932, SJIS) code. */ +#define IS_KANJI(p) is_cp932_system && isknj(*(p)) && isknj2(*(p+1)) + +/* Get wide string from multibyte string in UTF-8 */ +#define get_wstring_from_utf8(mb,w) get_wstring_from_mbstring(CP_UTF8,mb,w) +/* Get multibyte string in UTF-8 from wide string */ +#define get_utf8_from_wstring(w,mb) get_mbstring_from_wstring(CP_UTF8,w,mb) +/* Get wide string from multibyte string in file system codepage */ +#define get_wstring_from_fsyscp(mb,w) get_wstring_from_mbstring(file_system_codepage,mb,w) +/* Get multibyte string in file system codepage from wide string */ +#define get_fsyscp_from_wstring(w,mb) get_mbstring_from_wstring(file_system_codepage,w,mb) + +#endif /* not KPATHSEA_KNJ_H */ diff --git a/src/texsourc/kpathsea/kpathsea/kpathsea.c b/src/texsourc/kpathsea/kpathsea/kpathsea.c new file mode 100644 index 0000000..b7bf696 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/kpathsea.c @@ -0,0 +1,138 @@ +/* kpathsea.c: creating and freeing library instances + + Copyright 2009, 2012 Taco Hoekwater. + + 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, see . */ + +/* One big global struct, and a variable that points to it */ + +/* + * The code freeing the strings used in this struct is enabled/disabled + * by KPATHSEA_CAN_FREE. + */ + +#include + +kpathsea +kpathsea_new (void) +{ + kpathsea ret; + ret = xcalloc(1, sizeof(kpathsea_instance)); + return ret; +} + +#if KPATHSEA_CAN_FREE + +#define string_free(a) if ((a) != NULL) free((char *)(a)) + +static void +str_llist_free (str_llist_type p) +{ + str_llist_type q; + while (p != NULL) { + q = p->next; + free (p->str); + free (p); + p = q; + } +} + +static void +cache_free (cache_entry *the_cache, int cache_size) +{ + int f ; + for (f = 0; f < cache_size; f++) { + string_free (the_cache[f].key); + str_llist_free (the_cache[f].value[0]); + } + free (the_cache); +} +#endif /* KPATHSEA_CAN_FREE */ + +/* Sadly, quite a lot of the freeing is not safe: + it seems there are literals used all over. */ +void +kpathsea_finish (kpathsea kpse) +{ +#if KPATHSEA_CAN_FREE + int i; + kpse_format_info_type f; +#endif /* KPATHSEA_CAN_FREE */ + if (kpse==NULL) + return; +#if KPATHSEA_CAN_FREE + /* free internal stuff */ + hash_free (kpse->cnf_hash); + hash_free (kpse->db); + hash_free (kpse->alias_db); + str_list_free (&kpse->db_dir_list); + hash_free (kpse->link_table); + cache_free (kpse->the_cache, kpse->cache_length); + hash_free (kpse->map); + string_free (kpse->map_path); + string_free (kpse->elt); + /*string_free (kpse->path);*/ + if (kpse->log_file != (FILE *)NULL) + fclose(kpse->log_file); + string_free (kpse->invocation_name); + string_free (kpse->invocation_short_name); + string_free (kpse->program_name); + string_free (kpse->fallback_font); + string_free (kpse->fallback_resolutions_string); + if(kpse->fallback_resolutions != NULL) + free(kpse->fallback_resolutions); + for (i = 0; i != kpse_last_format; ++i) { + f = kpse->format_info[i]; + string_free (f.path); + string_free (f.override_path); + string_free (f.client_path); + /*string_free (f.cnf_path);*/ + } + + if (kpse->missfont != (FILE *)NULL) + fclose (kpse->missfont); + + for (i = 0; i < (int)kpse->expansion_len; i++) { + string_free (kpse->expansions[i].var); + } + free (kpse->expansions); + if (kpse->saved_env != NULL) { + for (i = 0; i != kpse->saved_count; ++i) + string_free (kpse->saved_env[i]); + free (kpse->saved_env); + } +#endif /* KPATHSEA_CAN_FREE */ +#if defined(WIN32) || defined(__CYGWIN__) + if (kpse->suffixlist != NULL) { + char **p; + for (p = kpse->suffixlist; *p; p++) + free (*p); + free (kpse->suffixlist); + kpse->suffixlist = NULL; + } +#endif /* WIN32 || __CYGWIN__ */ +#if defined (KPSE_COMPAT_API) + if (kpse == kpse_def) + return; +#endif + free (kpse); +} + + +#if defined (KPSE_COMPAT_API) + +kpathsea_instance kpse_def_inst; +kpathsea kpse_def = &kpse_def_inst; + +#endif /* KPSE_COMPAT_API */ diff --git a/src/texsourc/kpathsea/kpathsea/kpathsea.h b/src/texsourc/kpathsea/kpathsea/kpathsea.h new file mode 100644 index 0000000..20ba6c4 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/kpathsea.h @@ -0,0 +1,43 @@ +/* This is a generated file */ +/* collecting all public kpathsea headers. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/texsourc/kpathsea/kpathsea/kpsestat.c b/src/texsourc/kpathsea/kpathsea/kpsestat.c new file mode 100644 index 0000000..49d8843 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/kpsestat.c @@ -0,0 +1,126 @@ +/* kpsestat -- show file permissions of a file in octal form. + + Copyright 2008 Karl Berry. + 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 software; if not, see . */ + +#include +#include +#include +#include + +/* + * kpsestat mode x + * Print stat bits of file x on stdout, as modified by mode. + */ + +int +main (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/src/texsourc/kpathsea/kpathsea/kpsewhich.c b/src/texsourc/kpathsea/kpathsea/kpsewhich.c new file mode 100644 index 0000000..6ed6597 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/kpsewhich.c @@ -0,0 +1,779 @@ +/* kpsewhich -- standalone path lookup and variable expansion for Kpathsea. + Ideas from Thomas Esser, Pierre MacKay, and many others. + + Copyright 1995-2013 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, see . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#undef fputs +#undef puts +#define fputs win32_fputs +#define puts win32_puts +#endif + +/* For variable and path expansion. (-expand-var, -expand-path, + -show-path) */ +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; + +/* Base resolution. (-D, -dpi) */ +unsigned dpi = 600; + +/* The engine name, for '$engine' construct in texmf.cnf. (-engine) */ +string engine = NULL; + +/* Interactively ask for names to look up? (-interactive) */ +boolean interactive = false; + +/* The device name, for $MAKETEX_MODE. (-mode) */ +string mode = NULL; + +/* Search the disk as well as ls-R? (-must-exist, -mktex) */ +boolean must_exist = false; + +/* The program name, for `.PROG' construct in texmf.cnf. (-program) */ +string progname = NULL; + +/* Safe input and output names to check. (-safe-in-name and -safe-out-name) */ +string safe_in_name = NULL; +string safe_out_name = NULL; + +/* Return all matches, not just the first one? (-all) */ +boolean show_all = false; + +/* Only match files in given subdirs. (-subdir) */ +str_list_type subdir_paths; + +/* 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; + + + +/* Define one-word abbreviations for those format types which + can otherwise only be specified by strings containing spaces. */ + +typedef struct +{ + const_string abbr; + kpse_file_format_type format; +} format_abbr_type; + +static format_abbr_type format_abbrs[] + = { { "bitmapfont", kpse_any_glyph_format }, + { "mpsupport", kpse_mpsupport_format }, + { "doc", kpse_texdoc_format }, + { "source", kpse_texsource_format }, + { "trofffont", kpse_troff_font_format }, + { "dvipsconfig", kpse_dvips_config_format }, + { "web2c", kpse_web2c_format }, + { "othertext", kpse_program_text_format }, + { "otherbin", kpse_program_binary_format }, + { "miscfont", kpse_miscfonts_format }, + { "cmap", kpse_cmap_format }, + { "pdftexconfig", kpse_pdftex_config_format }, + { NULL, kpse_last_format } }; + +/* The function to look up STR in the abbr table above. + This is called only on a user-specified format string. + Return `kpse_last_format' if no match. */ + +static kpse_file_format_type +format_abbr (const_string str) +{ + kpse_file_format_type ret = kpse_last_format; + unsigned a = 0; + + while (format_abbrs[a].abbr != NULL) { + if (STREQ (str, format_abbrs[a].abbr)) { + ret = format_abbrs[a].format; + break; + } + a++; + } + + return ret; +} + + + +/* Return the substring in `.', if S has + that form. If it doesn't, return 0. */ + +static unsigned +find_dpi (string s) +{ + unsigned dpi_number = 0; + const_string extension = find_suffix (s); + + if (extension != NULL) + sscanf (extension, "%u", &dpi_number); + + return dpi_number; +} + + + +/* Return true if FTRY (the candidate suffix) matches NAME. If + IS_FILENAME is true, the check is simply that FTRY is a suffix of + NAME. If false (that is, NAME is a format), then FTRY and NAME must + be entirely equal. */ + +static boolean +try_suffix (boolean is_filename, string name, unsigned name_len, + const_string ftry) +{ + unsigned try_len; + + if (!ftry || ! *ftry) { + return false; + } + + try_len = strlen (ftry); + if (try_len > name_len) { + /* Candidate is longer than what we're looking for. */ + return false; + } + if (!is_filename && try_len < name_len) { + /* We're doing format names, not file names, and candidate is + shorter than what we're looking for. E.g., do not find `lua' + when looking for `clua'. */ + return false; + } + + if (FILESTRCASEEQ (name + name_len - try_len, ftry)) { + return true; + } + + return false; +} + + + +/* Use the file type from -format if that was previously determined + (i.e., the user_format global variable), else guess dynamically from + NAME. Return kpse_last_format if undeterminable. This function is + also used to parse the -format string, a case we distinguish via + is_filename being false. + + 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 (kpathsea kpse, string name, boolean is_filename) +{ + kpse_file_format_type ret = kpse_last_format; + + if (is_filename && user_format != kpse_last_format) { + ret = user_format; /* just return what we already computed */ + + } else if (FILESTRCASEEQ (name, "config.ps")) { + ret = kpse_dvips_config_format; + } else if (FILESTRCASEEQ (name, "fmtutil.cnf")) { + ret = kpse_web2c_format; + } else if (FILESTRCASEEQ (name, "glyphlist.txt")) { + ret = kpse_fontmap_format; + } else if (FILESTRCASEEQ (name, "mktex.cnf")) { + ret = kpse_web2c_format; + } else if (FILESTRCASEEQ (name, "pdfglyphlist.txt")) { + ret = kpse_fontmap_format; + } else if (FILESTRCASEEQ (name, "pdftex.cfg")) { + ret = kpse_pdftex_config_format; + } else if (FILESTRCASEEQ (name, "texglyphlist.txt")) { + ret = kpse_fontmap_format; + } else if (FILESTRCASEEQ (name, "texmf.cnf")) { + ret = kpse_cnf_format; + } else if (FILESTRCASEEQ (name, "updmap.cfg")) { + ret = kpse_web2c_format; + } else if (FILESTRCASEEQ (name, "XDvi")) { + ret = kpse_program_text_format; + } else { + if (!is_filename) { + /* Look for kpsewhich-specific format abbreviations. */ + ret = format_abbr (name); + } + + if (ret == kpse_last_format) { + int f = 0; /* kpse_file_format_type */ + unsigned name_len = strlen (name); + + while (f != kpse_last_format) { + const_string *ext; + const_string ftry; + boolean found = false; + + if (!kpse->format_info[f].type) + kpathsea_init_format (kpse, (kpse_file_format_type) f); + +/* Just to abbreviate this lengthy call. */ +#define TRY_SUFFIX(ftry) try_suffix (is_filename, name, name_len, (ftry)) + + if (!is_filename) { + /* Allow the long name, but only in the format options. 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; + f++; + } + ret = f; + } + } + return ret; +} + + + +/* Return newly-allocated NULL-terminated list of strings from MATCHES + that are prefixed with any of the subdirectories in SUBDIRS. That + is, for a string S in MATCHES, its dirname must end with one of the + elements in SUBDIRS. For instance, if subdir=foo/bar, that will + match a string foo/bar/baz or /some/texmf/foo/bar/baz. + + We don't reallocate the actual strings, just the list elements. + Perhaps later we will implement wildcards or // or something. */ + +static string * +subdir_match (str_list_type subdirs, string *matches) +{ + string *ret = XTALLOC1 (string); + unsigned len = 1; + unsigned e; + unsigned m; +#if defined(WIN32) + string p; + + for (e = 0; e < STR_LIST_LENGTH (subdirs); e++) { + for (p = STR_LIST_ELT (subdirs, e); *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + } +#endif + + for (m = 0; matches[m]; m++) { + unsigned loc; + string s = xstrdup (matches[m]); + for (loc = strlen (s); loc > 0 && !IS_DIR_SEP_CH (s[loc-1]); loc--) + ; + while (loc > 0 && IS_DIR_SEP_CH (s[loc-1])) { + loc--; + } + s[loc] = 0; /* wipe out basename */ + + for (e = 0; e < STR_LIST_LENGTH (subdirs); e++) { + string subdir = STR_LIST_ELT (subdirs, e); + unsigned subdir_len = strlen (subdir); + while (subdir_len > 0 && IS_DIR_SEP_CH (subdir[subdir_len-1])) { + subdir_len--; + subdir[subdir_len] = 0; /* remove trailing slashes from subdir spec */ + } + if (FILESTRCASEEQ (subdir, s + loc - subdir_len)) { + /* matched, save this one. */ + XRETALLOC (ret, len + 1, string); + ret[len-1] = matches[m]; + len++; + } + } + free (s); + } + ret[len-1] = NULL; + return ret; +} + + + +/* Look up a single filename NAME. Return 0 if success, 1 if failure. */ + +static unsigned +lookup (kpathsea kpse, string name) +{ + int i; + string ret = NULL; + string *ret_list = NULL; + + if (user_path) { + /* Translate ; to : if that's our ENV_SEP. See cnf.c. */ + if (IS_ENV_SEP (':')) { + string loc; + for (loc = user_path; *loc; loc++) { + if (*loc == ';') + *loc = ':'; + } + } + user_path = kpathsea_path_expand (kpse, user_path); + if (show_all) { + ret_list = kpathsea_all_path_search (kpse, user_path, name); + } else { + ret = kpathsea_path_search (kpse, 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 (kpse, name, true); + + switch (fmt) { + case kpse_pk_format: + case kpse_gf_format: + case kpse_any_glyph_format: + { + kpse_glyph_file_type glyph_ret; + string temp = remove_suffix (name); + /* Try to extract the resolution from the name. */ + unsigned local_dpi = find_dpi (name); + if (!local_dpi) + local_dpi = dpi; + ret = kpathsea_find_glyph (kpse, temp, + local_dpi, fmt, &glyph_ret); + if (temp != name) + free (temp); + } + break; + + case kpse_last_format: + /* If the suffix isn't recognized, assume it's a tex file. */ + fmt = kpse_tex_format; + /* fall through */ + + default: + if (show_all) { + ret_list = kpathsea_find_file_generic (kpse, name, fmt, + must_exist, true); + } else { + ret = kpathsea_find_file (kpse, name, fmt, must_exist); + } + } + } + + /* Turn single return into a null-terminated list for uniform treatment. */ + if (ret) { + ret_list = XTALLOC (2, string); + ret_list[0] = ret; + ret_list[1] = NULL; + } + + /* Filter by subdirectories, if specified. */ + if (STR_LIST_LENGTH (subdir_paths) > 0) { + string *new_list = subdir_match (subdir_paths, ret_list); + free (ret_list); + ret_list = new_list; + } + + /* Print output. */ + 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; +} + +/* Help message. */ + +#define USAGE "\n\ +Standalone path lookup and expansion for Kpathsea.\n\ +The default is to look up each FILENAME in turn and report its\n\ +first match (if any) to standard output.\n\ +\n\ +When looking up format (.fmt/.base/.mem) files, it is usually necessary\n\ +to also use -engine, or nothing will be returned; in particular,\n\ +-engine=/ will return matching format files for any engine.\n\ +\n\ +-all output all matches, one per line.\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; 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\ +-safe-in-name=STRING check if STRING is ok to open for input.\n\ +-safe-out-name=STRING check if STRING is ok to open for output.\n\ +-show-path=NAME output search path for file type NAME (list below).\n\ +-subdir=STRING only output matches whose directory ends with STRING.\n\ +-var-value=STRING output the value of variable $STRING.\n\ +-version print version number and exit.\n \ +" + +static void +help_message (kpathsea kpse, string *argv) +{ + int f; /* kpse_file_format_type */ + + printf ("Usage: %s [OPTION]... [FILENAME]...\n", argv[0]); + fputs (USAGE, stdout); + putchar ('\n'); + fputs (kpathsea_bug_address, stdout); + + /* Have to set this for init_format to work. */ + kpathsea_set_program_name (kpse, argv[0], progname); + + puts ("\nRecognized format names and their (abbreviations) and suffixes:"); + for (f = 0; f < kpse_last_format; f++) { + const_string *ext; + kpathsea_init_format (kpse, (kpse_file_format_type)f); + printf ("%s", kpse->format_info[f].type); + + /* Show abbreviation if we accept one. We repeatedly go through the + abbr list here, but it's so short, it doesn't matter. */ + { + unsigned a = 0; + while (format_abbrs[a].abbr != NULL) { + if (f == format_abbrs[a].format) { + printf (" (%s)", format_abbrs[a].abbr); + break; + } + a++; + } + } + + /* Regular suffixes. */ + putchar (':'); + for (ext = kpse->format_info[f].suffix; ext && *ext; ext++) { + putchar (' '); + fputs (*ext, stdout); + } + + if (kpse->format_info[f].alt_suffix) { + /* leave extra space between default and alt suffixes */ + putchar (' '); + } + for (ext = kpse->format_info[f].alt_suffix; ext && *ext; ext++) { + putchar (' '); + fputs (*ext, stdout); + } + + putchar ('\n'); + } + + exit (0); +} + + +/* Reading the options. */ + +/* This macro tests 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 }, + { "safe-in-name", 1, 0, 0 }, + { "safe-out-name", 1, 0, 0 }, + { "subdir", 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 (kpathsea kpse, 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")) { + kpse->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")) { + help_message (kpse, argv); + + } else if (ARGUMENT_IS ("mktex")) { + kpathsea_maketex_option (kpse, optarg, true); + must_exist = 1; /* otherwise it never gets called */ + + } else if (ARGUMENT_IS ("mode")) { + mode = optarg; + + } else if (ARGUMENT_IS ("no-mktex")) { + kpathsea_maketex_option (kpse, optarg, false); + must_exist = 0; + + } else if (ARGUMENT_IS ("path")) { + user_path = optarg; + + } else if (ARGUMENT_IS ("progname")) { + progname = optarg; + + } else if (ARGUMENT_IS ("safe-in-name")) { + safe_in_name = optarg; + + } else if (ARGUMENT_IS ("safe-out-name")) { + safe_out_name = optarg; + + } else if (ARGUMENT_IS ("show-path")) { + path_to_show = optarg; + user_format_string = optarg; + + } else if (ARGUMENT_IS ("subdir")) { + str_list_add (&subdir_paths, optarg); + + } else if (ARGUMENT_IS ("var-value")) { + var_to_value = optarg; + + } else if (ARGUMENT_IS ("version")) { + puts (kpathsea_version_string); + puts ("Copyright 2013 Karl Berry & Olaf Weber.\n\ +License LGPLv2.1+: GNU Lesser GPL version 2.1 or later \n\ +This is free software: you are free to change and redistribute it.\n\ +There is NO WARRANTY, to the extent permitted by law.\n"); + 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 + && !safe_in_name && !safe_out_name) { + fputs ("Missing argument. Try `kpsewhich --help' for more information.\n", + stderr); + exit (1); + } +} + + + +/* Initializations that may depend on the options. */ + +static void +init_more (kpathsea kpse) +{ + if (engine) + kpathsea_xputenv (kpse, "engine", engine); + + /* Disable all mktex programs unless they were explicitly enabled on our + command line. */ +#define DISABLE_MKTEX(fmt) \ +kpathsea_set_program_enabled (kpse, fmt, false, kpse_src_cmdline - 1) + DISABLE_MKTEX (kpse_pk_format); + DISABLE_MKTEX (kpse_mf_format); + DISABLE_MKTEX (kpse_tex_format); + DISABLE_MKTEX (kpse_tfm_format); + DISABLE_MKTEX (kpse_fmt_format); + DISABLE_MKTEX (kpse_ofm_format); + DISABLE_MKTEX (kpse_ocp_format); + + /* NULL for no fallback font. */ + kpathsea_init_prog (kpse, uppercasify (kpse->program_name), dpi, mode, NULL); + + /* Have to do this after setting the program name. */ + if (user_format_string) { + user_format = find_format (kpse, user_format_string, false); + if (user_format == kpse_last_format) { + WARNING1 ("kpsewhich: Ignoring unknown file type `%s'", + user_format_string); + } + } +} + + + +int +main (int argc, string *argv) +{ +#ifdef WIN32 + string *av, enc; + int ac; +#endif + unsigned unfound = 0; + kpathsea kpse = kpathsea_new(); + + /* Read options, then dependent initializations. */ + read_command_line (kpse, argc, argv); + + kpathsea_set_program_name (kpse, argv[0], progname); +#ifdef WIN32 + if(strstr(kpse->program_name,"xetex") || strstr(kpse->program_name,"xelatex") + || strstr(kpse->program_name,"uptex") || strstr(kpse->program_name,"uplatex") + || strstr(kpse->program_name,"dvipdfm") || strstr(kpse->program_name,"extractbb") + || strstr(kpse->program_name,"xbb") || strstr(kpse->program_name,"ebb") + || strstr(kpse->program_name,"dvips")) + { + enc = kpathsea_var_value (kpse, "command_line_encoding"); + if (get_command_line_args_utf8(enc, &ac, &av)) { + optind = 0; + read_command_line (kpse, ac, av); + argv = av; + argc = ac; + } + } +#endif + init_more (kpse); + + + /* Perform actions. */ + + /* Variable expansion. */ + if (var_to_expand) + puts (kpathsea_var_expand (kpse, var_to_expand)); + + /* Brace expansion. */ + if (braces_to_expand) + puts (kpathsea_brace_expand (kpse, braces_to_expand)); + + /* Path expansion. */ + if (path_to_expand) + puts (kpathsea_path_expand (kpse, 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 */ + kpathsea_init_format (kpse, user_format); + puts (kpse->format_info[user_format].path); + } else { + WARNING ("kpsewhich: Cannot show path for unknown file type"); + } + } + + /* Var to value. */ + if (var_to_value) { + const_string value = kpathsea_var_value (kpse, var_to_value); + if (!value) { + unfound++; + value = ""; + } + puts (value); + } + + if (safe_in_name) { + if (!kpathsea_in_name_ok_silent (kpse, safe_in_name)) + unfound++; + } + + if (safe_out_name) { + if (!kpathsea_out_name_ok_silent (kpse, safe_out_name)) + unfound++; + } + + /* --subdir must imply --all, since we filter here after doing the + search, rather than inside the search itself. */ + if (STR_LIST_LENGTH (subdir_paths) > 0) { + show_all = 1; + } + + /* Usual case: look up each given filename. */ + for (; optind < argc; optind++) { + unfound += lookup (kpse, argv[optind]); + } + + if (interactive) { + for (;;) { + string name = read_line (stdin); + if (!name || STREQ (name, "q") || STREQ (name, "quit")) + break; + unfound += lookup (kpse, name); + free (name); + } + } + + kpathsea_finish (kpse); + return unfound > 255 ? 1 : unfound; +} diff --git a/src/texsourc/kpathsea/kpathsea/lib.h b/src/texsourc/kpathsea/kpathsea/lib.h new file mode 100644 index 0000000..2aac251 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/lib.h @@ -0,0 +1,232 @@ +/* lib.h: declarations for common, low-level routines in kpathsea. + + Copyright 1992, 1993, 1994, 1995, 1996, 2008, 2009, 2010, 2011, + 2012 Karl Berry. + Copyright 1999, 2000, 2003, 2005 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, see . */ + +#ifndef KPATHSEA_LIB_H +#define KPATHSEA_LIB_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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). */ + +#if defined (KPSE_COMPAT_API) +/* This branch works as expected also in programs that use the new interface, + because kpathsea_set_program_name() sets up the kpse_def->invocation_name + whenever it is available. +*/ +#define FATAL_PERROR(str) do { \ + fprintf (stderr, "%s: ", kpse_def->invocation_name); \ + perror (str); exit (EXIT_FAILURE); } while (0) +#else +/* If there is no global variable available, just output the error */ +#define FATAL_PERROR(str) do { \ + perror (str); exit (EXIT_FAILURE); } while (0) +#endif + +#if defined (KPSE_COMPAT_API) +#define START_FATAL() do { \ + fprintf (stderr, "%s: fatal: ", kpse_def->invocation_name); +#else +#define START_FATAL() do { \ + fprintf (stderr, "fatal: "); +#endif + +#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 () + +#define LIB_START_FATAL() do { \ + fprintf (stderr, "%s: fatal: ", kpse->invocation_name); + +#define LIB_FATAL(str) \ + LIB_START_FATAL (); fputs (str, stderr); END_FATAL () +#define LIB_FATAL1(str, e1) \ + LIB_START_FATAL (); fprintf (stderr, str, e1); END_FATAL () +#define LIB_FATAL2(str, e1, e2) \ + LIB_START_FATAL (); fprintf (stderr, str, e1, e2); END_FATAL () + + +/* I find this easier to read. */ +#define STREQ(s1, s2) (((s1) != NULL) && ((s2) != NULL) && (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 (const_string s1, const_string s2); +extern KPSEDLL string concat3 (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 (const_string s); + +/* Convert all lowercase characters in S to uppercase. */ +extern KPSEDLL string uppercasify (const_string s); + +/* Like `atoi', but disallow negative numbers. */ +extern KPSEDLL unsigned atou (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 (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 (const_string name); + +/* Return directory part of NAME. This returns a new string. */ +extern KPSEDLL string xdirname (const_string name); + +#if !HAVE_DECL_STRSTR +extern string strstr (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 const_string find_suffix (const_string name); + +/* Return NAME with any suffix removed. */ +extern KPSEDLL string remove_suffix (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 (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 (string stem_prefix, string name); + +/* If NAME has a suffix, simply return it; otherwise, return + `NAME.SUFFIX'. */ +extern KPSEDLL const_string extend_filename (const_string name, + const_string suffix); + +/* Call putenv with the string `VAR=VALUE' and abort on error. */ +extern KPSEDLL void kpathsea_xputenv (kpathsea kpse, const_string var, + const_string value); +extern KPSEDLL void kpathsea_xputenv_int (kpathsea kpse, const_string var, + int value); +#if defined (KPSE_COMPAT_API) +extern KPSEDLL void xputenv (const_string var, const_string value); +extern KPSEDLL void xputenv_int (const_string var, int value); +#endif + +/* Return the current working directory. */ +extern KPSEDLL string xgetcwd (void); + +/* Returns true if FN is a directory or a symlink to a directory. */ +extern KPSEDLL boolean kpathsea_dir_p (kpathsea kpse, string fn); +#if defined (KPSE_COMPAT_API) +extern KPSEDLL boolean dir_p (string fn); +#endif + +/* If FN is a readable directory, return the number of links it has. + Otherwise, return -1. The nlinks parameter is a dummy on UNIX. */ +#if defined (KPSE_COMPAT_API) +extern KPSEDLL int dir_links (const_string fn, long nlinks); +#endif +extern KPSEDLL int kpathsea_dir_links (kpathsea kpse, 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 (const_string filename, const_string mode); +extern KPSEDLL void xfclose (FILE *fp, const_string filename); +extern KPSEDLL void xfseek (FILE *fp, long offset, int wherefrom, const_string filename); +extern KPSEDLL void xfseeko (FILE *fp, off_t offset, int wherefrom, const_string filename); +extern KPSEDLL long xftell (FILE *fp, const_string filename); +extern KPSEDLL off_t xftello (FILE *fp, const_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 (size_t size); +extern KPSEDLL address xrealloc (address old_address, size_t new_size); +extern KPSEDLL address xcalloc (size_t nelem, size_t 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))) + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_LIB_H */ diff --git a/src/texsourc/kpathsea/kpathsea/line.c b/src/texsourc/kpathsea/kpathsea/line.c new file mode 100644 index 0000000..b221a40 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/line.c @@ -0,0 +1,72 @@ +/* line.c: return the next line from a file, or NULL. + + Copyright 1992, 1993, 1995, 1996, 2008, 2013 Karl Berry. + Copyright 1998, 1999, 2001, 2005 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, see . */ + +#include +#include +#ifdef WIN32 +#undef getc +#undef ungetc +#define getc win32_getc +#define ungetc win32_ungetc +#endif + +/* Allocate in increments of this size. */ +#define BLOCK_SIZE 75 + +char * +read_line (FILE *f) +{ + int c; + unsigned limit = BLOCK_SIZE; + unsigned loc = 0; + char *line = 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 = xrealloc (line, limit); + } + } + + /* If we read anything, return it, even a partial last-line-if-file + which is not properly terminated. */ + if (loc == 0 && c == EOF) { + /* At end of file. */ + free (line); + line = NULL; + } else { + /* Terminate the string. We can't represent nulls in the file, + but this doesn't matter. */ + line[loc] = 0; + /* Absorb LF of a CRLF pair. */ + if (c == '\r') { + c = getc (f); + if (c != '\n') { + ungetc (c, f); + } + } + } + + return line; +} diff --git a/src/texsourc/kpathsea/kpathsea/line.h b/src/texsourc/kpathsea/kpathsea/line.h new file mode 100644 index 0000000..9c98ce9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/line.h @@ -0,0 +1,39 @@ +/* line.h: read an arbitrary-length input line. + + Copyright 1992, 1993, 2008 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef LINE_H +#define LINE_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 (FILE *f); + +#ifdef __cplusplus +} +#endif + +#endif /* not LINE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/magstep.c b/src/texsourc/kpathsea/kpathsea/magstep.c new file mode 100644 index 0000000..95a16ba --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/magstep.c @@ -0,0 +1,112 @@ +/* magstep.c: fix up fixed-point vs. floating-point. + + Copyright 1994, 1995, 2008 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#include + +#include + +/* 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 (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 +kpathsea_magstep_fix (kpathsea kpse, 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? */ + (void)kpse; /* currenty not used */ + + 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; +} + +#if defined (KPSE_COMPAT_API) +unsigned +kpse_magstep_fix (unsigned dpi, unsigned bdpi, int *m_ret) +{ + return kpathsea_magstep_fix(kpse_def, dpi, bdpi, m_ret); +} +#endif + diff --git a/src/texsourc/kpathsea/kpathsea/magstep.h b/src/texsourc/kpathsea/kpathsea/magstep.h new file mode 100644 index 0000000..eae08f6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/magstep.h @@ -0,0 +1,59 @@ +/* magstep.h: declaration for magstep fixing. + + Copyright 1994, 2008, 2009 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_MAGSTEP_H +#define KPATHSEA_MAGSTEP_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 kpathsea_magstep_fix (kpathsea kpse, unsigned dpi, + unsigned bdpi, int *m_ret); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL unsigned kpse_magstep_fix (unsigned dpi, unsigned bdpi, + int *m_ret); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_MAGSTEP_H */ diff --git a/src/texsourc/kpathsea/kpathsea/make-suffix.c b/src/texsourc/kpathsea/kpathsea/make-suffix.c new file mode 100644 index 0000000..9264aae --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/make-suffix.c @@ -0,0 +1,68 @@ +/* make-suffix.c: unconditionally add a filename suffix. + + Copyright 1992, 1993, 1995, 2008, 2011 Karl Berry. + Copyright 2001, 2005 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, see . */ + +#include +#include + +/* Return a new string: S suffixed with SUFFIX, regardless of what it + was before. This returns a newly allocated string. */ + +string +make_suffix (const_string s, const_string suffix) +{ + string new_s; + const_string dot_pos = strrchr (s, '.'); + const_string p; +#if defined(WIN32) + string q; +#endif + + if (dot_pos) + for (p = dot_pos + 1; *p; p++) { + if (IS_DIR_SEP (*p)) { + dot_pos = NULL; + break; + } +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif + } + + if (dot_pos == NULL) + 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, past_dot_index); + strcpy (new_s + past_dot_index, suffix); + } + +#if defined(WIN32) + for (q = new_s; *q; q++) { + if (*q == '\\') + *q = '/'; + else if (IS_KANJI(q)) + q++; + } +#endif + + return new_s; +} diff --git a/src/texsourc/kpathsea/kpathsea/man/Makefile.am b/src/texsourc/kpathsea/kpathsea/man/Makefile.am new file mode 100644 index 0000000..ea9e6fe --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/Makefile.am @@ -0,0 +1,31 @@ +## Makefile.am for the TeX Live subdirectory texk/kpathsea/man/ +## +## Copyright (C) 2009-2013 Peter Breitenlohner +## You may freely use, modify and/or distribute this file. +## +man_sources = \ + kpseaccess.man \ + kpsereadlink.man \ + kpsestat.man \ + kpsewhich.man \ + mktexlsr.man \ + mktexmf.man \ + mktexpk.man \ + mktextfm.man + +EXTRA_DIST = $(man_sources) + +KPATHSEA_PATHS_H = ${top_builddir}/.. + +include $(top_srcdir)/../../am/man.am + +# Symlinks within $(man1dir): FILE:LINK indicates LINK.1->FILE.1 +man1_links = \ + mktexlsr:texhash + +include $(top_srcdir)/../../am/man1_links.am + +install-data-hook: install-man1-links + +uninstall-hook: uninstall-man1-links + diff --git a/src/texsourc/kpathsea/kpathsea/man/Makefile.in b/src/texsourc/kpathsea/kpathsea/man/Makefile.in new file mode 100644 index 0000000..6f8e270 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/Makefile.in @@ -0,0 +1,598 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(top_srcdir)/../../am/man.am \ + $(top_srcdir)/../../am/man1_links.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am +subdir = man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-lib-version.m4 \ + $(top_srcdir)/../../m4/kpse-mktex.m4 \ + $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 \ + $(top_srcdir)/../../m4/libtool.m4 \ + $(top_srcdir)/../../m4/ltoptions.m4 \ + $(top_srcdir)/../../m4/ltsugar.m4 \ + $(top_srcdir)/../../m4/ltversion.m4 \ + $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \ + $(top_srcdir)/../../version.ac $(top_srcdir)/ac/mktex.ac \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/c-auto.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(nodist_man1_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KPSEVERSION = @KPSEVERSION@ +KPSE_LT_VERSINFO = @KPSE_LT_VERSINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_OBJDIR = @LT_OBJDIR@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WEB2CVERSION = @WEB2CVERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +man_sources = \ + kpseaccess.man \ + kpsereadlink.man \ + kpsestat.man \ + kpsewhich.man \ + mktexlsr.man \ + mktexmf.man \ + mktexpk.man \ + mktextfm.man + +EXTRA_DIST = $(man_sources) +KPATHSEA_PATHS_H = ${top_builddir}/.. +SUFFIXES = .1 .man .ps .dvi +man_files = $(man_sources:.man=.1) +nodist_man1_MANS = $(man_files) +DITROFF = groff +DVIS = $(man_files:.1=.dvi) +PSS = $(man_files:.1=.ps) +DISTCLEANFILES = sedscript $(man_files) $(DVIS) $(PSS) + +# Symlinks within $(man1dir): FILE:LINK indicates LINK.1->FILE.1 +man1_links = \ + mktexlsr:texhash + +all: all-am + +.SUFFIXES: +.SUFFIXES: .1 .man .ps .dvi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/../../am/man.am $(top_srcdir)/../../am/man1_links.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/../../am/man.am $(top_srcdir)/../../am/man1_links.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(nodist_man1_MANS) + @$(NORMAL_INSTALL) + @list1='$(nodist_man1_MANS)'; \ + list2=''; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(nodist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man1 + +.MAKE: install-am install-data-am install-strip uninstall-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man1 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-hook uninstall-man uninstall-man1 + + +.man.1: + $(AM_V_GEN)sed -f sedscript $< >$@ +$(man_files): sedscript + +# At present, all but VERSION should be unused. +sedscript: $(KPATHSEA_PATHS_H)/kpathsea/paths.h + $(AM_V_GEN)( \ + sed -n -e '/^#define/s/#define[ ][ ]*\([A-Z_a-z][A-Z_a-z]*\)[ ][ ]*\(.*\)/s%@\1@%\2%/p' \ + $(KPATHSEA_PATHS_H)/kpathsea/paths.h \ + | sed -e 's/"//g' -e 's/[ ]*\/\*[^*]*\*\///g'; \ + echo 's%@VER''SION@%$(VERSION)%'; \ + echo 's%@BINDIR@%$(bindir)%'; \ + echo 's%@INFODIR@%$(infodir)%'; \ + echo 's%@TEXINPUTDIR@%$(texinputdir)%'; \ + echo 's%@MFINPUTDIR@%$(mfinputdir)%'; \ + echo 's%@MPINPUTDIR@%$(mpinputdir)%'; \ + echo 's%@FONTDIR@%$(fontdir)%'; \ + echo 's%@FMTDIR@%$(fmtdir)%'; \ + echo 's%@BASEDIR@%$(basedir)%'; \ + echo 's%@MEMDIR@%$(memdir)%'; \ + echo 's%@TEXPOOLDIR@%$(texpooldir)%'; \ + echo 's%@MFPOOLDIR@%$(mfpooldir)%'; \ + echo 's%@MPPOOLDIR@%$(mppooldir)%'; \ + echo 's%@FONTMAPDIR@%$(dvipsdir)%'; \ + echo 's%@LOCALMODES@%$(localmodes)%') >sedscript + +.1.dvi: + $(DITROFF) -Tdvi -man $< >$@ + +.1.ps: + $(DITROFF) -Tps -man $< >$@ +.PHONY: install-man1-links uninstall-man1-links + +install-man1-links: + @cd $(DESTDIR)$(man1dir) && \ + for s in $(man1_links); do \ + link=`echo $$s | sed 's,.*:,,'`; \ + file=`echo $$s | sed 's,:.*,,'`; \ + rm -f $$link.1; \ + echo "creating link '$$link.1' -> '$$file.1'"; \ + echo ".so man1/$$file.1" >$$link.1; \ + done + +uninstall-man1-links: + @for s in $(man1_links); do \ + link=`echo $$s | sed 's,.*:,,'`; \ + rm -f $(DESTDIR)$(man1dir)/$$link.1; \ + done + +install-data-hook: install-man1-links + +uninstall-hook: uninstall-man1-links + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/texsourc/kpathsea/kpathsea/man/kpseaccess.man b/src/texsourc/kpathsea/kpathsea/man/kpseaccess.man new file mode 100644 index 0000000..e9b3035 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/kpseaccess.man @@ -0,0 +1,66 @@ +.TH KPSEACCESS 1 "1 March 2011" "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 mode +.I file +.\"===================================================================== +.SH DESCRIPTION +Exit successfully if +.I file +can be accessed with the specified +.IR mode . +The +.I mode +is an optional dash +.RB (` \- ') +followed by zero or more letters of +.BR rwx , +where +.B r +is for readable, +.B w +is for writable, and +.B 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 options: +.TP +.B --help +Print help message and exit. +.TP +.B --version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR access (2) diff --git a/src/texsourc/kpathsea/kpathsea/man/kpsereadlink.man b/src/texsourc/kpathsea/kpathsea/man/kpsereadlink.man new file mode 100644 index 0000000..343451a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/kpsereadlink.man @@ -0,0 +1,30 @@ +.TH KPSEREADLINK 1 "1 March 2011" "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 options: +.TP +.B --help +Print help message and exit. +.TP +.B --version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR readlink (2) diff --git a/src/texsourc/kpathsea/kpathsea/man/kpsestat.man b/src/texsourc/kpathsea/kpathsea/man/kpsestat.man new file mode 100644 index 0000000..f5a92b7 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/kpsestat.man @@ -0,0 +1,51 @@ +.TH KPSESTAT 1 "1 March 2011" "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 +.B = +as the mode to obtain the unchanged permissions. +.\"===================================================================== +.SH OPTIONS +.B kpsestat +accepts the following options: +.TP +.B --help +Print help message and exit. +.TP +.B --version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR chmod (1). diff --git a/src/texsourc/kpathsea/kpathsea/man/kpsewhich.man b/src/texsourc/kpathsea/kpathsea/man/kpsewhich.man new file mode 100644 index 0000000..7703986 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/kpsewhich.man @@ -0,0 +1,144 @@ +.TH KPSEWHICH 1 "1 March 2011" "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 +Set debugging flags. +.TP +.BI -D \ num +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 +Set +.I $engine +in the environment, which is used in some search paths. +.TP +.BI -expand-braces \ string +Print variable and brace expansion of +.IR string . +.TP +.BI -expand-path \ string +Print complete path expansion of +.IR string . +.TP +.BI -expand-var \ string +Print variable expansion of +.IR string . +.TP +.BI -format \ name +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 +Print help message and exit. +.TP +.B -interactive +Ask for additional filenames to look up. +.TP +.BI -mktex \ fmt +enable +.RI mktex fmt +generation. +.RI ( fmt =pk/mf/tex/tfm) +.TP +.BI -mode \ string +Set device name for +.I $MAKETEX_MODE +to +.IR string ; +no default. +.TP +.B -must-exist +Search the disk as well as ls-R if necessary. +.TP +.BI -no-mktex \ fmt +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 +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 +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 +Print the expansion of +.IR variable . +.TP +.B -version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR mktexlsr (1), +.BR mktexmf (1), +.BR mktexpk (1), +.BR mktextfm (1). diff --git a/src/texsourc/kpathsea/kpathsea/man/mktexlsr.man b/src/texsourc/kpathsea/kpathsea/man/mktexlsr.man new file mode 100644 index 0000000..d314b5c --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/mktexlsr.man @@ -0,0 +1,44 @@ +.TH MKTEXLSR 1 "1 March 2011" "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 +Print help message and exit. +.TP +.B --version +Print version information and exit. diff --git a/src/texsourc/kpathsea/kpathsea/man/mktexmf.man b/src/texsourc/kpathsea/kpathsea/man/mktexmf.man new file mode 100644 index 0000000..c6857fe --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/mktexmf.man @@ -0,0 +1,57 @@ +.TH MKTEXMF 1 "1 March 2011" "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 +Print help message and exit. +.TP +.B --version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR mktexpk (1), +.BR mktextfm (1). diff --git a/src/texsourc/kpathsea/kpathsea/man/mktexpk.man b/src/texsourc/kpathsea/kpathsea/man/mktexpk.man new file mode 100644 index 0000000..677aaf6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/mktexpk.man @@ -0,0 +1,115 @@ +.TH MKTEXPK 1 "1 March 2011" "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 +.BI >& 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. +.TP +.BI --dpi \ num +Generate the font at resolution +.IR num . +.TP +.B --help +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. +.TP +.BI --mfmode \ mode +The \*(MF mode to use. +.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. +.TP +.B --version +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/src/texsourc/kpathsea/kpathsea/man/mktextfm.man b/src/texsourc/kpathsea/kpathsea/man/mktextfm.man new file mode 100644 index 0000000..38c0688 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/man/mktextfm.man @@ -0,0 +1,65 @@ +.TH MKTEXTFM 1 "1 March 2011" "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 +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 +Print help message and exit. +.TP +.B --version +Print version information and exit. +.\"===================================================================== +.SH "SEE ALSO" +.BR mktexmf (1), +.BR mktexpk (1). diff --git a/src/texsourc/kpathsea/kpathsea/mingw32.c b/src/texsourc/kpathsea/kpathsea/mingw32.c new file mode 100644 index 0000000..f6f7371 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mingw32.c @@ -0,0 +1,438 @@ +/* mingw32.c: bits and pieces for mingw32 + + Copyright 2009-2013 Taco Hoekwater . + + 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, see . +*/ + +/* Original sources lifted from the distribution of XEmacs for Windows NT, + Copyright 1994-1996 Free Software Foundation, later adapted to + fpTeX 0.4 (2000) by Fabrice Popineau , + then simplified and re-adapted to TeXLive (2009) by Taco Hoekwater + . +*/ + +#ifdef __MINGW32__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Emulate getpwuid, getpwnam and others. */ + +typedef HWND (WINAPI *pGetDesktopWindow)(void); + +typedef HRESULT (WINAPI * pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL); + +extern int __cdecl _set_osfhnd (int fd, long h); +extern int __cdecl _free_osfhnd (int fd); + +static char *get_home_directory (void); +static int _parse_root (char * name, char ** pPath); + +void +init_user_info (void) +{ + /* Ensure HOME and SHELL are defined. */ + char *home = get_home_directory(); + if (home) { + putenv(concat("HOME=", home)); + } + else { + putenv ("HOME=c:/"); + } + if (getenv ("SHELL") == NULL) + putenv ((GetVersion () & 0x80000000) ? "SHELL=command" : "SHELL=cmd"); + + { + /* Win2K problem : we need a specific TEMP directory with + full access rights so that any user building a format file + or a font file will build it with full access rights. The installer + takes care of defining TEXMFTEMP=$SELFAUTOPARENT/tmp in the environment. + If it is defined, then use it as the TEMP and TMP variables. + */ + char *p; + if ((p = getenv("TEXMFTEMP")) != NULL) { + putenv(concat("TEMP=", p)); + putenv(concat("TMP=", p)); + } + } +} + +/* Returns the home directory, in external format */ +static char * +get_home_directory (void) +{ + char *found_home_directory = NULL; + + if ((found_home_directory = getenv("HOME")) != NULL) { + char q[MAXPATHLEN]; + /* In case it is %HOMEDRIVE%%HOMEPATH% */ + if (ExpandEnvironmentStrings(found_home_directory, q, sizeof(q)) == 0) { + /* Error */ + found_home_directory = NULL; + } + else { + found_home_directory = xstrdup(q); + goto done; + } + } + + { + char *homedrive, *homepath; + if ((homedrive = getenv("HOMEDRIVE")) != NULL && + (homepath = getenv("HOMEPATH")) != NULL) { + found_home_directory = concat(homedrive, homepath); + goto done; + } + } + + /* This method is the prefered one because even if it requires a more recent shell32.dll, + it does not need to call SHMalloc()->Free() */ + { + /* This will probably give the wrong value */ + char q [MAXPATHLEN]; + HINSTANCE h; + pSHGetSpecialFolderPathA p1; + pGetDesktopWindow p2; + HWND hwnd = NULL; + + if ((h = LoadLibrary("user32.dll"))) { + if ((p2 = (pGetDesktopWindow)GetProcAddress(h, "GetDesktopWindow"))) + hwnd = (*p2)(); + FreeLibrary(h); + } + + if (hwnd && (h = LoadLibrary("shell32.dll"))) { + if ((p1 = (pSHGetSpecialFolderPathA)GetProcAddress(h, "SHGetSpecialFolderPathA"))) + if ((*p1)(hwnd, q, CSIDL_PERSONAL, TRUE)) { + found_home_directory = xstrdup(q); + } + FreeLibrary(h); + } + if (found_home_directory) goto done; + } + + if (1) { + fprintf(stderr, "kpathsea has been unable to determine a good value for the user's $HOME\n" + " directory, and will be using the value:\n" + " %s\n" + " This is probably incorrect.\n", + found_home_directory + ); + } + done: + return found_home_directory; +} + + +/* Consider cached volume information to be stale if older than 10s, + at least for non-local drives. Info for fixed drives is never stale. */ +#define DRIVE_INDEX( c ) ( (c) <= 'Z' ? (c) - 'A' : (c) - 'a' ) +#define VOLINFO_STILL_VALID( root_dir, info ) \ + ( ( isalpha (root_dir[0]) ) \ + || GetTickCount () - info->timestamp < 10000 ) + + +/* Normalize filename by converting all path separators to + the specified separator. Also conditionally convert upper + case path name components to lower case. + Returns the index of the first meaningful char in the path + past any drive specifier of unc name specifier. + Remove any multiple path separators after a leading + drive specifier or double path separator. +*/ + +static int +normalize_filename (char *fp, char path_sep) +{ + char *p; + int ret, i; + + /* Always lower-case drive letters a-z, even if the filesystem + preserves case in filenames. + This is so filenames can be compared by string comparison + functions that are case-sensitive. Even case-preserving filesystems + do not distinguish case in drive letters. */ + if (fp[1] == ':' && *fp >= 'A' && *fp <= 'Z') { + *fp += 'a' - 'A'; + } + + /* Remove unneeded double slashes */ + ret = (IS_UNC_NAME(fp) ? 2 : + NAME_BEGINS_WITH_DEVICE(fp) ? + (IS_DIR_SEP(*(fp+2)) ? 3 : 2) : IS_DIR_SEP(*fp) ? 1 : 0); + for (i = ret, p = fp+i; + IS_DIR_SEP(*p); + i++, p++); + if (i > ret) { + int len = strlen(fp+i); + /* remove unneeded slashes, for the sake of win95 */ +#if 0 + fprintf(stderr, "moving %s to %s\n", fp+ret, fp+i); +#endif + memmove (fp+ret, fp+i, len+1); + } + + /* conditionnally rewrite to same path_sep, slash preferably */ + if (path_sep) { + for (p = fp; *p; p++) + if (IS_DIR_SEP(*p)) + *p = path_sep; + } + +#if 0 + fprintf(stderr, "normalize_filename returned (%d) %s\n", ret, fp); +#endif + + return ret; +} + + +/* Destructively turn backslashes into slashes. */ +#if 0 /* unused */ +static void +dostounix_filename (char *p) +{ + normalize_filename (p, '/'); +} +#endif + +/* Destructively turn slashes into backslashes. */ +static void +unixtodos_filename (char *p) +{ + normalize_filename (p, '\\'); +} + +/* Remove all CR's that are followed by a LF. + (From msdos.c...probably should figure out a way to share it, + although this code isn't going to ever change.) */ +#if 0 /* unused */ +static int +crlf_to_lf (int n, unsigned char *buf, unsigned *lf_count) +{ + unsigned char *np = buf; + unsigned char *startp = buf; + unsigned char *endp = buf + n; + + if (n == 0) + return n; + while (buf < endp - 1) + { + if (*buf == 0x0a) + (*lf_count)++; + if (*buf == 0x0d) + { + if (*(++buf) != 0x0a) + *np++ = 0x0d; + } + else + *np++ = *buf++; + } + if (buf < endp) + { + if (*buf == 0x0a) + (*lf_count)++; + *np++ = *buf++; + } + return np - startp; +} +#endif + +/* Parse the root part of file name, if present. Return length and + optionally store pointer to char after root. */ +static int +_parse_root (char * name, char ** pPath) +{ + char * start = name; + + if (name == NULL) + return 0; + + /* find the root name of the volume if given */ + if (isalpha (name[0]) && name[1] == ':') + { + /* skip past drive specifier */ + name += 2; + if (IS_DIR_SEP (name[0])) + name++; + } + else if (IS_DIR_SEP (name[0]) && IS_DIR_SEP (name[1])) + { + int slashes = 2; + name += 2; + do + { + if (IS_DIR_SEP (*name) && --slashes == 0) + break; + name++; + } + while ( *name ); + if (IS_DIR_SEP (name[0])) + name++; + } + + if (pPath) + *pPath = name; + + return name - start; +} + +/* Get long base name for name; name is assumed to be absolute. */ +static int +get_long_basename (char * name, char * buf, int size) +{ + WIN32_FIND_DATA find_data; + HANDLE dir_handle; + int len = 0; +#ifdef PIGSFLY + char *p; + + /* If the last component of NAME has a wildcard character, + return it as the basename. */ + p = name + strlen (name); + while (*p != '\\' && *p != ':' && p > name) p--; + if (p > name) p++; + if (strchr (p, '*') || strchr (p, '?')) + { + if ((len = strlen (p)) < size) + memcpy (buf, p, len + 1); + else + len = 0; + return len; + } +#endif + + dir_handle = FindFirstFile (name, &find_data); + if (dir_handle != INVALID_HANDLE_VALUE) + { + if ((len = strlen (find_data.cFileName)) < size) + memcpy (buf, find_data.cFileName, len + 1); + else + len = 0; + FindClose (dir_handle); + } + return len; +} + +/* Get long name for file, if possible (assumed to be absolute). */ +BOOL +win32_get_long_filename (char * name, char * buf, int size) +{ + char * o = buf; + char * p; + char * q; + char full[ MAX_PATH ]; + int len; + + len = strlen (name); + if (len >= MAX_PATH) + return FALSE; + + /* Use local copy for destructive modification. */ + memcpy (full, name, len+1); + unixtodos_filename (full); + + /* Copy root part verbatim. */ + len = _parse_root (full, &p); + memcpy (o, full, len); + o += len; + size -= len; + + do + { + q = p; + p = strchr (q, '\\'); + if (p) *p = '\0'; + len = get_long_basename (full, o, size); + if (len > 0) + { + o += len; + size -= len; + if (p != NULL) + { + *p++ = '\\'; + if (size < 2) + return FALSE; + *o++ = '\\'; + size--; + *o = '\0'; + } + } + else + return FALSE; + } + while (p != NULL && *p); + + return TRUE; +} + +/* special TeXLive Ghostscript */ + +static int is_dir (char *buff) +{ + struct stat stats; + + return stat (buff, &stats) == 0 && S_ISDIR (stats.st_mode); +} + +/* + TeXlive uses its own gs in + $SELFAUTOPARENT/tlpkg/tlgs +*/ +void texlive_gs_init(void) +{ + char *nptr, *path; + char tlgsbindir[512]; + char tlgslibdir[512]; + nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); + if (nptr == NULL || !strcmp(nptr, "0") || !strcmp(nptr, "n") || !strcmp(nptr, "f")) { + if (nptr) + free (nptr); + nptr = kpse_var_value("SELFAUTOPARENT"); + if (nptr) { + strcpy(tlgsbindir, nptr); + strcat(tlgsbindir,"/tlpkg/tlgs"); + if(is_dir(tlgsbindir)) { + strcpy(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/lib;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + strcat(tlgsbindir, "/bin;"); + free(nptr); + for(nptr = tlgsbindir; *nptr; nptr++) { + if(*nptr == '/') *nptr = '\\'; + } + nptr = getenv("PATH"); + path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); + strcpy(path, tlgsbindir); + strcat(path, nptr); + xputenv("PATH", path); + xputenv("GS_LIB", tlgslibdir); + } + } + } else { + free (nptr); + } +} + +#endif /* __MINGW32__ */ diff --git a/src/texsourc/kpathsea/kpathsea/mingw32.h b/src/texsourc/kpathsea/kpathsea/mingw32.h new file mode 100644 index 0000000..358ae60 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mingw32.h @@ -0,0 +1,85 @@ +/* mingw32.h: declarations for mingw32. + + Copyright 2009-2012 Taco Hoekwater . + + 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, see . */ + +#ifndef _MINGW32_H_ +#define _MINGW32_H_ + +#include +/* The embedded rndnpc.h defines boolean as 'unsigned char', + and we do not want that. + This should be safe as long as we don't use npc ourselves. */ +#define boolean saved_boolean +#include +#include +#include +#undef boolean +#include +#include +#include +#include + +/* sys/types.h defines off_t as `long' and we do not want that. + We need to include unistd.h and sys/stat.h using off_t + before defining off_t (no need to include wchar.h). */ +#include +#include +#define off_t off64_t +#define ftello ftello64 +#define fseeko fseeko64 + +#ifndef MAXPATHLEN +#define MAXPATHLEN _MAX_PATH +#endif + +#ifndef MAX_PIPES +#define MAX_PIPES 128 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +extern void init_user_info (void); +extern BOOL look_for_cmd (const char *, char **); +extern char *quote_args(char **); + +#endif /* MAKE_KPSE_DLL */ + +extern KPSEDLL BOOL win32_get_long_filename (char *, char *, int); +extern KPSEDLL void texlive_gs_init(void); + +static inline FILE * +win32_popen (const char *command, const char *fmode) +{ + char mode[3]; + + /* We always use binary mode */ + mode[0] = fmode[0]; + mode[1] = 'b'; + mode[2] = '\0'; + + return _popen (command, mode); +} +#define popen(cmd, mode) win32_popen(cmd, mode) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/texsourc/kpathsea/kpathsea/mktex.cnf b/src/texsourc/kpathsea/kpathsea/mktex.cnf new file mode 100644 index 0000000..1642187 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktex.cnf @@ -0,0 +1,18 @@ +# $Id: mktex.cnf 12069 2009-02-04 00:09:54Z karl $ +# Public domain. +# +# 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 (and other possible future) +# implementations of the scripts do not handle anything beyond simple +# assignment of variables, and so doing more is not 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 use the mktex.cnf file for: +# : ${MT_FEATURES=appendonlydir:varfonts} +# : ${MODE=ljfour} +# : ${BDPI=600} +# : ${ps_to_pk=gsftopk} diff --git a/src/texsourc/kpathsea/kpathsea/mktex.opt b/src/texsourc/kpathsea/kpathsea/mktex.opt new file mode 100644 index 0000000..bd5d0fb --- /dev/null +++ b/src/texsourc/kpathsea/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. +# +# Originally written by Thomas Esser. Public domain. +# $Id: mktex.opt 18383 2010-05-20 18:31:24Z karl $ + +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/src/texsourc/kpathsea/kpathsea/mktexdir b/src/texsourc/kpathsea/kpathsea/mktexdir new file mode 100644 index 0000000..e9c2100 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexdir @@ -0,0 +1,54 @@ +#!/bin/sh +# mkinstalldirs (now mktexdir) -- make directory hierarchy. +# Author: Noah Friedman , created: 1993-05-16. +# Public domain. +# +# Modified for sticky directory creation, --help, --version, more, +# by Thomas Esser, Karl Berry, Olaf Weber, et al. + +version='$Id: mktexdir 18383 2010-05-20 18:31:24Z karl $' +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/src/texsourc/kpathsea/kpathsea/mktexdir.opt b/src/texsourc/kpathsea/kpathsea/mktexdir.opt new file mode 100644 index 0000000..4d4345d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexdir.opt @@ -0,0 +1,11 @@ +# mktexdir.opt to determine various manipulations of the filenames. +# Sourced from mktexdir. +# +# Originally written by Thomas Esser. +# Public domain. +# $Id: mktexdir.opt 16497 2009-12-24 18:38:47Z karl $ + +# Set append-only bit on created directories. +case "$MT_FEATURES" in + *appendonlydir*) MT_APPEND_MASK=+t;; +esac diff --git a/src/texsourc/kpathsea/kpathsea/mktexlsr b/src/texsourc/kpathsea/kpathsea/mktexlsr new file mode 100644 index 0000000..abb5d05 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexlsr @@ -0,0 +1,218 @@ +#!/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/texlive/bin/mktexlsr +# +# Originally written as `texhash' by Thomas Esser +# , Okt., 1994. +# Public domain. + +version='$Id: mktexlsr 31723 2013-09-21 22:43:41Z karl $' +progname=`echo $0 | sed 's%.*/%%'` +usage="Usage: $progname [OPTION]... [DIR]... + +Rebuild ls-R filename databases used by TeX. If one or more arguments +DIRS are given, these are used as the directories in which to build +ls-R. Else all directories in the search path for ls-R files +(\$TEXMFDBS) are used. + +Options: + --dry-run do not actually update anything + --help display this help and exit + --quiet cancel --verbose + --silent same as --quiet + --verbose explain what is being done + --version output version information and exit + +If standard input is a terminal, --verbose is on by default. + +For more information, see the \`Filename database' section of +Kpathsea manual available at http://tug.org/kpathsea. + +Report bugs to tex-k@tug.org. +" + +# 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 + +if tty -s; then verbose=true; else verbose=false; fi +dry_run=false +trees= + +treefile="${TMPDIR-/tmp}/mktexlsrtrees$$.tmp" +trap 'cd /; rm -f $treefile; test -z "$db_dir_tmp" || rm -rf "$db_dir_tmp"; + exit' 0 1 2 3 7 13 15 + +# A copy of some stuff from mktex.opt, so we can run in the presence of +# terminally damaged ls-R files. +while test $# -gt 0; do + 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 "x$1" = x--verbose || test "x$1" = x-verbose; then + verbose=true + elif test "x$1" = x--dry-run || test "x$1" = x-n; then + dry_run=true + elif test "x$1" = x--quiet || test "x$1" = x--silent \ + || test "x$1" = x-quiet || test "x$1" = x-silent ; then + verbose=false + elif test "x$1" = x--; then + : + elif echo "x$1" | grep '^x-' >/dev/null; then + echo "$progname: unknown option \`$1', try --help if you need it." >&2 + exit 1 + else + if test ! -d "$1"; then + echo "$progname: $1: not a directory, skipping." >&2 + shift + continue + fi + # By saving the argument in a file, we can later get it back while + # supporting spaces in the name. This still doesn't support + # newlines in the directory names, but nobody ever complains about + # that, and it seems much too much trouble to use \0 terminators. + (umask 077 + if echo "$1" >>"$treefile"; then :; else + echo "$progname: $treefile: could not append to arg file, goodbye." >&2 + exit 1 + fi + ) + fi + shift +done + +# 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.' + +{ + # Get list of directories from the explicit arguments (now saved in + # $treefile), or $TEXMFDBS if no explicit args. Eliminate duplicates. + saveIFS=$IFS # break only at newline + IFS=' +' + if test -s "$treefile"; then + set x `sort "$treefile" | uniq` + else + set x `kpsewhich --show-path=ls-R | tr : ' +' | sort | uniq` + fi + IFS=$saveIFS + shift +} + +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 either 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 + + # want to be silent if the directory doesn't exist, since the ls-R + # path ordinarily contains many nonexistent directories. + 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: no 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: $db_dir_tmp: could not create directory, skipping..." >&2; continue; } + db_file_tmp="$db_dir_tmp/lsR$$.tmp" + rm -f "$db_file_tmp" + + $verbose && echo "$progname: Updating $db_file... " + $dry_run && continue + + 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 + # version control entries from the list. Also omit contents of any + # the version directories; sed apparently requires that we do that + # operation in a separate invocation. We do not try to support colons + # in directory names. + # + echo "./:" >>"$db_file_tmp" + vc_dirs='\.\(bzr\|git\|hg\|svn\)\|_darcs' + (cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) \ + | sed -e '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^'$vc_dirs'$/d;' \ + -e '/^[\.\/]*lsR[0-9]*\.tmp:*$/d' \ + | sed -e /$vc_dirs'.*:$/,/^$/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 + +$verbose && echo "$progname: Done." +exit 0 diff --git a/src/texsourc/kpathsea/kpathsea/mktexmf b/src/texsourc/kpathsea/kpathsea/mktexmf new file mode 100644 index 0000000..d5c77a8 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexmf @@ -0,0 +1,142 @@ +#!/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.) +# +# Originally written by Thomas Esser. +# Public domain. + +version='$Id: mktexmf 26569 2012-05-22 16:05:18Z karl $' +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 $name in + # csso12[0-5][0-9] from CJK package; unsupported by mktexmf + csso12[0-5][0-9]) + rootfile=;; + *) + case $rootname in + 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;; + 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" < "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" <$STDOUT +echo "$progname: $destdir/$mfname: successfully generated." >&2 +"$MT_MKTEXUPD" "$destdir" "$mfname" +exit 0 +) 1>&2 &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 --var-value=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 + elif test -e "$MT_TEXMFVAR"; then + # TEXMFVAR defined and exists, but it is not a directory? + FALLBACK=1 + else + # TEXMFVAR defined but does not exist, try to create it + MT_FEATURES=none "$MT_MKTEXDIR" "$MT_TEXMFVAR" || 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/src/texsourc/kpathsea/kpathsea/mktexnam.opt b/src/texsourc/kpathsea/kpathsea/mktexnam.opt new file mode 100644 index 0000000..a9eb4e5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexnam.opt @@ -0,0 +1,107 @@ +# mktexnam.opt to determine various manipulations of the filenames. +# Sourced from mktexnam. +# +# Primarily written by Thomas Esser, Karl Berry, and Olaf Weber. +# Public domain. +# $Id: mktexnam.opt 18383 2010-05-20 18:31:24Z karl $ + +# 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/src/texsourc/kpathsea/kpathsea/mktexpk b/src/texsourc/kpathsea/kpathsea/mktexpk new file mode 100644 index 0000000..48a57bd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/mktexpk @@ -0,0 +1,279 @@ +#!/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.) +# +# Originally written by Thomas Esser, Karl Berry, and Olaf Weber. +# Report bugs to tex-k@tug.org. +# Public domain. + +version='$Id: mktexpk 18407 2010-05-21 18:16:31Z karl $' +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 bitmap 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. + +If you expected the font to be available as an outline, and thus this +script does not work and should not have been called, most likely the +font's .tfm name is missing from the relevant map file (e.g., +psfonts.map for dvips, pdftex.map for pdftex). These map files are +typically maintained using updmap; q.v. + +For step-by-step instructions on making new fonts known to TeX, see +http://tug.org/fonts/fontinstall.html. + +Report bugs to: tex-k@tug.org +TeX Live home page: +" + +# 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.'\ + &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=epscszz;; + 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 + echo "$progname: perhaps $NAME is missing from the map file." >&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: $MT_MKTEXDIR $PKDESTDIR failed." >&2 + exit 1 +fi + +echo "$progname: Running $cmd" +$cmd $$.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 &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 # mag=0 fails with larm1000.mf +#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 $$.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 &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/src/texsourc/kpathsea/kpathsea/path-elt.c b/src/texsourc/kpathsea/kpathsea/path-elt.c new file mode 100644 index 0000000..b40032e --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/path-elt.c @@ -0,0 +1,140 @@ +/* path-elt.c: return the stuff between colons. + + Copyright 1993, 1996 2008 Karl Berry. + Copyright 1997, 2001, 2005 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, see . */ + +#include + +#include +#include + + +/* 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 (kpathsea kpse, const_string passed_path, boolean env_p) +{ + const_string p; + string ret; + int brace_level; + unsigned len; + + if (passed_path) + kpse->path = passed_path; + /* Check if called with NULL, and no previous path (perhaps we reached + the end). */ + else if (!kpse->path) + return NULL; + + /* OK, we have a non-null `path' if we get here. */ + assert (kpse->path); + p = kpse->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; +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif + p++; + } + + /* Return the substring starting at `path'. */ + len = p - kpse->path; + + /* Make sure we have enough space (including the null byte). */ + if (len + 1 > kpse->elt_alloc) + { + kpse->elt_alloc = len + 1; + kpse->elt = (string)xrealloc (kpse->elt, kpse->elt_alloc); + } + + strncpy (kpse->elt, kpse->path, len); + kpse->elt[len] = 0; + ret = kpse->elt; + + /* If we are at the end, return NULL next time. */ + if (kpse->path[len] == 0) + kpse->path = NULL; + else + kpse->path += len + 1; + + return ret; +} + +string +kpathsea_path_element (kpathsea kpse, const_string p) +{ + return element (kpse, p, true); +} + +string +kpathsea_filename_component (kpathsea kpse, const_string p) +{ + return element (kpse, p, false); +} + +#ifdef TEST + +void +print_path_elements (const_string path) +{ + string elt; + printf ("Elements of `%s':", path ? path : "(null)"); + + for (elt = kpathsea_path_element (kpse_def, path); elt != NULL; + elt = kpathsea_path_element (kpse_def, 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/src/texsourc/kpathsea/kpathsea/paths.h b/src/texsourc/kpathsea/kpathsea/paths.h new file mode 100644 index 0000000..1e321e5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/paths.h @@ -0,0 +1,316 @@ +/* paths.h */ +#ifndef KPATHSEA_PATHS_H +#define KPATHSEA_PATHS_H + +#ifndef DEFAULT_TEXMFMAIN +#define DEFAULT_TEXMFMAIN "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFLOCAL +#define DEFAULT_TEXMFLOCAL "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFDIST +#define DEFAULT_TEXMFDIST "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFHOME +#define DEFAULT_TEXMFHOME "/nonesuch" +#endif +#ifndef DEFAULT_TEXMF +#define DEFAULT_TEXMF "/nonesuch" +#endif +#ifndef DEFAULT_SYSTEXMF +#define DEFAULT_SYSTEXMF "/nonesuch" +#endif +#ifndef DEFAULT_VARTEXFONTS +#define DEFAULT_VARTEXFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFDBS +#define DEFAULT_TEXMFDBS "/nonesuch" +#endif +#ifndef DEFAULT_WEB2C +#define DEFAULT_WEB2C "/nonesuch" +#endif +#ifndef DEFAULT_TEXINPUTS +#define DEFAULT_TEXINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MFINPUTS +#define DEFAULT_MFINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MPINPUTS +#define DEFAULT_MPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MFTINPUTS +#define DEFAULT_MFTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_WEBINPUTS +#define DEFAULT_WEBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_CWEBINPUTS +#define DEFAULT_CWEBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXFORMATS +#define DEFAULT_TEXFORMATS "/nonesuch" +#endif +#ifndef DEFAULT_MFBASES +#define DEFAULT_MFBASES "/nonesuch" +#endif +#ifndef DEFAULT_MPMEMS +#define DEFAULT_MPMEMS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPOOL +#define DEFAULT_TEXPOOL "/nonesuch" +#endif +#ifndef DEFAULT_MFPOOL +#define DEFAULT_MFPOOL "/nonesuch" +#endif +#ifndef DEFAULT_MPPOOL +#define DEFAULT_MPPOOL "/nonesuch" +#endif +#ifndef DEFAULT_VFFONTS +#define DEFAULT_VFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TFMFONTS +#define DEFAULT_TFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_PKFONTS +#define DEFAULT_PKFONTS "/nonesuch" +#endif +#ifndef DEFAULT_GFFONTS +#define DEFAULT_GFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_GLYPHFONTS +#define DEFAULT_GLYPHFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXFONTMAPS +#define DEFAULT_TEXFONTMAPS "/nonesuch" +#endif +#ifndef DEFAULT_BIBINPUTS +#define DEFAULT_BIBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_BSTINPUTS +#define DEFAULT_BSTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MLBIBINPUTS +#define DEFAULT_MLBIBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MLBSTINPUTS +#define DEFAULT_MLBSTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPSHEADERS +#define DEFAULT_TEXPSHEADERS "/nonesuch" +#endif +#ifndef DEFAULT_T1FONTS +#define DEFAULT_T1FONTS "/nonesuch" +#endif +#ifndef DEFAULT_AFMFONTS +#define DEFAULT_AFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_SYSTTF +#define DEFAULT_SYSTTF "/nonesuch" +#endif +#ifndef DEFAULT_TTFONTS +#define DEFAULT_TTFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TTF2PKINPUTS +#define DEFAULT_TTF2PKINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TTF2TFMINPUTS +#define DEFAULT_TTF2TFMINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_T42FONTS +#define DEFAULT_T42FONTS "/nonesuch" +#endif +#ifndef DEFAULT_LIGFONTS +#define DEFAULT_LIGFONTS "/nonesuch" +#endif +#ifndef DEFAULT_MISCFONTS +#define DEFAULT_MISCFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXCONFIG +#define DEFAULT_TEXCONFIG "/nonesuch" +#endif +#ifndef DEFAULT_INDEXSTYLE +#define DEFAULT_INDEXSTYLE "/nonesuch" +#endif +#ifndef DEFAULT_ENCFONTS +#define DEFAULT_ENCFONTS "/nonesuch" +#endif +#ifndef DEFAULT_CMAPFONTS +#define DEFAULT_CMAPFONTS "/nonesuch" +#endif +#ifndef DEFAULT_SFDFONTS +#define DEFAULT_SFDFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OPENTYPEFONTS +#define DEFAULT_OPENTYPEFONTS "/nonesuch" +#endif +#ifndef DEFAULT_FONTFEATURES +#define DEFAULT_FONTFEATURES "/nonesuch" +#endif +#ifndef DEFAULT_FONTCIDMAPS +#define DEFAULT_FONTCIDMAPS "/nonesuch" +#endif +#ifndef DEFAULT_PDFTEXCONFIG +#define DEFAULT_PDFTEXCONFIG "/nonesuch" +#endif +#ifndef DEFAULT_TRFONTS +#define DEFAULT_TRFONTS "/nonesuch" +#endif +#ifndef DEFAULT_MPSUPPORT +#define DEFAULT_MPSUPPORT "/nonesuch" +#endif +#ifndef DEFAULT_MIMELIBDIR +#define DEFAULT_MIMELIBDIR "/nonesuch" +#endif +#ifndef DEFAULT_MAILCAPLIBDIR +#define DEFAULT_MAILCAPLIBDIR "/nonesuch" +#endif +#ifndef DEFAULT_TEXDOCS +#define DEFAULT_TEXDOCS "/nonesuch" +#endif +#ifndef DEFAULT_TEXSOURCES +#define DEFAULT_TEXSOURCES "/nonesuch" +#endif +#ifndef DEFAULT_TEXDOCSSUFFIX +#define DEFAULT_TEXDOCSSUFFIX ";.pdf;.ps;.dvi;.html;.txt;.tex" +#endif +#ifndef DEFAULT_TEXDOCSCOMPRESS +#define DEFAULT_TEXDOCSCOMPRESS ";.gz;.bz2;.zip;.Z;.xz" +#endif +#ifndef DEFAULT_TEXDOCEXT +#define DEFAULT_TEXDOCEXT "{$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}" +#endif +#ifndef DEFAULT_OFMFONTS +#define DEFAULT_OFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OPLFONTS +#define DEFAULT_OPLFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OVFFONTS +#define DEFAULT_OVFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OVPFONTS +#define DEFAULT_OVPFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OTPINPUTS +#define DEFAULT_OTPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_OCPINPUTS +#define DEFAULT_OCPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_T4HTINPUTS +#define DEFAULT_T4HTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEX4HTINPUTS +#define DEFAULT_TEX4HTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TW_LIBPATH +#define DEFAULT_TW_LIBPATH "/nonesuch" +#endif +#ifndef DEFAULT_TW_INIPATH +#define DEFAULT_TW_INIPATH "/nonesuch" +#endif +#ifndef DEFAULT_LUAINPUTS +#define DEFAULT_LUAINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_CLUAINPUTS +#define DEFAULT_CLUAINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFSCRIPTS +#define DEFAULT_TEXMFSCRIPTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPICTS +#define DEFAULT_TEXPICTS "/nonesuch" +#endif +#ifndef DEFAULT_KPSE_DOT +#define DEFAULT_KPSE_DOT "." +#endif +#ifndef DEFAULT_TEXMFCNF +#define DEFAULT_TEXMFCNF \ +"{$SELFAUTOLOC,\ +$SELFAUTOLOC/share/texmf-local/web2c,\ +$SELFAUTOLOC/share/texmf-dist/web2c,\ +$SELFAUTOLOC/share/texmf/web2c,\ +$SELFAUTOLOC/texmf-local/web2c,\ +$SELFAUTOLOC/texmf-dist/web2c,\ +$SELFAUTOLOC/texmf/web2c,\ +$SELFAUTODIR,\ +$SELFAUTODIR/share/texmf-local/web2c,\ +$SELFAUTODIR/share/texmf-dist/web2c,\ +$SELFAUTODIR/share/texmf/web2c,\ +$SELFAUTODIR/texmf-local/web2c,\ +$SELFAUTODIR/texmf-dist/web2c,\ +$SELFAUTODIR/texmf/web2c,\ +$SELFAUTOPARENT/../texmf-local/web2c,\ +$SELFAUTOPARENT,\ +$SELFAUTOPARENT/share/texmf-local/web2c,\ +$SELFAUTOPARENT/share/texmf-dist/web2c,\ +$SELFAUTOPARENT/share/texmf/web2c,\ +$SELFAUTOPARENT/texmf-local/web2c,\ +$SELFAUTOPARENT/texmf-dist/web2c,\ +$SELFAUTOPARENT/texmf/web2c}" +#endif +#ifndef DEFAULT_MISSFONT_LOG +#define DEFAULT_MISSFONT_LOG "missfont.log" +#endif +#ifndef DEFAULT_TEX_HUSH +#define DEFAULT_TEX_HUSH "none" +#endif +#ifndef DEFAULT_MKTEXTEX +#define DEFAULT_MKTEXTEX "0" +#endif +#ifndef DEFAULT_MKTEXPK +#define DEFAULT_MKTEXPK "1" +#endif +#ifndef DEFAULT_MKTEXMF +#define DEFAULT_MKTEXMF "1" +#endif +#ifndef DEFAULT_MKTEXTFM +#define DEFAULT_MKTEXTFM "1" +#endif +#ifndef DEFAULT_MKTEXFMT +#define DEFAULT_MKTEXFMT "1" +#endif +#ifndef DEFAULT_MKOCP +#define DEFAULT_MKOCP "0" +#endif +#ifndef DEFAULT_MKOFM +#define DEFAULT_MKOFM "0" +#endif +#ifndef DEFAULT_MPXCOMMAND +#define DEFAULT_MPXCOMMAND "" +#endif +#ifndef DEFAULT_TEX +#define DEFAULT_TEX "tex" +#endif +#ifndef DEFAULT_TEXJ +#define DEFAULT_TEXJ "ptex" +#endif +#ifndef DEFAULT_MPXTEXCMD +#define DEFAULT_MPXTEXCMD "etex" +#endif +#ifndef DEFAULT_MPXTEXCMDJ +#define DEFAULT_MPXTEXCMDJ "eptex" +#endif +#ifndef DEFAULT_CMAPINPUTS +#define DEFAULT_CMAPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_DVI2PATH +#define DEFAULT_DVI2PATH "/nonesuch" +#endif +#ifndef DEFAULT_DVI2LIB +#define DEFAULT_DVI2LIB "/nonesuch" +#endif +#ifndef DEFAULT_DVI2FONTDESC +#define DEFAULT_DVI2FONTDESC "/nonesuch" +#endif +#ifndef DEFAULT_JDVIKPSHEADER +#define DEFAULT_JDVIKPSHEADER "/nonesuch" +#endif +#ifndef DEFAULT_RISINPUTS +#define DEFAULT_RISINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_BLTXMLINPUTS +#define DEFAULT_BLTXMLINPUTS "/nonesuch" +#endif + +#endif /* KPATHSEA_PATHS_H */ diff --git a/src/texsourc/kpathsea/kpathsea/pathsearch.c b/src/texsourc/kpathsea/kpathsea/pathsearch.c new file mode 100644 index 0000000..0f59ac5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/pathsearch.c @@ -0,0 +1,671 @@ +/* pathsearch.c: look up a filename in a path. + + Copyright 1993, 1994, 1995, 1997, 2007, 2009-2012 Karl Berry. + Copyright 1997-2005 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, see . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* for `time' */ + +#ifdef __DJGPP__ +#include /* for stat bits */ +#endif + +#ifdef WIN32 +#undef fputs +#undef puts +#define fputs win32_fputs +#define puts win32_puts +#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. */ + + + +/* 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 (kpathsea kpse, str_list_type filenames) +{ + + if (kpse->log_opened == false) { + /* Get name from either envvar or config file. */ + string log_name = kpathsea_var_value (kpse, "TEXMFLOG"); + kpse->log_opened = true; + if (log_name) { + kpse->log_file = fopen (log_name, FOPEN_A_MODE); + if (!kpse->log_file) + perror (log_name); + free (log_name); + } + } + + if ( +#ifdef KPSE_DEBUG + KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH) || +#endif /* KPSE_DEBUG */ + kpse->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 (kpse->log_file && kpathsea_absolute_p (kpse, filename, false)) + fprintf (kpse->log_file, "%lu %s\n", (long unsigned) time (NULL), + filename); + +#ifdef KPSE_DEBUG + /* 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 (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) { + putc (' ', stderr); + fputs (filename, stderr); + } +#endif /* KPSE_DEBUG */ + } + } +} + +/* 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 (kpathsea kpse, 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 (kpathsea_readable_file (kpse, 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; +} + +/* Note: NAMES[i] is not modified. */ +static str_list_type +dir_list_search_list (kpathsea kpse, str_llist_type *dirs, 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 (kpathsea_absolute_p(kpse, 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 (kpathsea_readable_file (kpse, 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 (kpathsea kpse, string name) +{ + str_list_type ret_list; + string found = kpathsea_readable_file (kpse, 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 (kpathsea kpse, 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 = kpathsea_path_element (kpse, path); !done && elt; + elt = kpathsea_path_element (kpse, 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 */ + kpathsea_normalize_path(kpse, elt); + + /* Try ls-R, unless we're searching for texmf.cnf. Our caller + (search), also tests first_search, and does the resetting. */ + found = kpse->followup_search ? kpathsea_db_search (kpse, name, elt, all) + : NULL; + + /* 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 = kpathsea_element_dirs (kpse, elt); + if (dirs && *dirs) { + if (!found) + found = XTALLOC1 (str_list_type); + *found = dir_list_search (kpse, 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 (kpathsea kpse, 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_program_name' 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 = kpathsea_expand (kpse, original_name); + + /* If the first name is absolute or explicitly relative, no need to + consider PATH at all. */ + absolute_p = kpathsea_absolute_p (kpse, name, true); + +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF4 ("start search(file=%s, must_exist=%d, find_all=%d, path=%s).\n", + name, must_exist, all, path); +#endif /* KPSE_DEBUG */ + + /* Find the file(s). */ + ret_list = absolute_p ? absolute_search (kpse, name) + : path_search (kpse, 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 (kpse->followup_search == false) { + kpse->followup_search = true; + } else { + /* Record the filenames we found, if desired. And wrap them in a + debugging line if we're doing that. */ +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF1 ("search(%s) =>", original_name); +#endif /* KPSE_DEBUG */ + log_search (kpse, ret_list); +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) + putc ('\n', stderr); +#endif /* KPSE_DEBUG */ + } + +#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. */ + +string * +kpathsea_path_search_list_generic (kpathsea kpse, + const_string path, string* names, + boolean must_exist, boolean all) +{ + str_list_type ret_list; + 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_program_name' 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(); + +#ifdef KPSE_DEBUG + if (KPATHSEA_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); + } +#endif /* KPSE_DEBUG */ + + /* 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 (kpathsea_absolute_p (kpse, *namep, true)) { + if (kpathsea_readable_file (kpse, *namep)) { + str_list_add (&ret_list, xstrdup(*namep)); + 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 = kpathsea_path_element (kpse, path); !done && elt; + elt = kpathsea_path_element (kpse, 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. */ + kpathsea_normalize_path (kpse, elt); + + /* Try ls-R, unless we're searching for texmf.cnf. */ + found = kpse->followup_search + ? kpathsea_db_search_list (kpse, names, elt, all) : NULL; + + /* 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 = kpathsea_element_dirs (kpse, elt); + if (dirs && *dirs) { + if (!found) + found = XTALLOC1 (str_list_type); + *found = dir_list_search_list (kpse, 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: + /* Uniqify, since our paths can often end up finding the same file + more than once. */ + str_list_uniqify (&ret_list); + + /* Add NULL if we will be returning multiple elements. */ + if (STR_LIST_LENGTH (ret_list) == 0 + || (all && STR_LIST_LAST_ELT (ret_list) != NULL)) + str_list_add (&ret_list, NULL); + + if (kpse->followup_search == false) { + kpse->followup_search = true; + } else { + /* Record the filenames we found, if desired. And wrap them in a + debugging line if we're doing that. */ +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) { + DEBUGF1 ("search([%s", *names); + for (namep = names+1; *namep != NULL; namep++) { + fputc (' ', stderr); + fputs (*namep, stderr); + } + fputs ("]) =>", stderr); + } +#endif /* KPSE_DEBUG */ + log_search (kpse, ret_list); +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) + putc ('\n', stderr); +#endif /* KPSE_DEBUG */ + } + +#ifdef __DJGPP__ + /* Undo any side effects. */ + _djstat_flags = save_djgpp_flags; +#endif + + return STR_LIST (ret_list); +} + +/* Search PATH for the first NAME according to MUST_EXIST. */ + +string +kpathsea_path_search (kpathsea kpse, const_string path, const_string name, + boolean must_exist) +{ + string *ret_list = search (kpse, path, name, must_exist, false); + string ret = *ret_list; + free (ret_list); + return ret; +} + +/* Search PATH for all files named NAME. Might have been better not + to assert `must_exist' here, but it's too late to change. */ + +string * +kpathsea_all_path_search (kpathsea kpse, const_string path, const_string name) +{ + string *ret = search (kpse, path, name, true, true); + return ret; +} + +#if defined (KPSE_COMPAT_API) + +string +kpse_path_search (const_string path, const_string name, boolean must_exist) +{ + return kpathsea_path_search (kpse_def, path, name, must_exist); +} + +string * +kpse_all_path_search (const_string path, const_string name) +{ + return kpathsea_all_path_search (kpse_def, path, name); +} +#endif + + +#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, 0); + 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 (int argc, char **argv) +{ + kpse_set_program_name(argv[0], NULL); + /* 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: +standalone-compile-command: "gcc -posix -g -I. -I.. -DTEST pathsearch.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/pathsearch.h b/src/texsourc/kpathsea/kpathsea/pathsearch.h new file mode 100644 index 0000000..66227bd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/pathsearch.h @@ -0,0 +1,116 @@ +/* pathsearch.h: mostly-generic path searching. + + Copyright 1993, 1994, 1996, 1997, 2007, 2008, 2009, 2011, 2012 Karl Berry. + Copyright 1999-2005 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, see . */ + +#ifndef KPATHSEA_PATHSEARCH_H +#define KPATHSEA_PATHSEARCH_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* The naming of all these functions is rather scattered and + inconsistent, but they grew over time, and we don't want to change + the meaning of existing names. */ + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* 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 string kpathsea_path_element (kpathsea kpse, const_string path); + +/* Like `kpathsea_path_element', but for filename components (using + IS_DIR_SEP). Uses same area as `kpathsea_path_element'. */ +extern string kpathsea_filename_component (kpathsea kpse, 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 kpathsea_normalize_path (kpathsea kpse, 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 `kpathsea_path_search', which + has already assumed expansion has been done. */ +extern str_llist_type *kpathsea_element_dirs (kpathsea kpse, + string elt); + +#endif /* MAKE_KPSE_DLL */ + +/* Call `kpathsea_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. + + In any case, return a matching filename if found, otherwise NULL. + If more than one file matches, which one gets returned is + unspecified. */ +extern KPSEDLL string kpathsea_path_search + (kpathsea kpse, const_string path, const_string name, boolean must_exist); + +/* Like `kpathsea_path_search' with MUST_EXIST true, but always return all + matches in a NULL-terminated list. */ +extern KPSEDLL string *kpathsea_all_path_search + (kpathsea kpse, const_string path, const_string name); + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Search for any of the NAMES in PATH, and allow specifying both + MUST_EXIST and ALL. */ +extern string *kpathsea_path_search_list_generic (kpathsea kpse, + const_string path, string* names, boolean must_exist, boolean all); + +#endif /* MAKE_KPSE_DLL */ + +#if defined(KPSE_COMPAT_API) + +extern KPSEDLL string kpse_path_search + (const_string path, const_string name, boolean must_exist); +extern KPSEDLL string *kpse_all_path_search + (const_string path, const_string name); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_PATHSEARCH_H */ diff --git a/src/texsourc/kpathsea/kpathsea/proginit.c b/src/texsourc/kpathsea/kpathsea/proginit.c new file mode 100644 index 0000000..265b5eb --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/proginit.c @@ -0,0 +1,85 @@ +/* proginit.c: useful initializations for DVI drivers. + + Copyright 1994, 1995, 1996, 2008 Karl Berry. + Copyright 1997, 2005 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, see . */ + +#include +#include +#include +#include + + +/* 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 +kpathsea_init_prog (kpathsea kpse, 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. */ + kpathsea_set_program_enabled (kpse, kpse_pk_format, 1, kpse_src_env); + kpathsea_set_program_enabled (kpse, 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); + + kpathsea_init_fallback_resolutions (kpse, size_var); + kpathsea_xputenv_int (kpse, "MAKETEX_BASE_DPI", dpi); + kpse->fallback_font = fallback; + + /* Ugliness. See comments in kpse_make_tex in kpathsea/tex-make.c. */ + kpathsea_xputenv (kpse, "MAKETEX_MODE", mode ? mode : DIR_SEP_STRING); + + free (font_var); + free (header_var); + free (makepk_var); + free (size_var); +} + +#if defined (KPSE_COMPAT_API) +void +kpse_init_prog (const_string prefix, unsigned dpi, + const_string mode, const_string fallback) +{ + kpathsea_init_prog(kpse_def,prefix,dpi,mode,fallback); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/proginit.h b/src/texsourc/kpathsea/kpathsea/proginit.h new file mode 100644 index 0000000..a917c64 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/proginit.h @@ -0,0 +1,48 @@ +/* proginit.h: declarations for DVI driver initializations. + + Copyright 1994, 1995, 1996, 2008 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_PROGINIT_H +#define KPATHSEA_PROGINIT_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 +kpathsea_init_prog (kpathsea kpse, const_string prefix, unsigned dpi, + const_string mode, const_string fallback); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL void +kpse_init_prog (const_string prefix, unsigned dpi, const_string mode, + const_string fallback); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_PROGINIT_H */ diff --git a/src/texsourc/kpathsea/kpathsea/progname.c b/src/texsourc/kpathsea/kpathsea/progname.c new file mode 100644 index 0000000..c4fe781 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/progname.c @@ -0,0 +1,799 @@ +/* progname.c: the executable name we were invoked as; general initialization. + + Copyright 1994, 1996, 1997, 2008-2013 Karl Berry. + Copyright 1998-2005 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, see . */ + +#include +#include +#include +#include +#include +#include +/* For kpse_reset_progname */ +#include + + +#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 . */ +#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 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 + +#undef BSIZE +#define BSIZE 2048 /* sorry */ + + +/* Read link FN into SYM. */ + +static void +ReadSymLink (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 (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 (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 (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 (kpathsea kpse, 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). */ + /* There used to be a test for a variable |ll_loop| here, but + it was initialized to zero and never updated */ + if (0) { + 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 (kpse->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 (kpse->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 && kpse->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(k,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 (kpathsea kpse, string dir) +{ +#ifdef AMIGA + return dir; +#else + string c; + unsigned len; + string ret = NULL; + + for (c = kpathsea_filename_component (kpse, dir); c; + c = kpathsea_filename_component (kpse, NULL)) { + if (STREQ (c, ".")) { + /* If leading ., replace with cwd. Else ignore. */ + if (!ret) { + ret = xgetcwd (); + } + + } else if (STREQ (c, "..")) { + /* If leading .., start with xdirname (cwd). Else remove last + component from ret, if any. */ + if (!ret) { + string dot = xgetcwd (); + ret = xdirname (dot); + free (dot); + } else { + unsigned last; + string p = NAME_BEGINS_WITH_DEVICE (ret) ? ret + 2 : ret; + for (last = strlen (p); last > 0; last--) { + if (IS_DIR_SEP_CH (p[last - 1])) { + /* If we have `/../', that's the same as `/'. */ + p[(last > 1 ? last - 1 : 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. */ + if (!ret) { + ret = concat (NAME_BEGINS_WITH_DEVICE (c) ? "" : DIR_SEP_STRING, c); + } else { + string temp = ret; + len = strlen (ret); + ret = concat3 (ret, ret[len - 1] == DIR_SEP ? "" : DIR_SEP_STRING, c); + free (temp); + } + } + } + assert (ret); + + /* 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. */ + +string +kpathsea_selfdir (kpathsea kpse, const_string argv0) +{ + string self = NULL; + string name; + string ret; + + if (kpathsea_absolute_p (kpse, argv0, true)) { + self = xstrdup (argv0); + } else { +#ifdef AMIGA +#include +#include +#include + 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 */ + const_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 = kpathsea_path_element (kpse, getenv ("PATH")); !self && elt; + elt = kpathsea_path_element (kpse, NULL)) { + /* 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. */ + && !S_ISDIR(s.st_mode)) + self = name; + else + free (name); + } +#endif /* not AMIGA */ + } + + /* If argv0 is somehow dir/exename, `self' will still be NULL. */ + if (!self) + self = concat3 (".", DIR_SEP_STRING, argv0); + + name = remove_dots (kpse, expand_symlinks (kpse, self)); + +#ifndef AMIGA + free (self); +#endif + + ret = xdirname (name); + + free (name); + + return ret; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_selfdir (const_string argv0) +{ + return kpathsea_selfdir (kpse_def, argv0); +} +#endif + +#endif /* not WIN32 */ + +#if defined(WIN32) || defined(__CYGWIN__) + +/* Create a list of executable suffixes of files not to be written. */ +#define EXE_SUFFIXES ".com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.ws;.tcl;.py;.pyw" + +static void +mk_suffixlist (kpathsea kpse) +{ + char **p; + char *q, *r, *v; + int n; + +#if defined(__CYGWIN__) + v = xstrdup (EXE_SUFFIXES); +#else + v = getenv ("PATHEXT"); + if (v) /* strlwr() exists also in MingW */ + v = strlwr (xstrdup (v)); + else + v = xstrdup (EXE_SUFFIXES); +#endif + + q = v; + n = 0; + + while ((r = strchr (q, ';')) != NULL) { + n++; + r++; + q = r; + } + if (*q) + n++; + kpse->suffixlist = (char **) xmalloc ((n + 2) * sizeof (char *)); + p = kpse->suffixlist; + *p = xstrdup (".dll"); + p++; + q = v; + while ((r = strchr (q, ';')) != NULL) { + *r = '\0'; + *p = xstrdup (q); + p++; + r++; + q = r; + } + if (*q) { + *p = xstrdup (q); + p++; + } + *p = NULL; + free (v); +} +#endif /* WIN32 || __CYGWIN__ */ + +/* On win32 SELFAUTO{LOC,DIR,PARENT} must not be just `/', otherwise, + e.g., $SELFAUTODIR/texmf/tex would be mistaken as UNC name. */ +static inline string +fix_selfdir (string dir) +{ +#if defined(WIN32) + if (IS_DIR_SEP_CH (*dir) && dir[1] == 0) + dir++; +#endif + return dir; +} + +void +kpathsea_set_program_name (kpathsea kpse, const_string argv0, + const_string progname) +{ + const_string ext; + string sdir, sdir_parent, sdir_grandparent, sdir_greatgrandparent; + 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, cp; +#endif + + /* Set debugging stuff first, in case we end up doing debuggable stuff + during this initialization. */ + if (s) { + kpse->debug |= atoi (s); + } + +#if defined(WIN32) + if (!file_system_codepage) + file_system_codepage = AreFileApisANSI() ? GetACP() : GetOEMCP(); + cp = file_system_codepage; + if (cp == 932 || cp == 936 || cp == 950) { + is_cp932_system = cp; + } + else + is_cp932_system = 0; + +#if defined(__MINGW32__) + /* Set various info about user. Among many things, + ensure that HOME is set. */ + init_user_info(); +#else /* !__MINGW32__ */ + kpse->the_passwd.pw_name = kpse->the_passwd_name; + kpse->the_passwd.pw_passwd = kpse->the_passwd_passwd; + kpse->the_passwd.pw_uid = 0; + kpse->the_passwd.pw_gid = 0; + kpse->the_passwd.pw_quota = 0; + kpse->the_passwd.pw_gecos = kpse->the_passwd_gecos; + kpse->the_passwd.pw_dir = kpse->the_passwd_dir; + kpse->the_passwd.pw_shell = kpse->the_passwd_shell; + kpse->__system_allow_multiple_cmds = 0; + + /* Set various info about user. Among many things, + ensure that HOME is set. */ + kpathsea_init_user_info(kpse); +#endif /* !__MINGW32__ */ + + /* 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; + kpathsea_xputenv(kpse, "KPATHSEA_DEBUG_APPEND", "yes"); + } + } + + if ((err < 0) + && (err = _open(debug_output, flags, _S_IREAD | _S_IWRITE)) == -1) + { + WARNING1 ("kpathsea: Can't open %s for stderr redirection!\n", + debug_output); + perror (debug_output); + } else if ((olderr = _dup(fileno(stderr))) == -1) { + WARNING ("kpathsea: Can't dup() stderr!\n"); + close (err); + } else if (_dup2(err, fileno(stderr)) == -1) { + WARNING1 ("kpathsea: 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 kpse_selfdir + stuff useless for win32. */ + { + char short_path[PATH_MAX], path[PATH_MAX], *fp; +#if !defined(__MINGW32__) + HANDLE hnd; + WIN32_FIND_DATA ffd; +#endif + + /* SearchPath() always gives back an absolute directory */ + if (SearchPath(NULL, argv0, ".exe", PATH_MAX, short_path, &fp) == 0) + LIB_FATAL1("Can't determine where the executable %s is.\n", argv0); +#if defined(__MINGW32__) + if (!win32_get_long_filename(short_path, path, sizeof(path))) { + LIB_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; +#else /* !__MINGW32__ */ + if (getlongpath(path, short_path, PATH_MAX) == 0) + FATAL1("Can't get long name for %s.\n", short_path); + if ((hnd = FindFirstFile(short_path, &ffd)) == INVALID_HANDLE_VALUE) + FATAL1("The following path points to an invalid file : %s\n", path); + FindClose(hnd); + /* dirname aleady slashified in WIN32 */ +#endif /* !__MINGW32__ */ + /* sdir will be the directory of the executable, ie: c:/TeX/bin */ + sdir = xdirname(path); + kpse->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; + + kpse->invocation_name = xstrdup (long_progname); + } + else + /* If `_truename' failed, God help them, because we won't... */ + kpse->invocation_name = xstrdup (argv0); + } + else + kpse->invocation_name = xstrdup (argv0); + +#else /* !WIN32 && !__DJGPP__ */ + kpse->invocation_name = xstrdup (argv0); +#endif + + /* We need to find SELFAUTOLOC *before* removing the ".exe" suffix from + the program_name, otherwise the PATH search inside kpse_selfdir will fail, + since `prog' doesn't exists as a file, there's `prog.exe' instead. */ +#ifndef WIN32 + sdir = kpathsea_selfdir (kpse, kpse->invocation_name); +#endif + /* SELFAUTODIR is actually the parent of the invocation directory, + and SELFAUTOPARENT the grandparent. This is how teTeX did it. */ + kpathsea_xputenv (kpse, "SELFAUTOLOC", fix_selfdir (sdir)); + sdir_parent = xdirname (sdir); + kpathsea_xputenv (kpse, "SELFAUTODIR", fix_selfdir (sdir_parent)); + sdir_grandparent = xdirname (sdir_parent); + kpathsea_xputenv (kpse, "SELFAUTOPARENT", fix_selfdir (sdir_grandparent)); + sdir_greatgrandparent = xdirname (sdir_grandparent); + kpathsea_xputenv (kpse, "SELFAUTOGRANDPARENT", fix_selfdir (sdir_greatgrandparent)); + +#if defined(WIN32) || defined(__CYGWIN__) + mk_suffixlist(kpse); +#endif /* WIN32 || __CYGWIN__ */ + + free (sdir); + free (sdir_parent); + free (sdir_grandparent); + free (sdir_greatgrandparent); + + kpse->invocation_short_name + = xstrdup (xbasename (kpse->invocation_name)); + + 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 (kpse->invocation_short_name); + if (ext && FILESTRCASEEQ (ext, "exe")) { + kpse->program_name = remove_suffix (kpse->invocation_short_name); + } else { + kpse->program_name = xstrdup (kpse->invocation_short_name); + } + } + + /* Runtime check that snprintf always writes a trailing NUL byte. */ + { + char buf[4] = "old"; + assert (snprintf (buf, 2, "a") == 1 && buf[1] == '\0'); + assert ((unsigned)snprintf (buf, 2, "ab") >= 2 && buf[1] == '\0'); + assert ((unsigned)snprintf (buf, 2, "abc") >= 2 && buf[1] == '\0'); + } + /* Some of the utility routines (like atou() and xfopen()) will use + FATAL and variations thereof (see lib.h) if there is a problem. + + The next trick makes it possible for that message to report some useful + name instead of (NULL), if the backward compatible is compiled in. */ + +#if defined (KPSE_COMPAT_API) + if (kpse!=kpse_def) { + kpse_def->invocation_name = xstrdup(kpse->invocation_name); + kpse_def->invocation_short_name = xstrdup(kpse->invocation_short_name); + } +#endif + + kpathsea_xputenv (kpse, "progname", kpse->program_name); +} + + +#if defined (KPSE_COMPAT_API) +void +kpse_set_program_name (const_string argv0, const_string progname) +{ + kpathsea_set_program_name (kpse_def, argv0, progname); +} +#endif + +/* Returns ARGV0 with any leading path and on some systems the suffix + for executables stripped off. This returns a new string. + For example, `kpse_program_basename ("/foo/bar.EXE")' returns "bar" + on WIndows or Cygwin and "bar.EXE" otherwise. */ + +string +kpse_program_basename (const_string argv0) +{ + string base = xstrdup (xbasename (argv0)); +#ifdef EXEEXT + string dot = strrchr (base, '.'); + if (dot && FILESTRCASEEQ (dot, EXEEXT)) + *dot = 0; +#endif + return base; +} + + +#ifdef TEST +static const char *tab[] = { +/* 'normal' names */ + "/w/kpathsea", + "/w//kpathsea", + "/w/./kpathsea", + ".", + "./", + "./.", + "../kpathsea", + "/kpathsea/../foo", + "/../w/kpathsea", + "/../w/kpathsea/.", + "/te/share/texmf/../../../../bin/gnu", + NULL +}; + +int +main (int argc, char **argv) +{ + const char **p; + kpathsea kpse = xcalloc(1, sizeof(kpathsea_instance)); + + kpathsea_set_program_name(kpse, argv[0], NULL); + +#if defined(WIN32) + printf("\n%s: Nothing to do for WIN32\n", + kpse->invocation_short_name); +#else + printf("\n%s: name -> remove_dots(name)\n\n", + kpse->invocation_short_name); + + for (p = tab; *p; p++) { + char *q = xstrdup(*p); + char *s = remove_dots(kpse, q); + + printf("%s -> %s\n", q, s); + free (q); + free (s); + } +#endif + + return 0; +} +#endif /* TEST */ diff --git a/src/texsourc/kpathsea/kpathsea/progname.h b/src/texsourc/kpathsea/kpathsea/progname.h new file mode 100644 index 0000000..596424b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/progname.h @@ -0,0 +1,70 @@ +/* progname.h: Declarations for argv[0] equivalents. + + Copyright 1994, 1996, 2008, 2010-2013 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_PROGNAME_H +#define KPATHSEA_PROGNAME_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return directory ARGV0 comes from. Check PATH if ARGV0 is not + absolute. */ + +#if !defined (WIN32) +extern KPSEDLL string kpathsea_selfdir (kpathsea kpse, const_string argv0); +#endif + +/* 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 + value of kpse_invocation_short_name if PROGNAME is NULL. + This function also determines the AUTO* variables. */ + +extern KPSEDLL void kpathsea_set_program_name (kpathsea kpse, + const_string argv0, const_string progname); + +/* See also `kpathsea_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. */ + + +#if defined (KPSE_COMPAT_API) +#if !defined (WIN32) +extern KPSEDLL string kpse_selfdir (const_string argv0); +#endif + +extern KPSEDLL void kpse_set_program_name (const_string argv0, + const_string progname); +#endif /* KPSE_COMPAT_API */ + +/* Returns ARGV0 with any leading path and on some systems the suffix + for executables stripped off. This returns a new string. */ + +extern KPSEDLL string kpse_program_basename (const_string argv0); + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_PROGNAME_H */ diff --git a/src/texsourc/kpathsea/kpathsea/putenv.c b/src/texsourc/kpathsea/kpathsea/putenv.c new file mode 100644 index 0000000..34cbd3a --- /dev/null +++ b/src/texsourc/kpathsea/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/src/texsourc/kpathsea/kpathsea/readable.c b/src/texsourc/kpathsea/kpathsea/readable.c new file mode 100644 index 0000000..3e604cd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/readable.c @@ -0,0 +1,140 @@ +/* readable.c: check if a filename is a readable non-directory file. + + Copyright 1993, 1995, 1996, 2008, 2011, 2012 Karl Berry. + Copyright 1998, 1999, 2000, 2001, 2005 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, see . */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +/* 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 defined (WIN32) +/* st must be an unsigned int under Windows */ +static boolean +READABLE(const_string fn, unsigned int st) +{ + wchar_t *fnw; + fnw = get_wstring_from_fsyscp(fn, fnw=NULL); + if ((st = GetFileAttributesW(fnw)) != 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; + } + } + if(fnw) free(fnw); + 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! */ + +string +kpathsea_readable_file (kpathsea kpse, string name) +{ +#ifdef WIN32 + unsigned int st = 0; +#else /* ! WIN32 */ + struct stat st; +#endif + + kpathsea_normalize_path (kpse, name); + if (READABLE (name, st)) { + return name; +#ifdef ENAMETOOLONG + } else if (errno == ENAMETOOLONG) { + /* Truncate any too-long components in NAME. */ + unsigned c_len = 0; /* Length of current component. */ + char *s = name; /* Position in current component. */ + char *t = name; /* End of allowed length. */ + + for (; *s; s++) { + if (c_len <= NAME_MAX) + t = s; +#if defined(WIN32) + if (IS_KANJI (s)) { + s++; + c_len += 2; + continue; + } +#endif + if (IS_DIR_SEP (*s) || IS_DEVICE_SEP (*s)) { + if (c_len > NAME_MAX) { + /* Truncate if past the max for a component. */ + memmove (t, s, strlen (s) + 1); + s = t; + } + /* At a directory delimiter, reset component length. */ + c_len = 0; + } else + c_len++; + } + if (c_len > NAME_MAX) + /* Truncate if past the max for last component. */ + *t = 0; + + /* Perhaps some other error will occur with the truncated name, so + let's call access again. */ + if (READABLE (name, st)) /* Success. */ + return name; +#endif /* ENAMETOOLONG */ + } else { /* Some other error. */ + if (errno == EACCES) { /* Maybe warn them if permissions are bad. */ + if (!kpathsea_tex_hush (kpse, "readable")) { + perror (name); + } + } + } + return NULL; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_readable_file (string name) +{ + return kpathsea_readable_file (kpse_def, name); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/readable.h b/src/texsourc/kpathsea/kpathsea/readable.h new file mode 100644 index 0000000..123e299 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/readable.h @@ -0,0 +1,43 @@ +/* readable.h: is a file readable? + + Copyright 1993, 2008, 2009 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_READABLE_H +#define KPATHSEA_READABLE_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 kpathsea_readable_file (kpathsea kpse, string name); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL string kpse_readable_file (string name); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_READABLE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/readlink.c b/src/texsourc/kpathsea/kpathsea/readlink.c new file mode 100644 index 0000000..1a0fe72 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/readlink.c @@ -0,0 +1,77 @@ +/* readlink -- obtain contents of symlink. + + Copyright 2008, 2009 Karl Berry. + 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 Lesser General Public License + along with this library; if not, see . */ + +#include +#include +#include +#include + +#ifdef WIN32 +#include +#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 (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@tug.org.\n", stdout); + exit(0); + } else if (argc > 1 && strcmp (argv[1], "--version") == 0) { + printf ("%s (%s)\n\ +Copyright (C) 2009 Olaf Weber & Karl 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 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/src/texsourc/kpathsea/kpathsea/rm-suffix.c b/src/texsourc/kpathsea/kpathsea/rm-suffix.c new file mode 100644 index 0000000..289847d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/rm-suffix.c @@ -0,0 +1,41 @@ +/* rm-suffix.c: remove any suffix. + + Copyright 2008, 2011, 2012 Karl Berry. + Copyright 1992, 1993, 1995 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, see . */ + +#include + + +string +remove_suffix (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 = xstrdup (s); + + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/str-list.c b/src/texsourc/kpathsea/kpathsea/str-list.c new file mode 100644 index 0000000..750ccd9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/str-list.c @@ -0,0 +1,148 @@ +/* str-list.c: define routines for string lists. + + Copyright 1993, 2008, 2012 Karl Berry. + Copyright 2001, 2005 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, see . */ + +#include + +#include + + +/* See the .h file for comments. */ + + +void +str_list_add (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; +} + +void +cstr_list_add (cstr_list_type *l, const_string s) +{ + STR_LIST_LENGTH (*l)++; + XRETALLOC (STR_LIST (*l), STR_LIST_LENGTH (*l), const_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 (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 (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 (str_list_type *l) +{ + if (STR_LIST (*l)) + { + free (STR_LIST (*l)); + STR_LIST (*l) = NULL; + } +} + + + +/* Remove duplicate elements from L, freeing their space. Since our + lists are so short, we do a maximally inefficient bubble search. */ + +void +str_list_uniqify (str_list_type *l) +{ + unsigned e; + str_list_type ret = str_list_init (); + + for (e = 0; e < STR_LIST_LENGTH (*l); e++) { + string elt1 = STR_LIST_ELT (*l, e); + unsigned f; + for (f = e + 1; f < STR_LIST_LENGTH (*l); f++) { + string elt2 = STR_LIST_ELT (*l, f); + /* I don't think our list should ever contain NULL's, but if + it does, let it stay and don't bother collapsing multiple + NULL's into one. */ + if (FILESTRCASEEQ (elt1, elt2)) { + break; + } + } + + if (f == STR_LIST_LENGTH (*l)) { + str_list_add (&ret, elt1); /* not found */ + } else { + free (elt1); /* duplicate, forget this one */ + } + } + + /* Replace the passed list with what we constructed. */ + *l = ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/str-list.h b/src/texsourc/kpathsea/kpathsea/str-list.h new file mode 100644 index 0000000..770abbd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/str-list.h @@ -0,0 +1,103 @@ +/* str-list.h: declarations for string lists. + + Copyright 1993, 1994, 2007, 2008, 2010, 2012 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_STR_LIST_H +#define KPATHSEA_STR_LIST_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Lists of strings; used for, e.g., directory lists. */ +typedef struct +{ + unsigned length; + string *list; +} str_list_type; + +/* Lists of const strings; used for, e.g., hash tables. */ +typedef struct +{ + unsigned length; + const_string *list; +} cstr_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) + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Return a new, empty, list. */ +static inline str_list_type +str_list_init (void) +{ + str_list_type ret; + + STR_LIST_LENGTH (ret) = 0; + STR_LIST (ret) = NULL; + + return ret; +} +static inline cstr_list_type +cstr_list_init (void) +{ + cstr_list_type ret; + + STR_LIST_LENGTH (ret) = 0; + STR_LIST (ret) = NULL; + + return ret; +} + +#endif /* MAKE_KPSE_DLL */ + +/* 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 KPSEDLL void str_list_add (str_list_type *l, string s); +extern KPSEDLL void cstr_list_add (cstr_list_type *l, const_string s); + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Append all the elements from MORE to TARGET. */ +extern void str_list_concat (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 (str_list_type *l); + +/* Append each element of MORE to each element of TARGET. */ +extern void str_list_concat_elements + (str_list_type *target, str_list_type more); + +/* Remove duplicate elements from L, freeing their space. */ +extern void str_list_uniqify (str_list_type *l); + +#endif /* MAKE_KPSE_DLL */ + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_STR_LIST_H */ diff --git a/src/texsourc/kpathsea/kpathsea/str-llist.c b/src/texsourc/kpathsea/kpathsea/str-llist.c new file mode 100644 index 0000000..cea1781 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/str-llist.c @@ -0,0 +1,93 @@ +/* str-llist.c: implementation of a linked list of strings. + + Copyright 1993, 2008 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, see . */ + +#include + +#include + + +/* Add the new string STR to the end of the list L. */ + +void +str_llist_add (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 (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/src/texsourc/kpathsea/kpathsea/str-llist.h b/src/texsourc/kpathsea/kpathsea/str-llist.h new file mode 100644 index 0000000..bcc9b6d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/str-llist.h @@ -0,0 +1,66 @@ +/* str-llist.h: a linked list of strings, + + It's pretty sad 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. + + Copyright 1993, 1994, 2008, 2010 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, see . */ + +#ifndef STR_LLIST_H +#define STR_LLIST_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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) + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Add the new string E to the end of the list L. */ +extern void str_llist_add (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 (str_llist_type *l, str_llist_elt_type *e); + +#endif /* MAKE_KPSE_DLL */ + +#ifdef __cplusplus +} +#endif + +#endif /* not STR_LLIST_H */ diff --git a/src/texsourc/kpathsea/kpathsea/strcasecmp.c b/src/texsourc/kpathsea/kpathsea/strcasecmp.c new file mode 100644 index 0000000..481a1ae --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/strcasecmp.c @@ -0,0 +1,76 @@ +/* strcasecmp.c - case-insensitive strcmp + + Copyright 2008, 2010 Karl Berry. + Copyright 1991, 1992, 1995 Free Software Foundation, Inc. + This file was part of the GNU C Library. + Modified by Karl Berry for kpathsea. + + 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, see . */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +/* 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/src/texsourc/kpathsea/kpathsea/strstr.c b/src/texsourc/kpathsea/kpathsea/strstr.c new file mode 100644 index 0000000..4042c49 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/strstr.c @@ -0,0 +1,121 @@ +/* strstr.c - search for a substring in string. + + Copyright 2008, 2010 Karl Berry. + Copyright 1994, 1995 Free Software Foundation, Inc. + This file was part of the GNU C Library. + 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, see . */ + +/* + * 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 */ + +#ifdef HAVE_CONFIG_H +#include +#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/src/texsourc/kpathsea/kpathsea/strtol.c b/src/texsourc/kpathsea/kpathsea/strtol.c new file mode 100644 index 0000000..a1864c6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/strtol.c @@ -0,0 +1,291 @@ +/* strtol.c - convert a string to an unsigned long int. + + Copyright 1997, 2008 Karl Berry. + Copyright 1991, 1992, 1994, 1995 Free Software Foundation, Inc. + Modified by Karl Berry for kpathsea. + + 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, see . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define USE_NUMBER_GROUPING +# define STDC_HEADERS +# define HAVE_LIMITS_H +#endif + +#include +#include +#ifndef errno +extern int errno; +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif + +#ifdef STDC_HEADERS +# include +# include +#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 . */ + 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/src/texsourc/kpathsea/kpathsea/systypes.h b/src/texsourc/kpathsea/kpathsea/systypes.h new file mode 100644 index 0000000..e6f920c --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/systypes.h @@ -0,0 +1,28 @@ +/* c-systypes.h: include . It's too bad we need this file, + but some systems don't protect from multiple inclusions. + + Copyright 1993, 2008 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, see . */ + +#ifndef C_SYSTYPES_H +#define C_SYSTYPES_H + +#include + +/* This is the symbol that X uses to determine if has been + read, so we define it. */ +#define __TYPES__ + +#endif /* not C_SYSTYPES_H */ diff --git a/src/texsourc/kpathsea/kpathsea/tests/cnfnewline.test b/src/texsourc/kpathsea/kpathsea/tests/cnfnewline.test new file mode 100644 index 0000000..d1e64d7 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/cnfnewline.test @@ -0,0 +1,16 @@ +#!/bin/sh +# Copyright 2013 Peter Breitenlohner +# You may freely use, modify and/or distribute this file. + +TEXMFCNF=$srcdir/tests/cnfnewline; export TEXMFCNF + +val=`./kpsewhich --debug=-1 --var-value=lastvar` +test x"$val" = xlastval || exit 1 + +# verbose for testing. +#if test x"$val" = xlastval; then +# echo "$0: ok" +#else +# echo "$0: bad, got \`$val'" +# exit 1 +#fi diff --git a/src/texsourc/kpathsea/kpathsea/tests/cnfnewline/texmf.cnf b/src/texsourc/kpathsea/kpathsea/tests/cnfnewline/texmf.cnf new file mode 100644 index 0000000..a3a1890 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/cnfnewline/texmf.cnf @@ -0,0 +1 @@ +lastvar = lastval # with comment, but no final newline \ No newline at end of file diff --git a/src/texsourc/kpathsea/kpathsea/tests/kpseaccess.test b/src/texsourc/kpathsea/kpathsea/tests/kpseaccess.test new file mode 100644 index 0000000..5006bcf --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/kpseaccess.test @@ -0,0 +1,50 @@ +#! /bin/sh + +# Copyright (C) 2010 Peter Breitenlohner +# You may freely use, modify and/or distribute this file. + +ret=0 + +pass () { + echo "***** unexpected success of './kpseaccess $@'" + ret=77 +} + +fail () { + echo "***** unexpected failure of './kpseaccess $@'" + ret=77 +} + +./kpseaccess '' nonesuch && exit 1 +./kpseaccess - nonesuch && exit 1 +./kpseaccess r nonesuch && exit 1 +./kpseaccess w nonesuch && exit 1 +./kpseaccess x nonesuch && exit 1 + +./kpseaccess '' access.o || exit 1 +./kpseaccess - access.o || exit 1 +./kpseaccess rw access.o || exit 1 +# From the access(3p) POSIX manpage: +# If the process has appropriate privileges, an implementation may indicate +# success for X_OK even if none of the execute file permission bits are set. +./kpseaccess x access.o && pass x access.o + +# Testing write access to kpseaccess itself might fail with ETXTBSY. +./kpseaccess rwx kpsewhich || { + fail rwx kpsewhich + ./kpseaccess r kpsewhich || fail r kpsewhich + ./kpseaccess w kpsewhich || fail w kpsewhich + ./kpseaccess x kpsewhich || fail x kpsewhich +} + +./kpseaccess r $srcdir/access.c || exit 1 +./kpseaccess x $srcdir/access.c && pass x $srcdir/access.c + +if ./kpseaccess w $srcdir/access.c; then + echo 'file "$srcdir/access.c" is writable' +else + echo 'file "$srcdir/access.c" is not writable' +fi + +exit $ret + diff --git a/src/texsourc/kpathsea/kpathsea/tests/kpsereadlink.test b/src/texsourc/kpathsea/kpathsea/tests/kpsereadlink.test new file mode 100644 index 0000000..7770a00 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/kpsereadlink.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Copyright (C) 2010 Peter Breitenlohner +# You may freely use, modify and/or distribute this file. + +test "x$LN_S" = 'xln -s' || exit 77 + +./kpsereadlink $LT_OBJDIR/libkpathsea.lai && exit 1 + +link=`./kpsereadlink $LT_OBJDIR/libkpathsea.la` || exit 1 + +test "x$link" = x../libkpathsea.la || exit 1 + diff --git a/src/texsourc/kpathsea/kpathsea/tests/kpsestat.test b/src/texsourc/kpathsea/kpathsea/tests/kpsestat.test new file mode 100644 index 0000000..8e1cf85 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/kpsestat.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Copyright (C) 2010 Peter Breitenlohner +# You may freely use, modify and/or distribute this file. + +./kpsestat = nonesuch 2>/dev/null && exit 1 + +for f in . kpsestat kpsestat.o; do + echo "kpsestat = $f => `./kpsestat = $f`" +done + +for m in -rw g-r u-w o+x -rw,u+s -rw,g+s -rw,o+t; do + echo "kpsestat $m kpsestat.o => `./kpsestat $m kpsestat.o`" +done + +echo "kpsestat = \$srcdir => `./kpsestat = $srcdir`" +echo "kpsestat = \$srcdir/ => `./kpsestat = $srcdir/`" +echo "kpsestat = \$srcdir/kpsestat.c => `./kpsestat = $srcdir/kpsestat.c`" + diff --git a/src/texsourc/kpathsea/kpathsea/tests/kpsewhich.test b/src/texsourc/kpathsea/kpathsea/tests/kpsewhich.test new file mode 100644 index 0000000..b15f2b3 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tests/kpsewhich.test @@ -0,0 +1,21 @@ +#! /bin/sh +# Copyright 2010-2013 Peter Breitenlohner +# You may freely use, modify and/or distribute this file. + +TEXMFCNF=$srcdir +export TEXMFCNF + +./kpsewhich --var-value=TEXMFCNF || exit 1 # environment variable + +./kpsewhich --var-value=TEXMFMAIN || exit 1 + +./kpsewhich --expand-var=\$TEXMFMAIN || exit 1 + +TEXINPUTS=$srcdir/../tests/texmf \ + ./kpsewhich --all plain || exit 1 + +AFMFONTS=$srcdir/../tests/texmf \ + ./kpsewhich afmtest.afm || exit 1 + +BSTINPUTS=$srcdir/../tests/texmf \ + ./kpsewhich plain.bst || exit 1 diff --git a/src/texsourc/kpathsea/kpathsea/tex-file.c b/src/texsourc/kpathsea/kpathsea/tex-file.c new file mode 100644 index 0000000..323e744 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-file.c @@ -0,0 +1,1442 @@ +/* tex-file.c: high-level file searching by format. + + Copyright 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011 + 2012 Karl Berry. + Copyright 1998-2005 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, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* 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" +#define LUA_ENVS "LUAINPUTS" +#define FONTFEATURES_ENVS "FONTFEATURES" +#define FONTCIDMAPS_ENVS "FONTCIDMAPS" +#define MLBIB_ENVS "MLBIBINPUTS", BIB_ENVS +#define MLBST_ENVS "MLBSTINPUTS", BST_ENVS +#define CLUA_ENVS "CLUAINPUTS" +#define RIS_ENVS "RISINPUTS" +#define BLTXML_ENVS "BLTXMLINPUTS" + +/* 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 +kpathsea_init_fallback_resolutions (kpathsea kpse, 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 = kpathsea_expand_default (kpse, size_str, default_sizes); + + /* Initialize the list of last-resort sizes. */ + for (size = kpathsea_path_element (kpse, size_list); size != NULL; + size = kpathsea_path_element (kpse, 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; +} + +#if defined (KPSE_COMPAT_API) +void +kpse_init_fallback_resolutions ( string envvar) +{ + kpathsea_init_fallback_resolutions (kpse_def, envvar); +} +#endif + + +/* We should be able to set the program arguments in the same way. Not + to mention the path values themselves. */ + +void +kpathsea_set_program_enabled (kpathsea kpse, 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; + } +} + + +#if defined (KPSE_COMPAT_API) +void +kpse_set_program_enabled (kpse_file_format_type fmt, + boolean value, kpse_src_type level) +{ + kpathsea_set_program_enabled (kpse_def, fmt, value, level); +} + +#endif + + +/* Web2c and kpsewhich have command-line options to set this stuff. May + as well have a common place. */ + +void +kpathsea_maketex_option (kpathsea kpse, 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. */ + 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, "fmt")) { + fmt = kpse_fmt_format; + } else if (FILESTRCASEEQ (fmtname, "ofm")) { + fmt = kpse_ofm_format; + } else if (FILESTRCASEEQ (fmtname, "ocp")) { + fmt = kpse_ocp_format; + } else { + fprintf (stderr, "\nkpathsea: Unknown mktex format: %s\n", fmtname); + } + + if (fmt != kpse_last_format) { + kpathsea_set_program_enabled (kpse, fmt, value, kpse_src_cmdline); + } +} + +#if defined (KPSE_COMPAT_API) +void +kpse_maketex_option (const_string fmtname, boolean value) +{ + kpathsea_maketex_option (kpse_def, fmtname, value); +} +#endif + + +/* Macro subroutine for `init_path'. 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; \ + tmp = info->path; \ + info->path = kpathsea_expand_default (kpse, try_path, info->path); \ + free (tmp); \ + 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 (kpathsea kpse, kpse_format_info_type *info, + const_string default_path, ...) +{ + string env_name; + string env_value = NULL; + string var = NULL; + string tmp; + va_list ap; + + info->default_path = default_path; + + va_start (ap, 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 value simultaneously with the envvar value, to avoid having to + go through the envvar list twice, + that would mean having to create a str_list and use it twice. */ + 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 { /* Try PATH_prog. */ + free (evar); + evar = concat3 (env_name, "_", kpse->program_name); + env_value = getenv (evar); + if (env_value && *env_value) { + var = evar; + } else { /* Try simply PATH. */ + free (evar); + 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 = kpathsea_cnf_get (kpse, 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->raw_path = info->default_path; + info->path = xstrdup (info->raw_path); + info->path_source = "compile-time paths.h"; + + EXPAND_DEFAULT (info->cnf_path, "texmf.cnf"); + EXPAND_DEFAULT (info->client_path, "program config file"); + + if (var) { + /* Translate `;' in the envvar into `:' if that's our ENV_SEP. */ + if (IS_ENV_SEP (':')) { + string loc; + env_value = xstrdup (env_value); /* Freed below. */ + for (loc = env_value; *loc; loc++) { + if (*loc == ';') + *loc = ':'; + } + } + EXPAND_DEFAULT (env_value, concat (var, " environment variable")); + /* Do not free the copied env_value, because EXPAND_DEFAULT set + raw_path to point to it. If it gets overwritten again, tough. */ + } + + EXPAND_DEFAULT (info->override_path, "application override variable"); + tmp = info->path; + info->path = kpathsea_brace_expand (kpse, info->path); + free (tmp); +} + + +/* Some file types have more than one suffix, and sometimes it is + convenient to modify the list of searched suffixes. */ + +static void +kpathsea_set_suffixes_va_list (kpathsea kpse, kpse_file_format_type format, + boolean alternate, va_list 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++; + /* This is essentially + XRETALLOC (*list, count + 1, const_string); + except that MSVC warns without the cast to `void *'. */ + *list = (const_string *) xrealloc ((void *) *list, + (count + 1) * sizeof(const_string)); + (*list)[count - 1] = s; + } + (*list)[count] = NULL; +} + +void +kpathsea_set_suffixes (kpathsea kpse, kpse_file_format_type format, + boolean alternate, ...) +{ + va_list ap; + va_start (ap, alternate); + kpathsea_set_suffixes_va_list (kpse, format, alternate, ap); + va_end (ap); +} + + +#if defined (KPSE_COMPAT_API) +void +kpse_set_suffixes (kpse_file_format_type format, + boolean alternate, ...) +{ + va_list ap; + va_start (ap, alternate); + kpathsea_set_suffixes_va_list (kpse_def, format, alternate, ap); + va_end (ap); +} +#endif + + +/* 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) kpathsea_set_suffixes(kpse, format, false, args, NULL) +#define ALT_SUFFIXES(args) kpathsea_set_suffixes(kpse, 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 (kpse, &FMT_INFO, default_path, envs, NULL); \ + envvar_list = concatn_with_spaces (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 (kpathsea kpse, kpse_file_format_type fmt, + const_string dflt_prog, ...) +{ + 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 = kpathsea_var_value (kpse, PROG); /* $ENV/cnf{"MKTEXPK"} */ + const_string arg; + va_list ap; + + /* 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; + va_start (ap, dflt_prog); + while ((arg = va_arg (ap, string)) != NULL) { + f->argc++; + f->argv = (const_string *) xrealloc ((void *) f->argv, + (f->argc + 1) * sizeof(const_string)); + f->argv[f->argc - 1] = arg; + } + va_end (ap); + 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. */ + kpathsea_set_program_enabled (kpse, 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 (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); +} + +/* Same as concatn but puts a space between each element. All this just + for nice debugging output. But it's useful. */ + +static string +concatn_with_spaces (const_string str1, ...) +{ + string arg; + string ret; + va_list ap; + + if (!str1) + return NULL; + + ret = xstrdup (str1); + + va_start (ap, str1); + while ((arg = va_arg (ap, string)) != NULL) + { + string temp = concat3 (ret, " ", arg); + free (ret); + ret = temp; + } + va_end (ap); + + return ret; +} + + +/* Initialize everything for FORMAT. */ + +const_string +kpathsea_init_format (kpathsea kpse, kpse_file_format_type format) +{ + string envvar_list; /* only for debug output, set in INIT_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 (kpse, 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 (kpse, 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 (kpse, 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 (kpse, 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 (kpse, format, "mktexfmt", NULL); + INIT_FORMAT ("fmt", DEFAULT_TEXFORMATS, FMT_ENVS); + SUFFIXES (".fmt"); + 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 (kpse, format, "mktexfmt", NULL); + INIT_FORMAT ("mem", DEFAULT_MPMEMS, MEM_ENVS); + SUFFIXES (".mem"); + FMT_INFO.binmode = true; + break; + case kpse_mf_format: + init_maketex (kpse, 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 (kpse, 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 (kpse, 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"); + ALT_SUFFIXES (".pl"); + 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); +#define OVF_SUFFIXES ".ovf", ".vf" + SUFFIXES (OVF_SUFFIXES); + FMT_INFO.suffix_search_only = true; + FMT_INFO.binmode = true; + break; + case kpse_ovp_format: + INIT_FORMAT ("ovp", DEFAULT_OVPFONTS, OVP_ENVS); + SUFFIXES (".ovp"); + ALT_SUFFIXES (".vpl"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_pict_format: + INIT_FORMAT ("graphic/figure", DEFAULT_TEXINPUTS, PICT_ENVS); +#define ALT_PICT_SUFFIXES ".eps", ".epsi" + ALT_SUFFIXES (ALT_PICT_SUFFIXES); + FMT_INFO.binmode = true; + break; + case kpse_tex_format: + init_maketex (kpse, format, "mktextex", NULL); + INIT_FORMAT ("tex", DEFAULT_TEXINPUTS, TEX_ENVS); + SUFFIXES (".tex"); + /* TeX files can have any obscure suffix in the world (or none at + all). Only check for the most common ones. */ +#define ALT_TEX_SUFFIXES ".sty",".cls",".fd",".aux",".bbl",".def",".clo",".ldf" + ALT_SUFFIXES (ALT_TEX_SUFFIXES); + break; + case kpse_tex_ps_header_format: + INIT_FORMAT ("PostScript header", DEFAULT_TEXPSHEADERS, + TEX_PS_HEADER_ENVS); +/* Unfortunately, at one time dvips used this format for type1 fonts. */ +#define ALT_TEXPSHEADER_SUFFIXES ".pro" + ALT_SUFFIXES (ALT_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); +#define ALT_SOURCES_SUFFIXES ".dtx", ".ins" + ALT_SUFFIXES (ALT_SOURCES_SUFFIXES); + 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", ".dfont" + 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); +#define TYPE42_SUFFIXES ".t42", ".T42" + SUFFIXES (TYPE42_SUFFIXES); + 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"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_cmap_format: + INIT_FORMAT ("cmap files", DEFAULT_CMAPFONTS, CMAP_ENVS); + break; + case kpse_sfd_format: + INIT_FORMAT ("subfont definition files", DEFAULT_SFDFONTS, SFD_ENVS); + SUFFIXES (".sfd"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_opentype_format: + INIT_FORMAT ("opentype fonts", DEFAULT_OPENTYPEFONTS, OPENTYPE_ENVS); + SUFFIXES (".otf"); + FMT_INFO.suffix_search_only = true; + 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"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_texmfscripts_format: + INIT_FORMAT ("texmfscripts", DEFAULT_TEXMFSCRIPTS, TEXMFSCRIPTS_ENVS); + break; + case kpse_lua_format: + INIT_FORMAT ("lua", DEFAULT_LUAINPUTS, LUA_ENVS); +#define LUA_SUFFIXES \ + ".lua", ".luatex", ".luc", ".luctex", ".texlua", ".texluc", ".tlu" + SUFFIXES (LUA_SUFFIXES); + FMT_INFO.suffix_search_only = true; + break; + case kpse_fea_format: + INIT_FORMAT("font feature files", DEFAULT_FONTFEATURES, FONTFEATURES_ENVS); + SUFFIXES (".fea"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_cid_format: + INIT_FORMAT ("cid maps", DEFAULT_FONTCIDMAPS, FONTCIDMAPS_ENVS); +#define CID_SUFFIXES ".cid", ".cidmap" + SUFFIXES (CID_SUFFIXES); + FMT_INFO.suffix_search_only = true; + break; + case kpse_mlbib_format: + INIT_FORMAT ("mlbib", DEFAULT_MLBIBINPUTS, MLBIB_ENVS); +#define MLBIB_SUFFIXES ".mlbib", ".bib" + SUFFIXES (MLBIB_SUFFIXES); + FMT_INFO.suffix_search_only = true; + break; + case kpse_mlbst_format: + INIT_FORMAT ("mlbst", DEFAULT_MLBSTINPUTS, MLBST_ENVS); +#define MLBST_SUFFIXES ".mlbst", ".bst" + SUFFIXES (MLBST_SUFFIXES); + FMT_INFO.suffix_search_only = true; + break; + case kpse_clua_format: + INIT_FORMAT ("clua", DEFAULT_CLUAINPUTS, CLUA_ENVS); +#define CLUA_SUFFIXES ".dll", ".so" + SUFFIXES (CLUA_SUFFIXES); + FMT_INFO.suffix_search_only = true; + break; + case kpse_ris_format: + INIT_FORMAT ("ris", DEFAULT_RISINPUTS, RIS_ENVS); + SUFFIXES (".ris"); + FMT_INFO.suffix_search_only = true; + break; + case kpse_bltxml_format: + INIT_FORMAT ("bltxml", DEFAULT_BLTXMLINPUTS, BLTXML_ENVS); + SUFFIXES (".bltxml"); + FMT_INFO.suffix_search_only = true; + break; + default: + LIB_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 (KPATHSEA_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)); + DEBUGF1 (" environment variables = %s\n", envvar_list); + 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 (" 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); + DEBUGF1 (" open files in binary mode = %d\n", FMT_INFO.binmode); + DEBUGF1 (" numeric format value = %d\n", format); + } +#endif /* KPSE_DEBUG */ + + return FMT_INFO.path; +} + +#if defined (KPSE_COMPAT_API) +const_string +kpse_init_format (kpse_file_format_type format) +{ + return kpathsea_init_format (kpse_def, format); +} +#endif + + +/* These are subroutines called twice when finding file, to construct + the list of names to search for. */ + +/* We don't even use fontmaps any more in practice, they were for things + like the lcircle10/lcirc10 name change many years ago, but let's keep + the support working nonetheless. */ + +static void +target_fontmaps (kpathsea kpse, string **target, unsigned *count, + const_string name) +{ + const_string *mapped_names = kpathsea_fontmap_lookup (kpse, name); + + if (mapped_names != NULL) { + const_string mapped_name; + /* We leak mapped_names and its elements, some of the time. */ + while ((mapped_name = *mapped_names++) != NULL) { + (*target)[(*count)] = xstrdup (mapped_name); + (*count)++; + XRETALLOC ((*target), (*count)+1, string); + } + } +} + + +/* Possibly add NAME (and any fontmap equivalents) to the string list + in TARGET, depending on the various other parameters. */ + +static void +target_asis_name (kpathsea kpse, string **target, unsigned *count, + kpse_file_format_type format, + const_string name, boolean use_fontmaps, boolean has_potential_suffix, + string has_any_suffix) +{ + (void) has_any_suffix; /* -Wunused */ + /* Look for the name we've been given, provided non-suffix + searches are allowed or the name already includes a suffix. */ + if (has_potential_suffix || !FMT_INFO.suffix_search_only) { + (*target)[(*count)] = xstrdup (name); + (*count)++; + XRETALLOC ((*target), (*count)+1, string); + + if (use_fontmaps) { + target_fontmaps (kpse, target, count, name); + } + } +} + + +/* Possibly add NAME (and any fontmap equivalents), with any suffixes + for this FORMAT appended, to TARGET -- if it doesn't already have one + of the potential suffixes for FORMAT. */ + +static void +target_suffixed_names (kpathsea kpse, string **target, unsigned *count, + kpse_file_format_type format, + const_string name, boolean use_fontmaps, boolean has_potential_suffix) +{ + const_string *ext; + if (has_potential_suffix || !FMT_INFO.suffix) { + return; + } + + for (ext = FMT_INFO.suffix; *ext; ext++) { + string name_with_suffix = concat (name, *ext); + (*target)[(*count)] = name_with_suffix; + (*count)++; + XRETALLOC ((*target), (*count)+1, string); + + if (use_fontmaps) { + target_fontmaps (kpse, target, count, name_with_suffix); + } + } +} + +/* 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 +kpathsea_find_file (kpathsea kpse, const_string name, + kpse_file_format_type format, boolean must_exist) +{ + string *ret_list = kpathsea_find_file_generic (kpse, name, format, + must_exist, false); + string ret = *ret_list; + free (ret_list); + return ret; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_find_file (const_string name, kpse_file_format_type format, + boolean must_exist) +{ + return kpathsea_find_file(kpse_def, name, format, must_exist); +} +#endif + +/* As with `kpse_find_file', but also allow passing ALL for the search, + hence we always return a NULL-terminated list. */ + +string * +kpathsea_find_file_generic (kpathsea kpse, const_string const_name, + kpse_file_format_type format, + boolean must_exist, boolean all) +{ + string *target, name; + const_string *ext; + unsigned count; + unsigned name_len = 0; + boolean has_potential_suffix = false; + string has_any_suffix = NULL; + string try_std_extension_first = NULL; + 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 (const_name); + + if (FMT_INFO.path == NULL) + kpathsea_init_format (kpse, format); + +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) + DEBUGF3 ("kpse_find_file: searching for %s of type %s (from %s)\n", + const_name, FMT_INFO.type, FMT_INFO.path_source); +#endif /* KPSE_DEBUG */ + + /* Do variable and tilde expansion. */ + name = kpathsea_expand (kpse, const_name); + + try_std_extension_first + = kpathsea_var_value (kpse, "try_std_extension_first"); + has_any_suffix = strrchr (name, '.'); + if (has_any_suffix) { + string p = strchr (has_any_suffix, DIR_SEP); + if (p) { + has_any_suffix = NULL; + } + } + + /* Does NAME already end in a possible suffix? */ + name_len = strlen (name); + if (FMT_INFO.suffix) { + for (ext = FMT_INFO.suffix; !has_potential_suffix && *ext; ext++) { + unsigned suffix_len = strlen (*ext); + has_potential_suffix = (name_len >= suffix_len + && FILESTRCASEEQ (*ext, name + name_len - suffix_len)); + } + } + if (!has_potential_suffix && FMT_INFO.alt_suffix) { + for (ext = FMT_INFO.alt_suffix; !has_potential_suffix && *ext; ext++) { + unsigned suffix_len = strlen (*ext); + has_potential_suffix = (name_len >= suffix_len + && FILESTRCASEEQ (*ext, name + name_len - suffix_len)); + } + } + + /* Set up list of target names to search for, the order depending on + try_std_extension_first. */ + count = 0; + target = XTALLOC1 (string); + + if (has_any_suffix + && (try_std_extension_first == NULL || *try_std_extension_first == 'f' + || *try_std_extension_first == '0')) { + target_asis_name (kpse, &target, &count, format, name, use_fontmaps, + has_potential_suffix, has_any_suffix); + target_suffixed_names (kpse, &target, &count, format, name, use_fontmaps, + has_potential_suffix); + } else { + target_suffixed_names (kpse, &target, &count, format, name, use_fontmaps, + has_potential_suffix); + target_asis_name (kpse, &target, &count, format, name, use_fontmaps, + has_potential_suffix, has_any_suffix); + } + + /* Terminate list. */ + target[count] = NULL; + + if (try_std_extension_first) { + free (try_std_extension_first); + } + + /* Search, trying to minimize disk-pounding. */ + ret = kpathsea_path_search_list_generic (kpse, FMT_INFO.path, + target, false, all); + + /* Do we need to pound the disk? */ + if (! *ret && must_exist) { + for (count = 0; target[count]; count++) + free (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. */ + if (!has_potential_suffix && FMT_INFO.suffix_search_only) { + for (ext = FMT_INFO.suffix; *ext; ext++) + target[count++] = concat (name, *ext); + } + if (has_potential_suffix || !FMT_INFO.suffix_search_only) { + target[count++] = xstrdup (name); + } + target[count] = NULL; + ret = kpathsea_path_search_list_generic (kpse, FMT_INFO.path, + target, true, all); + } + + /* Free the list we created. */ + for (count = 0; target[count]; count++) + free (target[count]); + free (target); + + /* If nothing was found, call mktex* to create a missing file. Since + this returns a single string, morph it into a list. */ + if (! *ret && must_exist) { + ret = XTALLOC (2, string); + ret[0] = kpathsea_make_tex (kpse, format, name); + if (ret[0]) { + ret[1] = NULL; + } + } + + free (name); + + return ret; +} + +#if defined (KPSE_COMPAT_API) +string * +kpse_find_file_generic (const_string name, kpse_file_format_type format, + boolean must_exist, boolean all) +{ + return kpathsea_find_file_generic(kpse_def, name, format, must_exist, all); +} +#endif + + + +/* Return true if FNAME is acceptable to open for reading or writing. */ + +typedef enum ok_type { + ok_reading, + ok_writing +} ok_type; + +static const_string ok_type_name[] = { + "reading from", + "writing to" +}; + +static boolean +kpathsea_name_ok (kpathsea kpse, const_string fname, const_string check_var, + const_string default_choice, ok_type action, boolean silent) +{ + /* We distinguish three cases: + 'a' (any) allows any file to be opened. + 'r' (restricted) means disallowing special file names. + 'p' (paranoid) means being really paranoid: disallowing special file + names and restricting output files to be in or below + the working directory or $TEXMFOUTPUT, while input files + must be below the current directory, $TEXMFOUTPUT, or + (implicitly) in the system areas. + We default to "paranoid". The error messages from TeX may be puzzling. + This function contains several return and goto statements, be careful. */ + + const_string open_choice = kpathsea_var_value (kpse, check_var); + + if (!open_choice) + open_choice = default_choice; + + if (*open_choice == 'a' || *open_choice == 'y' || *open_choice == '1') + return true; + +#if defined (unix) && !defined (MSDOS) + { + /* Disallow .rhosts, .login, .ssh/, ..somefile, ..somedir/somefile, + etc. But allow .tex (for base LaTeX). */ + const_string q; + const_string qq = fname; + while ((q = strchr (qq, '.'))) { /* at each dot */ + if ((q == fname || IS_DIR_SEP (*(q - 1))) /* start or / precedes dot? */ + && !IS_DIR_SEP (*(q + 1)) /* ok if /./ */ + && !(*(q + 1) == '.' && IS_DIR_SEP (*(q + 2))) /* ok if /../ */ + && !STREQ (q, ".tex")) { /* specially allow .tex */ + goto not_ok; + } + qq = q + 1; + } + } +#else + /* Other OSs don't have special names? */ +#endif + + if (*open_choice == 'r' || *open_choice == 'n' || *open_choice == '0') + return true; + + /* Paranoia originally supplied by Charles Karney. */ + if (kpathsea_absolute_p (kpse, fname, false)) { + const_string texmfoutput = kpathsea_var_value (kpse, "TEXMFOUTPUT"); + /* Absolute pathname is only OK if TEXMFOUTPUT is set, it's not empty, + fname begins the TEXMFOUTPUT, and is followed by / */ + if (!texmfoutput || *texmfoutput == '\0' + || fname != strstr (fname, texmfoutput) + || !IS_DIR_SEP (fname[strlen (texmfoutput)])) + goto not_ok; + } + /* For all pathnames, we disallow "../" at the beginning or "/../" + anywhere. */ + if (fname[0] == '.' && fname[1] == '.' && IS_DIR_SEP(fname[2])) + goto not_ok; + else { + /* Check for "/../". Since more than one character can be matched + by IS_DIR_SEP, we cannot use "/../" itself. */ + const_string dotpair = strstr (fname, ".."); + while (dotpair) { + /* If dotpair[2] == DIR_SEP, then dotpair[-1] is well-defined, + because the "../" case was handled above. */ + if (IS_DIR_SEP (dotpair[2]) && IS_DIR_SEP (dotpair[-1])) + goto not_ok; + /* Continue after the dotpair. */ + dotpair = strstr (dotpair+2, ".."); + } + } + + /* We passed all tests. */ + return true; + + not_ok: /* Some test failed. */ + if (!silent) + fprintf (stderr, "\n%s: Not %s %s (%s = %s).\n", + kpse->invocation_name, ok_type_name[action], fname, + check_var, open_choice); + return false; +} + +/* For input default to all. */ + +boolean +kpathsea_in_name_ok_silent (kpathsea kpse, const_string fname) +{ + return kpathsea_name_ok (kpse, fname, "openin_any", "a", ok_reading, true); +} + +boolean +kpathsea_in_name_ok (kpathsea kpse, const_string fname) +{ + return kpathsea_name_ok (kpse, fname, "openin_any", "a", ok_reading, false); +} + + +#if defined(WIN32) || defined(__CYGWIN__) +static int +Isspace (char c) +{ + return (c == ' ' || c == '\t'); +} + +static boolean +executable_filep (kpathsea kpse, const_string fname, boolean silent) +{ + const_string fn; + string p, q, base; + string *pp; + +/* check openout_any */ + p = kpathsea_var_value (kpse, "openout_any"); + if (p && *p == 'p') { + free (p); +/* get base name + we cannot use xbasename() for abnormal names. +*/ + p = strrchr (fname, '/'); + if (p) + fn = p + 1; + else + fn = fname; + p = strrchr (fn, '\\'); + if (p) + fn = p + 1; + base = xstrdup (fn); +#if defined(__CYGWIN__) + for (p = base; *p; p++) + *p = TOLOWER (*p); + p = base; +#else + p = (char *) strlwr (base); +#endif + for (q = p + strlen (p) - 1; + (q >= p) && ((*q == '.') || (Isspace (*q))); q--) { + *q = '\0'; /* remove trailing '.' , ' ' and '\t' */ + } + q = strrchr (p, '.'); /* get extension part */ + pp = kpse->suffixlist; + if (pp && q) { + while (*pp) { + if (strchr (fname, ':') || !strcmp (q, *pp)) { + if (!silent) + fprintf (stderr, "\n%s: Forbidden to open for writing\n", fname); + free (base); + return true; + } + pp++; + } + } + free (base); + } else if (p) { + free (p); + } + return false; +} +#endif /* WIN32 || __CYGWIN__ */ + +static boolean +kpathsea_out_name_ok_1 (kpathsea kpse, const_string fname, boolean silent) +{ +#if defined(WIN32) || defined(__CYGWIN__) + /* Output of an executable file is restricted on Windows */ + if (executable_filep (kpse, fname, silent)) + return false; +#endif /* WIN32 || __CYGWIN__ */ + /* For output, default to paranoid. */ + return kpathsea_name_ok (kpse, fname, "openout_any", "p", ok_writing,silent); +} + +boolean +kpathsea_out_name_ok_silent (kpathsea kpse, const_string fname) +{ + return kpathsea_out_name_ok_1 (kpse, fname, true); +} + +boolean +kpathsea_out_name_ok (kpathsea kpse, const_string fname) +{ + return kpathsea_out_name_ok_1 (kpse, fname, false); +} + +#if defined (KPSE_COMPAT_API) +boolean +kpse_in_name_ok (const_string fname) +{ + /* For input default to all. */ + return kpathsea_in_name_ok (kpse_def, fname); +} + +boolean +kpse_out_name_ok (const_string fname) +{ + /* For output, default to paranoid. */ + return kpathsea_out_name_ok (kpse_def, fname); +} +#endif + + + +/* Open NAME along the search path for TYPE for reading and return the + resulting file, or exit with an error message. */ + +FILE * +kpathsea_open_file (kpathsea kpse, const_string name, + kpse_file_format_type type) +{ + string fullname = kpathsea_find_file (kpse, 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 { + LIB_FATAL2 ("%s file `%s' not found", kpse->format_info[type].type, name); + } + } + + return f; +} + +#if defined (KPSE_COMPAT_API) +FILE * +kpse_open_file (const_string name, kpse_file_format_type type) +{ + return kpathsea_open_file(kpse_def, name, type); +} +#endif + + +/* When using the %& 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 format_info, and would cause all of tex-file to be pulled + in by programs that do not need it. */ + +void +kpathsea_reset_program_name (kpathsea kpse, 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); + kpathsea_xputenv(kpse, "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 because their + values may differ with the new program name. */ + if (kpse->format_info[i].path != NULL) { + free (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. */ + } +} + +#if defined (KPSE_COMPAT_API) +void +kpse_reset_program_name (const_string progname) +{ + kpathsea_reset_program_name (kpse_def, progname); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/tex-file.h b/src/texsourc/kpathsea/kpathsea/tex-file.h new file mode 100644 index 0000000..1310b51 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-file.h @@ -0,0 +1,141 @@ +/* tex-file.h: find files in a particular format. + + Copyright 1993, 1994, 1995, 1996, 2007, 2008, 2009, 2010 Karl Berry. + Copyright 1998-2005 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, see . */ + +#ifndef KPATHSEA_TEX_FILE_H +#define KPATHSEA_TEX_FILE_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* 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 kpathsea_init_fallback_resolutions (kpathsea kpse, string envvar); + +#endif /* MAKE_KPSE_DLL */ + +/* If LEVEL is >= FMT's `program_enable_level', set `program_enabled_p' + for FMT to VALUE. */ +extern KPSEDLL void kpathsea_set_program_enabled (kpathsea kpse, + 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 kpathsea_maketex_option (kpathsea kpse, + const_string fmtname, boolean value); + +/* Change the list of searched suffixes for FORMAT to ... (alternate + suffixes if ALTERNATE is true). */ +extern KPSEDLL void kpathsea_set_suffixes (kpathsea kpse, + 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 kpathsea_init_format (kpathsea kpse, + kpse_file_format_type format); + +/* 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 kpathsea_find_file (kpathsea kpse, const_string name, + kpse_file_format_type format, boolean must_exist); + +/* Ditto, allowing ALL parameter and hence returning a NULL-terminated + list of results. */ +extern KPSEDLL string *kpathsea_find_file_generic (kpathsea kpse, + const_string name, kpse_file_format_type format, boolean must_exist, + boolean all); + +/* Return true if FNAME is acceptable to open for reading or writing. + If not acceptable, write a message to stderr. */ +extern KPSEDLL boolean kpathsea_in_name_ok (kpathsea kpse, const_string fname); +extern KPSEDLL boolean kpathsea_out_name_ok (kpathsea kpse, const_string fname); + +/* As above, but no error message. */ +extern KPSEDLL boolean kpathsea_in_name_ok_silent + (kpathsea kpse, const_string fname); +extern KPSEDLL boolean kpathsea_out_name_ok_silent + (kpathsea kpse, const_string fname); + +/* Don't just look up the name, actually open the file. */ +extern KPSEDLL FILE *kpathsea_open_file (kpathsea kpse, const_string name, + kpse_file_format_type format); + +/* 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 kpathsea_reset_program_name (kpathsea kpse, + const_string progname); + + +#if defined (KPSE_COMPAT_API) + +extern void kpse_init_fallback_resolutions (string envvar); + +extern KPSEDLL void kpse_set_program_enabled (kpse_file_format_type fmt, + boolean value, kpse_src_type level); + +extern KPSEDLL void kpse_maketex_option (const_string fmtname, boolean value); + +extern KPSEDLL void kpse_set_suffixes (kpse_file_format_type format, + boolean alternate, ...); + +extern KPSEDLL const_string kpse_init_format (kpse_file_format_type); + +extern KPSEDLL string kpse_find_file (const_string name, + kpse_file_format_type format, boolean must_exist); + +extern KPSEDLL string *kpse_find_file_generic + (const_string name, kpse_file_format_type format, + boolean must_exist, boolean all); + +extern KPSEDLL boolean kpse_in_name_ok (const_string fname); +extern KPSEDLL boolean kpse_out_name_ok (const_string fname); + +/* 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) + +extern KPSEDLL FILE *kpse_open_file (const_string, kpse_file_format_type); + +extern KPSEDLL void kpse_reset_program_name (const_string progname); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_TEX_FILE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/tex-glyph.c b/src/texsourc/kpathsea/kpathsea/tex-glyph.c new file mode 100644 index 0000000..79b27f6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-glyph.c @@ -0,0 +1,417 @@ +/* tex-glyph.c: search for GF/PK files. + + Copyright 1993, 1994, 1995, 1996, 2008, 2009, 2011 Karl Berry. + Copyright 1997, 1998, 1999, 2005 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, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +/* 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" +#ifdef WIN32 +#define DOS_BITMAP_SPEC "$KPATHSEA_DPI/$KPATHSEA_NAME.$KPATHSEA_FORMAT" +#endif + +/* Look up font $KPATHSEA_NAME at resolution $KPATHSEA_DPI in PATH, + with filename suffix EXTENSION. Return file found or NULL. */ + +static string +try_format (kpathsea kpse, kpse_file_format_type format) +{ + static const_string bitmap_specs[] + = { UNIX_BITMAP_SPEC, DPI_BITMAP_SPEC, +#ifdef WIN32 + DOS_BITMAP_SPEC, +#endif + NULL }; + const_string *spec; + boolean must_exist; + const_string *sfx; + string ret = NULL; + const_string path = kpse->format_info[format].path; + if (!path) + path = kpathsea_init_format (kpse, format); + + /* Set the suffix on the name we'll be searching for. */ + sfx = kpse->format_info[format].suffix; + if (sfx && *sfx) + kpathsea_xputenv (kpse, "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 = kpathsea_var_expand (kpse, *spec); + ret = kpathsea_path_search (kpse, 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 (kpathsea kpse, 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; + + kpathsea_xputenv_int (kpse, "KPATHSEA_DPI", dpi); + + /* Look for PK first (since it's more likely to be found), then GF. */ + ret = try_pk ? try_format (kpse, kpse_pk_format) : NULL; + format_found = kpse_pk_format; + + if (ret == NULL && try_gf) + { + ret = try_format (kpse, kpse_gf_format); + format_found = kpse_gf_format; + } + + if (ret != NULL && glyph_file) + { /* Success. Fill in the return info. */ + glyph_file->name = 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 (kpathsea kpse, const_string fontname, unsigned dpi, + kpse_file_format_type format, + kpse_glyph_file_type *glyph_file) +{ + string ret = try_size (kpse, 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 (kpse, 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 (kpathsea kpse, const_string *fontname_ptr, unsigned dpi, + kpse_file_format_type format, + kpse_glyph_file_type *glyph_file) +{ + const_string *mapped_names; + const_string fontname = *fontname_ptr; + string ret = NULL; + + mapped_names = kpathsea_fontmap_lookup (kpse, fontname); + if (mapped_names) { + const_string mapped_name; + const_string first_name = *mapped_names; + while (!ret && (mapped_name = *mapped_names++)) { + kpathsea_xputenv (kpse, "KPATHSEA_NAME", mapped_name); + ret = try_resolution (kpse, 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 (!kpathsea_fontmap_lookup (kpse, 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 (kpathsea kpse, + 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. */ + loc = 0; /* -Wall */ + /* 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 (kpse, 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 +kpathsea_find_glyph (kpathsea kpse, + const_string passed_fontname, unsigned dpi, + kpse_file_format_type format, + kpse_glyph_file_type *glyph_file) +{ + string ret; + kpse_glyph_source_type source; + const_string fontname = passed_fontname; + + /* Start the search: try the name we're given. */ + source = kpse_glyph_source_normal; + kpathsea_xputenv (kpse, "KPATHSEA_NAME", fontname); + ret = try_resolution (kpse, 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 (kpse, &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 && !kpathsea_absolute_p (kpse, fontname, true)) { + source = kpse_glyph_source_maketex; + /* `try_resolution' leaves the envvar set randomly. */ + kpathsea_xputenv_int (kpse, "KPATHSEA_DPI", dpi); + ret = kpathsea_make_tex (kpse, 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 (kpse, 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; + kpathsea_xputenv (kpse, "KPATHSEA_NAME", name); + + /* As before, first try it at the given size. */ + ret = try_resolution (kpse, name, dpi, format, glyph_file); + + /* The fallback font at the fallback resolutions. */ + if (!ret && kpse->fallback_resolutions) + ret = try_fallback_resolutions (kpse, 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; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_find_glyph (const_string passed_fontname, unsigned dpi, + kpse_file_format_type format, + kpse_glyph_file_type *glyph_file) +{ + return kpathsea_find_glyph (kpse_def, passed_fontname, dpi, format, + glyph_file); +} +#endif + + +/* The tolerances change whether we base things on DPI1 or DPI2. */ + +boolean +kpathsea_bitmap_tolerance (kpathsea kpse, 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; + (void)kpse; /* currenty not used */ + + return lower_bound <= dpi1 && dpi1 <= upper_bound; +} + +#if defined (KPSE_COMPAT_API) +boolean +kpse_bitmap_tolerance (double dpi1, double dpi2) +{ + return kpathsea_bitmap_tolerance (kpse_def, dpi1, dpi2); +} +#endif + + +#ifdef TEST + +void +test_find_glyph (kpathsea kpse, const_string fontname, unsigned dpi) +{ + string answer; + kpse_glyph_file_type ret; + + printf ("\nSearch for %s@%u:\n\t", fontname, dpi); + + answer = kpathsea_find_glyph (kpse, 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 (int argc, char **argv) +{ + kpathsea kpse = xcalloc(1,sizeof(kpathsea_instance)); + kpathsea_set_program_name(kpse, argv[0], NULL); + test_find_glyph (kpse, "/usr/local/lib/tex/fonts/cm/cmr10", 300); /* abs. */ + test_find_glyph (kpse, "cmr10", 300); /* normal */ + test_find_glyph (kpse, "logo10", 300); /* find gf */ + test_find_glyph (kpse, "cmr10", 299); /* find 300 */ + test_find_glyph (kpse, "circle10", 300); /* in fontmap */ + test_find_glyph (kpse, "none", 300); /* do not find */ + kpse->kpse_fallback_font = "cmr10"; + test_find_glyph (kpse, "fallback", 300); /* find fallback font cmr10 */ + kpathsea_init_fallback_resolutions (kpse, "KPATHSEA_TEST_SIZES"); + test_find_glyph (kpse, "fallbackdpi", 759); /* find fallback cmr10@300 */ + + kpathsea_xputenv (kpse,"GFFONTS", "."); + test_find_glyph (kpse, "cmr10", 300); /* different GFFONTS/TEXFONTS */ + + return 0; +} + +#endif /* TEST */ + + +/* +Local variables: +standalone-compile-command: "gcc -g -I. -I.. -DTEST tex-glyph.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/tex-glyph.h b/src/texsourc/kpathsea/kpathsea/tex-glyph.h new file mode 100644 index 0000000..0864bb3 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-glyph.h @@ -0,0 +1,98 @@ +/* tex-glyph.h: look for a TeX glyph font (GF or PK). + + Copyright 1993, 2008, 2009, 2011 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_TEX_GLYPH_H +#define KPATHSEA_TEX_GLYPH_H + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 +{ + const_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 if + FONT_NAME is an alias defined in a texfonts.map do all the above for + its real name. If not an alias, try creating it on the fly with + mktexpk. Then try the resolutions in `kpse_fallback_sizes', then + within the tolerance of each of those. 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 kpathsea_find_glyph (kpathsea kpse, + const_string font_name, unsigned dpi, + kpse_file_format_type format, + kpse_glyph_file_type *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 kpathsea_bitmap_tolerance (kpathsea kpse, + double dpi1, double dpi2); + + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL string kpse_find_glyph (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) + +extern KPSEDLL boolean kpse_bitmap_tolerance (double dpi1, double dpi2); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_TEX_GLYPH_H */ diff --git a/src/texsourc/kpathsea/kpathsea/tex-hush.c b/src/texsourc/kpathsea/kpathsea/tex-hush.c new file mode 100644 index 0000000..6904f12 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-hush.c @@ -0,0 +1,52 @@ +/* tex-hush.c: suppressing warnings? + + Copyright 1996, 2008 Karl Berry. + Copyright 1998, 2000, 2005 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, see . */ + +#include + +#include +#include +#include + +boolean +kpathsea_tex_hush (kpathsea kpse, const_string what) +{ + string h; + string hush = kpathsea_var_value (kpse, "TEX_HUSH"); + if (hush) { + if (STREQ (hush, "all")) + return true; + if (STREQ (hush, "none")) + return false; + for (h = kpathsea_path_element (kpse, hush); h; + h = kpathsea_path_element (kpse, NULL)) { + /* Don't do anything special with empty elements. */ + if (STREQ (h, what)) + return true; + } + } + + return false; +} + +#if defined (KPSE_COMPAT_API) +boolean +kpse_tex_hush (const_string what) +{ + return kpathsea_tex_hush (kpse_def, what); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/tex-hush.h b/src/texsourc/kpathsea/kpathsea/tex-hush.h new file mode 100644 index 0000000..3eb7ba1 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-hush.h @@ -0,0 +1,40 @@ +/* tex-hush.h: suppressing warnings? + + Copyright 1996, 2008 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, see . */ + +#ifndef KPATHSEA_TEX_HUSH_H +#define KPATHSEA_TEX_HUSH_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return true if WHAT is included in the TEX_HUSH environment + variable/config value. */ +extern KPSEDLL boolean kpathsea_tex_hush (kpathsea kpse, const_string what); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL boolean kpse_tex_hush (const_string what); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_TEX_HUSH_H */ diff --git a/src/texsourc/kpathsea/kpathsea/tex-make.c b/src/texsourc/kpathsea/kpathsea/tex-make.c new file mode 100644 index 0000000..bcb51e9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-make.c @@ -0,0 +1,541 @@ +/* tex-make.c: run external programs to make TeX-related files. + + Copyright 1993, 1994, 1995, 1996, 1997, 2008-2013 Karl Berry. + Copyright 1997, 1998, 2001-05 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, see . */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined (AMIGA) && !(defined (MSDOS) && !defined(__DJGPP__)) && !defined (WIN32) +#include +#endif + + +/* 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 (kpathsea kpse) +{ + 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) kpathsea_magstep_fix (kpse, 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, 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); + } + kpathsea_xputenv (kpse, "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 (kpathsea kpse, kpse_file_format_type format, string *args) +{ + 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 (!kpse->missfont && !kpse->make_tex_discard_errors) { + const_string missfont_name = kpathsea_var_value (kpse, "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 */ + + kpse->missfont + = missfont_name ? fopen (missfont_name, FOPEN_A_MODE) : NULL; + if (!kpse->missfont && kpathsea_var_value (kpse, "TEXMFOUTPUT")) { + missfont_name = concat3 (kpathsea_var_value (kpse, "TEXMFOUTPUT"), + DIR_SEP_STRING, missfont_name); + kpse->missfont = fopen (missfont_name, FOPEN_A_MODE); + } + + if (kpse->missfont) + fprintf (stderr, "kpathsea: Appending font creation commands to %s.\n", + missfont_name); + } + + /* Write the command if we have a log file. */ + if (kpse->missfont) { + fputs (args[0], kpse->missfont); + for (s = &args[1]; *s != NULL; s++) { + putc(' ', kpse->missfont); + fputs (*s, kpse->missfont); + } + putc ('\n', kpse->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 (kpathsea kpse, 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 = NULL; + string fn; +#if defined(WIN32) + char fullbin[256], *wrp; + + wrp = kpathsea_var_value(kpse, "SELFAUTOLOC"); + if(wrp == NULL) { + fprintf(stderr, "I cannot get SELFAUTOLOC\n"); + exit(100); + } + + strcpy(fullbin, wrp); + free(wrp); + for(wrp=fullbin; *wrp; wrp++) { + if(*wrp == '/') *wrp = '\\'; + } + strcat(fullbin, "\\"); + strcat(fullbin, args[0]); +#endif + if (!kpse->make_tex_discard_errors) { + fprintf (stderr, "\nkpathsea: 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 +#else /* WIN32 or Unix */ + { +#if defined (WIN32) + /* spawnvp(_P_NOWAIT, ...) and pipe --ak 2002/12/15 */ + + unsigned long nexitcode = STILL_ACTIVE; + HANDLE hchild; + int hstdout, childpipe[2]; + int hstderr = -1; + FILE *Hnul = NULL; + + fn = NULL; + + if(_pipe(childpipe, 1024, O_TEXT | _O_NOINHERIT) == -1) { + perror("kpathsea: pipe()"); + goto labeldone; + } + + hstdout = _dup(fileno(stdout)); + if(_dup2(childpipe[1], fileno(stdout)) != 0) { + close(hstdout); + close(childpipe[0]); + close(childpipe[1]); + goto labeldone; + } + + close(childpipe[1]); + + if(kpse->make_tex_discard_errors) { + Hnul = fopen("nul", "w"); + if(!Hnul) { + perror("kpathsea: fopen(\"nul\")"); + } + else { + hstderr = _dup(fileno(stderr)); + _dup2(fileno(Hnul), fileno(stderr)); + } + } + fprintf(stderr, "\nThe command name is %s\n", fullbin); + hchild = (HANDLE)spawnvp(_P_NOWAIT, fullbin, (const char * const *) args); + + _dup2(hstdout, fileno(stdout)); + close(hstdout); + + if((int)hchild == -1) { + close(childpipe[0]); + goto labeldone; + } + + if(hchild) { + char buf[1024+1]; + int num; + + fn = xstrdup(""); + while(nexitcode == STILL_ACTIVE) { + num = read(childpipe[0], buf, sizeof(buf)-1); + if(num) { + string newfn; + buf[num] = '\0'; + newfn = concat(fn, buf); + free(fn); + fn = newfn; + } + if(!GetExitCodeProcess(hchild, &nexitcode)) { + fn = NULL; + close(childpipe[0]); + goto labeldone; + } + } + close(childpipe[0]); + } + + labeldone: + if(kpse->make_tex_discard_errors && Hnul) { + _dup2(hstderr, fileno(stderr)); + close(hstderr); + fclose(Hnul); + } +#else /* !WIN32 */ + /* 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; + + /* 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); + } +#endif /* !WIN32 */ + + 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 : kpathsea_readable_file (kpse, 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); + } + } +#endif /* WIN32 or Unix */ + + if (ret == NULL) + misstex (kpse, format, args); + else + kpathsea_db_insert (kpse, ret); + + return ret; +} + + + +/* Create BASE in FORMAT and return the generated filename, or + return NULL. */ + +string +kpathsea_make_tex (kpathsea kpse, 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? */ + kpathsea_init_format (kpse, 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:make_tex: Invalid 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:make_tex: Invalid 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 (kpse); + + /* 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] = kpathsea_var_expand (kpse, spec.argv[argnum]); + } + args[argnum++] = xstrdup(base); + args[argnum] = NULL; + + ret = maketex (kpse, format, args); + + for (argnum = 0; args[argnum] != NULL; argnum++) + free (args[argnum]); + free (args); + } + + return ret; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_make_tex (kpse_file_format_type format, const_string base) +{ + return kpathsea_make_tex (kpse_def, format, base); +} +#endif + + +#ifdef TEST + +void +test_make_tex (kpathsea kpse, kpse_file_format_type fmt, const_string base) +{ + string answer; + + printf ("\nAttempting %s in format %d:\n", base, fmt); + + answer = kpathsea_make_tex (kpse, fmt, base); + puts (answer ? answer : "(nil)"); +} + + +int +main (int argc, char **argv) +{ + kpathsea kpse = xcalloc(1, sizeof(kpathsea_instance)); + kpathsea_set_program_name(kpse, argv[0], NULL); + kpathsea_xputenv (kpse, "KPATHSEA_DPI", "781"); /* call mktexpk */ + kpathsea_xputenv (kpse,"MAKETEX_BASE_DPI", "300"); /* call mktexpk */ + kpathsea_set_program_enabled(kpse, kpse_pk_format, 1, kpse_src_env); + test_make_tex (kpse, kpse_pk_format, "cmr10"); + + /* Fail with mktextfm. */ + kpathsea_set_program_enabled(kpse, kpse_tfm_format, 1, kpse_src_env); + test_make_tex (kpse, kpse_tfm_format, "foozler99"); + + /* Call something disabled. */ + test_make_tex (kpse, kpse_bst_format, "no-way"); + + return 0; +} + +#endif /* TEST */ + + +/* +Local variables: +standalone-compile-command: "gcc -g -I. -I.. -DTEST tex-make.c kpathsea.a" +End: +*/ diff --git a/src/texsourc/kpathsea/kpathsea/tex-make.h b/src/texsourc/kpathsea/kpathsea/tex-make.h new file mode 100644 index 0000000..00902f7 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tex-make.h @@ -0,0 +1,48 @@ +/* tex-make.h: declarations for executing external scripts. + + Copyright 1993, 1994, 2008, 2010 Karl Berry. + Copyright 1999, 2005 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, see . */ + +#ifndef KPATHSEA_TEX_MAKE_H +#define KPATHSEA_TEX_MAKE_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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 KPSEDLL string kpathsea_make_tex (kpathsea kpse, + kpse_file_format_type format, + const_string base_file); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL string kpse_make_tex (kpse_file_format_type format, + const_string base_file); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_TEX_MAKE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/texmf.cnf b/src/texsourc/kpathsea/kpathsea/texmf.cnf new file mode 100644 index 0000000..84009f5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/texmf.cnf @@ -0,0 +1,786 @@ +% original texmf.cnf -- runtime path configuration file for kpathsea. +% Public domain. +% +% If you modify this original file, YOUR CHANGES WILL BE LOST when it is +% updated. Instead, put your changes -- and only your changes, not an +% entire copy! -- in ../../texmf.cnf. That is, if this file is +% installed in /some/path/to/texlive/2013/texmf-dist/web2c/texmf.cnf, +% add your custom settings to /some/path/to/texlive/2013/texmf.cnf. +% +% What follows is a super-summary of what this .cnf file can +% contain. Please read the Kpathsea manual for more information. +% +% Any identifier (sticking to A-Za-z_ for names is safest) can be assigned. +% The `=' (and surrounding spaces) is optional. +% $foo (or ${foo}) in a value expands to the envvar or cnf value of foo. +% Long lines can be continued with a \. +% +% 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 (http://tug.org/kpathsea). +% +% // means to search subdirectories (recursively). +% A leading !! means to look only in the ls-R db, never on the disk. +% In this file, either ; or : can be used to separate path components. +% A leading/trailing/doubled path separator in the paths will be +% expanded into the compile-time default. Probably not what you want. +% +% Brace notation is supported, for example: /usr/local/{mytex,othertex} +% expands to /usr/local/mytex:/usr/local/othertex. We make extensive +% use of this. + + +% Part 1: Search paths and directories. + +% This is the parent directory of our several trees, i.e., +% /usr/local/texlive/YYYY in the original TeX Live distribution. +% +% All trees must be organized according to the TeX Directory Structure +% (http://tug.org/tds), or files may not be found. +% +% Redistributors will probably want $SELFAUTODIR/share, i.e., /usr/share. +% Kpathsea sets SELFAUTOLOC (the directory with the binary), +% SELFAUTODIR (its parent), and SELFAUTOPARENT (its grandparent). +TEXMFROOT = $SELFAUTOPARENT + +% The main tree of distributed packages and programs: +TEXMFDIST = $TEXMFROOT/texmf-dist + +% We used to have a separate /texmf tree with some core programs and files. +% Keep the variable name. +TEXMFMAIN = $TEXMFDIST + +% Local additions to the distribution trees. +TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local + +% TEXMFSYSVAR, where *-sys store cached runtime data. +TEXMFSYSVAR = $TEXMFROOT/texmf-var + +% TEXMFSYSCONFIG, where *-sys store configuration data. +TEXMFSYSCONFIG = $TEXMFROOT/texmf-config + +% Per-user texmf tree(s) -- organized per the TDS, as usual. To define +% more than one per-user tree, set this to a list of directories in +% braces, as described above. (This used to be HOMETEXMF.) ~ expands +% to %USERPROFILE% on Windows, $HOME otherwise. +TEXMFHOME = ~/texmf + +% TEXMFVAR, where texconfig/updmap/fmtutil store cached runtime data. +TEXMFVAR = ~/.texlive2013/texmf-var + +% TEXMFCONFIG, where texconfig/updmap/fmtutil store configuration data. +TEXMFCONFIG = ~/.texlive2013/texmf-config + +% List all the texmf trees. For an explanation of what they are, see the +% TeX Live manual. +% +% For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named +% explicitly and before all other trees. +% +% TEXMFLOCAL precedes TEXMFDIST because locally-installed versions +% should take precedence over distribution files -- although it is +% generally a source of confusion to have different versions of a +% package installed, whatever the trees, so try to avoid it. +TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFDIST} + +% 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. +% By default, this is only the !! elements of TEXMF, so that mktexlsr +% does not create ls-R files in the non-!! elements -- because if an +% ls-R is present, it will be used, and the disk will not be searched. +% This is arguably a bug in kpathsea. +TEXMFDBS = {!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFDIST} + +% The system trees. These are the trees that are shared by all users. +% If a tree appears in this list, the mktex* scripts will use +% VARTEXFONTS for generated files, if the original tree isn't writable; +% otherwise the current working directory is used. +SYSTEXMF = $TEXMFSYSVAR;$TEXMFLOCAL;$TEXMFDIST + +% First writable tree here is used by Lua(La)TeX for the font cache. +% LuaLaTeX uses the value here, while ConTeXt uses the same variable but +% from texmfcnf.lua; therefore the two values should be kept in sync. +% (As should everything else in texmf.cnf <-> texmfcnf.lua.) +TEXMFCACHE = $TEXMFSYSVAR;$TEXMFVAR + +% 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 = $TEXMFVAR/fonts + +% 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 in many distros. In this case, set VARTEXFONTS like this +%VARTEXFONTS = $TEXMFVAR/fonts +% and do not mention it in TEXMFDBS (but _do_ mention TEXMFVAR). +% +% Remove $VARTEXFONTS from TEXMFDBS if the VARTEXFONTS directory is below +% one of the TEXMF directories (avoids overlapping ls-R files). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Usually you will not need to edit any of the following variables. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% 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. We specify paths for all known +% formats, past or present. Not all of them are built these days. + +% 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,}// + +% Fontinst needs to read afm files. +TEXINPUTS.fontinst = .;$TEXMF/{tex,fonts/afm}// + +% 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.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.latex = .;$TEXMF/tex/{latex,generic,}// +TEXINPUTS.latex209 = .;$TEXMF/tex/{latex209,generic,latex,}// +TEXINPUTS.olatex = .;$TEXMF/tex/{latex,generic,}// + +% 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. +TEXINPUTS.elatex = .;$TEXMF/tex/{latex,generic,}// +TEXINPUTS.etex = .;$TEXMF/tex/{plain,generic,}// + +% pdfTeX. +TEXINPUTS.pdfcslatex = .;$TEXMF/tex/{cslatex,csplain,latex,generic,}// +TEXINPUTS.pdfcsplain = .;$TEXMF/tex/{csplain,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.pdfxmex = .;$TEXMF/tex/{mex,plain,generic,}// +TEXINPUTS.pdfxtex = .;$TEXMF/tex/{plain,generic,}// + +% LuaTeX. +TEXINPUTS.lualatex = .;$TEXMF/tex/{lualatex,latex,luatex,generic,}// +TEXINPUTS.luatex = .;$TEXMF/tex/{luatex,plain,generic,}// +TEXINPUTS.dvilualatex = .;$TEXMF/tex/{lualatex,latex,luatex,generic,}// +TEXINPUTS.dviluatex = .;$TEXMF/tex/{luatex,plain,generic,}// + +% XeTeX. +TEXINPUTS.xelatex = .;$TEXMF/tex/{xelatex,latex,xetex,generic,}// +TEXINPUTS.xeplain = .;$TEXMF/tex/{xeplain,eplain,plain,xetex,generic,}// +TEXINPUTS.xetex = .;$TEXMF/tex/{xetex,plain,generic,}// + +% Omega / Aleph. +TEXINPUTS.aleph = .;$TEXMF/tex/{plain,generic,}// +TEXINPUTS.elambda = .;$TEXMF/tex/{lambda,latex,generic,}// +TEXINPUTS.eomega = .;$TEXMF/tex/{plain,generic,}// +TEXINPUTS.lambda = .;$TEXMF/tex/{lambda,latex,generic,}// +TEXINPUTS.lamed = .;$TEXMF/tex/{lambda,latex,generic,}// +TEXINPUTS.omega = .;$TEXMF/tex/{plain,generic,}// + +% p(La)TeX. +TEXINPUTS.ptex = .;$TEXMF/tex/{ptex,plain,generic,}// +TEXINPUTS.platex = .;$TEXMF/tex/{platex,latex,generic,}// + +% epTeX, and for pmpost. +TEXINPUTS.eptex = .;$TEXMF/tex/{ptex,plain,generic,}// +TEX.pmpost = eptex + +% (e)up(La)TeX. +TEXINPUTS.uplatex = .;$TEXMF/tex/{uplatex,platex,latex,generic,}// +TEXINPUTS.uptex = .;$TEXMF/tex/{uptex,ptex,plain,generic,}// +TEXINPUTS.euptex = .;$TEXMF/tex/{uptex,ptex,plain,generic}// + +% pBibTeX bibliographies and style files. +BIBINPUTS.pbibtex = .;$TEXMF/{pbibtex,bibtex}/bib// +BSTINPUTS.pbibtex = .;$TEXMF/{pbibtex,bibtex}/bst// + +% ConTeXt. +TEXINPUTS.context = .;$TEXMF/tex/{context,plain,generic}// + +% jadetex. +TEXINPUTS.jadetex = .;$TEXMF/tex/{jadetex,latex,generic,}// +TEXINPUTS.pdfjadetex = .;$TEXMF/tex/{jadetex,latex,generic,}// + +% XMLTeX. +TEXINPUTS.xmltex = .;$TEXMF/tex/{xmltex,latex,generic,}// +TEXINPUTS.pdfxmltex = .;$TEXMF/tex/{xmltex,latex,generic,}// + +% Miscellany, no longer built. +TEXINPUTS.lamstex = .;$TEXMF/tex/{lamstex,plain,generic,}// +TEXINPUTS.lollipop = .;$TEXMF/tex/{lollipop,plain,generic,}// +TEXINPUTS.frpdflatex = .;$TEXMF/tex/{french,latex,generic,}// +TEXINPUTS.frpdftex = .;$TEXMF/tex/{french,plain,generic,}// + +% Earlier entries override later ones, so put this generic one last. +TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}// + +% ttf2tfm. +TTF2TFMINPUTS = .;$TEXMF/ttf2pk// + +% 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. +% We want to find the engine-specific file, e.g., cont-en.fmt can +% exist under both pdftex/ and xetex/. But just in case some formats +% end up without an engine directory, look directly in web2c/ too. +% We repeat the same definition three times because of the way fmtutil +% is implemented; if we use ${TEXFORMATS}, the mpost/mf/etc. formats +% will not be found. +TEXFORMATS = .;$TEXMF/web2c{/$engine,} +MFBASES = .;$TEXMF/web2c{/$engine,} +MPMEMS = .;$TEXMF/web2c{/$engine,} +% +% As of 2008, pool files don't exist any more (the strings are compiled +% into the binaries), but just in case something expects to find these: +TEXPOOL = .;$TEXMF/web2c +MFPOOL = ${TEXPOOL} +MPPOOL = ${TEXPOOL} + +% support the original xdvi. Must come before the generic settings. +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}// + +% 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. This isn't just fonts/map// because ConTeXt +% wants support for having files with the same name in the different +% subdirs. Maybe if the programs ever get unified to accepting the same +% map file syntax the definition can be simplified again. +TEXFONTMAPS = .;$TEXMF/fonts/map/{$progname,pdftex,dvips,}// + +% BibTeX bibliographies and style files. bibtex8 also uses these. +BIBINPUTS = .;$TEXMF/bibtex/bib// +BSTINPUTS = .;$TEXMF/bibtex/{bst,csf}// + +% MlBibTeX. +MLBIBINPUTS = .;$TEXMF/bibtex/bib/{mlbib,}// +MLBSTINPUTS = .;$TEXMF/bibtex/{mlbst,bst}// + +% .ris and .bltxml bibliography formats. +RISINPUTS = .;$TEXMF/bibtex/ris// +BLTXMLINPUTS = .;$TEXMF/bibtex/bltxml// + +% 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,type42,type3}}// +TEXPSHEADERS.gsftopk = .;$TEXMF/{dvips,fonts/{enc,type1,type42,type3,truetype}}// + +% OSFONTDIR is to provide a convenient hook for allowing TeX to find +% fonts installed on the system (outside of TeX). An empty default +% value would add "//" to the search paths, so we give it a dummy value. +OSFONTDIR = /please/set/osfontdir/in/the/environment + +% PostScript Type 1 outline fonts. +T1FONTS = .;$TEXMF/fonts/type1//;$OSFONTDIR// + +% PostScript AFM metric files. +AFMFONTS = .;$TEXMF/fonts/afm//;$OSFONTDIR// + +% TrueType outline fonts. +TTFONTS = .;$TEXMF/fonts/{truetype,opentype}//;$OSFONTDIR// + +% OpenType outline fonts. +OPENTYPEFONTS = .;$TEXMF/fonts/{opentype,truetype}//;$OSFONTDIR// + +% 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 feature files (.fea). +FONTFEATURES=.;$TEXMF/fonts/fea// + +% .cid and .cidmap +FONTCIDMAPS=.;$TEXMF/fonts/cid// + +% pdftex config files: +PDFTEXCONFIG = .;$TEXMF/pdftex/{$progname,}// + +% Used by DMP (ditroff-to-mpx), called by makempx -troff. +TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps +MPSUPPORT = .;$TEXMF/metapost/support + +% For xdvi to find mime.types and .mailcap, if they do not exist in +% ~. These are single directories, not paths. +% (But the default mime.types, at least, may well suffice.) +MIMELIBDIR = $TEXMFROOT/etc +MAILCAPLIBDIR = $TEXMFROOT/etc + +% Default settings for the fontconfig library as used by the Windows +% versions of xetex/xdvipdfmx. Not used by xetex on Unixish systems. +% ConTeXT MkIV (all platforms) also use these values. +% +FONTCONFIG_FILE = fonts.conf +FONTCONFIG_PATH = $TEXMFSYSVAR/fonts/conf +FC_CACHEDIR = $TEXMFSYSVAR/fonts/cache + +% TeX documentation and source files, for use with texdoc and kpsewhich. +TEXDOCS = $TEXMF/doc// +TEXSOURCES = .;$TEXMF/source// + +% Web and CWeb input paths. +WEBINPUTS = .;$TEXMF/web// +CWEBINPUTS = .;$TEXMF/cweb// + +% Omega-related fonts and other files. +OFMFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/{ofm,tfm}// +OPLFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/opl// +OVFFONTS = .;{$TEXMF/fonts,$VARTEXFONTS}/{ovf,vf}// +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// + +%% t4ht utility, sharing files with TeX4ht +TEX4HTFONTSET=alias,iso8859,unicode +TEX4HTINPUTS = .;$TEXMF/tex4ht/base//;$TEXMF/tex4ht/ht-fonts/{$TEX4HTFONTSET}// + +% TeXworks editor configuration and settings +TW_LIBPATH = $TEXMFCONFIG/texworks +TW_INIPATH = $TW_LIBPATH + +% For security, do not look in . for dvipdfmx.cfg, since the D option +% would allow command execution. +DVIPDFMXINPUTS = $TEXMF/dvipdfmx + +% Lua needs to look in TEXINPUTS for lua scripts distributed with packages. +% +% But we can't simply use $TEXINPUTS, since then if TEXINPUTS is set in +% the environment with a colon, say, TEXINPUTS=/some/dir:, the intended +% default expansion of TEXINPUTS will not happen and .lua files under +% the /tex/ will not be found. +% +% So, duplicate the TEXINPUTS.*lualatex values as LUAINPUTS.*lualatex. +% The default LUAINPUTS suffices for luatex and dviluatex. +% +LUAINPUTS.lualatex = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{lualatex,latex,luatex,generic,}// +LUAINPUTS.dvilualatex = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{lualatex,latex,luatex,generic,}// +LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,}// + +% Lua needs to look for binary lua libraries distributed with packages. +CLUAINPUTS = .;$SELFAUTOLOC/lib/{$progname,$engine,}/lua// + +% Architecture independent executables. +TEXMFSCRIPTS = $TEXMF/scripts/{$progname,$engine,}// + +% Other languages. +JAVAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/java// +PERLINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/perl// +PYTHONINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/python// +RUBYINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/ruby// + + +%% 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_program_name. +% +% This main texmf.cnf file is installed, for a release YYYY, in a +% directory such as /usr/local/texlive/YYYY/texmf-dist/web2c/texmf.cnf. +% Since this file is subject to future updates, the TeX Live installer +% or human administrator may also create a file +% /usr/local/texlive/YYYY/texmf.cnf; any settings in this latter file +% will take precedence over the distributed one. +% +% For security reasons, it is best not to include . in this path. +% +% The idea behind this lengthy definition: for each of +% SELFAUTO{LOC,DIR,PARENT}, look in the directory, +% then the subdirectories share/texmf-local, share/texmf-dist, share/texmf, +% then the subdirectories ./texmf-local, texmf-dist, ./texmf. +% At any given installation, most of these directories will not exist, +% but they all turn out to be useful somewhere. +% +% Special addition -- we want to include one more directory: the +% great-grandparent's texmf-local, because that is how TL is installed +% by default. That is, given a binary +% /usr/local/texlive/YYYY/bin/PLATFORM/kpsewhich, it should find +% /usr/local/texlive/texmf-local/web2c/texmf.cnf. I.e., not under YYYY. +% +% As a result, we cannot use actual brace expansion in the definition, +% since we don't want to scatter ../'s throughout the value. Hence we +% explicitly list every directory. Arguably more understandable anyway. +% +TEXMFCNF = {\ +$SELFAUTOLOC,\ +$SELFAUTOLOC/share/texmf-local/web2c,\ +$SELFAUTOLOC/share/texmf-dist/web2c,\ +$SELFAUTOLOC/share/texmf/web2c,\ +$SELFAUTOLOC/texmf-local/web2c,\ +$SELFAUTOLOC/texmf-dist/web2c,\ +$SELFAUTOLOC/texmf/web2c,\ +\ +$SELFAUTODIR,\ +$SELFAUTODIR/share/texmf-local/web2c,\ +$SELFAUTODIR/share/texmf-dist/web2c,\ +$SELFAUTODIR/share/texmf/web2c,\ +$SELFAUTODIR/texmf-local/web2c,\ +$SELFAUTODIR/texmf-dist/web2c,\ +$SELFAUTODIR/texmf/web2c,\ +\ +$SELFAUTOGRANDPARENT/texmf-local/web2c,\ +$SELFAUTOPARENT,\ +\ +$SELFAUTOPARENT/share/texmf-local/web2c,\ +$SELFAUTOPARENT/share/texmf-dist/web2c,\ +$SELFAUTOPARENT/share/texmf/web2c,\ +$SELFAUTOPARENT/texmf-local/web2c,\ +$SELFAUTOPARENT/texmf-dist/web2c,\ +$SELFAUTOPARENT/texmf/web2c\ +} +% +% For reference, here is the old brace-using definition: +%TEXMFCNF = {$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c} + +% kpathsea 3.5.3 and later sets these 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 = unsetprogname +engine = unsetengine + + +% Part 2: Options. + +% If this option is set to true, `tex a.b' will look first for a.b.tex +% (within each path element), and then for a.b, i.e., we try standard +% extensions first. If this is false, we first look for a.b and then +% a.b.tex, i.e., we try the name as-is first. +% +% Both names are always tried; the difference is the order in which they +% are tried. The setting applies to all searches, not just .tex. +% +% This setting only affects names being looked up which *already* have +% an extension. A name without an extension (e.g., `tex story') will +% always have an extension added first. +% +% The default is true, because we already avoid adding the standard +% extension(s) in the usual cases. E.g., babel.sty will only look for +% babel.sty, not babel.sty.tex, regardless of this setting. +try_std_extension_first = t + +% Enable system commands via \write18{...}. When enabled fully (set to +% t), obviously insecure. When enabled partially (set to p), only the +% commands listed in shell_escape_commands are allowed. Although this +% is not fully secure either, it is much better, and so useful that we +% enable it for everything but bare tex. +shell_escape = p + +% No spaces in this command list. +% +% The programs listed here are as safe as any we know: they either do +% not write any output files, respect openout_any, or have hard-coded +% restrictions similar or higher to openout_any=p. They also have no +% features to invoke arbitrary other programs, and no known exploitable +% bugs. All to the best of our knowledge. They also have practical use +% for being called from TeX. +% +shell_escape_commands = \ +bibtex,bibtex8,\ +kpsewhich,\ +makeindex,\ +mpost,\ +repstopdf,\ + +% we'd like to allow: +% dvips - but external commands can be executed, need at least -R1. +% epspdf, ps2pdf, pstopdf - need to respect openout_any, +% and gs -dSAFER must be used and check for shell injection with filenames. +% (img)convert (ImageMagick) - delegates.mgk possible misconfig, besides, +% without Unix convert it hardly seems worth it, and Windows convert +% is something completely different that destroys filesystems, so skip. +% pygmentize - but is the filter feature insecure? +% ps4pdf - but it calls an unrestricted latex. +% rpdfcrop - maybe ok, but let's get experience with repstopdf first. +% texindy,xindy - but is the module feature insecure? +% ulqda - but requires optional SHA1.pm, so why bother. +% tex, latex, etc. - need to forbid --shell-escape, and inherit openout_any. + +% plain TeX should remain unenhanced. +shell_escape.tex = f +shell_escape.initex = f + +% This is used by the Windows script wrapper for restricting searching +% for the purportedly safe shell_escape_commands above to system +% directories. +TEXMF_RESTRICTED_SCRIPTS = \ + {!!$TEXMFLOCAL,!!$TEXMFDIST}/scripts/{$progname,$engine,}// + +% 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 + +% 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 + +% Allow TeX, and MF to parse the first line of an input file for +% the %&format construct. +parse_first_line = t + +% But don't parse the first line if invoked as "tex", since we want that +% to remain Knuth-compatible. The src_specials and +% file_line_error_style settings, as well as the options -enctex, +% -mltex, -8bit, etc., also affect this, but they are all off by default. +parse_first_line.tex = f +parse_first_line.initex = f + +% Control 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 + +% Used by makempx to run TeX. We use "etex" because MetaPost is +% expecting DVI, and not "tex" because we want first line parsing. +TEX = etex + +% These variables specify the external program called for the +% interactive `e' option. %d is replaced by the line number and %s by +% the current filename. The default is specified at compile-time, and +% we let that stay in place since different platforms like different values. +%TEXEDIT = vi +%d '%s' % default for Unix +%TEXEDIT = texworks --position=+%d "%s" % default for Windows +%MFEDIT = ${TEXEDIT} +%MPEDIT = ${TEXEDIT} + +% The default `codepage and sort order' file for BibTeX8, when none is +% given as command line option or environment variable. +BIBTEX_CSFILE = 88591lat.csf + +% This variable is specific to Windows. It must be set to 0 or 1. The +% default is 0. Setting it to 1 tells the Windows script wrappers to +% use an already installed Perl interpreter if one is found on the +% search path, in preference to the Perl shipped with TeX Live. Thus, +% it may be useful if you both (a) installed a full Perl distribution +% for general use, and (b) need to run Perl programs from TL that use +% additional modules we don't provide. The TL Perl does provide all the +% standard Perl modules. +% +%TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 0 + + +% Part 3: Array and other sizes for TeX, Metafont, etc. +% +% 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 = 5000000 % 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 needs lots of memory. +extra_mem_top.context = 2000000 +extra_mem_bot.context = 4000000 + +% Words of font info for TeX (total size of all TFM files, approximately). +% Must be >= 20000 and <= 147483647 (without tex.ch changes). +font_mem_size = 8000000 + +% Total number of fonts. Must be >= 50 and <= 9000 (without tex.ch changes). +font_max = 9000 + +% Extra space for the hash table of control sequences. +hash_extra = 600000 + +% Max number of characters in all strings, including all error messages, +% help texts, font names, control sequences. These values apply to TeX. +pool_size = 6250000 +% Minimum pool space after TeX'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 = 500000 +% min pool space left after loading .fmt +pool_free = 47500 + +% 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, even though most documents can be handled with a small value. +buf_size = 200000 + +% Hyphenation trie. The maximum possible is 4194303 (ssup_trie_size in +% the sources), but we don't need that much. The value here suffices +% for all known free hyphenation patterns to be loaded simultaneously +% (as TeX Live does). +% +trie_size = 1000000 + +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, + % also applies to MetaPost +param_size = 10000 % simultaneous macro parameters, also applies to MP +save_size = 100000 % for saving values outside current group +stack_size = 5000 % simultaneous input sources + +% These are Omega-specific. +ocp_buf_size = 500000 % character buffers for ocp filters. +ocp_stack_size = 10000 % stacks for ocp computations. +ocp_list_size = 1000 % control for multiple ocps. + +% 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 TeX, Metafont, and MetaPost. +error_line = 79 +half_error_line = 50 +max_print_line = 79 + +% Metafont only. +screen_width.mf = 1664 +screen_depth.mf = 1200 + +% BibTeX only (max_strings also determines hash_size and hash_prime). +ent_str_size = 250 +glob_str_size = 20000 +max_strings.bibtex = 35307 +max_strings.bibtex8 = 35307 +max_strings.bibtexu = 35307 +max_strings.pbibtex = 35307 + +% GFtype only. +line_length.gftype = 500 +max_rows.gftype = 8191 +max_cols.gftype = 8191 + +% Guess input encoding (SJIS vs. Unicode, etc.) in pTeX and friends? +% Default is 0, to not guess. +guess_input_kanji_encoding = 0 diff --git a/src/texsourc/kpathsea/kpathsea/tilde.c b/src/texsourc/kpathsea/kpathsea/tilde.c new file mode 100644 index 0000000..fa7ebf9 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tilde.c @@ -0,0 +1,198 @@ +/* tilde.c: expand user's home directories. + + Copyright 1997, 1998, 2005, Olaf Weber. + Copyright 1993, 1995, 1996, 1997, 2008, 2011 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, see . */ + +#include + +#include +#include + +#undef USE_GETPWNAM +#ifdef HAVE_PWD_H +#include +#define USE_GETPWNAM 1 +#elif defined (WIN32) && !defined (__MINGW32__) +#define USE_GETPWNAM 1 +#endif + +#ifdef WIN32 +#define HOMEVAR "USERPROFILE" +#else +#define HOMEVAR "HOME" +#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 + , just return NAME. */ + +string +kpathsea_tilde_expand (kpathsea kpse, string name) +{ + string expansion; + const_string home; + const_string prefix; +#if defined(WIN32) + string p; +#endif + + (void)kpse; /* currenty not used */ + 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 != '~' +#ifndef USE_GETPWNAM + /* Same for `~user' or `~user/', but no passwd database. */ + || (name[1] && !IS_DIR_SEP (name[1])) +#endif + ) { + if (*prefix) + name -= 2; + expansion = name; + + } else { + /* If a bare tilde, return the home directory or `.'; if just `~user', + return that user's home directory or `.'. Very unlikely that the + directory name will do anyone any good, but ... */ + unsigned c; + +#ifdef USE_GETPWNAM + /* If `~user' or `~user/', look up user in the passwd database. */ + if (name[1] && !IS_DIR_SEP (name[1])) { + struct passwd *p; + string user; + c = 2; + while (!IS_DIR_SEP (name[c]) && name[c] != 0) { /* find user name */ +#if defined(WIN32) + if (IS_KANJI(name+c)) + c++; +#endif + c++; + } + + user = (string) xmalloc (c); + strncpy (user, name + 1, c - 1); + user[c - 1] = 0; + +#if defined(WIN32) && !defined(__MINGW32__) + p = kpathsea_getpwnam (kpse, user); +#else + /* We only need the cast here for (deficient) systems + which do not declare `getpwnam' in . */ + p = (struct passwd *) getpwnam (user); +#endif + free (user); + + /* If no such user, just use `.'. */ + home = p ? p->pw_dir : "."; + } else +#endif /* USE_GETPWNAM */ + { + c = 1; + home = getenv (HOMEVAR); + if (!home) + home = "."; + } + + /* handle leading // */ + if (IS_DIR_SEP (*home) && IS_DIR_SEP (home[1])) + home++; + + /* If HOME ends in /, omit the / in ~/ or ~user/. */ + if (name[c]) { +#if defined(WIN32) + const_string q; + + for (q = home; *q; q++) { + if (IS_DIR_SEP (*q) && q[1] == 0) + c++; + else if (IS_KANJI(q)) + q++; + } +#else + if (IS_DIR_SEP (home[strlen (home) - 1])) + c++; +#endif + } + + expansion = concat3 (prefix, home, name + c); + } + +#if defined(WIN32) + for (p = expansion; *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } +#endif + + /* We may return the same thing as the original, and then we might not + be returning a malloc-ed string. Callers beware. Sorry. */ + return expansion; +} + +#ifdef TEST + +void +test_expand_tilde (const_string filename) +{ + string answer; + + printf ("Tilde expansion of `%s':\t", filename ? filename : "(nil)"); + answer = kpathsea_tilde_expand (kpse_def, (string)filename); + puts (answer); +} + +int +main (int argc, char **argv) +{ + string tilde_path = "tilde"; + kpse_set_program_name(argv[0],NULL); + 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/src/texsourc/kpathsea/kpathsea/tilde.h b/src/texsourc/kpathsea/kpathsea/tilde.h new file mode 100644 index 0000000..e570791 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/tilde.h @@ -0,0 +1,34 @@ +/* tilde.h: declare tilde expander. + + Copyright 1993, 2008, 2010, 2011 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, see . */ + +#ifndef KPATHSEA_TILDE_H +#define KPATHSEA_TILDE_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include + +/* Replace a leading ~ or ~NAME in FILENAME with getenv ("HOME"), or + getenv ("USERPROFILE") on Windows, or with NAME's home directory, + respectively. Excise trailing slashes. FILENAME may not be null. */ + +extern string kpathsea_tilde_expand (kpathsea kpse, string filename); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not KPATHSEA_TILDE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/types.h b/src/texsourc/kpathsea/kpathsea/types.h new file mode 100644 index 0000000..a2b0a00 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/types.h @@ -0,0 +1,358 @@ +/* types.h: general types for kpathsea. + + Copyright 1993, 1995, 1996, 2005, 2008-2013 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, see . */ + +#ifndef KPATHSEA_TYPES_H +#define KPATHSEA_TYPES_H + +/* Required until all programs use the new API, if ever. */ +#define KPSE_COMPAT_API 1 + +/* 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 */ + +#include /* for FILE* */ + +/* Declare int64_t and uint64_t, and define PRId64 etc. */ +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#if (!defined __cplusplus || defined __STDC_FORMAT_MACROS) && !defined PRId64 +# if SIZEOF_LONG == 8 +# define __PRI64_PREFIX "l" +# else +# define __PRI64_PREFIX "ll" +# endif +# define PRId64 __PRI64_PREFIX "d" +# define PRIi64 __PRI64_PREFIX "i" +# define PRIo64 __PRI64_PREFIX "o" +# define PRIu64 __PRI64_PREFIX "u" +# define PRIx64 __PRI64_PREFIX "x" +# define PRIX64 __PRI64_PREFIX "X" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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; + +/* function pointer prototype definitions for recorder */ +typedef void (*p_record_input) (const_string); +typedef void (*p_record_output) (const_string); + +#ifdef __cplusplus +} +#endif + +/* the cache structure from elt-dirs.c */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + const_string key; + str_llist_type *value; +} cache_entry; + +/* from variable.c */ +typedef struct { + const_string var; + boolean expanding; +} expansion_type; + +#ifdef __cplusplus +} +#endif + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* from old tex-file.h */ + +/* 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_lua_format, + kpse_fea_format, + kpse_cid_format, + kpse_mlbib_format, + kpse_mlbst_format, + kpse_clua_format, + kpse_ris_format, + kpse_bltxml_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. */ + 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; /* Open files in binary mode? */ +} kpse_format_info_type; + +#if defined(WIN32) && !defined(__MINGW32__) +struct passwd { + char *pw_name; + char *pw_passwd; + int pw_uid; + int pw_gid; + int pw_quota; + char *pw_gecos; + char *pw_dir; + char *pw_shell; +}; +#endif /* WIN32 && !__MINGW32 */ + +typedef struct kpathsea_instance *kpathsea; + +typedef struct kpathsea_instance { + /* from cnf.c */ + p_record_input record_input; /* for --recorder */ + p_record_output record_output; /* for --recorder */ + hash_table_type cnf_hash; /* used by read_all_cnf */ + boolean doing_cnf_init; /* for kpse_cnf_get */ + /* from db.c */ + hash_table_type db; /* The hash table for all ls-R's */ + hash_table_type alias_db; /* The hash table for the aliases */ + str_list_type db_dir_list; /* list of ls-R's */ + /* from debug.c */ + unsigned debug; /* for --kpathsea-debug */ + /* from dir.c */ + hash_table_type link_table; /* a hash of links-per-dir */ + /* from elt-dir.c */ + cache_entry *the_cache; + unsigned cache_length; + /* from fontmap.c */ + hash_table_type map; /* the font mapping hash */ + const_string map_path; /* path for kpse_fontmap_format */ + /* from hash.c */ + /* Print the hash values as integers if this is nonzero. */ + boolean debug_hash_lookup_int; + /* from path-elt.c */ + string elt; /* static buffer for return value */ + unsigned elt_alloc; + const_string path; /* path we're currently working on */ + /* from pathsearch.c */ + boolean followup_search; + FILE *log_file; + boolean log_opened; /* Need to open the log file? */ + /* from progname.c */ + string invocation_name; + string invocation_short_name; + string program_name; /* pretended name */ + int ll_verbose; /* for symlinks (conditional) */ + /* from tex-file.c */ + /* If non-NULL, try looking for this if can't find the real font. */ + const_string 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. */ + const_string 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. */ + unsigned *fallback_resolutions; + kpse_format_info_type format_info[kpse_last_format]; + /* from tex-make.c */ + /* 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 make_tex_discard_errors; + FILE *missfont; + /* from variable.c */ + expansion_type *expansions; /* sole variable of this type */ + unsigned expansion_len ; + /* from xputenv.c */ + /* 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. */ + char **saved_env; /* keep track of changed items */ + int saved_count; +#if defined(WIN32) || defined(__CYGWIN__) + char **suffixlist; +#endif /* WIN32 || __CYGWIN__ */ + +#if defined(WIN32) && !defined(__MINGW32__) + char the_passwd_name[256]; + char the_passwd_passwd[256]; + char the_passwd_gecos[256]; + char the_passwd_dir[256]; + char the_passwd_shell[256]; + struct passwd the_passwd; + int __system_allow_multiple_cmds; +#endif /* WIN32 && !__MINGW32__ */ +} kpathsea_instance; + +/* these come from kpathsea.c */ +extern KPSEDLL kpathsea kpathsea_new (void) ; +extern KPSEDLL void kpathsea_finish (kpathsea kpse) ; + +#if defined (KPSE_COMPAT_API) + +#define kpse_bug_address kpathsea_bug_address + +extern KPSEDLL kpathsea_instance kpse_def_inst; +extern KPSEDLL kpathsea kpse_def; + +#define kpathsea_debug kpse_def_inst.debug +#define kpse_program_name kpse_def_inst.program_name +#define kpse_record_input kpse_def_inst.record_input +#define kpse_record_output kpse_def_inst.record_output +#define kpse_make_tex_discard_errors kpse_def_inst.make_tex_discard_errors +#define kpse_fallback_font kpse_def_inst.fallback_font +#define kpse_fallback_resolutions_string kpse_def_inst.fallback_resolutions_string +#define kpse_fallback_resolutions kpse_def_inst.fallback_resolutions +#define kpse_format_info kpse_def_inst.format_info +#define kpse_debug_hash_lookup_int kpse_def_inst.debug_hash_lookup_int + +#undef kpse_invocation_name +#define kpse_invocation_name kpse_def_inst.invocation_name +#undef kpse_invocation_short_name +#define kpse_invocation_short_name kpse_def_inst.invocation_short_name + +#endif /* KPSE_COMPAT_API */ + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_TYPES_H */ diff --git a/src/texsourc/kpathsea/kpathsea/uppercasify.c b/src/texsourc/kpathsea/kpathsea/uppercasify.c new file mode 100644 index 0000000..9d96d38 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/uppercasify.c @@ -0,0 +1,35 @@ +/* uppercasify.c: change all lowercase letters to uppercase. + + Copyright 1993, 2008 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, see . */ + +#include + +#include + + +string +uppercasify (const_string s) +{ + string target; + string ret = xstrdup (s); + + for (target = ret; *target; target++) + { + *target = TOUPPER (*target); + } + + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/variable.c b/src/texsourc/kpathsea/kpathsea/variable.c new file mode 100644 index 0000000..f207244 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/variable.c @@ -0,0 +1,310 @@ +/* variable.c: variable expansion. + + Copyright 1993, 1994, 1995, 1996, 2008, 2009, 2011, 2012 Karl Berry. + Copyright 1997, 1999, 2001, 2002, 2005 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, see . */ + +#include + +#include +#include +#include +#include +#include + + +/* Here's the simple one, when a program just wants a value. */ + +string +kpathsea_var_value (kpathsea kpse, const_string var) +{ + string vtry, ret; + const_string value; + + assert (kpse->program_name); + + /* First look for VAR.progname. */ + vtry = concat3 (var, ".", kpse->program_name); + value = getenv (vtry); + free (vtry); + + if (!value || !*value) { + /* Now look for VAR_progname. */ + vtry = concat3 (var, "_", kpse->program_name); + value = getenv (vtry); + free (vtry); + } + + /* Just plain VAR. */ + if (!value || !*value) + value = getenv (var); + + /* Not in the environment; check a config file. */ + if (!value || !*value) + value = kpathsea_cnf_get (kpse, var); + + /* We have a value; do variable and tilde expansion. We want to use ~ + in the cnf files, to adapt nicely to Windows and to avoid extra /'s + (see tilde.c), but we also want kpsewhich -var-value=foo to not + have any literal ~ characters, so our shell scripts don't have to + worry about doing the ~ expansion. */ + ret = value ? kpathsea_expand (kpse, value) : NULL; + +#ifdef KPSE_DEBUG + if (KPATHSEA_DEBUG_P (KPSE_DEBUG_VARS)) + DEBUGF2("variable: %s = %s\n", var, ret ? ret : "(nil)"); +#endif + + return ret; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_var_value (const_string var) +{ + return kpathsea_var_value (kpse_def,var); +} +#endif + + +/* 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. */ + +static void +expanding (kpathsea kpse, const_string var, boolean xp) +{ + unsigned e; + for (e = 0; e < kpse->expansion_len; e++) { + if (STREQ (kpse->expansions[e].var, var)) { + kpse->expansions[e].expanding = xp; + return; + } + } + + /* New variable, add it to the list. */ + kpse->expansion_len++; + XRETALLOC (kpse->expansions, kpse->expansion_len, expansion_type); + kpse->expansions[kpse->expansion_len - 1].var = xstrdup (var); + kpse->expansions[kpse->expansion_len - 1].expanding = xp; +} + + +/* Return whether VAR is currently being expanding. */ + +static boolean +expanding_p (kpathsea kpse, const_string var) +{ + unsigned e; + for (e = 0; e < kpse->expansion_len; e++) { + if (STREQ (kpse->expansions[e].var, var)) + return kpse->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. + Return 1 if `var' was defined, 0 if not. This is a subroutine for + the `kpathsea_var_expand' function. */ + +static boolean +expand (kpathsea kpse, fn_type *expansion, + const_string start, const_string end) +{ + boolean ret = false; + const_string value; + unsigned len = end - start + 1; + string var = (string)xmalloc (len + 1); + strncpy (var, start, len); + var[len] = 0; + + if (expanding_p (kpse, 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 = kpathsea_cnf_get (kpse, var); + + if (value) { + string tmp; + ret = true; + expanding (kpse, var, true); + tmp = kpathsea_expand (kpse, value); + expanding (kpse, var, false); + + fn_grow (expansion, tmp, strlen (tmp)); + free (tmp); + } + } + + free (var); + return ret; +} + +/* 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}. We do do ~ expansion. */ + +string +kpathsea_var_expand (kpathsea kpse, 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}', `$'. */ + 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 */ + if (!expand (kpse, &expansion, s, var_end)) { + /* If no expansion, include the literal $x construct, + so filenames containing dollar signs can be read. + The first +1 is to get the full variable name, + the other +1 is to get the dollar sign; we've moved past it. */ + fn_grow (&expansion, s - 1, var_end - s + 1 + 1); + } + 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)) { +#if defined(WIN32) + if (IS_KANJI(var_end)) + var_end++; +#endif + var_end++; + } + + if (! *var_end) { + WARNING1 ("kpathsea: %s: No matching } for ${", src); + s = var_end - 1; /* will incr to null at top of loop */ + } else { + expand (kpse, &expansion, s, var_end - 1); + s = var_end; /* will incr past } at top of loop*/ + } + + } else { + /* $: warn, but preserve characters; again, so + filenames containing dollar signs can be read. */ + WARNING2 ("kpathsea: %s: Unrecognized variable construct `$%c'", + src, *s); + fn_grow (&expansion, s - 1, 2); /* moved past the $ */ + } + } else + fn_1grow (&expansion, *s); + } + fn_1grow (&expansion, 0); + + ret = FN_STRING (expansion); + return ret; +} + +#if defined (KPSE_COMPAT_API) +string +kpse_var_expand (const_string src) +{ + return kpathsea_var_expand (kpse_def,src); +} +#endif + + +#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 (int argc, char **argv) +{ + kpse_set_program_name(argv[0], NULL); + 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/src/texsourc/kpathsea/kpathsea/variable.h b/src/texsourc/kpathsea/kpathsea/variable.h new file mode 100644 index 0000000..ab4a22a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/variable.h @@ -0,0 +1,54 @@ +/* variable.h: declare variable expander. + + Copyright 1993, 1995, 2008 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, see . */ + +#ifndef KPATHSEA_VARIABLE_H +#define KPATHSEA_VARIABLE_H + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the (variable-expanded) environment variable value or config + file value, or NULL. */ +extern KPSEDLL string kpathsea_var_value (kpathsea kpse, const_string var); + +/* Expand $VAR, ${VAR}, and ~ 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 kpathsea_var_expand (kpathsea kpse, const_string src); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL string kpse_var_value (const_string var); +extern KPSEDLL string kpse_var_expand (const_string src); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_VARIABLE_H */ diff --git a/src/texsourc/kpathsea/kpathsea/version.ac b/src/texsourc/kpathsea/kpathsea/version.ac new file mode 100644 index 0000000..840e2ac --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/version.ac @@ -0,0 +1,22 @@ +dnl +dnl Copyright (C) 2011-2013 Peter Breitenlohner +dnl +dnl This file is free software; the copyright holder +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl -------------------------------------------------------- +dnl Keep Kpathsea package and shared library versions the same: +dnl Only bug fixes: +dnl a.b.c => a.b.c+1 +dnl Adding new interfaces (backwards compatible) +dnl a.b.c => a.b+1.0 +dnl Modifying or revoking interfaces (not backwards compatible) +dnl a.b.c => a+1.0.0 +dnl +dnl After a release: +dnl append "dev", to distinguish binaries built between releases. +dnl -------------------------------------------------------- +dnl +dnl m4-include this file to define the current kpathsea version +m4_define([kpse_version], [6.2.0dev]) diff --git a/src/texsourc/kpathsea/kpathsea/version.c b/src/texsourc/kpathsea/kpathsea/version.c new file mode 100644 index 0000000..d4e5003 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/version.c @@ -0,0 +1,30 @@ +/* version.c: version number for libkpathsea. + + Copyright 1993, 1996, 2008, 2009 Karl Berry. + Copyright 1997, 1999, 2005 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, see . */ + +#include + +#include + +const char *kpathsea_version_string = KPSEVERSION; + +/* If you are redistributing a modified version of the original + distribution, please change this address here, among many other + places. Thanks. */ + +const char *kpathsea_bug_address = + "Email bug reports to tex-k@tug.org.\n"; diff --git a/src/texsourc/kpathsea/kpathsea/version.h b/src/texsourc/kpathsea/kpathsea/version.h new file mode 100644 index 0000000..ef94be6 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/version.h @@ -0,0 +1,36 @@ +/* version.h: version number for libkpathsea. + + Copyright 2009 Peter Breitenlohner. + + 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, see . */ + +#ifndef KPATHSEA_VERSION_H +#define KPATHSEA_VERSION_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern KPSEDLL const char *kpathsea_version_string; + +extern KPSEDLL const char *kpathsea_bug_address; + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_VERSION_H */ diff --git a/src/texsourc/kpathsea/kpathsea/win32/ChangeLog b/src/texsourc/kpathsea/kpathsea/win32/ChangeLog new file mode 100644 index 0000000..b45c36e --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/ChangeLog @@ -0,0 +1,78 @@ +2012-12-08 Akira Kakuto + + * getdestdir.c: Correct return value of getdestdir(). + +2012-10-04 Peter Breitenlohner + + * dirutil.c: Use stat in int is_dir (). + * Makefile.am: Avoid use of deprecated INCLUDES. + +2012-08-08 Peter Breitenlohner + + * Makefile.am: Install texhash.exe as copy of mktexlsr.exe. + +2012-08-03 Peter Breitenlohner + + * mktexfmt.c, mktexpk.c, mktextfm.c: Replace P_WAIT by _P_WAIT. + +2012-04-09 Peter Breitenlohner + + * Makefile.am (AM_CPPFLAGS): Define WEB2C_KPSE_VERSION. + * mktexpk.c, mktextfm.c: Drop WINWEB2CVERSION, WINKPSEVERSION, + use WEB2C_KPSE_VERSION with versions from configure. + +2011-08-29 Peter Breitenlohner + + * fmtutil.c: Add parens around assignment used as truth value. + +2011-08-11 Peter Breitenlohner + + * fmtutil.c: Return zero or one (Errorcnt could be 256). + +2011-08-10 Akira Kakuto + + * fmtutil.c: return a nonzero value if it fails to make a format. + +2011-08-10 Peter Breitenlohner + + * getdestdir.c, mktexmf.c, mktexpk.c, mktextfm.c, mktexupd.c, + mktexupdmain.c: No need to #include any standard headers, they + all come through . + * getdestdir.c, mktexpk.c, mktextfm.c: Use IS_KANJI(). + + * dirutil.[ch]: New files extracted ... + * getdestdir.[ch]: ... from here. + + * fmtutil.c, mktexfmt.c, mktexlsr.c: More new files from W32TeX. + Drop use of getlongname() for 8+3 names. Constify strings. + No need to #include any standard headers. + Declare functions as static. Drop unused variables. + Add parentheses around assignment used as truth value. + + * fmtutil.c: Declare the array index Exenum as unsigned char. + (is_dir, make_dir, make_dir_p): Removed, use dirutil.c. + + * mktexlsr.c: For MinGW #include "dirutil.h" and use is_dir(), + for native WIN32 #include and use d_isdir. + (search): No need to slashify name. Remove return at end. + +2011-08-09 Peter Breitenlohner + + * getdestdir.c, mktexmf.c, mktexpk.c, mktextfm.c, mktexupd.c, + mktexupdmain.c: New files from Akira's W32TeX. + + * getdestdir.c (getdestdir): Replace kstrrchr() by strrchr(). + + * mktexmf.c (main), mktexpk.c (main), mktextfm.c (main), + mktexupdmain.c (main): Drop use of getlongname() for 8+3 names. + + * mktexpk.c (main): Replace win32_popen() and win32_pclose() by + popen() and pclose(). + + * getdestdir.h, mktexupd.h: New headers with function prototypes. + + * *.c: Drop extern declarations and #include these headers. + Declare functions as static. Drop unused variables. + Add parentheses around assignment used as truth value. + Add 'return 0' at end of non-void function. Constify strings. + * getdestdir.c (getdestdir): Initialize `Num' to avoid warning. diff --git a/src/texsourc/kpathsea/kpathsea/win32/Makefile.am b/src/texsourc/kpathsea/kpathsea/win32/Makefile.am new file mode 100644 index 0000000..4edf1d1 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/Makefile.am @@ -0,0 +1,82 @@ +## Makefile.am for the TeX Live subdirectory texk/kpathsea/win32/ +## +## Copyright (C) 2011, 2012 Peter Breitenlohner +## You may freely use, modify and/or distribute this file. +## +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. +AM_CPPFLAGS += -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) Kpathsea-$(KPSEVERSION)"' +AM_CFLAGS = $(WARNING_CFLAGS) + +# Build WIN32 replacements for Unix shell scripts. +bin_PROGRAMS = \ + fmtutil \ + mktexfmt \ + mktexlsr \ + mktexmf \ + mktexpk \ + mktextfm \ + mktexupd + +fmtutil_SOURCES = \ + dirutil.c \ + dirutil.h \ + fmtutil.c \ + mktexupd.c \ + mktexupd.h + +mktexfmt_SOURCES = \ + mktexfmt.c + +mktexlsr_SOURCES = \ + dirutil.c \ + dirutil.h \ + mktexlsr.c + +mktexmf_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktexmf.c \ + mktexupd.c \ + mktexupd.h + +mktexpk_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktexpk.c \ + mktexupd.c \ + mktexupd.h + +mktextfm_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktextfm.c \ + mktexupd.c \ + mktexupd.h + +mktexupd_SOURCES = \ + mktexupdmain.c \ + mktexupd.c \ + mktexupd.h + +LDADD = ../libkpathsea.la + +install-exec-hook: + cp -p $(DESTDIR)$(bindir)/mktexlsr$(EXEEXT) $(DESTDIR)$(bindir)/texhash$(EXEEXT) + +uninstall-hook: + rm -f $(DESTDIR)$(bindir)/texhash$(EXEEXT) + +## Rebuild libkpathsea +../libkpathsea.la: ${top_srcdir}/../kpathsea/*.[ch] ../paths.h + cd .. && $(MAKE) $(AM_MAKEFLAGS) rebuild +../paths.h: + cd .. && $(MAKE) $(AM_MAKEFLAGS) rebuild + +EXTRA_DIST = ChangeLog + diff --git a/src/texsourc/kpathsea/kpathsea/win32/Makefile.in b/src/texsourc/kpathsea/kpathsea/win32/Makefile.in new file mode 100644 index 0000000..e677fae --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/Makefile.in @@ -0,0 +1,764 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = fmtutil$(EXEEXT) mktexfmt$(EXEEXT) mktexlsr$(EXEEXT) \ + mktexmf$(EXEEXT) mktexpk$(EXEEXT) mktextfm$(EXEEXT) \ + mktexupd$(EXEEXT) +subdir = win32 +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/../../build-aux/depcomp ChangeLog +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-lib-version.m4 \ + $(top_srcdir)/../../m4/kpse-mktex.m4 \ + $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 \ + $(top_srcdir)/../../m4/libtool.m4 \ + $(top_srcdir)/../../m4/ltoptions.m4 \ + $(top_srcdir)/../../m4/ltsugar.m4 \ + $(top_srcdir)/../../m4/ltversion.m4 \ + $(top_srcdir)/../../m4/lt~obsolete.m4 $(top_srcdir)/version.ac \ + $(top_srcdir)/../../version.ac $(top_srcdir)/ac/mktex.ac \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/c-auto.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_fmtutil_OBJECTS = dirutil.$(OBJEXT) fmtutil.$(OBJEXT) \ + mktexupd.$(OBJEXT) +fmtutil_OBJECTS = $(am_fmtutil_OBJECTS) +fmtutil_LDADD = $(LDADD) +fmtutil_DEPENDENCIES = ../libkpathsea.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_mktexfmt_OBJECTS = mktexfmt.$(OBJEXT) +mktexfmt_OBJECTS = $(am_mktexfmt_OBJECTS) +mktexfmt_LDADD = $(LDADD) +mktexfmt_DEPENDENCIES = ../libkpathsea.la +am_mktexlsr_OBJECTS = dirutil.$(OBJEXT) mktexlsr.$(OBJEXT) +mktexlsr_OBJECTS = $(am_mktexlsr_OBJECTS) +mktexlsr_LDADD = $(LDADD) +mktexlsr_DEPENDENCIES = ../libkpathsea.la +am_mktexmf_OBJECTS = dirutil.$(OBJEXT) getdestdir.$(OBJEXT) \ + mktexmf.$(OBJEXT) mktexupd.$(OBJEXT) +mktexmf_OBJECTS = $(am_mktexmf_OBJECTS) +mktexmf_LDADD = $(LDADD) +mktexmf_DEPENDENCIES = ../libkpathsea.la +am_mktexpk_OBJECTS = dirutil.$(OBJEXT) getdestdir.$(OBJEXT) \ + mktexpk.$(OBJEXT) mktexupd.$(OBJEXT) +mktexpk_OBJECTS = $(am_mktexpk_OBJECTS) +mktexpk_LDADD = $(LDADD) +mktexpk_DEPENDENCIES = ../libkpathsea.la +am_mktextfm_OBJECTS = dirutil.$(OBJEXT) getdestdir.$(OBJEXT) \ + mktextfm.$(OBJEXT) mktexupd.$(OBJEXT) +mktextfm_OBJECTS = $(am_mktextfm_OBJECTS) +mktextfm_LDADD = $(LDADD) +mktextfm_DEPENDENCIES = ../libkpathsea.la +am_mktexupd_OBJECTS = mktexupdmain.$(OBJEXT) mktexupd.$(OBJEXT) +mktexupd_OBJECTS = $(am_mktexupd_OBJECTS) +mktexupd_LDADD = $(LDADD) +mktexupd_DEPENDENCIES = ../libkpathsea.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(fmtutil_SOURCES) $(mktexfmt_SOURCES) $(mktexlsr_SOURCES) \ + $(mktexmf_SOURCES) $(mktexpk_SOURCES) $(mktextfm_SOURCES) \ + $(mktexupd_SOURCES) +DIST_SOURCES = $(fmtutil_SOURCES) $(mktexfmt_SOURCES) \ + $(mktexlsr_SOURCES) $(mktexmf_SOURCES) $(mktexpk_SOURCES) \ + $(mktextfm_SOURCES) $(mktexupd_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KPSEVERSION = @KPSEVERSION@ +KPSE_LT_VERSINFO = @KPSE_LT_VERSINFO@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_OBJDIR = @LT_OBJDIR@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +WEB2CVERSION = @WEB2CVERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I$(top_builddir)/.. -I$(top_srcdir)/.. \ + -DWEB2C_KPSE_VERSION='"Web2C-$(WEB2CVERSION) \ + Kpathsea-$(KPSEVERSION)"' +AM_CFLAGS = $(WARNING_CFLAGS) +fmtutil_SOURCES = \ + dirutil.c \ + dirutil.h \ + fmtutil.c \ + mktexupd.c \ + mktexupd.h + +mktexfmt_SOURCES = \ + mktexfmt.c + +mktexlsr_SOURCES = \ + dirutil.c \ + dirutil.h \ + mktexlsr.c + +mktexmf_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktexmf.c \ + mktexupd.c \ + mktexupd.h + +mktexpk_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktexpk.c \ + mktexupd.c \ + mktexupd.h + +mktextfm_SOURCES = \ + dirutil.c \ + dirutil.h \ + getdestdir.c \ + getdestdir.h \ + mktextfm.c \ + mktexupd.c \ + mktexupd.h + +mktexupd_SOURCES = \ + mktexupdmain.c \ + mktexupd.c \ + mktexupd.h + +LDADD = ../libkpathsea.la +EXTRA_DIST = ChangeLog +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign win32/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign win32/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +fmtutil$(EXEEXT): $(fmtutil_OBJECTS) $(fmtutil_DEPENDENCIES) $(EXTRA_fmtutil_DEPENDENCIES) + @rm -f fmtutil$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fmtutil_OBJECTS) $(fmtutil_LDADD) $(LIBS) + +mktexfmt$(EXEEXT): $(mktexfmt_OBJECTS) $(mktexfmt_DEPENDENCIES) $(EXTRA_mktexfmt_DEPENDENCIES) + @rm -f mktexfmt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktexfmt_OBJECTS) $(mktexfmt_LDADD) $(LIBS) + +mktexlsr$(EXEEXT): $(mktexlsr_OBJECTS) $(mktexlsr_DEPENDENCIES) $(EXTRA_mktexlsr_DEPENDENCIES) + @rm -f mktexlsr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktexlsr_OBJECTS) $(mktexlsr_LDADD) $(LIBS) + +mktexmf$(EXEEXT): $(mktexmf_OBJECTS) $(mktexmf_DEPENDENCIES) $(EXTRA_mktexmf_DEPENDENCIES) + @rm -f mktexmf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktexmf_OBJECTS) $(mktexmf_LDADD) $(LIBS) + +mktexpk$(EXEEXT): $(mktexpk_OBJECTS) $(mktexpk_DEPENDENCIES) $(EXTRA_mktexpk_DEPENDENCIES) + @rm -f mktexpk$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktexpk_OBJECTS) $(mktexpk_LDADD) $(LIBS) + +mktextfm$(EXEEXT): $(mktextfm_OBJECTS) $(mktextfm_DEPENDENCIES) $(EXTRA_mktextfm_DEPENDENCIES) + @rm -f mktextfm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktextfm_OBJECTS) $(mktextfm_LDADD) $(LIBS) + +mktexupd$(EXEEXT): $(mktexupd_OBJECTS) $(mktexupd_DEPENDENCIES) $(EXTRA_mktexupd_DEPENDENCIES) + @rm -f mktexupd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mktexupd_OBJECTS) $(mktexupd_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmtutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdestdir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexfmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexlsr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexmf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexpk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktextfm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexupd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktexupdmain.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-exec-am install-strip uninstall-am + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-hook + + +install-exec-hook: + cp -p $(DESTDIR)$(bindir)/mktexlsr$(EXEEXT) $(DESTDIR)$(bindir)/texhash$(EXEEXT) + +uninstall-hook: + rm -f $(DESTDIR)$(bindir)/texhash$(EXEEXT) + +../libkpathsea.la: ${top_srcdir}/../kpathsea/*.[ch] ../paths.h + cd .. && $(MAKE) $(AM_MAKEFLAGS) rebuild +../paths.h: + cd .. && $(MAKE) $(AM_MAKEFLAGS) rebuild + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/texsourc/kpathsea/kpathsea/win32/dirutil.c b/src/texsourc/kpathsea/kpathsea/win32/dirutil.c new file mode 100644 index 0000000..db0525f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/dirutil.c @@ -0,0 +1,62 @@ + +#include + +#include "dirutil.h" + +/* check a directory */ +int +is_dir (char *buff) +{ + struct stat stats; + + return stat (buff, &stats) == 0 && S_ISDIR (stats.st_mode); +} + +/* make a directory */ +int +make_dir (char *buff) +{ + if (_mkdir (buff)) { + fprintf(stderr, "mkdir %s error.\n", buff); + return (1); + } + if (_chmod (buff, _S_IREAD | _S_IWRITE)) { + fprintf(stderr, "chmod %s failed.\n", buff); + return (1); + } + return (0); +} + +int +make_dir_p(char *buff) +{ + int ret = 0; + int i = 0; + char *p = buff; + + while (1) { + if(*p == '\0') { + ret = 0; + if(!is_dir(buff)) { + if(make_dir(buff)) { + ret = 1; + } + } + break; + } + if(*p == '/' && (i > 0 && *(p-1) != ':')) { + *p = '\0'; + if(!is_dir(buff)) { + if(make_dir(buff)) { + ret = 1; + *p = '/'; + break; + } + } + *p = '/'; + } + p++; + i++; + } + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/dirutil.h b/src/texsourc/kpathsea/kpathsea/win32/dirutil.h new file mode 100644 index 0000000..c260ff3 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/dirutil.h @@ -0,0 +1,3 @@ +extern int is_dir (char *buff); +extern int make_dir (char *buff); +extern int make_dir_p (char *buff); diff --git a/src/texsourc/kpathsea/kpathsea/win32/fmtutil.c b/src/texsourc/kpathsea/kpathsea/win32/fmtutil.c new file mode 100644 index 0000000..495abf1 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/fmtutil.c @@ -0,0 +1,959 @@ +/* + +Try TEXMFVAR as a head directory, if not defined try TEXMFMAIN next. + + +fmtutil.c (2002/10/06 --ak) +Web2C-7.3.9 (2002/10/25 --ak) +Web2C-7.4.2 (2002/12/27 --ak) +Web2C-7.4.3 (2003/01/12 --ak) +Web2C-7.5.2 (2003/11/09 --ak) +Web2C-7.5.3 (2004/05/09 --ak) +Web2C-7.5.3 (2004/06/11 --ak) +Web2C-7.5.5 (2005/12/23 --ak) +Web2C-7.5.5 (2006/11/25 --ak) +Web2C-7.5.6 (2007/06/01 --ak) save log files. +Web2C-7.5.6 (2008/01/20 --ak) Create necessary directories. +Web2C-2009 (2009/06/11 --ak) error handling. +Web2C-2009 (2009/08/13 Nobert) new option --byengine +Web2C-2009 (2009/10/10 --ak) creates mplib-luatex.mem. +Web2C-2010 (2010/05/31 --ak) multiple language files. +Web2C-2010 (2010/07/03 --ak) new options. +*/ + +#include + +#include "dirutil.h" +#include "mktexupd.h" + +#define BLEN 512 +#define SLEN 256 +#define MAXFMT 128 +#define SIXTY4 64 +#define SIXTEEN 16 +#define DEFAULTCNF "fmtutil.cnf" +#define REVISION "fmtutil (C version 0.7) 2002-2010 --ak" + +typedef struct { +char *format; +char *engine; +char *hyphen; +char *args; +} cmd_t; + +/* +Global variables +*/ +cmd_t K[MAXFMT]; +int Fmtnum = 0; +char Buff[BLEN]; +char Programname[BLEN]; +char Enginename[BLEN]; +char Realenginename[BLEN]; +char Destdir[BLEN]; +char Currdir[BLEN]; +char *Exefile[MAXFMT]; +unsigned char Exenum = 0; +int Errorcnt = 0; +int UserDestdir = 0; +int QQQ = 0; /* quiet */ + +static void +revision(void) +{ + printf(REVISION "\n"); +} + +static void +usage(void) +{ + printf( +"Commands:\n" +" --all recreate all format, base, mem files\n" +" --missing create all missing format, base, mem files\n" +" --refresh recreate existing format, base, mem files\n" +" --byfmt FORMATNAME (re)create format for `FORMATNAME'\n" +" `base' and `mem' files can also be created\n" +" --byhyphen HYPHENFILE (re)create formats that depend on `HYPHENFILE'\n" +" --byengine ENGINENAME (re)create formats that depend on `ENGINENAME'\n" +" --showhyphen FORMATNAME print name of hyphenfile for format `FORMATNAME'\n" +" --version show revision number\n" +" --help show this message\n" +" --enablefmt FORMATNAME (not implemented)\n" +" --disablefmt FORMATNAME (not implemented)\n" +" --listcfg (not implemented)\n" +" --catcfg (not implemented)\n" +" --edit (not implemented)\n" +"\n" +"Options:\n" +" --cnffile FILE set configfile for fmtutil\n" +" default is `fmtutil.cnf'\n" +" --fmtdir DIRECTORY set destination directory for format files\n" +" `DIRECTORY' must be an absolute path\n" +" default is $TEXMFVAR/web2c/$engine\n" +" or $TEXMFMAIN/web2c/$engine if TEXMFVAR is undefined\n" +" --engine TEXENGINE specify the TeX engine (with --byfmt fmtname)\n" +" --quiet be silent\n" +" --no-error-if-no-format (just for compatibility)\n" +" --no-engine-subdir (not implemented)\n" +" --test (not implemented)\n" +" --dolinks (not implemented)\n" +" --force (not implemented)\n"); +} + +static void +freeK(void) +{ + int i; + for(i=0; i < MAXFMT; i++) { + free(K[i].format); + free(K[i].engine); + free(K[i].hyphen); + free(K[i].args); + free(Exefile[i]); + } +} + +static int +do_initex(char *fm, char *en, char *args) +{ + int ret, lsrflag; + char fmt[BLEN]; + char ext[SIXTEEN]; + char cmd[BLEN]; + char progn[BLEN]; + char progn2[BLEN]; + char enginesubdir[BLEN]; + char src[BLEN]; + char dst[BLEN]; + char logdst[BLEN]; + char log[BLEN]; + char fullbin[256], *pp; + + if(!strnicmp(fm, "cont", 4)) strcpy(progn, "context"); + else if(!strnicmp(fm, "ptex-", 5)) strcpy(progn, "ptex"); + else if(!strnicmp(fm, "platex-", 7)) strcpy(progn, "platex"); + else strcpy(progn, fm); + + strcpy(enginesubdir, en); + + if(!strcasecmp(enginesubdir, "mf-nowin")) + strcpy(enginesubdir, "metafont"); + if(!strcasecmp(enginesubdir, "mf")) + strcpy(enginesubdir, "metafont"); + if(!strcasecmp(enginesubdir, "mpost")) + strcpy(enginesubdir, "metapost"); + + if(!strcasecmp(en, "mf-nowin")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".base"); + } + else if(!strcasecmp(en, "mf")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".base"); + } + else if(!strcasecmp(en, "mpost")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".mem"); + } + else if(!strcasecmp(en, "pmpost")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".mem"); + } + else if(!strcasecmp(en, "upmpost")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".mem"); + } + else if(!strcasecmp(en, "mp641")) { + strcpy(fmt, "--jobname="); + strcpy(ext, ".mem"); + } + else if(!strcasecmp(en, "nts")) { + strcpy(fmt, "--fmt="); + strcpy(ext, ".nfmt"); + } + else { + strcpy(fmt, "--jobname="); + strcpy(ext, ".fmt"); + } + + if(!strcasecmp(en, "pmpost") || !strcasecmp(en, "mpost") + || !strcasecmp(en, "upmpost") || !strcasecmp(en, "mp641")) + strcpy(progn2, "mpost"); + else if(!strcasecmp(en, "mf-nowin")) + strcpy(progn2, "mf"); + else if(!strcasecmp(en, "nts")) + strcpy(progn2, "tex"); + else strcpy(progn2, progn); + + pp = kpse_var_value("SELFAUTOLOC"); + if(pp == NULL) { + fprintf(stderr, "I cannot get SELFAUTOLOC\n"); + exit(100); + } + fullbin[0] = '\"'; + fullbin[1] = '\0'; + strcat(fullbin, pp); + free(pp); + for(pp=fullbin; *pp; pp++) { + if(*pp == '/') *pp = '\\'; + } + strcat(fullbin, "\\"); + strcat(fullbin, en); + strcat(fullbin, "\""); + + if(!strcasecmp(en, "nts")) + sprintf(cmd, "%s --ini --progname=%s %s BLEN-1) { + fprintf(stderr, "\nToo long a string.\n"); + return 100; + } + /* --cnffile FILE */ + + if(!strncmp(av[i],"--cn", 4) || !strncmp(av[i], "-cn", 3)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + strcpy(cnffile, av[i]); + continue; + } + /* --engine TEXENGINE */ + + else if(!strncmp(av[i],"--eng", 5) || !strncmp(av[i], "-eng", 4)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + strcpy(Enginename, av[i]); + continue; + } + /* --fmtdir DIRCTORY */ + + else if(!strncmp(av[i],"--fm", 4) || !strncmp(av[i], "-fm", 3)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + strcpy(Destdir, av[i]); + UserDestdir = 1; + continue; + } + /* --all */ + + else if(!strncmp(av[i],"--a", 3) || !strncmp(av[i], "-a", 2)) { + flag = 1; + continue; + } + /* --missing */ + + else if(!strncmp(av[i],"--m", 3) || !strncmp(av[i], "-m", 2)) { + flag = 2; + continue; + } + /* --refresh */ + + else if(!strncmp(av[i],"--r", 3) || !strncmp(av[i], "-r", 2)) { + flag = 6; + continue; + } + /* --byfmt FORMATNAME */ + + else if(!strncmp(av[i],"--byf", 5) || !strncmp(av[i], "-byf", 4)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + flag = 3; + strcpy(fmtname, av[i]); + continue; + } + /* --byhyphen HYPHENFILE */ + + else if(!strncmp(av[i],"--byh", 5) || !strncmp(av[i], "-byh", 4)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + flag = 4; + strcpy(hyphenfile, av[i]); + for(p=hyphenfile; *p; p++) { + if(*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + p = strrchr(hyphenfile, '/'); + if(p) { + p++; + strcpy(hyphenfile, p); + } + continue; + } + /* --byengine ENGINENAME */ + + else if(!strncmp(av[i],"--bye", 5) || !strncmp(av[i], "-bye", 4)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + flag = 7; + strcpy(byenginename, av[i]); + continue; + } + /* --showhyphen FORMATNAME */ + + else if(!strncmp(av[i],"--s", 3) || !strncmp(av[i], "-s", 2)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + flag = 5; + strcpy(fmtname, av[i]); + continue; + } + /* --version */ + + else if(!strncmp(av[i],"--v", 3) || !strncmp(av[i], "-v", 2)) { + revision(); + return 0; + } + /* --help */ + + else if(!strncmp(av[i],"--h", 3) || !strncmp(av[i], "-h", 2)) { + usage(); + return 0; + } + /* --enablefmt FORMATNAME */ + + else if(!strncmp(av[i],"--ena", 5) || !strncmp(av[i], "-ena", 4)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + fprintf(stderr, "`--enablefmt FORMATNAME' is not implemented.\n"); + continue; + } + /* --disablefmt FORMATNAME */ + + else if(!strncmp(av[i],"--di", 4) || !strncmp(av[i], "-di", 3)) { + i++; + if(i >= ac) { + fprintf(stderr, "Invalid argument.\n"); + exit (100); + } + fprintf(stderr, "`--disablefmt FORMATNAME' is not implemented.\n"); + continue; + } + /* --listcfg */ + + else if(!strncmp(av[i],"--l", 3) || !strncmp(av[i], "-l", 2)) { + fprintf(stderr, "`--listcfg' is not implemented.\n"); + continue; + } + /* --catcfg */ + + else if(!strncmp(av[i],"--ca", 4) || !strncmp(av[i], "-ca", 3)) { + fprintf(stderr, "`--catcfg' is not implemented.\n"); + continue; + } + /* --edit */ + + else if(!strncmp(av[i],"--ed", 4) || !strncmp(av[i], "-ed", 3)) { + fprintf(stderr, "`--edit' is not implemented.\n"); + continue; + } + /* --test */ + + else if(!strncmp(av[i],"--t", 3) || !strncmp(av[i], "-t", 2)) { + fprintf(stderr, "`--test' is not implemented.\n"); + continue; + } + /* --dolinks */ + + else if(!strncmp(av[i],"--do", 4) || !strncmp(av[i], "-do", 3)) { + fprintf(stderr, "`--dolinks' is not implemented.\n"); + continue; + } + /* --force */ + + else if(!strncmp(av[i],"--fo", 4) || !strncmp(av[i], "-fo", 3)) { + fprintf(stderr, "`--force' is not implemented.\n"); + continue; + } + /* --no-engine-subdir */ + + else if(!strncmp(av[i],"--no-en", 7) || !strncmp(av[i], "-no-en", 6)) { + fprintf(stderr, "`--no-engine-subdir' is not implemented.\n"); + continue; + } + /* --no-error-if-no-format */ + + else if(!strncmp(av[i],"--no-er", 7) || !strncmp(av[i], "-no-er", 6)) { + continue; + } + /* --quiet */ + + else if(!strncmp(av[i],"--q", 3) || !strncmp(av[i], "-q", 2)) { + QQQ = 1; + continue; + } + else { + fprintf(stderr, "%s: Invalid argument.\n\n", av[0]); + usage(); + return 100; + } + } + + if(flag == 0) { + usage(); + return 100; + } + + + if(!cnffile[0]) strcpy(cnffile, DEFAULTCNF); + cnfname = kpse_find_file(cnffile, kpse_web2c_format, 0); + if(!cnfname) { + fprintf(stderr, "Failed to find cnffile %s.\n", cnffile); + exit (100); + } + + in = fopen(cnfname, "r"); + free(cnfname); + if(!in) { + fprintf(stderr, "Failed to open %s.\n", cnffile); + exit (100); + } + + for(i=0; i < MAXFMT; i++) { + K[i].format = (char *)malloc(BLEN); + K[i].engine = (char *)malloc(BLEN); + K[i].hyphen = (char *)malloc(BLEN); + K[i].args = (char *)malloc(BLEN); + Exefile[i] = (char *)malloc(BLEN); + } + + i = 0; + while(fgets(Buff, BLEN, in)) { + if(Buff[0] == '#' || + Buff[0] == '\n' || + Buff[0] == 0x25) + continue; + p = strtok(Buff, " \t"); + if(p) + strcpy(K[i].format, p); + else + K[i].format[0] = '\0'; + p = strtok(NULL, " \t"); + if(p) + strcpy(K[i].engine, p); + else + K[i].engine[0] = '\0'; + p = strtok(NULL, " \t"); + if(p) + strcpy(K[i].hyphen, p); + else + K[i].hyphen[0] = '\0'; + p = strtok(NULL, "\n"); + if(p) { + while(*p == ' ' || *p == '\t') + p++; + j = strlen(p); + if(*(p+j-1) == '\n') + *(p+j-1) = '\0'; + strcpy(K[i].args, p); + } + else + K[i].args[0] = '\0'; + + if(!K[i].format[0] || + !K[i].engine[0] || + !K[i].hyphen[0] || + !K[i].args) { + fprintf(stderr, "Invalid line in %s.\n", cnffile); + freeK(); + return (100); + } + i++; + if(i > MAXFMT) { + fprintf(stderr, "Too many lines in %s.\n", cnffile); + freeK(); + return (100); + } + } + + Fmtnum = i; + fclose(in); + + j = 0; + if(flag == 5) { + for(i = 0; i < Fmtnum; i++) { + if(!strcasecmp(K[i].format, fmtname)) { + show_hyphen(K[i].format, K[i].hyphen); + j++; + } + } + if(j == 0) + fprintf(stderr, "argument of --showhyphen must be a format name.\n"); + freeK(); + return 1; + } + + if(strcasecmp(Programname, "fmtutil-sys") == 0) { + char *px = kpse_var_value("TEXMFSYSVAR"); + if(px) { + xputenv("TEXMFVAR", px); + } + } + + if(UserDestdir == 0) { + p = kpse_var_value("TEXMFVAR"); + if(!p) + p = kpse_var_value("TEXMFMAIN"); + if(!p) { + fprintf(stderr, "TEXMFMAIN not defined.\n"); + freeK(); + return 100; + } + strcpy(Destdir, p); + free(p); + for(p = Destdir; *p ; p++) { + if(*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + + i = strlen(Destdir); + while (Destdir[i-1] == '/') + i--; + Destdir[i] = '\0'; + strcat(Destdir, "/web2c"); + } + + if(!is_dir(Destdir)) { + if(make_dir_p(Destdir)) { + fprintf(stderr, "Failed to make a format under %s.\n", Destdir); + return (-100); + } + } + + strcat(Destdir, "/"); + p = _getcwd(Currdir, BLEN); + if(p) { + for(p = Currdir; *p ; p++) { + if(*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + i = strlen(Currdir); + if(Currdir[i-1] == '/') Currdir[i-1] = '\0'; + strcpy(kpsedot, "KPSE_DOT=.;"); + strcat(kpsedot, Currdir); + _putenv(kpsedot); + } + + cdrive = _getdrive(); + if(tmp[1] == ':') { + tdrive = tolower(*tmp) -'a' + 1; + _chdrive(tdrive); + } + _chdir(tmp); + + j = 0; + + if(flag == 4) { + char *p, *q; + int cont; + for(i = 0; i < Fmtnum; i++) { + p = K[i].hyphen; + cont = 1; + while(cont) { + for(q = p; *q && *q != ','; q++) + ; + if(*q == '\0') cont = 0; + *q = '\0'; + q++; + if(!strcasecmp(p, hyphenfile)) { + do_initex(K[i].format, K[i].engine, K[i].args); + j++; + cont = 0; + } + p = q; + } + } + if(j == 0) + fprintf(stderr, "hyphen pattern %s not written in %s.\n",hyphenfile,cnffile); + } + + else if(flag == 7) { + if(strcasecmp(byenginename, "metafont") == 0) + strcpy(byenginename, "mf-nowin"); + if(strcasecmp(byenginename, "metapost") == 0) + strcpy(byenginename, "mpost"); + for(i = 0; i < Fmtnum; i++) { + if(!strcasecmp(K[i].engine, byenginename)) { + do_initex(K[i].format, K[i].engine, K[i].args); + j++; + } + } + if(j == 0) { + fprintf(stderr, "engine name %s not written in %s.\n", byenginename, cnffile); + } + } + + else if(flag == 3) { + for(i = 0; i < Fmtnum; i++) { + if(Enginename[0]) { + if(!strcasecmp(Enginename, "metafont")) + strcpy(Realenginename, "mf-nowin"); + else if(!strcasecmp(Enginename, "metapost")) + strcpy(Realenginename, "mpost"); + else + strcpy(Realenginename, Enginename); + if(!strcasecmp(K[i].format, fmtname) && + !strcasecmp(K[i].engine, Realenginename)) { + do_initex(K[i].format, K[i].engine, K[i].args); + j++; + } + } + else { + if(!strcasecmp(K[i].format, fmtname)) { + do_initex(K[i].format, K[i].engine, K[i].args); + j++; + } + } + } + if(j == 0) { + if(Enginename[0]) + fprintf(stderr, "format name %s with engine %s not written in %s.\n", + fmtname, Realenginename, cnffile); + else + fprintf(stderr, "format name %s not written in %s.\n", fmtname, cnffile); + } + } + + else if((flag == 2) || (flag == 6)) { + for(i = 0; i < Fmtnum; i++) { + strcpy(Buff, Destdir); + + strcpy(enginesubdir, K[i].engine); + if(!strcasecmp(enginesubdir, "mf-nowin")) + strcpy(enginesubdir, "metafont"); + if(!strcasecmp(enginesubdir, "mf")) + strcpy(enginesubdir, "metafont"); + if(!strcasecmp(enginesubdir, "mpost")) + strcpy(enginesubdir, "metapost"); + if(strcasecmp(enginesubdir, "nts")) + strcat(Buff, enginesubdir); + strcat(Buff, "/"); + + strcat(Buff, K[i].format); + if(!strcasecmp(K[i].engine, "nts")) + strcat(Buff, ".nfmt"); + else if(!strcasecmp(K[i].engine, "mf")) + strcat(Buff, ".base"); + else if(!strcasecmp(K[i].engine, "mf-nowin")) + strcat(Buff, ".base"); + else if(!strcasecmp(K[i].engine, "mpost")) + strcat(Buff, ".mem"); + else if(!strcasecmp(K[i].engine, "pmpost")) + strcat(Buff, ".mem"); + else if(!strcasecmp(K[i].engine, "upmpost")) + strcat(Buff, ".mem"); + else + strcat(Buff, ".fmt"); + if(flag == 2) { + if(_access(Buff, 0) != 0) + do_initex(K[i].format, K[i].engine, K[i].args); + else if(QQQ == 0) + fprintf(stderr, "%s exists.\n", Buff); + } else if(flag == 6) { + if(_access(Buff, 0) == 0) + do_initex(K[i].format, K[i].engine, K[i].args); + else if(QQQ == 0) + fprintf(stderr, "%s does not exist.\n", Buff); + } + } + } + + else if(flag == 1) + do_all(); + + _chdrive(cdrive); + _chdir(Currdir); + +/* +Check executable files. (ignore "Batch" or "Script" files (case 'x')) +*/ + if(Exenum && QQQ == 0) { + fprintf(stderr, "\n\nNow I check executable files...\n"); + fprintf(stderr, "If some executable files do not exist, you must make them\n"); + fprintf(stderr, "by hard link (Windows NT/2000/XP/Vista/7)," + " symbolic link (Vista/7)\n" + "or copying (Windows 95/98/Me).\n\n"); + + for(i = 0; i < Exenum; i++) { + if(testexe(Exefile[i], ".exe")) + sprintf(Buff, "OK. %s.exe exists.", Exefile[i]); + else if(testexe(Exefile[i], ".bat")) + sprintf(Buff, "OK. %s.bat exists.", Exefile[i]); + else if(testexe(Exefile[i], ".sh")) + sprintf(Buff, "OK. %s.sh exists.", Exefile[i]); + else + sprintf(Buff, "I cannot find %s.", Exefile[i]); + j = strlen(Buff); + + if((i+1) % 2) { + for(k = j; k < 36; k++) + Buff[k] = ' '; + Buff[k] = '\0'; + fprintf(stderr, "%s", Buff); + } + else { + fprintf(stderr, "%s", Buff); + fprintf(stderr, "\n"); + } + } + fprintf(stderr, "\n"); + } + + freeK(); + if(Errorcnt && QQQ == 0) { + fprintf(stderr, "\n\nI could not create %d of format (base/mem) file(s).\n", + Errorcnt); + fprintf(stderr, "For details, see log file(s) in the (fmt/base/mem) dir(s).\n"); + } + return Errorcnt != 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/getdestdir.c b/src/texsourc/kpathsea/kpathsea/win32/getdestdir.c new file mode 100644 index 0000000..2dcafbd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/getdestdir.c @@ -0,0 +1,248 @@ +/* +getdestdir.c +from mktexpk: + argv[0] = "Dummy", argv[1] = "pk", argv[2] = path, argv[3] = mode +from mktextfm: + argv[0] = "Dummy", argv[1] = "tfm", argv[2] = path +*/ + +#include + +#include "dirutil.h" +#include "getdestdir.h" + +#define NUMBUF 32 +#define LENBUF 128 +#define MPATH 256 +#define FTOP "fonts" + +/* error message */ +static void +fatal (const char *s) +{ + fprintf (stderr, "%s\n", s); +} + +char * +getdestdir (int ac, char **av) +{ + static char buff[MPATH]; + char *pb[NUMBUF]; + char *p, *q; + char spec[32]; + int i, Num = 0, ispk, k; + char *topdir; + + ispk = 0; + + for (i = 0; i < NUMBUF; i++) { + if (!(pb[i] = (char *) malloc (LENBUF))) { + fatal ("Memory allocation error."); + return (NULL); + } + } + + if (ac != 3 && ac != 4) { + fatal ("Argument error."); + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + + strcpy (spec, av[1]); + + for (p = av[2]; *p; p++) { /* path */ + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + + p = av[2]; + q = buff; + +/* UNC name support */ + + if (p[0] == '/' && p[1] == '/') { + *q++ = *p++; + *q++ = *p++; + } + + while (*p) { + if (*p == '/') { + *q = *p; + while (*p == '/') + p++; + p--; + } else { + *q = *p; + } + p++; + q++; + } + *q = '\0'; /* now path name of ${name}.mf is in buff. */ +/* +#ifdef TEST + return xstrdup(buff); +#endif +*/ + if (ac == 4) + ispk = 1; /* called from mktexpk */ + + if (!(p = strrchr (buff, '/'))) { + fatal ("Invalid path name."); + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + + *p = '\0'; /* get directory name */ + + for (i = 0; i < NUMBUF; i++) { + if (!(p = strrchr (buff, '/'))) { + fatal ("Invalid path name."); + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + *p = '\0'; + p++; + strcpy (pb[i], p); + if (!stricmp (pb[i], FTOP)) { + Num = i; + break; + } + } + + Num -= 2; + if (Num < 0) { + fprintf (stderr, "Font resources should be under a directory "); + fprintf (stderr, "with the name \"fonts\".\n"); + fprintf (stderr, "Furthermore, there must be at least two directories "); + fprintf (stderr, "under the directory \"fonts\".\n"); + fatal ("Invalid path name."); + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + + topdir = kpse_var_value ("MAKETEXPK_TOP_DIR"); + if (topdir && *topdir && ispk) { + for (i = 0; topdir[i]; i++) { + if (topdir[i] == '\\') + topdir[i] = '/'; + else if (IS_KANJI(topdir+i)) + i++; + } + i = strlen (topdir); + while(topdir[i - 1] == '/') + i--; + topdir[i] = '\0'; + + if(!is_dir(topdir)) { + if(make_dir_p(topdir)) { + fprintf(stderr, "Failed to access %s.\n", topdir); + return NULL; + } + } +#ifdef TEST + printf ("%s\n", topdir); +#endif + if (strnicmp (&topdir[i - 3], "/pk", 3) != 0) { + strcat (topdir, "/pk"); + if (!is_dir(topdir)) { + if (make_dir(topdir)) { + fprintf(stderr, "Faild to access %s.\n", topdir); + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + } + } + strcpy (buff, topdir); + free(topdir); + } else { + if((topdir = kpse_var_value("TEXMFVAR")) != NULL) { + for (i = 0; topdir[i]; i++) { + if (topdir[i] == '\\') + topdir[i] = '/'; + else if (IS_KANJI(topdir+i)) + i++; + } + i = strlen (topdir); + while(topdir[i - 1] == '/') + i--; + topdir[i] = '\0'; + + if(!is_dir(topdir)) { + if(make_dir_p(topdir)) { + fprintf(stderr, "Failed to access %s.\n", topdir); + return NULL; + } + } + + strcpy(buff, topdir); + free(topdir); + } + + strcat (buff, "/fonts"); + if (!is_dir (buff)) { + if (make_dir (buff)) { + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + } + strcat (buff, "/"); + strcat (buff, spec); + if (!is_dir (buff)) { + if (make_dir (buff)) { + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + } + } + + if (ispk) { + strcat (buff, "/"); + strcat (buff, av[3]); + if (!is_dir (buff)) { + if (make_dir (buff)) { + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + } + } + + for (i = Num; i > -1; i--) { + strcat (buff, "/"); + strcat (buff, pb[i]); + if (is_dir (buff)) + continue; + else { + if (make_dir (buff)) { + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + return (NULL); + } + } + } + + for (k = 0; k < NUMBUF; k++) + free (pb[k]); + + p = xstrdup(buff); + return p; +} + +#ifdef TEST +int +main (int ac, char *av[]) +{ + kpse_set_program_name (av[0], "getdestdir"); + printf ("%s", getdestdir (ac, av)); + return 0; +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/win32/getdestdir.h b/src/texsourc/kpathsea/kpathsea/win32/getdestdir.h new file mode 100644 index 0000000..743db04 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/getdestdir.h @@ -0,0 +1 @@ +extern char *getdestdir (int ac, char **av); diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexfmt.c b/src/texsourc/kpathsea/kpathsea/win32/mktexfmt.c new file mode 100644 index 0000000..826bede --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexfmt.c @@ -0,0 +1,95 @@ +/* mktexfmt.c + */ + +#include + +int main(int ac, char **av) +{ + int savo, savi; + FILE *fnul; + char *fmtname; + char *p; + char orgname[256]; + + char texbindir[256]; + char fullbin[256]; + + kpse_set_program_name(av[0], NULL); + + if(ac != 2) { + fprintf(stderr,"%s : Usage %s formatname\n", av[0], av[0]); + fprintf(stderr,"formatname : (foo.fmt, foo.nfmt, foo.mem, foo.base)\n"); + return 1; + } + + if(strlen(av[1]) > 127) { + fprintf(stderr, "\nToo long a format name.\n"); + return 100; + } + + p = kpse_var_value("SELFAUTOLOC"); + if(p == 0) { + fprintf(stderr, "I cannot get SELFAUTOLOC\n"); + exit(1); + } + strcpy(texbindir, p); + free(p); + for(p=texbindir; *p; p++) { + if(*p == '/') *p = '\\'; + } + strcat(texbindir, "\\"); + + strcpy(orgname, av[1]); + + p = strrchr(av[1], '.'); + if(!p) { + fprintf(stderr, "formatname needs a suffix.\n"); + return 1; + } + + if(stricmp(p, ".fmt") && stricmp(p, ".nfmt") && + stricmp(p, ".base") && stricmp(p, ".mem")) { + fprintf(stderr, "%s : unknown format type.\n", av[1]); + return 1; + } + + *p = '\0'; + +/* save stdout and stdin */ + savo = _dup(fileno(stdout)); + savi = _dup(fileno(stdin)); + +/* connect stdout to stderr */ + _dup2(fileno(stderr), fileno(stdout)); + +/* connect stdin to nul device */ + if(!(fnul = fopen("nul", "r"))) { + fprintf(stderr, "Cannot open nul device to read\n"); + exit(100); + } + _dup2(fileno(fnul), fileno(stdin)); + +/* COMMAND */ + strcpy(fullbin, texbindir); + strcat(fullbin, "fmtutil.exe"); + fprintf(stderr, "Running the command %s\n", fullbin); + spawnlp(_P_WAIT, fullbin, "fmtutil", "--byfmt", av[1], NULL); + +/* END COMMAND */ + +/* return to original stdout and stdin */ + _dup2(savo, fileno(stdout)); + close(savo); + _dup2(savi, fileno(stdin)); + close(savi); + +/* close nul device */ + fclose(fnul); + + fmtname = kpse_find_file(orgname , kpse_fmt_format, 0); + if(fmtname) { + printf("%s\n", fmtname); + free(fmtname); + } + return 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexlsr.c b/src/texsourc/kpathsea/kpathsea/win32/mktexlsr.c new file mode 100644 index 0000000..80e283f --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexlsr.c @@ -0,0 +1,225 @@ +/* +mktexlsr +Web2C 2010 (2010/08/22 --ak) +*/ + +#include + +#ifdef __MINGW32__ +#include "dirutil.h" +#else +#include +#endif + +#define MAXTREE 32 /* Max number of texmf trees */ + +/* magic header */ +#define HDL "%% ls-R -- filename database for kpathsea; do not change this line.\n" + +#define VARTEXFONTS "c:/var/tex/fonts/ls-R" + +FILE *ls_R; + +static void +search(const char *name) +{ + DIR *dp; + struct dirent *de; + char buff[256]; + int len; + + if ((dp = opendir(name))) { + fprintf(ls_R, "\n%s:\n", name); + while ((de = readdir(dp))) { + if(stricmp(de->d_name, ".") && + stricmp(de->d_name, "..") && + stricmp(de->d_name, ".bzr") && + stricmp(de->d_name, ".git") && + stricmp(de->d_name, ".hg") && + stricmp(de->d_name, ".svn") && + stricmp(de->d_name, "_bzr") && + stricmp(de->d_name, "_git") && + stricmp(de->d_name, "_hg") && + stricmp(de->d_name, "_svn") && + stricmp(de->d_name, "_darcs")) { + fprintf(ls_R, "%s\n", de->d_name); + } + } + closedir(dp); + + len = strlen (name); + strcpy (buff, name); + if (name[len-1] != '/') + buff[len++] = '/'; + + dp = opendir(name); + while ((de = readdir(dp))) { + if(stricmp(de->d_name, ".") && + stricmp(de->d_name, "..") && + stricmp(de->d_name, ".bzr") && + stricmp(de->d_name, ".git") && + stricmp(de->d_name, ".hg") && + stricmp(de->d_name, ".svn") && + stricmp(de->d_name, "_bzr") && + stricmp(de->d_name, "_git") && + stricmp(de->d_name, "_hg") && + stricmp(de->d_name, "_svn") && + stricmp(de->d_name, "_darcs")) { +#ifdef __MINGW32__ + strcpy(buff + len, de->d_name); + if (is_dir (buff)) { + search (buff); + } +#else + if (de->d_isdir) { + strcpy (buff + len, de->d_name); + search (buff); + } +#endif + } + } + closedir(dp); + } +} + +int Quiet = 0; + +int main(int ac, char **av) +{ + char *texmfdbs ; + int cdrive, tdrive; + char ls_R_name[256]; + int len, i, numtree; + char *progname; + char *pathbuff[MAXTREE]; + char *p, *q; + + progname = av[0]; + kpse_set_program_name(progname, NULL); + + for(i = 0; i < MAXTREE; i++) { + pathbuff[i] = (char *)malloc(384); + if(!pathbuff[i]) { + fprintf(stderr, "Memory allocation error.\n"); + exit(100); + } + } + + if(ac > 1 && (!strncmp(av[1], "-v", 2) || !strncmp(av[1], "--v", 3))) { + puts (kpathsea_version_string); + puts ("Copyright 2010 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); + } + + if(ac > 1 && (!strncmp(av[1], "-h", 2) || !strncmp(av[1], "--h", 3))) { + printf("Usage: %s [--quiet|--silent] [DIRS ...]\n\n" +"Rebuild all necessary ls-R filename databases completely. If one or\n" +"more arguments DIRS are given, these are used as texmf directories to\n" +"build ls-R for. Else all directories in the search path for ls-R files\n" +"($TEXMFDBS) are used.", av[0]); + exit (0); + } + + if(ac > 1) { + if(!strncmp(av[1], "-q", 2) || !strncmp(av[1], "--q", 3) || + !strncmp(av[1], "-s", 2) || !strncmp(av[1], "--s", 3)) { + Quiet = 1; + ac--; + av++; + } + } + if(ac > 1) { + if(ac > MAXTREE + 1) { + fprintf(stderr, "Number of trees must be less than %d.\n" + "Some trees are discarded.\n", MAXTREE); + numtree = MAXTREE; + } else { + numtree = ac - 1; + } + for(i=0; i < numtree; i++) { + strcpy(pathbuff[i], av[i+1]); + for(p=pathbuff[i]; *p; p++) { + if(*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + } + } else { + if(!(p = kpse_var_value("TEXMFDBS"))) { + fprintf(stderr, "TEXMFDBS is not defined in texmf.cnf.\n"); + exit (100); + } + + texmfdbs = kpse_brace_expand(p); + free(p); + + for(i=0 ; (i < MAXTREE) && *texmfdbs ; i++) { + p = strchr(texmfdbs, ';'); + if(!p) { + strcpy(pathbuff[i], texmfdbs); + q = pathbuff[i]; + if(*q == '!' && *(q+1) == '!') + q += 2; + strcpy(pathbuff[i], q); + i++; + break; + } + *p = '\0'; + strcpy(pathbuff[i], texmfdbs); + q = pathbuff[i]; + if(*q == '!' && *(q+1) == '!') + q += 2; + strcpy(pathbuff[i], q); + p++; + texmfdbs = p; + } + + numtree = i; + } + + for(i = 0; i < numtree; i++) { + strcpy(ls_R_name, pathbuff[i]); + len = strlen(ls_R_name); + if(ls_R_name[len-1] != '/') strcat(ls_R_name, "/"); + strcat(ls_R_name, "ls-R"); + + ls_R = fopen(ls_R_name, "wb"); + if(!ls_R) { + fprintf(stderr, "Cannot open %s to write.\n", ls_R_name); + if(!stricmp(ls_R_name, VARTEXFONTS)) + fprintf(stderr, " (Don't mind this message.)\n"); + continue; + } + + cdrive = _getdrive(); + + if(ls_R_name[1] == ':') { + tdrive = tolower(ls_R_name[0]) - 'a' + 1; + _chdrive(tdrive); + } + + _chdir(pathbuff[i]); + if(!Quiet) + fprintf(stderr, "%s: Updating %s...\n", progname, ls_R_name); + fprintf(ls_R, HDL); + search("./"); + + fclose(ls_R); + if(!Quiet) + fprintf(stderr, "%s: Updated %s.\n", progname, ls_R_name); + _chdrive(cdrive); + } + + if(!Quiet) + fprintf(stderr, "%s: Done.\n", progname); + + for(i = 0; i < MAXTREE; i++) { + free(pathbuff[i]); + } + + return 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexmf.c b/src/texsourc/kpathsea/kpathsea/win32/mktexmf.c new file mode 100644 index 0000000..a1ff80b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexmf.c @@ -0,0 +1,354 @@ +/* + * mktexmf.c (Borrowed from Fabrice) + * (2006 --ak) + * +*/ + +#include + +#include "dirutil.h" +#include "getdestdir.h" +#include "mktexupd.h" + +#define SBUF 256 + +char *progname; + +static int +test_file(char c, char * name) +{ +/* + * c= 'z', 'f', 'd', 'r' + * +*/ + FILE *fp; + + if (c == 'z') { + if (name == NULL) return 1; + else if (*name == '\0') return 1; + else if (_access(name, 0) != 0) return 1; + else if ((fp = (FILE *)fopen(name, "r")) == NULL) return 1; + else if (_filelength(_fileno(fp)) == 0L) { + fclose(fp); + return 1; + } + else { + fclose(fp); + return 0; + } + } + else if (c == 'f') { + if (name == NULL) return 0; + else if (*name == '\0') return 0; + else if (_access(name, 0) != 0) return 0; + else return 1; + } + else if (c == 'd') { + if (is_dir(name)) return 1; + else return 0; + } + else if (c == 'r') { + if (_access(name, 4) == 0) return 1; + else return 0; + } + return 0; +} + +static void +usage(void) +{ + fprintf(stderr, "Usage : mktexmf FONT.\n\n"); + fprintf(stderr, "Makes the Metafont source file for FONT," + " if possible. For example,\n"); + fprintf(stderr, "`ecr12' or `cmr11'.\n"); +} + +/* + * Split a .mf name into root part and point size part. + * Root and point size are optional (may be NULL). + */ + +static void +split_mf_name(string name, string *base, string *root, string *ptsize) +{ + string p, q; + /* name = basename $1 .mf */ + p = strrchr (name, '.'); + if (p) { + if (stricmp (p, ".mf") == 0) *p = '\0'; + } + p = name; + + if (base) + *base = xstrdup(p); + /* rootname = `echo $name | sed 's/[0-9]*$//'` */ + for (q = p + strlen(p); q > p && isdigit(q[-1]); q--); + /* ptsize = `echo $name | sed 's/^$rootname//'` */ + if (ptsize) + *ptsize = xstrdup(q); + *q = '\0'; + if (root) + *root = p; + else + free(p); +} + +static void +relmem (char **v) +{ + int j; + for (j = 0; j < 4; j++) + free (v[j]); + return; +} + +int +main (int argc, char **argv) +{ + string rootname, pointsize; + const_string realsize; + string name; + string sauterroot, rootfile; + string destdir = NULL; + FILE *f; + size_t ptsz_len; + char font[SBUF]; + char mfname[SBUF]; + char *arg[4]; + int i; + char *ptr; + + progname = argv[0]; + kpse_set_program_name (progname, NULL); + if (argc != 2) { + usage(); + return 0; + } + + for (i=0; i < 4; i++) { + arg[i] = (char *)malloc(SBUF); + } + + if(strlen(argv[1]) > SBUF - 1) { + fprintf(stderr, "\nToo long a font name.\n"); + return 100; + } + + strcpy (font, argv[1]); + + split_mf_name(font, &name, &rootname, &pointsize); + + + fprintf(stderr, "name = %s, rootname = %s, pointsize = %s\n", + name, rootname, pointsize); + + + sauterroot = kpse_find_file(concat3("b-", rootname, ".mf"), + kpse_mf_format, false); + + if (sauterroot && *sauterroot) { + rootfile = sauterroot; + rootname = concat("b-", rootname); + strcpy (arg[0], "Dummy"); + strcpy (arg[1], "source"); + strcpy (arg[2], sauterroot); + if (!(ptr = getdestdir (3, arg))) { + fprintf(stderr, "Cannot get destination directory name.\n"); + relmem (arg); + return 100; + } + destdir = ptr; + } + else if (strlen(name) == 8 + && FILESTRNCASEEQ(name, "csso12", 6) + && (name[6] >= '0' && name[6] <= '5') + && isdigit(name[7])) { + rootfile = xstrdup(""); + } + else if (FILESTRNCASEEQ(rootname, "cs", 2) + || FILESTRNCASEEQ(rootname, "lcsss", 5) + || FILESTRNCASEEQ(rootname, "icscsc", 6) + || FILESTRNCASEEQ(rootname, "icstt", 5) + || FILESTRNCASEEQ(rootname, "ilcsss", 6) + ) { + rootfile = kpse_find_file("cscode.mf", + kpse_mf_format, false); + } + else if (strlen(rootname) >= 3 + && ((FILESTRNCASEEQ(rootname, "wn", 2) + && strchr("bBcCdDfFiIrRsStTuUvV", rootname[2])) + || (FILESTRNCASEEQ(rootname, "rx", 2) + && strchr("bBcCdDfFiIoOrRsStTuUvVxX", rootname[2]) + && strlen(rootname) >= 4 + && strchr("bBcCfFhHiIlLmMoOsStTxX", rootname[3])) + || ((rootname[0] == 'l' || rootname[0] == 'L') + && strchr("aAbBcCdDhHlL", rootname[1]) + && strchr("bBcCdDfFiIoOrRsStTuUvVxX", rootname[2])))) { + char lhprefix[64]; + strncpy(lhprefix, name, 2); + lhprefix[2] = '\0'; + strcat(lhprefix, "codes.mf"); + rootfile = kpse_find_file(lhprefix, kpse_mf_format, false); + } + else { + string tem; + rootfile = kpse_find_file(tem = concat(rootname, ".mf"), + kpse_mf_format, false); + free(tem); + } + + if (test_file('z', rootfile)) { + fprintf (stderr, "%s: empty or non-existent rootfile!\n", progname); + relmem (arg); + return 1; + } + if (!test_file('f', rootfile)) { + fprintf (stderr, "%s: rootfile %s does not exist!\n", progname, rootfile); + relmem (arg); + return 1; + } + + if (!destdir) { + if (rootfile && *rootfile) { + strcpy (arg[0], "Dummy"); + strcpy (arg[1], "source"); + strcpy (arg[2], rootfile); + if (!(ptr = getdestdir (3, arg))) { + fprintf(stderr, "Cannot get destination directory name.\n"); + relmem (arg); + return 1; + } + destdir = ptr; + } + } + + if (!test_file('d', destdir)) { + relmem (arg); + return 1; + } + + ptsz_len = strlen(pointsize); + if (ptsz_len == 0) { + fprintf(stderr, "%s: no pointsize.\n", progname); + relmem (arg); + return 1; + } else if (ptsz_len == 2) { + if (pointsize[0] == '1' && pointsize[1] == '1') + realsize = "10.95"; /* \magstephalf */ + else if (pointsize[0] == '1' && pointsize[1] == '4') + realsize = "14.4"; /* \magstep2 */ + else if (pointsize[0] == '1' && pointsize[1] == '7') + realsize = "17.28"; /* \magstep3 */ + else if (pointsize[0] == '2' && pointsize[1] == '0') + realsize = "20.74"; /* \magstep4 */ + else if (pointsize[0] == '2' && pointsize[1] == '5') + realsize = "24.88"; /* \magstep5 */ + else if (pointsize[0] == '3' && pointsize[1] == '0') + realsize = "29.86"; /* \magstep6 */ + else if (pointsize[0] == '3' && pointsize[1] == '6') + realsize = "35.83"; /* \magstep7 */ + else + realsize = pointsize; + } + /* 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 inserting a + dot before the last two digits. */ + else if (ptsz_len == 4 || ptsz_len == 5) { + /* realsize=`echo "$pointsize" | sed 's/\(..\)$/.\1/'` */ + string tempsize = (string)xmalloc(ptsz_len + 2); + strcpy(tempsize, pointsize); + /* The script doesn't check for last chars being digits, but we do! */ + if (isdigit(tempsize[ptsz_len-1]) + && isdigit(tempsize[ptsz_len-2])) { + tempsize[ptsz_len+1] = '\0'; + tempsize[ptsz_len] = tempsize[ptsz_len-1]; + tempsize[ptsz_len-1] = tempsize[ptsz_len-2]; + tempsize[ptsz_len-2] = '.'; + free(pointsize); + } + realsize = tempsize; + } else realsize = pointsize; + +/* mfname is the full name */ + strcpy (mfname, destdir); + i = strlen (mfname); + if (mfname[i-1] != '/') { + mfname[i] = '/'; + mfname[i+1] = '\0'; + } + + strcat (mfname, name); + strcat (mfname, ".mf"); + + if (test_file('r', mfname)) { + fprintf(stderr, "%s: %s already exists.\n", progname, mfname); + fprintf(stdout, "%s\n", mfname); + if (destdir) free (destdir); + relmem (arg); + return 0; + } + + if ((f = fopen(mfname, "wb")) == NULL) { + fprintf(stderr, "%s: can't write into the file %s/%s.\n", + progname, destdir, name); + if (destdir) free (destdir); + relmem (arg); + return 1; + } + + if (FILESTRNCASEEQ(name, "ec", 2) + || FILESTRNCASEEQ(name, "tc", 2)) { + fprintf(f, "if unknown exbase: input exbase fi;\n"); + fprintf(f, "gensize:=%s;\ngenerate %s;\n", realsize, rootname); + } + else if (FILESTRNCASEEQ(name, "dc", 2)) { + fprintf(f, "if unknown dxbase: input dxbase fi;\n"); + fprintf(f, "gensize:=%s;\ngenerate %s;\n", realsize, rootname); + + } + else if (FILESTRNCASEEQ(name, "cs", 2) + || FILESTRNCASEEQ(name, "lcsss", 5) + || FILESTRNCASEEQ(name, "icscsc", 6) + || FILESTRNCASEEQ(name, "icstt", 5) + || FILESTRNCASEEQ(name, "ilcsss", 6) + ) { + fprintf(f, "input cscode\nuse_driver;\n"); + } + else if (strlen(name) >= 3 + && ((FILESTRNCASEEQ(name, "wn", 2) + && strchr("bBcCdDfFiIrRsStTuUvV", name[2])) + || (FILESTRNCASEEQ(name, "rx", 2) + && strchr("bBcCdDfFiIoOrRsStTuUvVxX", name[2]) + && strlen(name) >= 4 + && strchr("bBcCfFhHiIlLmMoOsStTxX", name[3])) + || ((name[0] == 'l' || name[0] == 'L') + && strchr("aAbBcCdDhHlL", name[1]) + && strchr("bBcCdDfFiIoOrRsStTuUvVxX", name[2])))) { + fprintf(f, "input fikparm;\n"); + } + else if (strlen(name) >= 4 && strchr("gG", name[0]) + && strchr("lLmMoOrRsStT", name[1]) + && strchr("bBiIjJmMtTwWxX", name[2]) + && strchr("cCiIlLnNoOrRuU", name[3])) { + /* A small superset of the names of the cbgreek fonts: + pattern `g[lmorst][bijmtwx][cilnou]*'. + This is only slightly more general than the exact set of patterns. + */ + fprintf(f, "gensize:=%s;\ninput %s;\n", realsize, rootname); + } + else { + /* FIXME: this was in the previous versions */ + /* fprintf(f, "if unknown %s: input %s fi;\n", base, base); */ + fprintf(f, "design_size := %s;\ninput %s;\n", + realsize, rootname); + } + + fclose(f); + fprintf(stdout, "%s\n", mfname); + fprintf(stderr, "%s: %s: successfully generated.\n", progname, mfname); + mktexupd (mfname); + if (destdir) free (destdir); + relmem (arg); + return 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexpk.c b/src/texsourc/kpathsea/kpathsea/win32/mktexpk.c new file mode 100644 index 0000000..97035a5 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexpk.c @@ -0,0 +1,1245 @@ +/* mktexpk.c (Web2C-7.5.5 --ak 2006) + * %%---------------------------------------- + * % Special variables for mktexpk ( W32TeX ) + * % ---------------------------------------- + * % MAKETEXPK_STYLE = dosnames + * % ----------------------------------------- + * % MAKETEXPK_TOP_DIR = $VARTEXFONTS + * % ----------------------------------------- + * % MAKETEXPK_MODE = canonex + * % ----------------------------------------- + * % MAKETEXPK_MODE_300 = cx + * % MAKETEXPK_MODE_400 = nexthi + * % MAKETEXPK_MODE_600 = canonex + * % etc. + * %%----------------------------------------- + * + * Usage: mktexpk [OPTIONS] name, + * 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 (absolute path). + * + * The following old form is also supported: + * Usage: mktexmk name dpi bdpi mag [mode] + */ + +#include + +#include "dirutil.h" +#include "getdestdir.h" +#include "mktexupd.h" + +#define LLBUF 1024 +#define LBUF 512 +#define SBUF 256 +#define TBUF 256 + +/* +Global variables +*/ + +char *progname; +int UseAspectRatio = 0; +int FileName = 0; +double AspectRatio = 1.0; + +#define BBUFF_FUL 253 +#define FFILE_END 254 +#define LLINE_END 255 + +static int +ffgets(char *buf, int size, FILE *fi) +{ + char *p; + int c; + int n; + + n = 0; + p = buf; + *p = '\0'; + + while(1) { + c = getc(fi); + if(c == 26) + continue; + n++; + if(c == EOF) { + n++; + *p++ = '\n'; + *p = '\0'; + return FFILE_END; + } + else if(c == 0x0d || c == 0x0a) { + n++; + *p++ = '\n'; + *p = '\0'; + if(c == 0x0d) { + c = getc(fi); + if(c != 0x0a) + ungetc(c, fi); + } + return LLINE_END; + } + else if(n == (size - 3)) { + *p++ = c; *p = '\0'; + return BBUFF_FUL; + } + else *p++ = c; + } +} + +static int +isskip(char c) +{ + if((c == ' ') || (c == '\t')) + return 1; + else if((c == '<') || (c == '[')) { + FileName = 1; + return 1; + } + else + return 0; +} + +static void +skipchar(char **p) +{ + while(isskip(**p)) + (*p)++; +} + +static void +version (void) +{ + fprintf (stderr, "%s, (C version 1.5 --ak 2006-2012)\n", progname); + fprintf (stderr, WEB2C_KPSE_VERSION "\n"); +} + +static void +usage (void) +{ + fprintf (stderr, "Usage: %s [OPTIONS] NAME,\n\ + Create a PK font.\n\n\ +--dpi DPI use resolution DPI.\n\ +--bdpi BDPI use base resolution BDPI.\n\ +--mag MAG use magnificiation MAG.\n\ +--mfmode MODE use MODE as the METAFONT mode.\n\ +--destdir DESTDIR write fonts in DESTDIR.\n", progname); +} + +static void +help (void) +{ + fprintf (stderr, "Usage: %s [OPTIONS] NAME,\n\ + Create a PK font.\n\n\ +--dpi DPI use resolution DPI.\n\ +--bdpi BDPI use base resolution BDPI.\n\ +--mag MAG use magnificiation MAG.\n\ +--mfmode MODE use MODE as the METAFONT mode.\n\ +--destdir DESTDIR write fonts in DESTDIR.\n\n\ +Try to create a PK file for NAME at resolution DPI, with an assumed\n\ +device base resolution of BDPI, and a Metafont `mag' of MAG. Use MODE\n\ +for the METAFONT mode. Use DESTDIR for the root of where to install\n\ +into. DESTDIR must be an absolute directory name. If DESTDIR is not given,\n\ +suitable directory is determined according to the TDS.\n\n\ +Old form:\n\ +Usage: %s name dpi bdpi mag [mode]\n\ +is also supported.", progname, progname); +} + + +static void +tpkerr (const char *s) +{ + fprintf (stderr, "%s\n", s); +} + + +static void +relmem (char **v) +{ + int j; + for (j = 0; j < 4; j++) + free (v[j]); + return; +} + + +int +main (int ac, char **av) +{ + static char execfile[SBUF]; + char rbuff[LBUF]; + char buff[LBUF]; + char cmd[LBUF]; + char mfname[TBUF]; + char tfname[TBUF]; + char pkname[TBUF]; + + char name[TBUF]; + char dpi[TBUF]; + char ydpi[TBUF]; + char bdpi[TBUF]; + char mag[TBUF]; + char mode[TBUF]; + char destdir[SBUF]; + + char *arg[4]; + + char currdir[SBUF]; + char kpsedot[SBUF]; + char *tmp; + int cdrive, tdrive; + + FILE *fr, *fw, *fnul, *tfmfileptr; + + int i, savo, savi, ret; + int style; + int issetdest; + int app; + int oldform; + int ps2pkok; + char *env; + char *p, *fpp; + + double Xdpi, Ydpi; + + char texname[TBUF], pfbname[TBUF], slant[TBUF], extend[TBUF], encname[TBUF]; + + char texbindir[256]; + char fullbin[512]; + +/* + * style = 0 : MAKETEXPK_STYLE undefined or other than dosnames + * style = 1 : MAKETEXPK_STYLE = dosnames + */ + +/* + * issetdest = 0 : no destdir + * issetdest = 1 : destdir + * issetdest = 2 : current working dir + */ + +/* + * app = 0 : mf + * app = 1 : ps2pk + * app = 2 : gsftopk + * app = 3 : ttf2pk + * app = 4 : hbf2gf + */ + +/* + * oldform = 0 : newform of the command line + * oldform = 1 : oldform of the command line + */ + +/* + * TEMP | TMP | TMPDIR (necessary) + * + */ + + tmp = getenv ("TEMP"); + if (!tmp) + getenv ("TMP"); + if (!tmp) + getenv ("TMPDIR"); + if (!tmp) { + tpkerr ("Please define TEMP | TMP | TMPDIR."); + return (100); + } + tmp = xstrdup(tmp); +/* + * normalize directory separators + */ + + for (fpp = tmp; *fpp; fpp++) { + if (*fpp == '\\') + *fpp = '/'; + else if (IS_KANJI(fpp)) + fpp++; + } + + for (i = 0; i < 4; i++) + arg[i] = (char *) malloc (SBUF); + + progname = av[0]; + kpse_set_program_name (progname, NULL); + +/* + * get tex binary dir + * + */ + p = kpse_var_value("SELFAUTOLOC"); + if(p == 0) { + fprintf(stderr, "I cannot get SELFAUTOLOC\n"); + exit(100); + } + strcpy(texbindir, p); + free(p); + for(p=texbindir; *p; p++) { + if(*p == '/') *p = '\\'; + } + *p = '\\'; + *(p+1) = '\0'; + + if (ac < 2) { + usage (); + relmem (arg); + return (100); + } + + issetdest = 0; + ps2pkok = 0; + +/* + * oldform or newform ? + * + */ + + if (av[1][0] == '-') + oldform = 0; + else + oldform = 1; + + +/* + * Old form of the command line + */ + + if (oldform == 1) { + if (ac < 5) { + usage (); + relmem (arg); + return (100); + } + if((strlen(av[1]) > TBUF -1 ) || + (strlen(av[2]) > TBUF -1 ) || + (strlen(av[3]) > TBUF -1 ) || + (strlen(av[4]) > TBUF -1 )) { + fprintf(stderr, "\nToo long a string.\n"); + return 100; + } + + strcpy (name, av[1]); + strcpy (dpi, av[2]); + strcpy (bdpi, av[3]); + strcpy (mag, av[4]); + if (ac > 5) { + if(strlen(av[5]) > TBUF -1) { + fprintf(stderr, "\nToo long a string.\n"); + return 100; + } + strcpy (mode, av[5]); + } + else + mode[0] = '\0'; + } else { +/* + * New form of the command line + */ + name[0] = dpi[0] = bdpi[0] = mag[0] = mode[0] = destdir[0] = '\0'; + i = 1; + while (i < ac) { + if(strlen(av[i]) > TBUF - 1) { + fprintf(stderr, "\nToo long a string.\n"); + return 100; + } + if (av[i][0] != '-') { + strcpy (name, av[i]); + break; + } + if (!strcmp (av[i], "--dpi") || !strcmp (av[i], "-dpi")) { + i++; + if (i >= ac) { + tpkerr ("Invarid arguments."); + relmem (arg); + return (100); + } + strcpy (dpi, av[i]); + i++; + } else if (!strcmp (av[i], "--bdpi") || !strcmp (av[i], "-bdpi")) { + i++; + if (i >= ac) { + tpkerr ("Invarid arguments."); + relmem (arg); + return (100); + } + strcpy (bdpi, av[i]); + i++; + } else if (!strcmp (av[i], "--mag") || !strcmp (av[i], "-mag")) { + i++; + if (i >= ac) { + tpkerr ("Invarid arguments."); + relmem (arg); + return (100); + } + strcpy (mag, av[i]); + i++; + } else if (!strcmp (av[i], "--mfmode") || !strcmp (av[i], "-mfmode")) { + i++; + if (i >= ac) { + tpkerr ("Invarid arguments."); + relmem (arg); + return (100); + } + strcpy (mode, av[i]); + i++; + } else if (!strcmp (av[i], "--destdir") || !strcmp (av[i], "-destdir")) { + i++; + if (i >= ac) { + tpkerr ("Invarid arguments."); + relmem (arg); + return (100); + } + strcpy (destdir, av[i]); + issetdest = 1; + i++; + } else if (!strcmp (av[i], "--version") || !strcmp (av[i], "-version")) { + version (); + relmem (arg); + return (0); + } else if (!strcmp (av[i], "--help") || !strcmp (av[i], "-help")) { + help (); + relmem (arg); + return (0); + } else { + tpkerr ("Argument error."); + relmem (arg); + return (100); + } + } + } /* End of command line analysis */ + + env = kpse_var_value ("MAKETEXPK_STYLE"); + + if ((env == NULL) || !(*env) || (env && strcmp (env, "dosnames"))) { + style = 0; + } else + style = 1; + +/* + * Default program is mf + */ + + app = 0; + +/* + * check if mfmode and bdpi are consistent or not + */ + + if (bdpi[0] && mode[0] && mode[0] != '/') { + FILE *frd; + char buff[128]; + int len; + + strcpy (fullbin, texbindir); + strcat (fullbin, "mf-nowin.exe \"\\mode:="); + strcat (fullbin, mode); + strcat (fullbin, ";mode_setup;message"); + strcat (fullbin, "(decimal round pixels_per_inch);"); + strcat (fullbin, "end. gsftopk --> ttf2pk --> hbf2gf."); + app = 1; + } + } + + if (app != 0) { + strcpy (mode, "modeless"); + strcpy (tfname, name); + strcat (tfname, ".tfm"); + if (!(p = kpse_var_value ("TFMFONTS"))) { + tpkerr ("Cannot get value of TFMFONTS."); + relmem (arg); + return (100); + } + free (p); +/* + I don't try to create nonexisting tfm here. +*/ + if (!(p = kpse_find_file (tfname, kpse_tfm_format, 0))) { + fprintf (stderr, "Cannot find %s .\n", tfname); + relmem (arg); + return 100; + } + tfmfileptr = fopen (p, "rb"); + if (!tfmfileptr) { + fprintf (stderr, "I cannot open %s.\n", p); + relmem (arg); + return 100; + } + i = 256 * getc (tfmfileptr); + i += getc (tfmfileptr); + fclose (tfmfileptr); + if ((i == 9) || (i == 11)) { + fprintf (stderr, "Current font seems to be a Japanese one.\n"); + fprintf (stderr, "I give up to create a PK font.\n"); + relmem (arg); + return 100; + } + } + + if ((p[0] == '.') && (p[1] == '/') && (issetdest != 1)) + issetdest = 2; + + fpp = _getcwd (currdir, SBUF); + if (!fpp) { + fprintf (stderr, "Failed to get current working directory.\n"); + relmem (arg); + return (100); + } + for (fpp = currdir; *fpp; fpp++) { + if (*fpp == '\\') + *fpp = '/'; + else if (IS_KANJI(fpp)) + fpp++; + } + + i = strlen (currdir); + if (currdir[i - 1] == '/') + currdir[i - 1] = '\0'; + + strcpy (kpsedot, "KPSE_DOT=.;"); + strcat (kpsedot, currdir); + _putenv (kpsedot); + + if (issetdest == 2) { + strcpy (destdir, currdir); + } + + if (issetdest == 0) { + strcpy (arg[0], "Dummy"); + strcpy (arg[1], "pk"); + strcpy (arg[2], p); + strcpy (arg[3], mode); + + if (!(p = getdestdir (4, arg))) { + tpkerr ("Cannot get destination directory name."); + relmem (arg); + return (100); + } + strcpy (rbuff, p); + } else + strcpy (rbuff, destdir); + +/* + * Change backslash into slash + */ + + for (p = rbuff; *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + + p = rbuff; + i = strlen (p); + if (p[i - 1] == '/') + p[i - 1] = '\0'; + + if (issetdest) { + if (!is_dir (p)) { + fprintf (stderr, "Destination %s is not found.\n", p); + relmem (arg); + return (100); + } + } else if (!is_dir (p)) { + if (make_dir (p)) { + tpkerr ("Error in make_dir."); + relmem (arg); + return (100); + } + } + + strcpy (buff, p); + p = buff; + + i = strlen (p); + + if (p[i - 1] != '/') + strcat (p, "/"); + + if (dpi[0] == 0) { + tpkerr ("Cannot determine DPI."); + relmem (arg); + return (100); + } + + if (style == 1 && issetdest != 2) { /* dosnames */ + strcat (p, "dpi"); + strcat (p, dpi); + if (!is_dir (p)) { + if (make_dir (p)) { + tpkerr ("Error in make_dir."); + relmem (arg); + return (100); + } + } + strcat (p, "/"); + } + + strcat (p, name); + strcat (p, "."); + + if (style != 1 || issetdest == 2) + strcat (p, dpi); /* long suffix */ + strcat (p, "pk"); + +/* Now buff and p is the full path name of pk file */ +/* check the existence of pk file */ + + if (_access (p, 0) == 0) { + fprintf (stderr, "%s exists.\n", p); + relmem (arg); + printf ("%s\n", p); + return (0); + } + +/* + * Go to the temporary directory + */ + + cdrive = _getdrive (); + if (tmp[1] == ':') { + tdrive = tolower (*tmp) - 'a' + 1; + _chdrive (tdrive); + } + _chdir (tmp); + +/* + * save stdout and stdin + */ + savo = _dup (fileno (stdout)); + savi = _dup (fileno (stdin)); + +/* + * connect stdout to stderr +*/ + _dup2 (fileno (stderr), fileno (stdout)); + +/* + * connect stdin to nul + */ + if (!(fnul = fopen ("nul", "rb"))) { + fprintf (stderr, "Cannot open nul device to read.\n"); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + _dup2 (fileno (fnul), fileno (stdin)); + +/* + * pkname is the filename of PK font + */ + sprintf (pkname, "%s.%spk", name, dpi); + + if (app == 0) { +/* + * METAFONT command line + */ + if (mag[0] == 0) { + tpkerr ("Cannot determine MAG."); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + sprintf (cmd, + "--progname=mf --base=mf \\mode:=%s; \\mag:=%s; nonstopmode; input %s;", + mode, mag, name); + + strcpy (execfile, "mf-nowin.exe"); + fprintf (stderr, "%s %s\n", execfile, cmd); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, cmd, NULL); + + sprintf (cmd, "%s.%sgf", name, dpi); + +/* + * check the consistency + */ + if (_access (cmd, 0) != 0) { + tpkerr ("Failed to make gf font by METAFONT."); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + +/* + * Change gf into pk + */ + strcpy (execfile, "gftopk.exe"); + fprintf (stderr, "%s %s %s\n", execfile, cmd, pkname); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, cmd, pkname, NULL); + + if (_access (pkname, 0) != 0) { + tpkerr ("Failed to make pk from gf."); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + +/* + * erase gf file + */ + remove (cmd); + +/* + * erase log file + */ + sprintf (cmd, "%s.log", name); + remove (cmd); +/* + * erase tfm file + */ + sprintf (cmd, "%s.tfm", name); + remove (cmd); + + goto finale; + } + +/* + * app = 1 : ps2pk --> gsftopk --> ttf2pk --> hbf2gf + */ + + p = kpse_find_file ("pspksupp.map", kpse_fontmap_format, 0); + if(p) { + fr = fopen (p, "r"); /* Read pspksupp.map */ + free (p); + + if (!fr) { + tpkerr ("Cannot open pspksupp.map to read."); + ps2pkok = 0; + goto do_ps2pk; + } + + while (fgets (rbuff, SBUF, fr)) { + if (rbuff[0] == '%' || rbuff[0] == '#' || rbuff[0] == '\n') + continue; + texname[0] = pfbname[0] = slant[0] = extend[0] = encname[0] = '\0'; + i = sscanf (rbuff, "%s %s %s %s %s", texname, pfbname, slant, extend, + encname); + if (i == 2 && !strncmp (texname, "AspectRatio", 11)) { + if (!sscanf (pfbname, "%lf", &AspectRatio)) { + tpkerr ("File format of pspksupp.map is wrong."); + fclose (fr); + ps2pkok = 0; + goto do_ps2pk; + } + UseAspectRatio = 1; + continue; + } else if (i > 0 && !stricmp (texname, name)) { + p = kpse_var_value ("T1FONTS"); + if (!p) { + tpkerr ("T1FONTS is not defined."); + ps2pkok = 0; + break; + } + free (p); + p = kpse_find_file (pfbname, kpse_type1_format, 0); + if (!p) { + fprintf (stderr, "%s is not found.\n", pfbname); + ps2pkok = 0; + break; + } + free (p); + ps2pkok = 1; + if(bdpi[0] == 0) + i--; + break; + } + } + fclose (fr); + goto do_ps2pk; + } else { + char *q; + char a[SBUF]; + char b[SBUF]; + char psname[SBUF]; + char pscommand[SBUF]; + double slantval, extendval; + + texname[0] = pfbname[0] = encname[0] = '\0'; + a[0] = b[0] = psname[0] = pscommand[0] = '\0'; + FileName = 0; + strcpy(slant, "0"); + strcpy(extend, "1"); + + ps2pkok = 0; + + p = kpse_find_file ("ps2pk.map", kpse_fontmap_format, 0); + if(!p) { + tpkerr("Necessary map file for ps2pk is not found."); + goto do_ps2pk; + } + fr = fopen(p,"rb"); + free(p); + if (!fr) { + tpkerr ("Cannot open ps2pk.map to read."); + goto do_ps2pk; + } + while ((ret=ffgets (rbuff, LBUF, fr)) != FFILE_END) { + if(ret == BBUFF_FUL) { + fprintf(stderr, "A line in ps2pk.map seems to be too long.\n"); + fprintf(stderr, "I try to continue. But something may be wrong.\n"); + } + p = rbuff; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + continue; + q = texname; + while(!isskip(*p) && (*p != '\n')) + *q++ = *p++; + *q = '\0'; + if(stricmp(texname, name)) + continue; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) { + fprintf(stderr, "Incorrect line in \"ps2pk.map\".\n"); + break; + } + if(FileName) + q = a; + else + q = psname; + while(!isskip(*p) && (*p != '\n')) + *q++ = *p++; + *q = '\0'; + skipchar(&p); +/* +skip flag +*/ + if(!FileName) { + while(isdigit(*p)) + p++; + skipchar(&p); + } + if((*p == '%') || (*p == '#') || (*p == '\n')) { + tpkerr("I cannot use ps2pk due to lack of data."); + break; + } + if(*p == '\"') { + q = pscommand; + *q++ = *p++; + while(*p != '\"') + *q++ = *p++; + *q++ = *p++; + *q = '\0'; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + } + if(FileName && a[0] == '\0') + q = a; + else if(FileName && b[0] == '\0') + q = b; + else { + tpkerr("Incorrect line in ps2pk.map."); + break; + } + while(!isskip(*p) && (*p != '\n')) + *q++ = *p++; + *q = '\0'; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + if(*p == '\"') { + q = pscommand; + *q++ = *p++; + while(*p != '\"') + *q++ = *p++; + *q++ = *p++; + *q = '\0'; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + } + if (FileName && a[0] == '\0') + q = a; + else if (FileName && b[0] == '\0') + q = b; + else { + fprintf(stderr, "Incorrect line in \"ps2pk.map\".\n"); + break; + } + while(!isskip(*p) && (*p != '\n')) + *q++ = *p++; + *q = '\0'; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + if(*p == '\"') { + q = pscommand; + *q++ = *p++; + while(*p != '\"') + *q++ = *p++; + *q++ = *p++; + *q = '\0'; + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + } + skipchar(&p); + if((*p == '%') || (*p == '#') || (*p == '\n')) + break; + else { + fprintf(stderr, "Incorrect line in \"ps2pk.map\".\n"); + break; + } + } + fclose(fr); + + if(pscommand[0]) { + p = strstr(pscommand, "SlantFont"); + if(p) { + p--; + while(*p == ' ' || *p == '\t') p--; + while(*p != ' ' && *p != '\t' && *p != '\"') p--; + p++; + sscanf(p, "%lf SlantFont", &slantval); + sprintf(slant, "%lf", slantval); + p = slant + strlen(slant) - 1; + while(*p == '0') { + *p = '\0'; + p--; + } + } + p = strstr(pscommand, "ExtendFont"); + if(p) { + p--; + while(*p == ' ' || *p == '\t') p--; + while(*p != ' ' && *p != '\t' && *p != '\"') p--; + p++; + sscanf(p, "%lf ExtendFont", &extendval); + sprintf(extend, "%lf", extendval); + p = extend + strlen(extend) - 1; + while(*p == '0') { + *p = '\0'; + p--; + } + } + } + if(a[0]) { + p = strrchr(a, '.'); + if(p && !stricmp(p, ".enc")) { + *p = '\0'; + strcpy(encname, a); + } + else if(p && !stricmp(p, ".pfb")) { + *p = '\0'; + strcpy(pfbname, a); + } + } + if(b[0]) { + p = strrchr(b, '.'); + if(p && !stricmp(p, ".enc")) { + *p = '\0'; + strcpy(encname, b); + } + else if(p && !stricmp(p, ".pfb")) { + *p = '\0'; + strcpy(pfbname, b); + } + } + if(pfbname[0] == '\0') + goto do_ps2pk; + p = kpse_find_file (pfbname, kpse_type1_format, 0); + if(!p) + goto do_ps2pk; + free(p); + ps2pkok = 1; + if(encname[0] && bdpi[0]) { + i = 5; + } else if(!encname[0] && !bdpi[0]) { + i = 3; + } else { + i = 4; + } + } + + do_ps2pk: + + if (ps2pkok) { + if (UseAspectRatio) { + sscanf (dpi, "%lf", &Xdpi); + Ydpi = Xdpi * AspectRatio; + sprintf (ydpi, "%d", (int) Ydpi); + } else + strcpy (ydpi, dpi); + + if (i == 3) { + sprintf (cmd, "-X%s -Y%s -S%s -E%s %s %s", + dpi, ydpi, slant, extend, pfbname, pkname); + } else if (i == 4 && bdpi[0]) { + sprintf (cmd, "-X%s -Y%s -R%s -S%s -E%s %s %s", + dpi, ydpi, bdpi, slant, extend, pfbname, pkname); + } else if (i == 4 && encname[0]) { + sprintf (cmd, "-e%s -X%s -Y%s -S%s -E%s %s %s", + encname, dpi, ydpi, slant, extend, pfbname, pkname); + } else if (i == 5) { + sprintf (cmd, "-e%s -X%s -Y%s -R%s -S%s -E%s %s %s", + encname, dpi, ydpi, bdpi, slant, extend, pfbname, pkname); + } else { + tpkerr ("File format of pspksupp.map is wrong."); + goto do_gsftopk; + } + + strcpy (execfile, "ps2pk.exe"); + fprintf (stderr, "%s %s\n", execfile, cmd); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, cmd, NULL); + + if (_access (pkname, 0) != 0) { + tpkerr ("ps2pk failed to make pk font."); + goto do_gsftopk; + } + goto finale; + } + +/* + * ps2pk is impossible to use + */ + + do_gsftopk: + + tpkerr ("ps2pk cannot be used."); + tpkerr ("I try gsftopk."); + app = 2; + + strcpy (execfile, "gsftopk.exe"); + fprintf (stderr, "%s %s %s\n", execfile, name, dpi); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, name, dpi, NULL); + + if (_access (pkname, 0) != 0) { + tpkerr ("gsftopk cannot be used."); + tpkerr ("Next I try ttf2pk."); + app = 3; + strcpy (execfile, "ttf2pk.exe"); + fprintf (stderr, "%s -q %s %s\n", execfile, name, dpi); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, "-q", name, dpi, NULL); + + if (_access (pkname, 0) != 0) { + tpkerr ("ttf2pk failed."); + tpkerr ("Finally I try hbf2gf."); + app = 4; + strcpy (execfile, "hbf2gf.exe"); + fprintf (stderr, "%s -q -p %s %s\n", execfile, name, dpi); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, "-q -p", name, dpi, NULL); + + sprintf (cmd, "%s.%sgf", name, dpi); + if (_access (cmd, 0) != 0) { + tpkerr ("All trials failed."); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + strcpy (execfile, "gftopk.exe"); + fprintf (stderr, "%s %s %s\n", execfile, cmd, pkname); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, cmd, pkname, NULL); + + if (_access (pkname, 0) != 0) { + tpkerr ("All trials failed."); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + remove (cmd); + } + } + + finale: + +/* + * return to original stdout and stdin + */ + _dup2 (savo, fileno (stdout)); + close (savo); + _dup2 (savi, fileno (stdin)); + close (savi); + +/* + * close nul device + */ + fclose (fnul); + +/* + * copy the pk file + */ + if (!(fr = fopen (pkname, "rb"))) { + fprintf (stderr, "Cannot open %s to read.\n", pkname); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + + if (!(fw = fopen (buff, "wb"))) { + fprintf (stderr, "Cannot open %s to write.\n", buff); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + + while ((i = fread (rbuff, 1, LBUF, fr))) + fwrite (rbuff, 1, i, fw); + + fclose (fr); + fclose (fw); + remove (pkname); + + relmem (arg); + +/* + * update ls-R if it exists + */ + mktexupd (buff); + +/* + * tell kpathsea + */ + + printf ("%s\n", buff); + _chdrive (cdrive); + _chdir (currdir); + + return (0); +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktextfm.c b/src/texsourc/kpathsea/kpathsea/win32/mktextfm.c new file mode 100644 index 0000000..ee69d22 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktextfm.c @@ -0,0 +1,393 @@ +/* mktextfm.c + * Assumes the cx mode in mf.base . + * Usage: mktextfm [--destdir DESTDIR] name + * Web2C 7.3.7 (2001/12/29 --ak) + * not change current dir to tmp (2002/10/05 --ak) + * Web2C 7.5.2 (2003/02/20 --ak) + * change current dir to tmp. + */ + +#include + +#include "dirutil.h" +#include "getdestdir.h" +#include "mktexupd.h" + +#define LBUF 512 +#define SBUF 256 +#define TBUF 256 + +char *progname; + +static void +usage (void) +{ + fprintf (stderr, "Usage: %s [--destdir destdir] name\n", progname); + return; +} + +static void +version (void) +{ + fprintf (stderr, "%s, (C version 1.4 --ak 2009-2012)\n", progname); + fprintf (stderr, WEB2C_KPSE_VERSION "\n"); + return; +} + +static void +help (void) +{ + fprintf (stderr, "Usage (1): %s name\n", progname); + fprintf (stderr, " tfm is saved following TDS\n"); + fprintf (stderr, "Usage (2): %s --destdir destdir name\n", progname); + fprintf (stderr, " destdir must be an absolute path of dir\n"); + fprintf (stderr, "Usage (3): %s --version\n", progname); + fprintf (stderr, "Usage (4): %s --help\n", progname); + + return; +} + +static void +relmem (char **v) +{ + int j; + for (j = 0; j < 4; j++) + free (v[j]); + return; +} + +int +main (int ac, char **av) +{ + char rbuff[LBUF]; + char buff[SBUF]; + char savebuff[SBUF]; + char cmd[LBUF]; + char mffile[TBUF]; + char *arg[4]; + static char execfile[SBUF]; + + char kpsedot[SBUF]; + char currdir[SBUF]; + char *tmp; + int cdrive, tdrive; + + FILE *fr, *fw, *fnul; + + int i, savo, savi; + char *p, *fp, *fpp; + int issetdest; + char fontname[SBUF]; + + char texbindir[256]; + char fullbin[512]; + + progname = av[0]; + kpse_set_program_name (av[0], NULL); + +/* + * get tex binary dir + * + */ + p = kpse_var_value("SELFAUTOLOC"); + if(p == 0) { + fprintf(stderr, "I cannot get SELFAUTOLOC\n"); + exit(100); + } + strcpy(texbindir, p); + free(p); + for(p=texbindir; *p; p++) { + if(*p == '/') *p = '\\'; + } + *p = '\\'; + *(p+1) = '\0'; + + tmp = getenv ("TEMP"); + if (!tmp) + getenv ("TMP"); + if (!tmp) + getenv ("TMPDIR"); + if (!tmp) { + fprintf (stderr, "Please define TEMP | TMP | TMPDIR.\n"); + return (100); + } + + tmp = xstrdup(tmp); + + for (fpp = tmp; *fpp; fpp++) { + if (*fpp == '\\') + *fpp = '/'; + else if (IS_KANJI(fpp)) + fpp++; + } +/* +issetdest = 0 : TDS +issetdest = 1 : user setting +issetdest = 2 : current directory +*/ + + issetdest = 0; + + if (ac < 2) { + usage (); + return (100); + } + + if ((!strcmp (av[1], "--version")) || (!strcmp (av[1], "-version"))) { + version (); + return (100); + } + + if ((!strcmp (av[1], "--help")) || (!strcmp (av[1], "-help"))) { + help (); + return (100); + } + + for (i = 0; i < 4; i++) + arg[i] = (char *) malloc (SBUF); + + if ((!strcmp (av[1], "--destdir")) || (!strcmp (av[1], "-destdir"))) { + if (ac != 4) { + usage (); + relmem (arg); + return (100); + } + issetdest = 1; + strcpy (buff, av[2]); + strcpy (fontname, av[3]); + for (p = buff; *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } + } else { + strcpy (fontname, av[1]); + } + + + /* fontname = font name + */ + if ((p = strrchr (fontname, '.'))) + *p = '\0'; + + /* mffile is METAFONT file name + */ + strcpy (mffile, fontname); + strcat (mffile, ".mf"); + + if (!(fp = kpse_var_value ("MFINPUTS"))) { + fprintf (stderr, "Cannot get value of MFINPUTS\n"); + relmem (arg); + return (100); + } + + free (fp); + + xputenv("MKTEXMF", "1"); + if (!(p = kpse_find_file (mffile, kpse_mf_format, 1))) { + fprintf (stderr, "Cannot find %s.\n", mffile); + relmem (arg); + return (100); + } + + fpp = _getcwd (currdir, SBUF); + if (!fpp) { + fprintf (stderr, "Failed to get current working directory.\n"); + relmem (arg); + return (100); + } + for (fpp = currdir; *fpp; fpp++) { + if (*fpp == '\\') + *fpp = '/'; + else if (IS_KANJI(fpp)) + fpp++; + } + + i = strlen (currdir); + if (currdir[i - 1] == '/') + currdir[i - 1] = '\0'; + strcpy (kpsedot, "KPSE_DOT=.;"); + strcat (kpsedot, currdir); + _putenv (kpsedot); + + if ((p[0] == '.') && (p[1] == '/') && (issetdest != 1)) { + issetdest = 2; + strcpy (buff, currdir); + } + + if (issetdest == 0) { + /* now path of ${name}.mf is in p */ + strcpy (arg[0], "Dummy"); + strcpy (arg[1], "tfm"); + strcpy (arg[2], p); + + if (!(p = getdestdir (3, arg))) { + fprintf (stderr, "Cannot get destination directory name.\n"); + relmem (arg); + return (100); + } + strcpy (buff, p); + } + +/* Now buff is the destdir */ + p = buff; + + i = strlen (p); + + if (p[i - 1] != '/') + strcat (p, "/"); + strcat (p, fontname); + strcat (p, ".tfm"); + +/* now p (or buff) is the full path name of the tfm font */ +/* check if it exists */ + if (_access (p, 0) == 0) { + fprintf (stderr, "%s exists\n", p); + printf ("%s\n", p); + relmem (arg); + return (0); + } + + cdrive = _getdrive (); + if (tmp[1] == ':') { + tdrive = tolower (*tmp) - 'a' + 1; + _chdrive (tdrive); + } + _chdir (tmp); + +/* save stdout and stdin */ + savo = _dup (fileno (stdout)); + savi = _dup (fileno (stdin)); + +/* connect stdout to stderr */ + _dup2 (fileno (stderr), fileno (stdout)); + +/* connect stdin to nul device */ + if (!(fnul = fopen ("nul", "r"))) { + fprintf (stderr, "Cannot open nul device to read\n"); + relmem (arg); + _chdrive (cdrive); + _chdir (currdir); + return (100); + } + _dup2 (fileno (fnul), fileno (stdin)); + +/* METAFONT command line */ + strcpy (cmd, "--progname=mf --base=mf "); + strcat (cmd, "\\mode:=ljfour; \\mag:=1; nonstopmode; input "); + strcat (cmd, fontname); + strcat (cmd, ";"); + + strcpy (execfile, "mf-nowin.exe"); + fprintf (stderr, "%s %s\n", execfile, cmd); + strcpy(fullbin, texbindir); + strcat(fullbin, execfile); + (void) spawnlp (_P_WAIT, fullbin, execfile, cmd, NULL); + +/* return to original stdout and stdin */ + _dup2 (savo, fileno (stdout)); + close (savo); + _dup2 (savi, fileno (stdin)); + close (savi); + +/* close nul device */ + fclose (fnul); + +/* check consistency */ + strcpy (cmd, fontname); + strcat (cmd, ".600gf"); + + if (_access (cmd, 0) == -1) { + fprintf (stderr, "METAFONT failed to make gf font.\n"); + relmem (arg); + _chdrive (cdrive); + _chdir (currdir); + return (100); + } + + remove (cmd); + + strcpy (cmd, fontname); + strcat (cmd, ".tfm"); + +/* copy the tfm file */ + if (!(fr = fopen (cmd, "rb"))) { + fprintf (stderr, "Cannot open %s to read\n", cmd); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + if (!(fw = fopen (buff, "wb"))) { + fprintf (stderr, "Cannot open %s to write\n", buff); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + + while ((i = fread (rbuff, 1, LBUF, fr))) + fwrite (rbuff, 1, i, fw); + fclose (fr); + fclose (fw); + + strcpy(savebuff, buff); + +/* + copy log file into the current directory + in the case that issetdest == 2, + because feynmf package requires the + log file. +*/ + + if(issetdest == 2) { + i = strlen(buff); + if(i > 3) { + i -= 4; + buff[i] = '\0'; + strcat(buff, ".log"); + strcpy(cmd, fontname); + strcat(cmd, ".log"); + if (!(fr = fopen (cmd, "rb"))) { + fprintf (stderr, "Cannot open %s to read\n", cmd); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + if (!(fw = fopen (buff, "wb"))) { + fprintf (stderr, "Cannot open %s to write\n", buff); + _chdrive (cdrive); + _chdir (currdir); + relmem (arg); + return (100); + } + while ((i = fread (rbuff, 1, LBUF, fr))) + fwrite (rbuff, 1, i, fw); + fclose (fr); + fclose (fw); + } + } + + relmem (arg); + if(issetdest != 2) + mktexupd (savebuff); + +/* erase files */ + strcpy (cmd, fontname); + strcat (cmd, ".log"); + remove (cmd); + + strcpy (cmd, fontname); + strcat (cmd, ".tfm"); + remove (cmd); + + _chdrive (cdrive); + _chdir (currdir); + +/* send message to Kpathsea */ + printf ("%s\n", savebuff); + + return (0); +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexupd.c b/src/texsourc/kpathsea/kpathsea/win32/mktexupd.c new file mode 100644 index 0000000..ffe5fb3 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexupd.c @@ -0,0 +1,112 @@ +#include + +#include "mktexupd.h" + +#define MBUF 128 +#define SBUF 256 +#define LBUF 512 +#define DBS "TEXMFDBS" +#define MAXTREE 16 + +void +mktexupd (char *s) +{ + char fname[MBUF]; + char lsrname[SBUF]; + char path[LBUF]; + char *rootdir[MAXTREE]; + int i, j, treenum; + char *pa, *pb, *pc; + int existflag = 0; + FILE *f; + + pa = kpse_var_value (DBS); + if (pa == NULL) { + fprintf (stderr, "No definition of TEXMFDBS.\n"); + fprintf (stderr, "Maybe you are not using ls-R.\n"); + return; + } + + pb = kpse_brace_expand (pa); + free (pa); + if (pb == NULL) { + fprintf (stderr, "I cannot expand braces in TEXMFDBS.\n"); + fprintf (stderr, "Maybe you are not using ls-R.\n"); + return; + } + + for (i = 0; i < MAXTREE; i++) + rootdir[i] = (char *) malloc (MBUF); + + pa = pb; + i = 0; + + while (*pa && i < MAXTREE) { + if (*pa == '!' && *(pa + 1) == '!') { + pa++; + pa++; + } + pc = rootdir[i]; + while (*pa != ';' && *pa) + *pc++ = *pa++; + *pc = '\0'; + if (*pa == ';') { + pa++; + i++; + } + } + + i++; + treenum = i; + free (pb); + + for (i = 0; i < treenum; i++) { + j = strlen (rootdir[i]); + if (rootdir[i][j - 1] == '/') + rootdir[i][j - 1] = '\0'; + } + + strcpy (path, s); + pa = strrchr (path, '/'); + if (pa == NULL) { + fprintf (stderr, "Path name of the file may be incorrect.\n"); + for (i = 0; i < MAXTREE; i++) + free (rootdir[i]); + return; + } + + *pa = '\0'; + pa++; + strcpy (fname, pa); + + for (i = 0; i < treenum; i++) { + j = strlen (rootdir[i]); + if (j && strnicmp (path, rootdir[i], j) == 0) { + existflag = 1; + break; + } + } + + if (existflag) { + strcpy (lsrname, rootdir[i]); + strcat (lsrname, "/ls-R"); + if (_access (lsrname, 0) != 0) { + for (j = 0; j < MAXTREE; j++) + free (rootdir[j]); + return; + } + pa = path; + pb = rootdir[i]; + while (tolower (*pa) == tolower (*pb) && *pb) { + pa++; + pb++; + } + f = fopen (lsrname, "ab"); + fprintf (f, "\n.%s:\n%s\n", pa, fname); + fclose (f); + } else { + fprintf(stderr, "mktexupd failed\n"); + } + for (i = 0; i < MAXTREE; i++) + free (rootdir[i]); +} diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexupd.h b/src/texsourc/kpathsea/kpathsea/win32/mktexupd.h new file mode 100644 index 0000000..76bd89d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexupd.h @@ -0,0 +1 @@ +extern void mktexupd (char *s); diff --git a/src/texsourc/kpathsea/kpathsea/win32/mktexupdmain.c b/src/texsourc/kpathsea/kpathsea/win32/mktexupdmain.c new file mode 100644 index 0000000..a1484fa --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32/mktexupdmain.c @@ -0,0 +1,33 @@ +#include + +#include "mktexupd.h" + +int main(int argc, char **argv) +{ + char dir[256]; + char file[256]; + char path[256]; + char *p; + int i; + + kpse_set_program_name (argv[0], NULL); + if(argc != 3) { + fprintf(stderr, "%s:: usage: %s DIR FILE\n", argv[0], argv[0]); + return 1; + } + strcpy(dir, argv[1]); + strcpy(file, argv[2]); + for(p = dir; *p; ++p) { + if(*p == '\\') *p = '/'; + else if (IS_KANJI(p)) p++; + } + i = strlen(dir); + while(dir[i-1] == '/') + i--; + dir[i] = '\0'; + strcpy(path, dir); + strcat(path, "/"); + strcat(path, file); + mktexupd(path); + return 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/win32lib.c b/src/texsourc/kpathsea/kpathsea/win32lib.c new file mode 100644 index 0000000..f281d8b --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32lib.c @@ -0,0 +1,434 @@ +/* win32lib.c: bits and pieces for win32 and msvc. + + Copyright 2006, 2011-2013 Akira Kakuto. + Copyright 1996, 1997, 1998, 1999 Fabrice Popineau. + + 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, see . */ + +#include +#include +#include +#include + +FILE * win32_popen (const char *cmd, const char *fmode) +{ + char mode[3]; + + mode[0] = fmode[0]; + mode[1] = 'b'; + mode[2] = '\0'; + + return _popen (cmd, mode); +} + +int win32_pclose (FILE *f) +{ + return _pclose (f); +} + +/* large file support */ + +__int64 +xftell64 (FILE *f, const char *filename) +{ +#if _MSC_VER > 1200 + __int64 where; + where = _ftelli64(f); + if (where < (__int64)0) + FATAL_PERROR(filename); +#else + __int64 where, filepos; + int fd; + + fd = fileno(f); + if(f->_cnt < 0) + f->_cnt = 0; + if((filepos = _lseeki64(fd, (__int64)0, SEEK_CUR)) < (__int64)0) { + FATAL_PERROR(filename); + return (__int64)(-1); + } + if(filepos == (__int64)0) + where = (__int64)(f->_ptr - f->_base); + else + where = filepos - f->_cnt; +#endif + return where; +} + +void +xfseek64 (FILE *f, __int64 offset, int wherefrom, const char *filename) +{ +#if _MSC_VER > 1200 + if (_fseeki64(f, offset, wherefrom) < (__int64)0) + FATAL_PERROR(filename); +#else + if(wherefrom == SEEK_CUR) { + offset += xftell64(f, filename); + wherefrom = SEEK_SET; + } + fflush(f); + if (_lseeki64(fileno(f), offset, wherefrom) < (__int64)0) + FATAL_PERROR(filename); +#endif +} + + +/* special TeXLive Ghostscript */ + +static int is_dir (char *buff) +{ + struct stat stats; + + return stat (buff, &stats) == 0 && S_ISDIR (stats.st_mode); +} + +/* + TeXlive uses its own gs in + $SELFAUTOPARENT/tlpkg/tlgs +*/ +void texlive_gs_init(void) +{ + char *nptr, *path; + char tlgsbindir[512]; + char tlgslibdir[512]; + nptr = kpse_var_value("TEXLIVE_WINDOWS_EXTERNAL_GS"); + if (nptr == NULL || !strcmp(nptr, "0") || !strcmp(nptr, "n") || !strcmp(nptr, "f")) { + if (nptr) + free (nptr); + nptr = kpse_var_value("SELFAUTOPARENT"); + if (nptr) { + strcpy(tlgsbindir, nptr); + strcat(tlgsbindir,"/tlpkg/tlgs"); + if(is_dir(tlgsbindir)) { + strcpy(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/lib;"); + strcat(tlgslibdir, tlgsbindir); + strcat(tlgslibdir, "/fonts"); + strcat(tlgsbindir, "/bin;"); + free(nptr); + for(nptr = tlgsbindir; *nptr; nptr++) { + if(*nptr == '/') *nptr = '\\'; + } + nptr = getenv("PATH"); + path = (char *)malloc(strlen(nptr) + strlen(tlgsbindir) + 6); + strcpy(path, tlgsbindir); + strcat(path, nptr); + xputenv("PATH", path); + xputenv("GS_LIB", tlgslibdir); + } + } + } else { + free (nptr); + } +} + +/* + path name in char *input is changed into the long + name format and returned in char *buff. + return value: 0 if failed + 1 if succeeded +*/ + +int getlongpath(char *buff, char *input, int len) +{ + HANDLE hnd; + WIN32_FIND_DATA ffd; + int cnt = 0; + char *p, *q, *r; + + buff[0] = '\0'; +/* +temporarily change directory separators into back slashs +*/ + for(p = input; *p; p++) { + if(*p == '/') + *p = '\\'; + } + + p = q = input; + r = buff; + +/* +UNC name +*/ + if(q[0] == '\\' && q[1] == '\\') { + cnt += 2; + if(cnt > len) return 0; + buff[0] = '/'; + buff[1] = '/'; + p += 2; + r += 2; + while(*p != '\\' && *p) { + if (IS_KANJI(p)) { + cnt++; + if(cnt > len) return 0; + *r++ = *p++; + } + cnt++; + if(cnt > len) return 0; + *r++ = *p++; + } + cnt++; + if(cnt > len) return 0; + *r++ = '/'; + if(*p) p++; + while(*p != '\\' && *p) { + if (IS_KANJI(p)) { + cnt++; + if(cnt > len) return 0; + *r++ = *p++; + } + cnt++; + if(cnt > len) return 0; + *r++ = *p++; + } + cnt++; + if(cnt > len) return 0; + *r++ = '/'; + *r= '\0'; + if(*p) p++; +/* +drive name +*/ + } else if(isalpha(q[0]) && q[1] == ':' && q[2] == '\\') { + *r++ = q[0]; + *r++ = ':'; + *r++ = '/'; + *r = '\0'; + p += 3; + cnt += 3; + if(cnt > len) return 0; + } + + for( ; *p; p++) { + if(IS_KANJI(p)) { + p++; + continue; + } + if(*p == '\\') { + *p = '\0'; + if((hnd = FindFirstFile(q, &ffd)) == INVALID_HANDLE_VALUE) { + return 0; + } + FindClose(hnd); + cnt += strlen(ffd.cFileName); + cnt++; + if(cnt > len) return 0; + strcat(buff, ffd.cFileName); + strcat(buff, "/"); + *p = '\\'; + } + } + +/* +file itself +*/ + if((hnd = FindFirstFile(q, &ffd)) == INVALID_HANDLE_VALUE) { + return 0; + } + FindClose(hnd); + cnt += strlen(ffd.cFileName); + if(cnt > len) return 0; + strcat(buff, ffd.cFileName); + return 1; +} + +/* user info */ + +/* Adapted for XEmacs by David Hobley */ +/* Sync'ed with Emacs 19.34.6 by Marc Paquette */ +/* Adapted to fpTeX 0.4 by Fabrice Popineau */ + +char * get_home_directory() +{ + char *p; + char *home = getenv("HOME"); + if(!home) + home = getenv("USERPROFILE"); + if(home) { + home = xstrdup(home); + for(p = home; *p; p++) { + if(IS_KANJI(p)) { + p++; + continue; + } + if(*p == '\\') + *p = '/'; + } + } + return home; +} + +int +kpathsea_getuid (kpathsea kpse) +{ + return kpse->the_passwd.pw_uid; +} + +int +kpathsea_getgid (kpathsea kpse) +{ + return kpse->the_passwd.pw_gid; +} + +struct passwd * +kpathsea_getpwuid (kpathsea kpse, int uid) +{ + if (uid == kpse->the_passwd.pw_uid) + return &kpse->the_passwd; + return NULL; +} + +struct passwd * +kpathsea_getpwnam (kpathsea kpse, char *name) +{ + struct passwd *pw; + + pw = kpathsea_getpwuid (kpse, kpathsea_getuid (kpse)); + if (!pw) + return pw; + + if (stricmp (name, pw->pw_name)) + return NULL; + + return pw; +} + +void +kpathsea_init_user_info (kpathsea kpse) +{ + char *home; + DWORD nSize = 256; + + if (!GetUserName (kpse->the_passwd.pw_name, &nSize)) + strcpy (kpse->the_passwd.pw_name, "unknown"); + kpse->the_passwd.pw_uid = 123; + kpse->the_passwd.pw_gid = 123; + + /* Ensure HOME and SHELL are defined. */ + + home = get_home_directory(); + if (home) { + putenv(concat("HOME=", home)); + } + else { + putenv ("HOME=c:/"); + } + + if (getenv ("SHELL") == NULL) + putenv ((GetVersion () & 0x80000000) ? "SHELL=command" : "SHELL=cmd"); + + { + /* If TEXMFTEMP is defined, then use it as the TEMP and TMP variables. */ + char *p; + if ((p = getenv("TEXMFTEMP")) != NULL) { + putenv(concat("TEMP=", p)); + putenv(concat("TMP=", p)); + } + } + + /* Set dir and shell from environment variables. */ + strcpy (kpse->the_passwd.pw_dir, get_home_directory()); + strcpy (kpse->the_passwd.pw_shell, getenv ("SHELL")); +} + +/* win32_system */ +static int is_include_space(const char *s) +{ + char *p; + p = strchr(s, ' '); + if(p) return 1; + p = strchr(s, '\t'); + if(p) return 1; + return 0; +} + +int win32_system(const char *cmd) +{ + const char *p; + char *q; + char *av[4]; + int len, ret; + int spacep = 0; + + if(cmd == NULL) + return 1; + + av[0] = xstrdup("cmd.exe"); + av[1] = xstrdup("/c"); + + len = strlen(cmd) + 3; + spacep = is_include_space(cmd); + av[2] = malloc(len); + q = av[2]; + if(spacep) + *q++ = '"'; + for(p = cmd; *p; p++, q++) { + if(*p == '\'') + *q = '"'; + else + *q = *p; + } + if(spacep) + *q++ = '"'; + *q = '\0'; + av[3] = NULL; + ret = spawnvp(_P_WAIT, av[0], av); + free(av[0]); + free(av[1]); + free(av[2]); + return ret; +} + +#if defined (KPSE_COMPAT_API) +int +getuid (void) +{ + return kpathsea_getuid(kpse_def); +} + +int +geteuid (void) +{ + /* I could imagine arguing for checking to see whether the user is + in the Administrators group and returning a UID of 0 for that + case, but I don't know how wise that would be in the long run. */ + return getuid (); +} + +int +getgid (void) +{ + return kpathsea_getgid (kpse_def); +} + +int +getegid (void) +{ + return getgid (); +} + +struct passwd * +getpwuid (int uid) +{ + return kpathsea_getpwuid (kpse_def, uid); +} + +struct passwd * +getpwnam (char *name) +{ + return kpathsea_getpwnam (kpse_def, name); +} + +#endif /* KPSE_COMPAT_API */ diff --git a/src/texsourc/kpathsea/kpathsea/win32lib.h b/src/texsourc/kpathsea/kpathsea/win32lib.h new file mode 100644 index 0000000..d7e51f0 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/win32lib.h @@ -0,0 +1,281 @@ +/* win32lib.h: bits and pieces for win32 and msvc. + + Copyright 2006, 2010-2013 Akira Kakuto. + Copyright 1996, 1997, 1998, 1999 Fabrice Popineau. + + 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, see . */ + + +#ifndef KPATHSEA_WIN32LIB_H +#define KPATHSEA_WIN32LIB_H + +#ifndef KPSE_COMPAT_API +#define KPSE_COMPAT_API 1 +#endif + +#pragma warning( disable : 4007 4096 4018 4244 ) + +#include +#include + +/* + * Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. + */ + +#ifndef DOSISH +#define DOSISH +#endif + +#ifndef MAXPATHLEN +#define MAXPATHLEN _MAX_PATH +#endif + +#define HAVE_DUP2 1 +#define HAVE_RENAME 1 +#define HAVE_RMDIR 1 +#define HAVE_MKDIR 1 +#define HAVE_GETHOSTNAME 1 +#define HAVE_RANDOM 1 +#define USE_UTIME 1 +#define HAVE_MOUSE 1 +#define HAVE_TZNAME 1 + +/* These have to be defined because our compilers treat __STDC__ as being + defined (most of them anyway). */ + +#define access _access +#define alloca _alloca +#define chdir _chdir +#define chmod _chmod +#define close _close +#define creat _creat +#define daylight _daylight +#define dup _dup +#define dup2 _dup2 +#define execlp _execlp +#define execvp _execvp +#define fcloseall _fcloseall +#define fdopen _fdopen +#define fileno _fileno +#define flushall _flushall +#define fstat _fstat +#define ftime _ftime +#define getpid _getpid +#define getcwd _getcwd +#define getwd(dir) GetCurrentDirectory(MAXPATHLEN, dir) +#define inline __inline +#define isascii __isascii +#define isatty _isatty +#define itoa _itoa +#define link _link +#define lseek _lseek +#define memicmp _memicmp +#define mktemp _mktemp +#define open _open + +#define putenv _putenv +#define read _read +#define rmdir _rmdir +#define setmode _setmode +#define spawnlp _spawnlp +#define stat _stat +#define stricmp _stricmp +#ifdef strcasecmp +#undef strcasecmp +#endif +#define strcasecmp _stricmp +#define strdup _strdup +#define strlwr _strlwr +#define strncasecmp _strnicmp +#define strnicmp _strnicmp +#define tempnam _tempnam +#define timeb _timeb +#define timezone _timezone +#define unlink _unlink +#define umask _umask +#define utime _utime +#define write _write + +#ifndef S_IFMT +#define S_IFMT _S_IFMT +#endif +#ifndef S_IFDIR +#define S_IFDIR _S_IFDIR +#endif +#ifndef S_IFCHR +#define S_IFCHR _S_IFCHR +#endif +#ifndef S_IFIFO +#define S_IFIFO _S_IFIFO +#endif +#ifndef S_IFREG +#define S_IFREG _S_IFREG +#endif +#ifndef S_IREAD +#define S_IREAD _S_IREAD +#endif +#ifndef S_IWRITE +#define S_IWRITE _S_IWRITE +#endif +#define S_IEXEC _S_IEXEC +#ifndef S_IXUSR +#define S_IXUSR _S_IEXEC +#endif +#ifndef S_IXGRP +#define S_IXGRP _S_IEXEC +#endif +#ifndef S_IXOTH +#define S_IXOTH _S_IEXEC +#endif +#ifndef S_IRUSR +#define S_IRUSR _S_IREAD +#endif +#ifndef S_IWUSR +#define S_IWUSR _S_IWRITE +#endif +#ifndef S_IROTH +#define S_IROTH _S_IREAD +#endif +#ifndef S_IWOTH +#define S_IWOTH _S_IWRITE +#endif +#ifndef S_IRGRP +#define S_IRGRP _S_IREAD +#endif +#ifndef S_IWGRP +#define S_IWGRP _S_IWRITE +#endif +#ifndef O_RDWR +#define O_RDWR _O_RDWR +#endif +#ifndef O_CREAT +#define O_CREAT _O_CREAT +#endif +#ifndef O_TRUNC +#define O_TRUNC _O_TRUNC +#endif +#ifndef O_RDONLY +#define O_RDONLY _O_RDONLY +#endif +#ifndef O_WRONLY +#define O_WRONLY _O_WRONLY +#endif +#ifndef O_APPEND +#define O_APPEND _O_APPEND +#endif +#ifndef O_TEXT +#define O_TEXT _O_TEXT +#endif +#ifndef O_BINARY +#define O_BINARY _O_BINARY +#endif +#ifndef O_EXCL +#define O_EXCL _O_EXCL +#endif + +#if defined (S_IFBLK) && !defined (S_ISBLK) +#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ +#endif + +#if defined (S_IFCHR) && !defined (S_ISCHR) +#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ +#endif + +#if defined (S_IFDIR) && !defined (S_ISDIR) +#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ +#endif + +#if defined (S_IFREG) && !defined (S_ISREG) +#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ +#endif + +#if defined (S_IFIFO) && !defined (S_ISFIFO) +#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ +#endif + +#if defined (S_IFLNK) && !defined (S_ISLNK) +#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ +#endif + +#if defined (S_IFSOCK) && !defined (S_ISSOCK) +#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ +#endif + +/* Define this so that winsock.h definitions don't get included when + windows.h is... For this to have proper effect, config.h must + always be included before windows.h. */ +#if !defined(_WINSOCKAPI_) && !defined(WWW_WIN_DLL) +#define _WINSOCKAPI_ 1 +#endif + +#define boolean saved_boolean +#include +#undef boolean + +#include + +/* Defines size_t and alloca (). */ +#include + +/* For proper declaration of environ. */ +#include +#include +#include +#include +#include + +/* For _getcwd. */ +#include + +/* Web2C takes care of ensuring that these are defined. */ +#ifdef max +#undef max +#undef min +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern KPSEDLL FILE *win32_popen (const char *cmd, const char *mode); +extern KPSEDLL int win32_pclose (FILE *f); +extern KPSEDLL struct passwd *kpathsea_getpwnam (kpathsea kpse, char *name); +extern KPSEDLL int win32_system(const char *cmd); + +#if defined (KPSE_COMPAT_API) +extern KPSEDLL struct passwd *getpwnam (char *name); +#endif /* KPSE_COMPAT_API */ + +#define system(p) win32_system(p) +#define popen(cmd, mode) win32_popen(cmd, mode) +#define pclose(file) win32_pclose(file) +/* Functions for WIN32 */ +extern KPSEDLL FILE *popen(const char * str, const char * str2); +extern KPSEDLL int pclose(FILE * f); +extern KPSEDLL int system(const char * cmd); + +extern KPSEDLL void texlive_gs_init(void); +extern KPSEDLL int getlongpath (char *output, char *input, int len); +extern KPSEDLL char *get_home_directory (void); + +#define off_t __int64 +#define xfseeko xfseek64 +#define xftello xftell64 + +#ifdef __cplusplus +} +#endif + +#endif /* not KPATHSEA_WIN32LIB_H */ diff --git a/src/texsourc/kpathsea/kpathsea/xbasename.c b/src/texsourc/kpathsea/kpathsea/xbasename.c new file mode 100644 index 0000000..c66da1c --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xbasename.c @@ -0,0 +1,67 @@ +/* xbasename.c: return the last element in a path. + + Copyright 1992, 1994, 1995, 1996, 2008, 2011 Karl Berry. + Copyright 2005 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, see . */ + +/* Have to include this first to get c-auto.h. */ +#include + +#include + +/* 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 (const_string name) +{ + const_string base = name; + const_string p; + + if (NAME_BEGINS_WITH_DEVICE(name)) + base += 2; + + else if (IS_UNC_NAME(name)) { + unsigned limit; + + for (limit = 2; name[limit] && !IS_DIR_SEP (name[limit]); limit++) +#if defined(WIN32) + if (IS_KANJI(name+limit)) limit++ +#endif + ; + if (name[limit++] && name[limit] && !IS_DIR_SEP (name[limit])) { + for (; name[limit] && !IS_DIR_SEP (name[limit]); limit++) +#if defined(WIN32) + if (IS_KANJI(name+limit)) limit++ +#endif + ; + } else + /* malformed UNC name, backup */ + limit = 0; + base += limit; + } + + for (p = base; *p; p++) { + if (IS_DIR_SEP(*p)) + base = p + 1; +#if defined(WIN32) + else if (IS_KANJI(p)) + p++; +#endif + } + + return base; +} diff --git a/src/texsourc/kpathsea/kpathsea/xcalloc.c b/src/texsourc/kpathsea/kpathsea/xcalloc.c new file mode 100644 index 0000000..aca1554 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xcalloc.c @@ -0,0 +1,35 @@ +/* xcalloc.c: calloc with error checking. + + Copyright 1992, 1993, 2008, 2010 Karl Berry. + Copyright 2005 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, see . */ + +#include + + +void * +xcalloc (size_t nelem, size_t elsize) +{ + void *new_mem = (void*)calloc(nelem ? nelem : 1, elsize ? elsize : 1); + + if (new_mem == NULL) { + fprintf(stderr, + "xcalloc: request for %lu elements of size %lu failed.\n", + (unsigned long)nelem, (unsigned long)elsize); + exit(EXIT_FAILURE); + } + + return new_mem; +} diff --git a/src/texsourc/kpathsea/kpathsea/xdirname.c b/src/texsourc/kpathsea/kpathsea/xdirname.c new file mode 100644 index 0000000..c5b38ba --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xdirname.c @@ -0,0 +1,116 @@ +/* xdirname.c: return the directory part of a path. + + Copyright 1999, 2008, 2011 Karl Berry. + Copyright 2005 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, see . */ + +/* 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 +#include + +string +xdirname (const_string name) +{ + string ret; + unsigned limit = 0, loc; +#if defined(WIN32) + string p; + unsigned i, j; +#endif + + /* Ignore a NULL name. */ + if (!name) + return NULL; + + if (NAME_BEGINS_WITH_DEVICE(name)) { + limit = 2; + } else if (IS_UNC_NAME(name)) { + for (limit = 2; name[limit] && !IS_DIR_SEP (name[limit]); limit++) +#if defined(WIN32) + if (IS_KANJI(name+limit)) limit++ +#endif + ; + if (name[limit++] && name[limit] && !IS_DIR_SEP (name[limit])) { + for (; name[limit] && !IS_DIR_SEP (name[limit]); limit++) +#if defined(WIN32) + if (IS_KANJI(name+limit)) limit++ +#endif + ; + limit--; + } else + /* malformed UNC name, backup */ + limit = 0; + } + +#if defined(WIN32) + j = loc = limit; + if (j > 2) j++; + for (i = j; name[i]; i++) { + if (IS_DIR_SEP (name[i])) { + j = i; + for (i++; IS_DIR_SEP (name[i]); i++) + ; + loc = i + 1; + } else if (IS_KANJI(name+i)) i++; + } +#else + for (loc = strlen (name); loc > limit && !IS_DIR_SEP (name[loc-1]); loc--) + ; +#endif + + if (loc == limit) { + if (limit == 0) + ret = xstrdup ("."); + else if (limit == 2) { + ret = (string)xmalloc(4); + ret[0] = name[0]; + ret[1] = name[1]; + ret[2] = '.'; + ret[3] = '\0'; + } else { + /* UNC name is "//server/share". */ + ret = xstrdup (name); + } + } else { + /* If have ///a, must return /, so don't strip off everything. */ +#if defined(WIN32) + loc = j; + if (loc == limit && IS_DIR_SEP (name[loc])) loc++; +#else + while (loc > limit+1 && IS_DIR_SEP (name[loc-1])) { + loc--; + } +#endif + ret = (string)xmalloc(loc+1); + strncpy(ret, name, loc); + ret[loc] = '\0'; + } + +#if defined(WIN32) + for (p = ret; *p; p++) { + if (*p == '\\') + *p = '/'; + else if (IS_KANJI(p)) + p++; + } +#endif + + return ret; +} diff --git a/src/texsourc/kpathsea/kpathsea/xdirtest.c b/src/texsourc/kpathsea/kpathsea/xdirtest.c new file mode 100644 index 0000000..9deca79 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xdirtest.c @@ -0,0 +1,157 @@ +/* xdirtest.c: standalone program to test xdirname() and xbasename(). + + Copyright 1999 Karl Berry. + Copyright 2005 Olaf Weber. + Copyright 2011 Peter Breitenlohner. + + 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, see . */ + +#include + +static const char *tab[] = { +/* UNC names */ +#if defined (WIN32) + "\\\\neuromancer\\fptex\\bin\\win32\\kpsewhich.exe", + "\\\\neuromancer\\fptex\\win32\\kpsewhich.exe", + "\\\\neuromancer\\fptex\\kpsewhich.exe", + "\\\\neuromancer\\kpsewhich.exe", + "//server.host/share/file", + "//server.host/share/file/", + "//server.host/share/", + "//server.host//share", /* malformed */ + "//server.host", /* malformed */ + "//.host/share", /* not UNC name */ +#endif + "//neuromancer/kpsewhich.exe", +/* names with device */ +#if defined (WIN32) + "p:\\bin\\win32\\kpsewhich.exe", + "p:\\bin\\win32\\\\", + "p:\\win32\\kpsewhich.exe", + "p:\\win32\\", + "p:\\kpsewhich.exe", + "p:\\", + "p:bin\\win32\\kpsewhich.exe", + "p:win32\\kpsewhich.exe", +#endif + "p:win32//kpsewhich.exe", + "p:win32/", + "p:kpsewhich.exe", + "p:///kpsewhich.exe", +/* 'normal' names */ + "/usr/bin/win32/kpsewhich.exe", + "/usr/bin/win32//", + "/usr/bin/kpsewhich.exe", + "/usr/bin/", + "///usr/kpsewhich.exe", + "/usr/kpsewhich.exe", + "///kpsewhich.exe", + "/kpsewhich.exe", + "", + NULL +}; + +#if defined (WIN32) +static const char *ktab[] = { +/* UNC names */ + "\\\\serverK\\\\shareK\\\\file", + "\\\\serverKK\\shareKK\\file", + "\\\\serverK\\\\shareK\\", + "\\\\serverKK\\shareKK", +/* 'normal' names */ + "\\abcK\\deKKfK\\\\hijK\\", + "\\abcKKdeKKfKK\\hijKK", + "\\abcK\\deKKfK\\", + "\\abcKKdeKKfKK", + NULL +}; + +static char * +to_kanji (const char *str) { + char *p, *ret = xstrdup(str); + + for (p = ret; *p; p++) + if (*p == 'K') + *p = 0x81; + + return ret; +} + +static char * +from_kanji (char *str) { + char *p; + + for (p = str; *p; p++) + if ((unsigned char) *p == 0x81) + *p = 'K'; + + return str; +} + +static void +do_kanji (void) { + const char **p; + + printf("\nAssuming CP %s 932\n", is_cp932_system ? "is" : "is not"); + + for (p = ktab; *p; p++) { + char *q = to_kanji(*p); + char *r = xdirname(q); + + printf("%s -> %s + %s\n", *p, from_kanji(r), *p + (xbasename(q)-q)); + + free (r); + free (q); + } +} + +static void +kanji_test(void) { + int save_cp932 = is_cp932_system; + + printf("\nTesting 2-Byte Kanji (CP 932, SJIS) codes with 'K' representing 0x81\n"); + + is_cp932_system = 932; /* pretend CP is 932 */ + do_kanji(); + + is_cp932_system = 0; /* pretend CP is not 932 */ + do_kanji(); + + is_cp932_system = save_cp932; +} +#endif + +int main(int argc, char **argv) +{ + const char **p; + kpathsea kpse = kpathsea_new(); + + kpathsea_set_program_name (kpse, argv[0], NULL); + + printf("\n%s: name -> xdirname(name) + xbasename(name)\n\n", + kpse->invocation_short_name); + + for (p = tab; *p; p++) { + char *q = xdirname(*p); + + printf("%s -> %s + %s\n", *p, q, xbasename(*p)); + free (q); + } + +#if defined (WIN32) + kanji_test(); +#endif + + return 0; +} diff --git a/src/texsourc/kpathsea/kpathsea/xfopen.c b/src/texsourc/kpathsea/kpathsea/xfopen.c new file mode 100644 index 0000000..00bec3d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xfopen.c @@ -0,0 +1,48 @@ +/* xfopen.c: fopen and fclose with error checking. + + Copyright 1992, 1993, 1995, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#include + + +/* These routines just check the return status from standard library + routines and abort if an error happens. */ + +FILE * +xfopen (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 (FILE *f, const_string filename) +{ + assert(f); + + if (fclose(f) == EOF) + FATAL_PERROR(filename); + +} diff --git a/src/texsourc/kpathsea/kpathsea/xfseek.c b/src/texsourc/kpathsea/kpathsea/xfseek.c new file mode 100644 index 0000000..1a1bfa0 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xfseek.c @@ -0,0 +1,27 @@ +/* xfseek.c: fseek with error checking. + + Copyright 1992, 1995, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#include + +void +xfseek (FILE *f, long offset, int wherefrom, const_string filename) +{ + if (fseek (f, offset, wherefrom) < 0) { + FATAL_PERROR(filename); + } +} diff --git a/src/texsourc/kpathsea/kpathsea/xfseeko.c b/src/texsourc/kpathsea/kpathsea/xfseeko.c new file mode 100644 index 0000000..8d83644 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xfseeko.c @@ -0,0 +1,26 @@ +/* xfseeko.c: fseeko with error checking. + + Copyright 2008 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, see . */ + +#include + +void +xfseeko (FILE *f, off_t offset, int wherefrom, const_string filename) +{ + if (fseeko (f, offset, wherefrom) < 0) { + FATAL_PERROR(filename); + } +} diff --git a/src/texsourc/kpathsea/kpathsea/xftell.c b/src/texsourc/kpathsea/kpathsea/xftell.c new file mode 100644 index 0000000..123f49a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xftell.c @@ -0,0 +1,30 @@ +/* xftell.c: ftell with error checking. + + Copyright 1992, 1993, 1995, 2008, 2011 Karl Berry. + Copyright 2005 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, see . */ + +#include + +long +xftell (FILE *f, const_string filename) +{ + long where = ftell (f); + + if (where < 0) + FATAL_PERROR(filename); + + return where; +} diff --git a/src/texsourc/kpathsea/kpathsea/xftello.c b/src/texsourc/kpathsea/kpathsea/xftello.c new file mode 100644 index 0000000..a01b42a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xftello.c @@ -0,0 +1,31 @@ +/* xftello.c: ftello with error checking. + + Copyright 1992, 1993, 1995, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#include + + +off_t +xftello (FILE *f, const_string filename) +{ + off_t where = ftello (f); + + if (where < 0) + FATAL_PERROR(filename); + + return where; +} diff --git a/src/texsourc/kpathsea/kpathsea/xgetcwd.c b/src/texsourc/kpathsea/kpathsea/xgetcwd.c new file mode 100644 index 0000000..dae50dd --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xgetcwd.c @@ -0,0 +1,157 @@ +/* xgetcwd.c: a from-scratch version of getwd. Ideas from tcsh 5.20 source. + + Copyright 1992, 1994, 1996, 2008, 2011 Karl Berry. + Copyright 2005 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, see . */ + +#include + +#if (defined (HAVE_GETCWD) && !defined (GETCWD_FORKS)) || defined (HAVE_GETWD) +#include +#else /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */ +#include +#include +#include + + +static void +xchdir (string dirname) +{ + if (chdir(dirname) != 0) + _PERROR(dirname); +} + +#endif /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */ + + +/* Return the pathname of the current directory, or give a fatal error. */ + +string +xgetcwd (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 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) + LIB_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 || GETCWD_FORKS) && not HAVE_GETWD */ +} diff --git a/src/texsourc/kpathsea/kpathsea/xmalloc.c b/src/texsourc/kpathsea/kpathsea/xmalloc.c new file mode 100644 index 0000000..65a0d2d --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xmalloc.c @@ -0,0 +1,34 @@ +/* xmalloc.c: malloc with error checking. + + Copyright 1992, 1993, 2008, 2010 Karl Berry. + Copyright 2005 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, see . */ + +#include + + +void * +xmalloc (size_t size) +{ + void *new_mem = (void *)malloc(size ? size : 1); + + if (new_mem == NULL) { + fprintf(stderr, "fatal: memory exhausted (xmalloc of %lu bytes).\n", + (unsigned long)size); + exit(EXIT_FAILURE); + } + + return new_mem; +} diff --git a/src/texsourc/kpathsea/kpathsea/xopendir.c b/src/texsourc/kpathsea/kpathsea/xopendir.c new file mode 100644 index 0000000..5d42556 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xopendir.c @@ -0,0 +1,47 @@ +/* xopendir.c: opendir and closedir with error checking. + + Copyright 1992, 1993, 1994, 1995, 1996, 2008, 2010 Karl Berry. + Copyright 2005 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, see . */ + +#include +#include + + +#if !defined(WIN32) || defined(__MINGW32__) +DIR * +xopendir (const_string dirname) +{ + DIR *d = opendir(dirname); + + if (d == NULL) + FATAL_PERROR(dirname); + + return d; +} + +void +xclosedir (DIR *d) +{ +#ifdef CLOSEDIR_VOID + closedir (d); +#else + int ret = closedir(d); + + if (ret != 0) + FATAL("closedir failed"); +#endif +} +#endif /* not WIN32 || __MINGW32__ */ diff --git a/src/texsourc/kpathsea/kpathsea/xopendir.h b/src/texsourc/kpathsea/kpathsea/xopendir.h new file mode 100644 index 0000000..b786d9a --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xopendir.h @@ -0,0 +1,33 @@ +/* xopendir.h: declare checked directory operations. + + Copyright 1994, 1996, 2008, 2010 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, see . */ + +#if !defined (KPATHSEA_XOPENDIR_H) && (!defined (WIN32) || defined(__MINGW32__)) +#define KPATHSEA_XOPENDIR_H + +#include +#include +#include + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +/* Like opendir and closedir, but abort on error. */ +extern DIR *xopendir (const_string dirname); +extern void xclosedir (DIR *); + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not (KPATHSEA_XOPENDIR_H or WIN32) */ diff --git a/src/texsourc/kpathsea/kpathsea/xputenv.c b/src/texsourc/kpathsea/kpathsea/xputenv.c new file mode 100644 index 0000000..4d1fb53 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xputenv.c @@ -0,0 +1,125 @@ +/* xputenv.c: set an environment variable without return. */ + +/* Copyright 1993-98, 2008, 2009 Karl Berry. + Copyright 2003-05 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, see . */ + + +#include +#include + +#ifdef WIN32 +#include +#else +#if !HAVE_DECL_PUTENV +extern int putenv (char* entry); +#endif +#endif /* not WIN32 */ + +/* + * 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 +kpathsea_xputenv(kpathsea kpse, 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 != kpse->saved_count; ++cur_loc) { + if (strncmp(kpse->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) + LIB_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 == kpse->saved_count) { + /* No old string. */ + kpse->saved_count++; + XRETALLOC(kpse->saved_env, kpse->saved_count, char *); + } else { + /* We owned the old string. */ + free(kpse->saved_env[cur_loc]); + } + kpse->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 +kpathsea_xputenv_int (kpathsea kpse, const_string var_name, int num) +{ + char str[MAX_INT_LENGTH]; + sprintf (str, "%d", num); + + kpathsea_xputenv (kpse, var_name, str); +} + +#if defined (KPSE_COMPAT_API) +void +xputenv (const char *var, const char *value) +{ + kpathsea_xputenv (kpse_def, var, value); +} + +void +xputenv_int (const_string var_name, int num) +{ + kpathsea_xputenv_int(kpse_def, var_name, num); +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/xrealloc.c b/src/texsourc/kpathsea/kpathsea/xrealloc.c new file mode 100644 index 0000000..e566683 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xrealloc.c @@ -0,0 +1,43 @@ +/* xrealloc.c: realloc with error checking. + + Copyright 1992, 1993, 2008, 2010, 2013 Karl Berry. + Copyright 2005 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, see . */ + +#include + +void * +xrealloc (void *old_ptr, size_t size) +{ + void *new_mem; + + if (old_ptr == NULL) { + new_mem = xmalloc(size); + } else { + new_mem = (void *)realloc(old_ptr, size ? size : 1); + 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 %lu bytes).\n", + (unsigned long)size); + exit(EXIT_FAILURE); + } + } + + return new_mem; +} diff --git a/src/texsourc/kpathsea/kpathsea/xstat.c b/src/texsourc/kpathsea/kpathsea/xstat.c new file mode 100644 index 0000000..226ca62 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xstat.c @@ -0,0 +1,54 @@ +/* xstat.c: stat and (maybe) lstat with error checking. + + Copyright 1992, 1993, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#include + +#include + + +struct stat +xstat (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 (const_string path) +{ + struct stat s; + + if (lstat(path, &s) != 0) + FATAL_PERROR(path); + return s; +} +#endif diff --git a/src/texsourc/kpathsea/kpathsea/xstat.h b/src/texsourc/kpathsea/kpathsea/xstat.h new file mode 100644 index 0000000..59347ba --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xstat.h @@ -0,0 +1,45 @@ +/* xstat.h: stat with error checking. + + Copyright 1992, 1993, 1994, 2008, 2010, 2011 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, see . */ + +#ifndef KPATHSEA_XSTAT_H +#define KPATHSEA_XSTAT_H + +#ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ + +#include +#include +#include + +/* 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 (const_string path); + +/* Ditto, for lstat(2) (except that lstat might not exist). */ +#ifdef S_ISLNK +extern struct stat xlstat (const_string path); +#else +#define xlstat xstat +#endif + +#endif /* MAKE_KPSE_DLL */ + +#endif /* not KPATHSEA_XSTAT_H */ diff --git a/src/texsourc/kpathsea/kpathsea/xstrdup.c b/src/texsourc/kpathsea/kpathsea/xstrdup.c new file mode 100644 index 0000000..7384218 --- /dev/null +++ b/src/texsourc/kpathsea/kpathsea/xstrdup.c @@ -0,0 +1,29 @@ +/* xstrdup.c: strdup with error checking. + + Copyright 1992, 1993, 2008 Karl Berry. + Copyright 2005 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, see . */ + +#include + + +/* Return a copy of S in new storage. */ + +string +xstrdup (const_string s) +{ + string new_string = (string)xmalloc(strlen (s) + 1); + return strcpy(new_string, s); +} diff --git a/src/texsourc/kpathsea/make-obj.bat b/src/texsourc/kpathsea/make-obj.bat new file mode 100644 index 0000000..060ebd3 --- /dev/null +++ b/src/texsourc/kpathsea/make-obj.bat @@ -0,0 +1,63 @@ +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/absolute.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/access.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/atou.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/cnf.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concat3.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concatn.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/db.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/debug.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/dir.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/elt-dirs.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/expand.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/extend-fname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/file-p.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/find-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/fn.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/fontmap.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/getopt.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/getopt1.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/hash.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kdefault.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/knj.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpathsea.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpsestat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpsewhich.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/line.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/magstep.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/make-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/path-elt.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/pathsearch.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/proginit.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/progname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/putenv.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/readable.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/readlink.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/rm-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/str-list.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/str-llist.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-file.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-glyph.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-hush.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-make.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tilde.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/uppercasify.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/variable.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/version.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/win32lib.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xbasename.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xcalloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xdirname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xdirtest.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfopen.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfseek.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfseeko.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xftell.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xftello.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xgetcwd.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xmalloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xopendir.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xputenv.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xrealloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xstat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xstrdup.c diff --git a/src/texsourc/kpathsea/meaning.txt b/src/texsourc/kpathsea/meaning.txt new file mode 100644 index 0000000..db46b9e --- /dev/null +++ b/src/texsourc/kpathsea/meaning.txt @@ -0,0 +1,71 @@ +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/absolute.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/access.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/atou.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/cnf.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concat3.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/concatn.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/db.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/debug.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/dir.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/elt-dirs.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/expand.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/extend-fname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/file-p.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/find-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/fn.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/fontmap.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/getopt.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/getopt1.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/hash.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kdefault.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/knj.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpathsea.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpsestat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/kpsewhich.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/line.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/magstep.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/make-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/path-elt.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/pathsearch.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/proginit.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/progname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/putenv.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/readable.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/readlink.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/rm-suffix.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/str-list.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/str-llist.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-file.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-glyph.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-hush.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tex-make.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/tilde.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/uppercasify.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/variable.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/version.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/win32lib.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xbasename.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xcalloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xdirname.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xdirtest.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfopen.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfseek.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xfseeko.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xftell.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xftello.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xgetcwd.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xmalloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xopendir.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xputenv.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xrealloc.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xstat.c +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/xstrdup.c + +cl -c -I. -DWIN32=1 -DMAKE_KPSE_DLL=1 kpathsea/dirent.c + + + +cl -LD -Fekpathsea611.dll tex-file.obj absolute.obj atou.obj cnf.obj concat.obj concat3.obj concatn.obj db.obj debug.obj dir.obj elt-dirs.obj expand.obj extend-fname.obj file-p.obj find-suffix.obj fn.obj fontmap.obj getopt.obj getopt1.obj hash.obj kdefault.obj kpathsea.obj line.obj magstep.obj make-suffix.obj path-elt.obj pathsearch.obj proginit.obj progname.obj readable.obj rm-suffix.obj str-list.obj str-llist.obj tex-glyph.obj tex-hush.obj tex-make.obj tilde.obj uppercasify.obj variable.obj version.obj xbasename.obj xcalloc.obj xdirname.obj xfopen.obj xfseek.obj xftell.obj xgetcwd.obj xmalloc.obj xopendir.obj xputenv.obj xrealloc.obj xstat.obj xstrdup.obj knj.obj win32lib.obj user32.lib advapi32.lib shell32.lib + +cl mktexlsr.obj dirent.obj tex-file.obj absolute.obj atou.obj cnf.obj concat.obj concat3.obj concatn.obj db.obj debug.obj dir.obj elt-dirs.obj expand.obj extend-fname.obj file-p.obj find-suffix.obj fn.obj fontmap.obj getopt.obj getopt1.obj hash.obj kdefault.obj kpathsea.obj line.obj magstep.obj make-suffix.obj path-elt.obj pathsearch.obj proginit.obj progname.obj readable.obj rm-suffix.obj str-list.obj str-llist.obj tex-glyph.obj tex-hush.obj tex-make.obj tilde.obj uppercasify.obj variable.obj version.obj xbasename.obj xcalloc.obj xdirname.obj xfopen.obj xfseek.obj xftell.obj xgetcwd.obj xmalloc.obj xopendir.obj xputenv.obj xrealloc.obj xstat.obj xstrdup.obj knj.obj win32lib.obj user32.lib advapi32.lib shell32.lib diff --git a/src/texsourc/kpathsea/win32/c-auto.h b/src/texsourc/kpathsea/win32/c-auto.h new file mode 100644 index 0000000..00d2150 --- /dev/null +++ b/src/texsourc/kpathsea/win32/c-auto.h @@ -0,0 +1,157 @@ +/* c-auto.h. Generated automatically by configure. */ +/* 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. */ + +/* Guard against double inclusion. */ +#ifndef KPATHSEA_C_AUTO_H +#define KPATHSEA_C_AUTO_H + +/* kpathsea: the version string. */ +#define KPSEVERSION "kpathsea version 6.2.0dev" + +/* 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. */ +#define HAVE_PUTENV 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRTOL 1 +#define HAVE_STRSTR 1 +#define HAVE_DECL_STRSTR 1 + +/* 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. */ +#define STDC_HEADERS 1 + +/* Define if your compiler understands prototypes. */ +#define HAVE_PROTOTYPES 1 + +/* 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 1 +#define MAKE_TEX_PK_BY_DEFAULT 1 +#define MAKE_TEX_TEX_BY_DEFAULT 0 +#define MAKE_TEX_TFM_BY_DEFAULT 1 +#define MAKE_TEX_FMT_BY_DEFAULT 1 +#define MAKE_OMEGA_OFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OCP_BY_DEFAULT 0 + +/* Define if you have the bcmp function. */ +/* #define HAVE_BCMP 1 */ + +/* Define if you have the bcopy function. */ +/* #define HAVE_BCOPY 1 */ + +/* Define if you have the bzero function. */ +/* #define HAVE_BZERO 1 */ + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getwd function. */ +/* #define HAVE_GETWD 1 */ + +/* Define if you have the index function. */ +/* #define HAVE_INDEX 1 */ + +/* Define if you have the memcmp function. */ +#define HAVE_MEMCMP 1 + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the rindex function. */ +/* #define HAVE_RINDEX 1 */ + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strrchr function. */ +#define HAVE_STRRCHR 1 + +/* Define if you have the strstr function. */ +#define HAVE_STRSTR 1 + +/* Define if you have the strtol function. */ +#define HAVE_STRTOL 1 + +/* Define if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #define HAVE_PWD_H 1 */ + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +/* #define HAVE_SYS_PARAM_H 1 */ + +/* Define if you have the header file. */ +/* #define HAVE_UNISTD_H 1 */ + +#define strcasecmp stricmp +/* Define if you have the m library (-lm). */ +/* #undef HAVE_LIBM */ + +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 + +#endif /* !KPATHSEA_C_AUTO_H */ diff --git a/src/texsourc/kpathsea/win32/kpathsea.h b/src/texsourc/kpathsea/win32/kpathsea.h new file mode 100644 index 0000000..20ba6c4 --- /dev/null +++ b/src/texsourc/kpathsea/win32/kpathsea.h @@ -0,0 +1,43 @@ +/* This is a generated file */ +/* collecting all public kpathsea headers. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/texsourc/kpathsea/win32/paths.h b/src/texsourc/kpathsea/win32/paths.h new file mode 100644 index 0000000..1e321e5 --- /dev/null +++ b/src/texsourc/kpathsea/win32/paths.h @@ -0,0 +1,316 @@ +/* paths.h */ +#ifndef KPATHSEA_PATHS_H +#define KPATHSEA_PATHS_H + +#ifndef DEFAULT_TEXMFMAIN +#define DEFAULT_TEXMFMAIN "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFLOCAL +#define DEFAULT_TEXMFLOCAL "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFDIST +#define DEFAULT_TEXMFDIST "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFHOME +#define DEFAULT_TEXMFHOME "/nonesuch" +#endif +#ifndef DEFAULT_TEXMF +#define DEFAULT_TEXMF "/nonesuch" +#endif +#ifndef DEFAULT_SYSTEXMF +#define DEFAULT_SYSTEXMF "/nonesuch" +#endif +#ifndef DEFAULT_VARTEXFONTS +#define DEFAULT_VARTEXFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFDBS +#define DEFAULT_TEXMFDBS "/nonesuch" +#endif +#ifndef DEFAULT_WEB2C +#define DEFAULT_WEB2C "/nonesuch" +#endif +#ifndef DEFAULT_TEXINPUTS +#define DEFAULT_TEXINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MFINPUTS +#define DEFAULT_MFINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MPINPUTS +#define DEFAULT_MPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MFTINPUTS +#define DEFAULT_MFTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_WEBINPUTS +#define DEFAULT_WEBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_CWEBINPUTS +#define DEFAULT_CWEBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXFORMATS +#define DEFAULT_TEXFORMATS "/nonesuch" +#endif +#ifndef DEFAULT_MFBASES +#define DEFAULT_MFBASES "/nonesuch" +#endif +#ifndef DEFAULT_MPMEMS +#define DEFAULT_MPMEMS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPOOL +#define DEFAULT_TEXPOOL "/nonesuch" +#endif +#ifndef DEFAULT_MFPOOL +#define DEFAULT_MFPOOL "/nonesuch" +#endif +#ifndef DEFAULT_MPPOOL +#define DEFAULT_MPPOOL "/nonesuch" +#endif +#ifndef DEFAULT_VFFONTS +#define DEFAULT_VFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TFMFONTS +#define DEFAULT_TFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_PKFONTS +#define DEFAULT_PKFONTS "/nonesuch" +#endif +#ifndef DEFAULT_GFFONTS +#define DEFAULT_GFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_GLYPHFONTS +#define DEFAULT_GLYPHFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXFONTMAPS +#define DEFAULT_TEXFONTMAPS "/nonesuch" +#endif +#ifndef DEFAULT_BIBINPUTS +#define DEFAULT_BIBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_BSTINPUTS +#define DEFAULT_BSTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MLBIBINPUTS +#define DEFAULT_MLBIBINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_MLBSTINPUTS +#define DEFAULT_MLBSTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPSHEADERS +#define DEFAULT_TEXPSHEADERS "/nonesuch" +#endif +#ifndef DEFAULT_T1FONTS +#define DEFAULT_T1FONTS "/nonesuch" +#endif +#ifndef DEFAULT_AFMFONTS +#define DEFAULT_AFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_SYSTTF +#define DEFAULT_SYSTTF "/nonesuch" +#endif +#ifndef DEFAULT_TTFONTS +#define DEFAULT_TTFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TTF2PKINPUTS +#define DEFAULT_TTF2PKINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TTF2TFMINPUTS +#define DEFAULT_TTF2TFMINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_T42FONTS +#define DEFAULT_T42FONTS "/nonesuch" +#endif +#ifndef DEFAULT_LIGFONTS +#define DEFAULT_LIGFONTS "/nonesuch" +#endif +#ifndef DEFAULT_MISCFONTS +#define DEFAULT_MISCFONTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXCONFIG +#define DEFAULT_TEXCONFIG "/nonesuch" +#endif +#ifndef DEFAULT_INDEXSTYLE +#define DEFAULT_INDEXSTYLE "/nonesuch" +#endif +#ifndef DEFAULT_ENCFONTS +#define DEFAULT_ENCFONTS "/nonesuch" +#endif +#ifndef DEFAULT_CMAPFONTS +#define DEFAULT_CMAPFONTS "/nonesuch" +#endif +#ifndef DEFAULT_SFDFONTS +#define DEFAULT_SFDFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OPENTYPEFONTS +#define DEFAULT_OPENTYPEFONTS "/nonesuch" +#endif +#ifndef DEFAULT_FONTFEATURES +#define DEFAULT_FONTFEATURES "/nonesuch" +#endif +#ifndef DEFAULT_FONTCIDMAPS +#define DEFAULT_FONTCIDMAPS "/nonesuch" +#endif +#ifndef DEFAULT_PDFTEXCONFIG +#define DEFAULT_PDFTEXCONFIG "/nonesuch" +#endif +#ifndef DEFAULT_TRFONTS +#define DEFAULT_TRFONTS "/nonesuch" +#endif +#ifndef DEFAULT_MPSUPPORT +#define DEFAULT_MPSUPPORT "/nonesuch" +#endif +#ifndef DEFAULT_MIMELIBDIR +#define DEFAULT_MIMELIBDIR "/nonesuch" +#endif +#ifndef DEFAULT_MAILCAPLIBDIR +#define DEFAULT_MAILCAPLIBDIR "/nonesuch" +#endif +#ifndef DEFAULT_TEXDOCS +#define DEFAULT_TEXDOCS "/nonesuch" +#endif +#ifndef DEFAULT_TEXSOURCES +#define DEFAULT_TEXSOURCES "/nonesuch" +#endif +#ifndef DEFAULT_TEXDOCSSUFFIX +#define DEFAULT_TEXDOCSSUFFIX ";.pdf;.ps;.dvi;.html;.txt;.tex" +#endif +#ifndef DEFAULT_TEXDOCSCOMPRESS +#define DEFAULT_TEXDOCSCOMPRESS ";.gz;.bz2;.zip;.Z;.xz" +#endif +#ifndef DEFAULT_TEXDOCEXT +#define DEFAULT_TEXDOCEXT "{$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}" +#endif +#ifndef DEFAULT_OFMFONTS +#define DEFAULT_OFMFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OPLFONTS +#define DEFAULT_OPLFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OVFFONTS +#define DEFAULT_OVFFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OVPFONTS +#define DEFAULT_OVPFONTS "/nonesuch" +#endif +#ifndef DEFAULT_OTPINPUTS +#define DEFAULT_OTPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_OCPINPUTS +#define DEFAULT_OCPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_T4HTINPUTS +#define DEFAULT_T4HTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEX4HTINPUTS +#define DEFAULT_TEX4HTINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TW_LIBPATH +#define DEFAULT_TW_LIBPATH "/nonesuch" +#endif +#ifndef DEFAULT_TW_INIPATH +#define DEFAULT_TW_INIPATH "/nonesuch" +#endif +#ifndef DEFAULT_LUAINPUTS +#define DEFAULT_LUAINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_CLUAINPUTS +#define DEFAULT_CLUAINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXMFSCRIPTS +#define DEFAULT_TEXMFSCRIPTS "/nonesuch" +#endif +#ifndef DEFAULT_TEXPICTS +#define DEFAULT_TEXPICTS "/nonesuch" +#endif +#ifndef DEFAULT_KPSE_DOT +#define DEFAULT_KPSE_DOT "." +#endif +#ifndef DEFAULT_TEXMFCNF +#define DEFAULT_TEXMFCNF \ +"{$SELFAUTOLOC,\ +$SELFAUTOLOC/share/texmf-local/web2c,\ +$SELFAUTOLOC/share/texmf-dist/web2c,\ +$SELFAUTOLOC/share/texmf/web2c,\ +$SELFAUTOLOC/texmf-local/web2c,\ +$SELFAUTOLOC/texmf-dist/web2c,\ +$SELFAUTOLOC/texmf/web2c,\ +$SELFAUTODIR,\ +$SELFAUTODIR/share/texmf-local/web2c,\ +$SELFAUTODIR/share/texmf-dist/web2c,\ +$SELFAUTODIR/share/texmf/web2c,\ +$SELFAUTODIR/texmf-local/web2c,\ +$SELFAUTODIR/texmf-dist/web2c,\ +$SELFAUTODIR/texmf/web2c,\ +$SELFAUTOPARENT/../texmf-local/web2c,\ +$SELFAUTOPARENT,\ +$SELFAUTOPARENT/share/texmf-local/web2c,\ +$SELFAUTOPARENT/share/texmf-dist/web2c,\ +$SELFAUTOPARENT/share/texmf/web2c,\ +$SELFAUTOPARENT/texmf-local/web2c,\ +$SELFAUTOPARENT/texmf-dist/web2c,\ +$SELFAUTOPARENT/texmf/web2c}" +#endif +#ifndef DEFAULT_MISSFONT_LOG +#define DEFAULT_MISSFONT_LOG "missfont.log" +#endif +#ifndef DEFAULT_TEX_HUSH +#define DEFAULT_TEX_HUSH "none" +#endif +#ifndef DEFAULT_MKTEXTEX +#define DEFAULT_MKTEXTEX "0" +#endif +#ifndef DEFAULT_MKTEXPK +#define DEFAULT_MKTEXPK "1" +#endif +#ifndef DEFAULT_MKTEXMF +#define DEFAULT_MKTEXMF "1" +#endif +#ifndef DEFAULT_MKTEXTFM +#define DEFAULT_MKTEXTFM "1" +#endif +#ifndef DEFAULT_MKTEXFMT +#define DEFAULT_MKTEXFMT "1" +#endif +#ifndef DEFAULT_MKOCP +#define DEFAULT_MKOCP "0" +#endif +#ifndef DEFAULT_MKOFM +#define DEFAULT_MKOFM "0" +#endif +#ifndef DEFAULT_MPXCOMMAND +#define DEFAULT_MPXCOMMAND "" +#endif +#ifndef DEFAULT_TEX +#define DEFAULT_TEX "tex" +#endif +#ifndef DEFAULT_TEXJ +#define DEFAULT_TEXJ "ptex" +#endif +#ifndef DEFAULT_MPXTEXCMD +#define DEFAULT_MPXTEXCMD "etex" +#endif +#ifndef DEFAULT_MPXTEXCMDJ +#define DEFAULT_MPXTEXCMDJ "eptex" +#endif +#ifndef DEFAULT_CMAPINPUTS +#define DEFAULT_CMAPINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_DVI2PATH +#define DEFAULT_DVI2PATH "/nonesuch" +#endif +#ifndef DEFAULT_DVI2LIB +#define DEFAULT_DVI2LIB "/nonesuch" +#endif +#ifndef DEFAULT_DVI2FONTDESC +#define DEFAULT_DVI2FONTDESC "/nonesuch" +#endif +#ifndef DEFAULT_JDVIKPSHEADER +#define DEFAULT_JDVIKPSHEADER "/nonesuch" +#endif +#ifndef DEFAULT_RISINPUTS +#define DEFAULT_RISINPUTS "/nonesuch" +#endif +#ifndef DEFAULT_BLTXMLINPUTS +#define DEFAULT_BLTXMLINPUTS "/nonesuch" +#endif + +#endif /* KPATHSEA_PATHS_H */ diff --git a/src/texsourc/lib.h b/src/texsourc/lib.h index c9deaff..1b7ae04 100644 --- a/src/texsourc/lib.h +++ b/src/texsourc/lib.h @@ -108,7 +108,7 @@ extern string extend_filename (string name, string suffix); perror(3) with FILENAME as its argument. */ extern FILE *xfopen (string filename, string mode); // extern void xfclose (FILE *, string filename); -extern int xfclose (FILE *, string filename); +extern void xfclose (FILE *, string filename); extern void xfseek (FILE *, long, int, string filename); extern long xftell (FILE *, string filename); diff --git a/src/texsourc/makefile b/src/texsourc/makefile index 1d0373a..3e609e7 100644 --- a/src/texsourc/makefile +++ b/src/texsourc/makefile @@ -34,7 +34,8 @@ CFLAGS=/nologo /c /MT /GF /Gy /Ox /W4 /DMSDOS /DTeX /DPHARLAP /DNDEBUG # LFLAGS=@yandytex.nt /MAP lib\libdos.lib # Release version # LFLAGS=/MAP lib\libdos.lib -LFLAGS=/MAP /MACHINE:X86 +LFLAGS=/MAP +# /MACHINE:X86 # debugging version # LFLAGS=@yandytex.nt /MAP /DEBUG /PDB:yandytex.pdb lib\libdos.lib # LFLAGS=/MAP /DEBUG /PDB:yandytex.pdb @@ -51,7 +52,7 @@ objs = texmf.obj itex.obj openinou.obj subroute.obj local.obj \ texmf.exe: $(objs) $(LINK) $(LFLAGS) texmf itex openinou subroute local \ tex0 tex1 tex2 tex3 tex4 tex5 tex6 tex7 tex8 tex9 \ - yandy_pool yandytex.res md5 md5file + yandy_pool yandytex.res md5 md5file kpathsea\kpathsea.lib copy texmf.exe yandytex.exe del ..\yandy\bin\texmf.exe copy texmf.exe ..\yandy\bin\texmf.exe diff --git a/src/texsourc/openinou.c b/src/texsourc/openinou.c index d7be2cc..1f9923c 100644 --- a/src/texsourc/openinou.c +++ b/src/texsourc/openinou.c @@ -31,7 +31,7 @@ #pragma warning(disable:4996) #pragma warning(disable:4131) // old style declarator -#pragma warning(disable:4135) // conversion between different integral types +#pragma warning(disable:4135) // conversion between different integral types #pragma warning(disable:4127) // conditional expression is constant #include @@ -45,16 +45,7 @@ #define PATH_SEP '/' #define PATH_SEP_STRING "/" -/* openinout.c: open input and output files. These routines used by - TeX, Metafont, and BibTeX. */ - -/* #include */ /* debugging 94/Mar/2 */ -/* #include */ /* debugging 94/Mar/2 */ -/* #include */ /* for getch */ - -// #include "config.h" -// #include "c-namemx.h" -// #include "c-pathch.h" +/* openinout.c: open input and output files. */ #define BUILDNAMEDIRECT /* avoid malloc for string concat */ @@ -101,6 +92,7 @@ char *xconcat3 (char *buffer, char *s1, char *s2, char *s3) int n1 = strlen(s1); int n2 = strlen(s2); int n3 = strlen(s3); + if (buffer == s3) { /* treat special case of overlap */ memmove (buffer + n1 + n2, buffer, n3 + 1); /* trailing null ! */ @@ -146,34 +138,38 @@ int qualified (unsigned char * name) else return 0; } -/* patch path if (i) path not empty (ii) name not qualified (iii) ext match */ +/* patch path if + (i) path not empty + (ii) name not qualified + (iii) ext match +*/ int prepend_path_if (unsigned char *buffer, unsigned char *name, char *ext, unsigned char *path) { if (path == NULL) return 0; + if (*path == '\0') return 0; + if (qualified(name)) return 0; + if (strstr((char *)name, ext) == NULL) return 0; + patch_in_path(buffer, name, path); + return 1; } #endif /* end of MSDOS */ /* Following works on null-terminated strings */ -/* void check_short_name(void) { */ /* 1995/Feb/20 */ void check_short_name (unsigned char *s) -{ /* 1995/Sep/26 */ +{ unsigned char *star, *sdot; int n; -/* if ((star = strrchr(name_of_file+1, '\\')) != NULL) star++; - else if ((star = strrchr(name_of_file+1, '/')) != NULL) star++; - else if ((star = strchr(name_of_file+1, ':')) != NULL) star++; - else star = name_of_file+1; */ /* 1995/Sep/26 */ if ((star = (unsigned char *) strrchr((char *) s, '\\')) != NULL) star++; else if ((star = (unsigned char *) strrchr((char *) s, '/')) != NULL) @@ -182,16 +178,21 @@ void check_short_name (unsigned char *s) star++; else star = s; + if ((sdot = (unsigned char *) strchr((char *) star, '.')) != NULL) n = sdot - star; else n = strlen((char *) star); + if (n > 8) strcpy((char *) star + 8, (char *) star + n); + if ((sdot = (unsigned char *) strchr((char *) star, '.')) != NULL) { star = sdot + 1; + n = strlen((char *) star); + if (n > 3) *(star + 3) = '\0'; } @@ -253,36 +254,9 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) /* 8 + 3 file names on Windows NT 95/Feb/20 */ if (shorten_file_name) { - check_short_name(name_of_file + 1); /* 95/Sep/26 */ -/* space_terminate (name_of_file + 1); */ + check_short_name(name_of_file + 1); } #endif /* MSDOS */ - -#ifdef BibTeX - if (path_index == NO_FILE_PATH) - { - unsigned temp_length; - -/* null_terminate (name_of_file + 1); */ -/* if share_flag is non-zero and we are opening for reading use fsopen */ -/* but we can assume here that we are opening for *input* */ -/* *f = fopen (name_of_file + 1, fopen_mode); */ - if (share_flag == 0) - *f = fopen (name_of_file + 1, fopen_mode); - else - *f = _fsopen (name_of_file + 1, fopen_mode, share_flag); - temp_length = strlen (name_of_file + 1); -/* space_terminate (name_of_file + 1); */ - - if (*f != NULL) - { - name_length = temp_length; - openable = true; - } - } - - else -#endif /* BibTeX */ if (open_trace_flag) { @@ -329,8 +303,9 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) #ifdef TeX /* If we just opened a TFM file, we have to read the first byte, since TeX wants to look at it. What a kludge. */ +/* See comments in ctex.ch for why we need this. */ if (path_index == TFMFILEPATH) - { /* See comments in ctex.ch for why we need this. */ + { tfm_temp = getc (*f); } #endif /* TeX */ @@ -361,13 +336,16 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) selector = log_only; print_char(' '); print_char('('); + while (*s != '\0') print_char (*s++); + print_char(')'); selector = old_setting; #else int n; n = strlen((char *) name_of_file + 1); + if (file_offset + n > max_print_line) { putc('\n', log_file); @@ -375,6 +353,7 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) } /* somewhat risky ? */ else putc(' ', log_file); + fprintf(log_file, "(%s)", name_of_file + 1); file_offset += n+3; /* space_terminate (name_of_file + 1); */ @@ -386,7 +365,9 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) else if (source_direct == NULL) /* 98/Sep/29 */ { char *s; + source_direct = xstrdup((char *) name_of_file + 1); + if (trace_flag) { sprintf(log_line, "Methinks the source %s is `%s'\n", "file", source_direct); @@ -394,7 +375,7 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) } if ((s = strrchr(source_direct, '/')) == NULL) - *source_direct='\0'; + *source_direct = '\0'; else *(s+1) = '\0'; @@ -413,6 +394,7 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) name_of_file[temp_length + 1] = ' '; /* space terminate */ /* set up name_length ??? */ } + return openable; } @@ -424,78 +406,8 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode) #define NO_MAKETEX #endif -/* the string program is unreferenced in DOS NO_MAKETEX */ - -static bool make_tex_file (string program) -{ -#ifdef NO_MAKETEX - return 0; -#else - char cmd[NAME_MAX + 1 + PATH_MAX + 1]; - unsigned cmd_len; - int ret; - unsigned i = 1; /* For copying from `name_of_file'. */ - - /* debugging by Clerk Ma, 20140331 */ - if (trace_flag) - { - sprintf(log_line, "Doing %s", program); - show_line(log_line, 0); - } - /* Wrap another sh around the invocation of the MakeTeX program, so we - can avoid `sh: MakeTeXTFM: not found' errors confusing the user. - We don't use fork/exec ourselves, since we'd have to call sh anyway - to interpret the script. */ -#ifdef MSDOS - strcpy (cmd, "command.com "); -#else - strcpy (cmd, "sh -c "); -#endif - -/* strcat (cmd, program); */ /* shrouded 93/Nov/20 */ - strcat (cmd, "Make"); -#ifndef MSDOS - strcat (cmd, "TeX"); -#endif - strcat (cmd, program); - cmd_len = strlen (cmd); - cmd[cmd_len++] = ' '; - - while (name_of_file[i] != ' ') - cmd[cmd_len++] = name_of_file[i++]; - - /* Add terminating null. */ - cmd[cmd_len] = 0; - - /* Don't show any output. */ -#ifdef MSDOS - strcat (cmd, "> nul"); /* ? 93/Nov/20 */ -#else - strcat (cmd, ">/dev/null 2>&1"); -#endif - -/* Run the command, and return whether or not it succeeded. */ - ret = system (cmd); - return ret == EXIT_SUCCESS_CODE; -#endif /* not NO_MAKE_TEX */ -} - #define TEXONLY -/* This is called by TeX if an \input resp. TFM file can't be opened. */ - -bool maketextex (void) /* called in tex3.c and tex8.c */ -{ -/* return make_tex_file ("MakeTeXTeX"); */ - return make_tex_file ("TeX"); -} - -bool maketextfm (void) /* called in tex3.c */ -{ -/* return make_tex_file ("MakeTeXTFM"); */ - return make_tex_file ("TFM"); -} - char *get_env_shroud (char *); /* defined in texmf.c */ /* char outputdirectory[PATH_MAX]; */ /* defined in local.c */ @@ -506,89 +418,6 @@ extern char * aux_directory; /* defined in local.c */ extern char * fmt_directory; /* defined in local.c */ extern char * pdf_directory; /* defined in local.c */ -#ifdef IGNORED -/* Try and figure out if can write to current directory */ -bool isitsafe (char *name) -{ -/* struct stat statbuf; */ /* debugging 94/Mar/2 */ -/* Can't test access on file, since fails if not exist */ -/* Can't test access on `nul', since always fails */ -/* Can test access on `.', but its true on locked diskette! */ -/* stat on directory always says read an write permission */ - return true; /* for now */ -} -#endif - -/* open_output moved to end to avoid pragma problems 96/Sep/15 */ - -/* used only in start_input in tex3.c, and in open_or_close_in in tex8.c */ -/* modified 97/June/5 to take null terminated (C) string */ - -#ifdef IGNORED -bool extensionirrelevantaux (char *base, char *suffix) -{ - bool ret; -/* make_c_string (&base); */ -/* base[nlen+1] = '\0'; */ /* null terminate */ -#ifdef MSDOS -/* In DOS, an extension is irrelevant if there already is an extension ! */ -/* MAY NEED TO REVISE IN WIN32 where we can have foo.bar.chomp.tex ??? */ - { /* simplification 1996/Jan/20 ??? */ - char *s, *t; - if ((s = strrchr (base, '.')) == NULL) - ret = 0; /* no extension */ - else - { - if ((t = strrchr (base, PATH_SEP)) != NULL || - (t = strrchr (base, '\\')) != NULL || - (t = strrchr (base, ':')) != NULL) - { - if (t > s) - ret = 0; /* last dot occurs in path - no extension */ - else - ret = 1; /* last dot occurs in file name itself */ - } - else - ret = 1; /* name not qualified and has dot */ - } - } -#else /* not MSDOS */ - { - char temp[PATH_MAX]; - strcpy (temp, base); - strcat (temp, "."); - strcat (temp, suffix); - ret = same_file_p (base, temp); - } -#endif /* end of not MSDOS */ -/* make_pascal_string (&base); */ -/* base[nlen+1] = ' '; */ /* space terminate */ - return ret; -} -#endif /* IGNORED */ - -/* Test if the Pascal string BASE concatenated with the extension - `.SUFFIX' is the same file as just BASE. SUFFIX is a C string. */ - -/* used in `start_input' (tex3.c) and open_or_close_in (tex8.c) */ -/* used to always return true, since in DOS can have only one extension */ -/* modified 98/Feb/7 to always return false */ - -bool extensionirrelevantp (unsigned char *base, int nlen, char *suffix) -{ -#ifdef IGNORED - bool ret; - base[nlen+1] = '\0'; /* null terminate */ - ret = extensionirrelevantaux(base+1, suffix); - base[nlen+1] = ' '; /* space terminate */ - return ret; -#endif - return false; -} - -/* #define a_close(f) if (f) { if (ferror (f)) {perror(""); exit(1);} } if (f) (void) fclose (f) */ -/* #define a_close(f) if (f) (void) check_fclose (f) */ - /* At least check for I/O error (such as disk full) when closing */ /* Would be better to check while writing - but this is better than nothing */ /* This is used for both input and output files, but never mind ... */ @@ -604,34 +433,24 @@ int check_fclose (FILE * f) { if (f == NULL) return 0; // sanity check + if (ferror(f) || fclose (f)) { perrormod("\n! I/O Error"); uexit (1); // ??? } + return 0; } /* open_output moved down here to avoid potential pragma problem */ -/* #pragma optimize ("g", off) *//* try and avoid compiler bug here */ - -/* Open an output file F either in the current directory or in - $TEXMFOUTPUT/F, if the environment variable `TEXMFOUTPUT' exists. - (Actually, this applies to the BibTeX output files, also, but - `TEXMFBIBOUTPUT' was just too long.) The filename is in the global - `name_of_file', as a Pascal string. We return whether or not the open - succeeded. If it did, the global `name_length' is set to the length - of the actual filename. */ - bool open_output (FILE **f, char *fopen_mode) { unsigned temp_length; name_of_file[name_length + 1] = '\0'; /* null terminate */ -/* reinsert '~' and ' ' in file names - 95/June/5 */ -/* done late to prevent problems with null_terminate / space_terminate */ if (pseudo_tilde != 0 || pseudo_space != 0) { retwiddle(name_of_file + 1); @@ -641,17 +460,12 @@ bool open_output (FILE **f, char *fopen_mode) /* 8 + 3 file names on Windows NT 95/Feb/20 */ if (shorten_file_name) { - check_short_name(name_of_file + 1); /* 95/Sep/26 */ + check_short_name(name_of_file + 1); } #endif -/* null_terminate (name_of_file + 1); */ /* Make the filename into a C string. */ - -/* if (debug_flag) try_and_open(name_of_file+1); */ /* debugging 94/Mar/20 */ - #ifdef MSDOS -/* write into user specified output directory if given on command line */ -/* following code added 1993/Dec/12 */ /* separated 1996/Jan/20 */ + if (prepend_path_if (name_of_file + 1, name_of_file + 1, ".dvi", (unsigned char *) dvi_directory) || prepend_path_if (name_of_file + 1, name_of_file + 1, ".log", (unsigned char *) log_directory) || prepend_path_if (name_of_file + 1, name_of_file + 1, ".aux", (unsigned char *) aux_directory) || @@ -666,11 +480,9 @@ bool open_output (FILE **f, char *fopen_mode) } #endif -/* name_length recomputed below so don't need to do it yet */ - if (open_trace_flag) { - sprintf(log_line, " Open `%s' for output ", name_of_file + 1); /* C string */ + sprintf(log_line, " Open `%s' for output ", name_of_file + 1); show_line(log_line, 0); } @@ -691,7 +503,7 @@ bool open_output (FILE **f, char *fopen_mode) { #ifdef BUILDNAMEDIRECT unsigned char temp_name[PATH_MAX]; - xconcat3((char *) temp_name, temp_dir, PATH_SEP_STRING, (char *)name_of_file + 1); + xconcat3((char *) temp_name, temp_dir, PATH_SEP_STRING, (char *) name_of_file + 1); #else /* string temp_name = concat3 (temp_dir, "/", name_of_file + 1); */ string temp_name = concat3 (temp_dir, PATH_SEP_STRING, name_of_file + 1); @@ -710,10 +522,7 @@ bool open_output (FILE **f, char *fopen_mode) } } -// show_line(name_of_file+1, 1); // debugging only -// New code to remember complete dvi_file name and log_file_name -// To remember for output at the end 2000 June 18 - if (strstr((char *)name_of_file + 1, ".dvi") != NULL) + if (strstr((char *) name_of_file + 1, ".dvi") != NULL) { if (qualified(name_of_file + 1)) *log_line = '\0'; @@ -722,10 +531,10 @@ bool open_output (FILE **f, char *fopen_mode) (void) _getcwd(log_line, sizeof(log_line)); strcat(log_line, PATH_SEP_STRING); } + strcat(log_line, (char*) name_of_file + 1); unixify(log_line); dvi_file_name = xstrdup(log_line); -// show_line(dvi_file_name, 1); // debugging only } else if (strstr((char *)name_of_file + 1, ".log") != NULL) { @@ -736,22 +545,17 @@ bool open_output (FILE **f, char *fopen_mode) (void) _getcwd(log_line, sizeof(log_line)); strcat(log_line, PATH_SEP_STRING); } + strcat(log_line, (char *) name_of_file + 1); unixify(log_line); log_file_name = xstrdup(log_line); -// show_line(log_file_name, 1); // debugging only } -/* Back into a Pascal string, but first get its length. */ + temp_length = strlen ((char *)name_of_file + 1); -/* space_terminate (name_of_file + 1); */ - name_of_file[temp_length+1] = ' '; /* space terminate */ + name_of_file[temp_length+1] = ' '; -/* Only set `name_length' if we succeeded. I'm not sure why. */ - if (*f) /* TEST ? 94/MAR/2 */ + if (*f) name_length = temp_length; return *f != NULL; -} - -/* #pragma optimize ("g",)*/ /* try and avoid compiler bug here */ -/* #pragma optimize ("", on) */ /* try and avoid compiler bug here */ +} \ No newline at end of file diff --git a/src/texsourc/ptex-base.ch b/src/texsourc/ptex-base.ch new file mode 100644 index 0000000..971c4b4 --- /dev/null +++ b/src/texsourc/ptex-base.ch @@ -0,0 +1,6859 @@ +% This is a change file for pTeX 3.4 +% By Sadayuki Tanaka and ASCII MEDIA WORKS. +% +% Thanks for : +% Ryoichi Kurasawa (us009185@interramp.com), +% Hisato Hamano, +% Hiroto Kagotani (kagotani@in.it.okayama-u.ac.jp), +% Takashi Kakiuchi (kakiuchi@sy6.isl.mei.co.jp), +% Yoichi Kawabata (kawabata@canon.co.jp), +% Makoto Kobayashi (makoto@lloem.fujidenki.co.jp), +% Yoshihiro Aoki (aoki@tokyo-shoseki-ptg.co.jp), +% Akira Kakuto (kakuto@fsci.fuk.kindai.ac.jp). +% Koich Inoue (inoue@ma.ns.musashi-tech.ac.jp). +% +% (??/??/87) RKS jTeX 2.9 -- j1.0 +% (??/??/89) RKS jTeX 2.93 -- j1.3 +% (12/ 9/89) H_2 pTeX 2.93 j1.3 p1.0.1 +% (12/??/89) RKS jTeX 2.95 -- j1.5 +% (12/??/89) RKS jTeX 2.99 -- j1.5 +% (02/02/90) RKS jTeX 2.99 -- j1.6 +% (04/16/90) H_2 pTeX 2.99 j1.6 p1.0.3 +% (09/14/90) H_2 pTeX 2.99 j1.6 p1.0.9 -- pre-release +% (10/29/90) H_2 Bug fix (p1.0.9a) +% (01/21/92) H_2 jTeX 2.99 - j1.7 +% (01/21/92) H_2 pTeX 2.99 j1.7 p1.0.9F +% (03/09/92) H_2 pTeX 2.99 j1.7 p1.0.9G jflag BUG +% (03/20/95) KN pTeX p2.0 (based on 3.1415) +% (09/08/95) KN pTeX p2.1 +% (09/20/95) KN pTeX p2.1.1 +% (11/21/95) KN pTeX p2.1.4 +% (08/27/97) KN pTeX p2.1.5 (based on 3.14159) +% (02/26/98) KN pTeX p2.1.6 +% (03/19/98) KN pTeX p2.1.7 +% (03/26/98) KN pTeX p2.1.8 (Web2c 7.2) +% (02/21/2000) KN pTeX p2.1.9 (Web2c 7.3.1) +% (11/13/2000) KN pTeX p2.1.10 +% (05/22/2001) KN pTeX p2.1.11 +% (03/10/2001) KN pTeX p3.0 (modified BSD licence) +% (09/02/2004) ST pTeX p3.1.4 +% (11/29/2004) KN pTeX p3.1.5 +% (12/13/2004) KN pTeX p3.1.8 +% (10/17/2005) ST pTeX p3.1.9 +% (07/18/2006) ST pTeX p3.1.10 +% (08/17/2009) ST pTeX p3.1.11 +% (05/23/2010) AK Bug fix by Hironori Kitagawa. +% (31/12/2010) AK Bug fix and accent Kanji by Hironori Kitagawa. +% (19/01/2011) PB Let \lastkern etc act through disp node. +% (15/04/2011) PB pTeX p3.2 Add \ifdbox and \ifddir +% (2011-08-18) PB Bug fix by Hironori Kitagawa. +% (2012-05-11) PB pTeX p3.3 +% (2013-04-09) PB pTeX p3.4 (TL 2013) +% +@x [1.2] l.200 - pTeX: +@d banner==TeX_banner +@d banner_k==TeX_banner_k +@y +@d pTeX_version_string=='-p3.4' {current p\TeX\ version} +@# +@d pTeX_banner=='This is pTeX, Version 3.1415926',pTeX_version_string +@d pTeX_banner_k==pTeX_banner + {printed when p\TeX\ starts} +@# +@d banner==pTeX_banner +@d banner_k==pTeX_banner_k +@z + +@x [2.??] l.586 - pTeX: +@!ASCII_code=0..255; {eight-bit numbers} +@y +@!ASCII_code=0..255; {eight-bit numbers} +@!KANJI_code=0..65535; {sixteen-bit numbers} +@z + +@x [3.??] l.870 - pTeX: +@!eight_bits=0..255; {unsigned one-byte quantity} +@y +@!eight_bits=0..255; {unsigned one-byte quantity} +@!sixteen_bits=0..65535; {unsigned two-bytes quantity} +@z + +@x [3.??] l.891 - pTeX: +@ All of the file opening functions are defined in C. +@y +@ All of the file opening functions are defined in C. + +@ Kanji code handling. +@z + +@x [4.47] l.1325 - pTeX: +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} +label done,exit; +var k,@!l:0..255; {small indices or counters} +@y +@!init function get_strings_started:boolean; {initializes the string pool, + but returns |false| if something goes wrong} +label done,exit; +var k,@!l:KANJI_code; {small indices or counters} +@z + +@x [4.49] l.1384 - pTeX: +@= + (k<" ")or(k>"~") +@y +@= + not (ismultiprn(k) or xprn[k]) +@z + +@x [5.54] l.1514 - pTeX: Global variables +@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for + pseudoprinting} +@y +@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for + pseudoprinting} +@!trick_buf2:array[0..ssup_error_line] of 0..2; {pTeX: buffer for KANJI} +@!kcode_pos: 0..2; {pTeX: denotes whether first byte or second byte of KANJI} +@z + +@x [5.55] l.1519 - pTeX: Initialize the kcode_pos +@ @= +selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; +@y +@ @= +selector:=term_only; tally:=0; term_offset:=0; file_offset:=0; +kcode_pos:=0; +@z + +@x [5.57] l.1538 - pTeX: kcode_pos +procedure print_ln; {prints an end-of-line} +begin case selector of +term_and_log: begin wterm_cr; wlog_cr; + term_offset:=0; file_offset:=0; + end; +log_only: begin wlog_cr; file_offset:=0; + end; +term_only: begin wterm_cr; term_offset:=0; + end; +no_print,pseudo,new_string: do_nothing; +othercases write_ln(write_file[selector]) +endcases;@/ +@y +procedure print_ln; {prints an end-of-line} +begin case selector of +term_and_log: begin + if kcode_pos=1 then begin wterm(' '); wlog(' '); end; + wterm_cr; wlog_cr; term_offset:=0; file_offset:=0; + end; +log_only: begin if kcode_pos=1 then wlog(' '); + wlog_cr; file_offset:=0; + end; +term_only: begin if kcode_pos=1 then wterm(' '); + wterm_cr; term_offset:=0; + end; +no_print,pseudo,new_string: do_nothing; +othercases write_ln(write_file[selector]) +endcases;@/ +kcode_pos:=0; +@z + +@x [5.58] l.1557 - pTeX: kcode_pos, trick_buf2 +procedure print_char(@!s:ASCII_code); {prints a single character} +label exit; +begin if @ then + if selector then + if selector=max_print_line-1 then + begin wlog_cr; file_offset:=0; + end; + if (selector=term_and_log)or(selector=term_only) then + if term_offset>=max_print_line-1 then + begin wterm_cr; term_offset:=0; + end; + end +else kcode_pos:=0; +case selector of +term_and_log: begin wterm(xchr[s]); incr(term_offset); + if term_offset=max_print_line then + begin wterm_cr; term_offset:=0; + end; + wlog(xchr[s]); incr(file_offset); + if file_offset=max_print_line then + begin wlog_cr; file_offset:=0; + end; + end; +log_only: begin wlog(xchr[s]); incr(file_offset); + if file_offset=max_print_line then print_ln; + end; +term_only: begin wterm(xchr[s]); incr(term_offset); + if term_offset=max_print_line then print_ln; + end; +no_print: do_nothing; +pseudo: if tally=str_ptr then s:="???" {this can't happen} +@.???@> +else if s<256 then + if s<0 then s:="???" {can't happen} + else begin if selector>pseudo then + begin print_char(s); return; {internal strings are not expanded} + end; + if (@) then + if selector=str_ptr then s:="???" {this can't happen} +@.???@> +else if s<256 then + if s<0 then s:="???" {can't happen} + else begin if selector>pseudo then + begin print_char(s); return; {internal strings are not expanded} + end; + if (@) then + if selector= +if src_specials_p or file_line_error_style_p or parse_first_line_p then + wterm(banner_k) +else + wterm(banner); +@y +@= +if src_specials_p or file_line_error_style_p or parse_first_line_p then + wterm(banner_k) +else + wterm(banner); + wterm(' ('); + wterm(conststringcast(get_enc_string)); + wterm(')'); +@z + +@x [8.111] l.2436 - pTeX: check hi/ho ********************* + (mem_top+sup_main_memory>=max_halfword) then bad:=14; +@y + (mem_top+sup_main_memory>=max_halfword)or@| + (hi(0)<>0) then bad:=14; +@z + +@x [8.112] l.2450 - pTeX: hi/ho +sufficiently large. +@y +sufficiently large and this is required for p\TeX. +@z + +@x [8.112] l.2588 - pTeX: +@d ho(#)==# {to take a sixteen-bit item from a halfword} +@y +@d ho(#)==# {to take a sixteen-bit item from a halfword} +@d KANJI(#)==# {pTeX: to output a KANJI code} +@d tokanji(#)==# {pTeX: to take a KANJI code from a halfword} +@d tonum(#)==# {pTeX: to put a KANJI code into a halfword} +@z + +@x [10.135] l.2895 - pTeX: box_dir +|fil|, |fill|, or |filll|). The |subtype| field is not used. +@y +|fil|, |fill|, or |filll|). The |subtype| field is not used in \TeX. +In p\TeX\ the |subtype| field records the box direction |box_dir|. +@z + +@x [10.135] l.2897 - pTeX: box_dir, space_ptr, xspace_ptr +@d hlist_node=0 {|type| of hlist nodes} +@d box_node_size=7 {number of words to allocate for a box node} +@d width_offset=1 {position of |width| field in a box node} +@d depth_offset=2 {position of |depth| field in a box node} +@d height_offset=3 {position of |height| field in a box node} +@d width(#) == mem[#+width_offset].sc {width of the box, in sp} +@d depth(#) == mem[#+depth_offset].sc {depth of the box, in sp} +@d height(#) == mem[#+height_offset].sc {height of the box, in sp} +@d shift_amount(#) == mem[#+4].sc {repositioning distance, in sp} +@d list_offset=5 {position of |list_ptr| field in a box node} +@d list_ptr(#) == link(#+list_offset) {beginning of the list inside the box} +@d glue_order(#) == subtype(#+list_offset) {applicable order of infinity} +@d glue_sign(#) == type(#+list_offset) {stretching or shrinking} +@d normal=0 {the most common case when several cases are named} +@d stretching = 1 {glue setting applies to the stretch components} +@d shrinking = 2 {glue setting applies to the shrink components} +@d glue_offset = 6 {position of |glue_set| in a box node} +@d glue_set(#) == mem[#+glue_offset].gr + {a word of type |glue_ratio| for glue setting} +@y +@d hlist_node=0 {|type| of hlist nodes} +@d box_node_size=8 {number of words to allocate for a box node} +@# +@d box_dir(#) == (qo(subtype(#))) {direction of a box} +@d set_box_dir(#) == subtype(#):=set_box_dir_end +@d set_box_dir_end(#) == qi(#) +@# +@d dir_default = 0 {direction of the box, default Left to Right} +@d dir_dtou = 1 {direction of the box, Bottom to Top} +@d dir_tate = 3 {direction of the box, Top to Bottom} +@d dir_yoko = 4 {direction of the box, equal default} +@d any_dir == dir_yoko,dir_tate,dir_dtou +@# +@d width_offset=1 {position of |width| field in a box node} +@d depth_offset=2 {position of |depth| field in a box node} +@d height_offset=3 {position of |height| field in a box node} +@d width(#) == mem[#+width_offset].sc {width of the box, in sp} +@d depth(#) == mem[#+depth_offset].sc {depth of the box, in sp} +@d height(#) == mem[#+height_offset].sc {height of the box, in sp} +@d shift_amount(#) == mem[#+4].sc {repositioning distance, in sp} +@d list_offset=5 {position of |list_ptr| field in a box node} +@d list_ptr(#) == link(#+list_offset) {beginning of the list inside the box} +@d glue_order(#) == subtype(#+list_offset) {applicable order of infinity} +@d glue_sign(#) == type(#+list_offset) {stretching or shrinking} +@d normal=0 {the most common case when several cases are named} +@d stretching = 1 {glue setting applies to the stretch components} +@d shrinking = 2 {glue setting applies to the shrink components} +@d glue_offset = 6 {position of |glue_set| in a box node} +@d glue_set(#) == mem[#+glue_offset].gr + {a word of type |glue_ratio| for glue setting} +@d space_offset = 7 {position of |glue_set| in a box node} +@d space_ptr(#) == link(#+space_offset) +@d xspace_ptr(#) == info(#+space_offset) +@z + +@x [10.136] l.3037 - pTeX: space_ptr, xspace_ptr +width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; +glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); +@y +width(p):=0; depth(p):=0; height(p):=0; shift_amount(p):=0; list_ptr(p):=null; +glue_sign(p):=normal; glue_order(p):=normal; set_glue_ratio_zero(glue_set(p)); +space_ptr(p):=zero_glue; xspace_ptr(p):=zero_glue; +add_glue_ref(zero_glue); add_glue_ref(zero_glue); +@z + +@x [10.137] l.3045 - pTeX: direction change node +@d vlist_node=1 {|type| of vlist nodes} +@y +@d vlist_node=1 {|type| of vlist nodes} + +@ A |dir_node| stands for direction change. + +@d dir_node=2 {|type| of dir nodes} + +@p function new_dir_node(b:pointer; dir:eight_bits):pointer; +var p:pointer; {the new node} +begin if type(b)>vlist_node then confusion("new_dir_node:not box"); +p:=new_null_box; type(p):=dir_node; set_box_dir(p)(dir); +case box_dir(b) of + dir_yoko: @; + dir_tate: @; + dir_dtou: @; + othercases confusion("new_dir_node:illegal dir"); +endcases; +link(b):=null; list_ptr(p):=b; +new_dir_node:=p; +end; + +@ @= + case dir of + dir_tate: begin width(p):=height(b)+depth(b); + depth(p):=width(b)/2; height(p):=width(b)-depth(p); + end; + dir_dtou: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + othercases confusion("new_dir_node:y->?"); + endcases + +@ @= + case dir of + dir_yoko: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + dir_dtou: begin width(p):=width(b); + depth(p):=height(b); height(p):=depth(b); + end; + othercases confusion("new_dir_node:t->?"); + endcases + +@ @= + case dir of + dir_yoko: begin width(p):=height(b)+depth(b); + depth(p):=0; height(p):=width(b); + end; + dir_tate: begin width(p):=width(b); + depth(p):=height(b); height(p):=depth(b); + end; + othercases confusion("new_dir_node:d->?"); + endcases +@z + +@x [10.138] l.3054 - pTeX: renumber rule_node +@d rule_node=2 {|type| of rule nodes} +@y +@d rule_node=3 {|type| of rule nodes} +@z + +@x [10.140] l.3083 - pTeX: renumber ins_node, add ins_dir field +@d ins_node=3 {|type| of insertion nodes} +@d ins_node_size=5 {number of words to allocate for an insertion} +@d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} +@d ins_ptr(#)==info(#+4) {the vertical list to be inserted} +@d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} +@y +@d ins_node=4 {|type| of insertion nodes} +@d ins_node_size=6 {number of words to allocate for an insertion} +@d float_cost(#)==mem[#+1].int {the |floating_penalty| to be used} +@d ins_ptr(#)==info(#+4) {the vertical list to be inserted} +@d split_top_ptr(#)==link(#+4) {the |split_top_skip| to be used} +@d ins_dir(#)==subtype(#+5) {direction of |ins_node|} +@z + +@x [10.141] l.3089 - pTeX: disp_node +@ A |mark_node| has a |mark_ptr| field that points to the reference count +@y +@ A |disp_node| has a |disp_dimen| field that points to the displacement +distance of the baselineshift between Latin characters and Kanji chatacters. + +@d disp_node=5 {|type| of a displace node} +@d disp_dimen(#)==mem[#+1].sc + +@ A |mark_node| has a |mark_ptr| field that points to the reference count +@z + +@x [10.140] l.3095 - pTeX: renumber nodes +@d mark_node=4 {|type| of a mark node} +@y +@d mark_node=6 {|type| of a mark node} +@z + +@x [10.141] l.3105 - pTeX: renumber nodes +@d adjust_node=5 {|type| of an adjust node} +@y +@d adjust_node=7 {|type| of an adjust node} +@z + +@x [10.142] l.3122 - pTeX: renumber nodes +@d ligature_node=6 {|type| of a ligature node} +@y +@d ligature_node=8 {|type| of a ligature node} +@z + +@x [10.145] l.3163 - pTeX: renumber nodes +@d disc_node=7 {|type| of a discretionary node} +@y +@d disc_node=9 {|type| of a discretionary node} +@z + +@x [10.146] l.3191 - pTeX: renumber nodes +@d whatsit_node=8 {|type| of special extension nodes} +@y +@d whatsit_node=10 {|type| of special extension nodes} +@z + +@x [10.147] l.3198 - pTeX: renumber nodes +@d math_node=9 {|type| of a math node} +@y +@d math_node=11 {|type| of a math node} +@z + +@x [10.150] l.3244 - pTeX: renumber nodes +@d glue_node=10 {|type| of node that points to a glue specification} +@y +@d glue_node=12 {|type| of node that points to a glue specification} +@z + +@x [10.155] l.3342 - pTeX: renumber nodes +@d kern_node=11 {|type| of a kern node} +@d explicit=1 {|subtype| of kern nodes from \.{\\kern} and \.{\\/}} +@d acc_kern=2 {|subtype| of kern nodes from accents} +@y +@d kern_node=13 {|type| of a kern node} +@d explicit=1 {|subtype| of kern nodes from \.{\\kern}} +@d acc_kern=2 {|subtype| of kern nodes from accents} +@d ita_kern=3 {|subtype| of kern nodes from \.{\\/}} +@z + +@x [10.157] l.3363 - pTeX: renumber nodes +@d penalty_node=12 {|type| of a penalty node} +@y +@d penalty_node=14 {|type| of a penalty node} +@d widow_pena=1 {|subtype| of penalty nodes from \.{\\jchrwidowpenalty}} +@d kinsoku_pena=2 {|subtype| of penalty nodes from kinsoku} +@z + +@x [10.159] l.3392 - pTeX: renumber nodes +@d unset_node=13 {|type| for an unset node} +@y +@d unset_node=15 {|type| for an unset node} +@z + +@x [10.160] l.3397 - pTeX: renumber nodes +@ In fact, there are still more types coming. When we get to math formula +processing we will see that a |style_node| has |type=14|; and a number +of larger type codes will also be defined, for use in math mode only. +@y +@ In fact, there are still more types coming. When we get to math formula +processing we will see that a |style_node| has |type=16|; and a number +of larger type codes will also be defined, for use in math mode only. +@z + +@x [12.174] l.3662 - pTeX: print KANJI + print_ASCII(qo(character(p))); +@y + if font_dir[font(p)]<>dir_default then + begin p:=link(p); print_kanji(info(p)); + end + else print_ASCII(qo(character(p))); +@z + +@x [12.175] l.3672 - pTeX: Print a short indication of dir_nodes. +hlist_node,vlist_node,ins_node,whatsit_node,mark_node,adjust_node, + unset_node: print("[]"); +@y +hlist_node,vlist_node,dir_node,ins_node,whatsit_node, + mark_node,adjust_node,unset_node: print("[]"); +@z + +@x [12.176] l.3698 - pTeX: print KANJI. + print_char(" "); print_ASCII(qo(character(p))); +@y + print_char(" "); + if font_dir[font(p)]<>dir_default then + begin p:=link(p); print_kanji(info(p)); + end + else print_ASCII(qo(character(p))); +@z + +@x [12.183] l.3815 - pTeX: display char_node and disp_node. +if is_char_node(p) then print_font_and_char(p) +else case type(p) of + hlist_node,vlist_node,unset_node: @; + rule_node: @; + ins_node: @; + whatsit_node: @; +@y +if is_char_node(p) then + begin print_font_and_char(p); + if font_dir[font(p)]<>dir_default then p:=link(p) + end +else case type(p) of + hlist_node,vlist_node,dir_node,unset_node: @; + rule_node: @; + ins_node: @; + whatsit_node: @; + disp_node: begin print_esc("displace "); print_scaled(disp_dimen(p)); + end; +@z + +@x [12.184] l.3833 - pTeX: display dir_node. +@ @= +begin if type(p)=hlist_node then print_esc("h") +else if type(p)=vlist_node then print_esc("v") +else print_esc("unset"); +@y +@ @= +begin case type(p) of + hlist_node: print_esc("h"); + vlist_node: print_esc("v"); + dir_node: print_esc("dir"); + othercases print_esc("unset") + endcases@/; +@z +@x [12.184] l.3842 - pTeX: display dir_node. + if shift_amount(p)<>0 then + begin print(", shifted "); print_scaled(shift_amount(p)); + end; +@y + if shift_amount(p)<>0 then + begin print(", shifted "); print_scaled(shift_amount(p)); + end; +@z +@x [12.184] l.3845 - pTeX: display dir_node. + end; +@y + if box_dir(p)<>dir_default then + begin print(", "); print_direction(box_dir(p)); + end; + end; +@z + +@x [12.188] l.3896 - pTeX: Display insertion and ins_dir. +@ @= +begin print_esc("insert"); print_int(qo(subtype(p))); +print(", natural size "); print_scaled(height(p)); +@y +@ @= +begin print_esc("insert"); print_int(qo(subtype(p))); +print_dir(ins_dir(p)); +print(", natural size "); print_scaled(height(p)); +@z + +@x [12.194] l.3961 - pTeX: Display penalty usage +@ @= +begin print_esc("penalty "); print_int(penalty(p)); +end +@y +@ @= +begin print_esc("penalty "); print_int(penalty(p)); +if subtype(p)=widow_pena then print("(for \jchrwidowpenalty)") +else if subtype(p)=kinsoku_pena then print("(for kinsoku)"); +end +@z + +@x [13.202] l.4043 - pTeX: dir_node, disp_node + hlist_node,vlist_node,unset_node: begin flush_node_list(list_ptr(p)); + free_node(p,box_node_size); goto done; + end; +@y + hlist_node,vlist_node,dir_node,unset_node: + begin flush_node_list(list_ptr(p)); + fast_delete_glue_ref(space_ptr(p)); + fast_delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); goto done; + end; +@z + +@x [13.202] l.4056 - pTeX: + kern_node,math_node,penalty_node: do_nothing; +@y + disp_node, + kern_node,math_node,penalty_node: do_nothing; +@z + +@x [14.206] l.4121 - pTeX: space_ptr, xspace_ptr, dir_node, disp_node +@ @= +@y +@ @= +@z +@x [14.206] l.4123 +hlist_node,vlist_node,unset_node: begin r:=get_node(box_node_size); + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last two words} +@y +dir_node, +hlist_node,vlist_node,unset_node: begin r:=get_node(box_node_size); + mem[r+7]:=mem[p+7]; + mem[r+6]:=mem[p+6]; mem[r+5]:=mem[p+5]; {copy the last three words} + add_glue_ref(space_ptr(r)); add_glue_ref(xspace_ptr(r)); +@z +@x [14.206] l.4130 +ins_node: begin r:=get_node(ins_node_size); mem[r+4]:=mem[p+4]; + add_glue_ref(split_top_ptr(p)); + ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} + words:=ins_node_size-1; + end; +@y +ins_node: begin r:=get_node(ins_node_size); + mem[r+5]:=mem[p+5]; mem[r+4]:=mem[p+4]; + add_glue_ref(split_top_ptr(p)); + ins_ptr(r):=copy_node_list(ins_ptr(p)); {this affects |mem[r+4]|} + words:=ins_node_size-2; + end; +@z + +@x [14.206] l.4140 - pTeX: disp_node +kern_node,math_node,penalty_node: begin r:=get_node(small_node_size); +@y +disp_node, +kern_node,math_node,penalty_node: begin r:=get_node(small_node_size); +@z + +@x [15.207] l.4201 - pTeX: Add kanji, kana, other_kchar category codes. +@d max_char_code=15 {largest catcode for individual characters} +@y +@d kanji=16 {kanji} +@d kana=17 {hiragana, katakana, alphabet} +@d other_kchar=18 {kanji codes} +@d max_char_code=18 {largest catcode for individual characters} +@z + +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d char_num=16 {character specified numerically ( \.{\\char} )} +@d math_char_num=17 {explicit math code ( \.{\\mathchar} )} +@d mark=18 {mark definition ( \.{\\mark} )} +@d xray=19 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} +@d make_box=20 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} +@d hmove=21 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} +@d vmove=22 {vertical motion ( \.{\\raise}, \.{\\lower} )} +@d un_hbox=23 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} +@d un_vbox=24 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} +@y +@d char_num=max_char_code+1 {character specified numerically ( \.{\\char} )} +@d math_char_num=char_num+1 {explicit math code ( \.{\\mathchar} )} +@d mark=math_char_num+1 {mark definition ( \.{\\mark} )} +@d xray=mark+1 {peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~)} +@d make_box=xray+1 {make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~)} +@d hmove=make_box+1 {horizontal motion ( \.{\\moveleft}, \.{\\moveright} )} +@d vmove=hmove+1 {vertical motion ( \.{\\raise}, \.{\\lower} )} +@d un_hbox=vmove+1 {unglue a box ( \.{\\unhbox}, \.{\\unhcopy} )} +@d un_vbox=un_hbox+1 {unglue a box ( \.{\\unvbox}, \.{\\unvcopy} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d remove_item=25 {nullify last item ( \.{\\unpenalty}, + \.{\\unkern}, \.{\\unskip} )} +@d hskip=26 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} +@d vskip=27 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} +@d mskip=28 {math glue ( \.{\\mskip} )} +@d kern=29 {fixed space ( \.{\\kern})} +@d mkern=30 {math kern ( \.{\\mkern} )} +@d leader_ship=31 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} +@d halign=32 {horizontal table alignment ( \.{\\halign} )} +@d valign=33 {vertical table alignment ( \.{\\valign} )} +@y +@d remove_item=un_vbox+1 {nullify last item ( \.{\\unpenalty}, + \.{\\unkern}, \.{\\unskip} )} +@d hskip=remove_item+1 {horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~)} +@d vskip=hskip+1 {vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~)} +@d mskip=vskip+1 {math glue ( \.{\\mskip} )} +@d kern=mskip+1 {fixed space ( \.{\\kern})} +@d mkern=kern+1 {math kern ( \.{\\mkern} )} +@d leader_ship=mkern+1 {use a box ( \.{\\shipout}, \.{\\leaders}, etc.~)} +@d halign=leader_ship+1 {horizontal table alignment ( \.{\\halign} )} +@d valign=halign+1 {vertical table alignment ( \.{\\valign} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d no_align=34 {temporary escape from alignment ( \.{\\noalign} )} +@d vrule=35 {vertical rule ( \.{\\vrule} )} +@d hrule=36 {horizontal rule ( \.{\\hrule} )} +@d insert=37 {vlist inserted in box ( \.{\\insert} )} +@d vadjust=38 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} +@d ignore_spaces=39 {gobble |spacer| tokens ( \.{\\ignorespaces} )} +@d after_assignment=40 {save till assignment is done ( \.{\\afterassignment} )} +@d after_group=41 {save till group is done ( \.{\\aftergroup} )} +@d break_penalty=42 {additional badness ( \.{\\penalty} )} +@d start_par=43 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} +@d ital_corr=44 {italic correction ( \.{\\/} )} +@d accent=45 {attach accent in text ( \.{\\accent} )} +@d math_accent=46 {attach accent in math ( \.{\\mathaccent} )} +@d discretionary=47 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} +@d eq_no=48 {equation number ( \.{\\eqno}, \.{\\leqno} )} +@d left_right=49 {variable delimiter ( \.{\\left}, \.{\\right} )} +@y +@d no_align=valign+1 {temporary escape from alignment ( \.{\\noalign} )} +@d vrule=no_align+1 {vertical rule ( \.{\\vrule} )} +@d hrule=vrule+1 {horizontal rule ( \.{\\hrule} )} +@d insert=hrule+1 {vlist inserted in box ( \.{\\insert} )} +@d vadjust=insert+1 {vlist inserted in enclosing paragraph ( \.{\\vadjust} )} +@d ignore_spaces=vadjust+1 {gobble |spacer| tokens ( \.{\\ignorespaces} )} +@d after_assignment=ignore_spaces+1 {save till assignment is done ( \.{\\afterassignment} )} +@d after_group=after_assignment+1 {save till group is done ( \.{\\aftergroup} )} +@d break_penalty=after_group+1 {additional badness ( \.{\\penalty} )} +@d start_par=break_penalty+1 {begin paragraph ( \.{\\indent}, \.{\\noindent} )} +@d ital_corr=start_par+1 {italic correction ( \.{\\/} )} +@d accent=ital_corr+1 {attach accent in text ( \.{\\accent} )} +@d math_accent=accent+1 {attach accent in math ( \.{\\mathaccent} )} +@d discretionary=math_accent+1 {discretionary texts ( \.{\\-}, \.{\\discretionary} )} +@d eq_no=discretionary+1 {equation number ( \.{\\eqno}, \.{\\leqno} )} +@d left_right=eq_no+1 {variable delimiter ( \.{\\left}, \.{\\right} )} +@z +@x [15.208] l.4207 - pTeX: Add inhibit_glue, chg_dir. +@d math_comp=50 {component of formula ( \.{\\mathbin}, etc.~)} +@d limit_switch=51 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} +@d above=52 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} +@d math_style=53 {style specification ( \.{\\displaystyle}, etc.~)} +@d math_choice=54 {choice specification ( \.{\\mathchoice} )} +@d non_script=55 {conditional math glue ( \.{\\nonscript} )} +@d vcenter=56 {vertically center a vbox ( \.{\\vcenter} )} +@d case_shift=57 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} +@d message=58 {send to user ( \.{\\message}, \.{\\errmessage} )} +@d extension=59 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} +@d in_stream=60 {files for reading ( \.{\\openin}, \.{\\closein} )} +@d begin_group=61 {begin local grouping ( \.{\\begingroup} )} +@d end_group=62 {end local grouping ( \.{\\endgroup} )} +@d omit=63 {omit alignment template ( \.{\\omit} )} +@d ex_space=64 {explicit space ( \.{\\\ } )} +@d no_boundary=65 {suppress boundary ligatures ( \.{\\noboundary} )} +@d radical=66 {square root and similar signs ( \.{\\radical} )} +@d end_cs_name=67 {end control sequence ( \.{\\endcsname} )} +@d min_internal=68 {the smallest code that can follow \.{\\the}} +@d char_given=68 {character code defined by \.{\\chardef}} +@d math_given=69 {math code defined by \.{\\mathchardef}} +@d last_item=70 {most recent item ( \.{\\lastpenalty}, + \.{\\lastkern}, \.{\\lastskip} )} +@d max_non_prefixed_command=70 {largest command code that can't be \.{\\global}} +@y +@d math_comp=left_right+1 {component of formula ( \.{\\mathbin}, etc.~)} +@d limit_switch=math_comp+1 {diddle limit conventions ( \.{\\displaylimits}, etc.~)} +@d above=limit_switch+1 {generalized fraction ( \.{\\above}, \.{\\atop}, etc.~)} +@d math_style=above+1 {style specification ( \.{\\displaystyle}, etc.~)} +@d math_choice=math_style+1 {choice specification ( \.{\\mathchoice} )} +@d non_script=math_choice+1 {conditional math glue ( \.{\\nonscript} )} +@d vcenter=non_script+1 {vertically center a vbox ( \.{\\vcenter} )} +@d case_shift=vcenter+1 {force specific case ( \.{\\lowercase}, \.{\\uppercase}~)} +@d message=case_shift+1 {send to user ( \.{\\message}, \.{\\errmessage} )} +@d extension=message+1 {extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~)} +@d in_stream=extension+1 {files for reading ( \.{\\openin}, \.{\\closein} )} +@d begin_group=in_stream+1 {begin local grouping ( \.{\\begingroup} )} +@d end_group=begin_group+1 {end local grouping ( \.{\\endgroup} )} +@d omit=end_group+1 {omit alignment template ( \.{\\omit} )} +@d ex_space=omit+1 {explicit space ( \.{\\\ } )} +@d no_boundary=ex_space+1 {suppress boundary ligatures ( \.{\\noboundary} )} +@d radical=no_boundary+1 {square root and similar signs ( \.{\\radical} )} +@d end_cs_name=radical+1 {end control sequence ( \.{\\endcsname} )} +@d min_internal=end_cs_name+1 {the smallest code that can follow \.{\\the}} +@d char_given=min_internal {character code defined by \.{\\chardef}} +@d math_given=char_given+1 {math code defined by \.{\\mathchardef}} +@d last_item=math_given+1 {most recent item ( \.{\\lastpenalty}, + \.{\\lastkern}, \.{\\lastskip} )} +@d inhibit_glue=last_item+1 {inhibit adjust glue ( \.{\\inhibitglue} )} +@d chg_dir=inhibit_glue+1 {change dir mode by \.{\\tate}, \.{\\yoko}} +@d max_non_prefixed_command=chg_dir {largest command code that can't be \.{\\global}} +@z + +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d toks_register=71 {token list register ( \.{\\toks} )} +@d assign_toks=72 {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} +@d assign_int=73 {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} +@d assign_dimen=74 {user-defined length ( \.{\\hsize}, etc.~)} +@d assign_glue=75 {user-defined glue ( \.{\\baselineskip}, etc.~)} +@d assign_mu_glue=76 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} +@d assign_font_dimen=77 {user-defined font dimension ( \.{\\fontdimen} )} +@d assign_font_int=78 {user-defined font integer ( \.{\\hyphenchar}, + \.{\\skewchar} )} +@d set_aux=79 {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} +@d set_prev_graf=80 {specify state info ( \.{\\prevgraf} )} +@d set_page_dimen=81 {specify state info ( \.{\\pagegoal}, etc.~)} +@d set_page_int=82 {specify state info ( \.{\\deadcycles}, +@y +@d toks_register=max_non_prefixed_command+1 {token list register ( \.{\\toks} )} +@d assign_toks=toks_register+1 + {special token list ( \.{\\output}, \.{\\everypar}, etc.~)} +@d assign_int=assign_toks+1 + {user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~)} +@d assign_dimen=assign_int+1 {user-defined length ( \.{\\hsize}, etc.~)} +@d assign_glue=assign_dimen+1 {user-defined glue ( \.{\\baselineskip}, etc.~)} +@d assign_mu_glue=assign_glue+1 {user-defined muglue ( \.{\\thinmuskip}, etc.~)} +@d assign_font_dimen=assign_mu_glue+1 + {user-defined font dimension ( \.{\\fontdimen} )} +@d assign_font_int=assign_font_dimen+1 + {user-defined font integer ( \.{\\hyphenchar}, \.{\\skewchar} )} +@d assign_kinsoku=assign_font_int+1 + {user-defined kinsoku character ( \.{\\prebreakpenalty}, + \.{\\postbreakpenalty} )} +@d assign_inhibit_xsp_code=assign_kinsoku+1 + {user-defined inhibit xsp character ( \.{\\inhibitxspcode} )} +@d set_kansuji_char=assign_inhibit_xsp_code+1 + {user-defined kansuji character ( \.{\\kansujichar} )} +@d set_aux=set_kansuji_char+1 + {specify state info ( \.{\\spacefactor}, \.{\\prevdepth} )} +@d set_prev_graf=set_aux+1 {specify state info ( \.{\\prevgraf} )} +@d set_page_dimen=set_prev_graf+1 {specify state info ( \.{\\pagegoal}, etc.~)} +@d set_page_int=set_page_dimen+1 {specify state info ( \.{\\deadcycles}, +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d set_box_dimen=83 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} +@d set_shape=84 {specify fancy paragraph shape ( \.{\\parshape} )} +@y +@d set_box_dimen=set_page_int+1 {change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )} +@d set_shape=set_box_dimen+1 {specify fancy paragraph shape ( \.{\\parshape} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d def_code=85 {define a character code ( \.{\\catcode}, etc.~)} +@d def_family=86 {declare math fonts ( \.{\\textfont}, etc.~)} +@d set_font=87 {set current font ( font identifiers )} +@d def_font=88 {define a font file ( \.{\\font} )} +@d register=89 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} +@d max_internal=89 {the largest code that can follow \.{\\the}} +@d advance=90 {advance a register or parameter ( \.{\\advance} )} +@d multiply=91 {multiply a register or parameter ( \.{\\multiply} )} +@d divide=92 {divide a register or parameter ( \.{\\divide} )} +@d prefix=93 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} +@y +@d def_code=set_shape+1 {define a character code ( \.{\\catcode}, etc.~)} +@d def_family=def_code+1 {declare math fonts ( \.{\\textfont}, etc.~)} +@d set_font=def_family+1 {set current font ( font identifiers )} +@d def_font=set_font+1 {define a font file ( \.{\\font} )} +@d def_jfont=def_font+1 {define a font file ( \.{\\jfont} )} +@d def_tfont=def_jfont+1 {define a font file ( \.{\\tfont} )} +@d register=def_tfont+1 {internal register ( \.{\\count}, \.{\\dimen}, etc.~)} +@d max_internal=register {the largest code that can follow \.{\\the}} +@d advance=max_internal+1 {advance a register or parameter ( \.{\\advance} )} +@d multiply=advance+1 {multiply a register or parameter ( \.{\\multiply} )} +@d divide=multiply+1 {divide a register or parameter ( \.{\\divide} )} +@d prefix=divide+1 {qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d let=94 {assign a command code ( \.{\\let}, \.{\\futurelet} )} +@d shorthand_def=95 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} + {or \.{\\charsubdef}} +@d read_to_cs=96 {read into a control sequence ( \.{\\read} )} +@y +@d let=prefix+1 {assign a command code ( \.{\\let}, \.{\\futurelet} )} +@d shorthand_def=let+1 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)} + {or \.{\\charsubdef}} +@d read_to_cs=shorthand_def+1 {read into a control sequence ( \.{\\read} )} +@z +@x [15.209] l.4272 - pTeX: def_jfont, def_tfont, set_auto_spacing +@d def=97 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} +@d set_box=98 {set a box ( \.{\\setbox} )} +@d hyph_data=99 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} +@d set_interaction=100 {define level of interaction ( \.{\\batchmode}, etc.~)} +@d max_command=100 {the largest command code seen at |big_switch|} +@y +@d def=read_to_cs+1 {macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} )} +@d set_box=def+1 {set a box ( \.{\\setbox} )} +@d hyph_data=set_box+1 {hyphenation data ( \.{\\hyphenation}, \.{\\patterns} )} +@d set_interaction=hyph_data+1 {define level of interaction ( \.{\\batchmode}, etc.~)} +@d set_auto_spacing=set_interaction+1 {set auto spaceing mode + ( \.{\\autospacing}, \.{\\noautospacing}, ( \.{\\autoxspacing}, \.{\\noautoxspacing} )} +@d max_command=set_auto_spacing {the largest command code seen at |big_switch|} +@z + +@x [16.212] l.4437 - pTeX: last_jchr, direction, adjust direction +@= +@!list_state_record=record@!mode_field:-mmode..mmode;@+ + @!head_field,@!tail_field: pointer; +@y +@= +@!list_state_record=record@!mode_field:-mmode..mmode;@+ + @!dir_field,@!adj_dir_field: -dir_yoko..dir_yoko; + @!pdisp_field: scaled; + @!head_field,@!tail_field,@!pnode_field,@!last_jchr_field: pointer; +@z + +@x [16.213] l.4445 - pTeX: last_jchr, direction, adjust_dir, prev_{node,disp} +@d head==cur_list.head_field {header node of current list} +@d tail==cur_list.tail_field {final node on current list} +@y +@d direction==cur_list.dir_field {current direction} +@d adjust_dir==cur_list.adj_dir_field {current adjust direction} +@d head==cur_list.head_field {header node of current list} +@d tail==cur_list.tail_field {final node on current list} +@d prev_node==cur_list.pnode_field {previous to last |disp_node|} +@d prev_disp==cur_list.pdisp_field {displacemant at |prev_node|} +@d last_jchr==cur_list.last_jchr_field {final jchar node on current list} +@z + +@x [16.214] l.4464 - pTeX: prev_append: disp_node +@d tail_append(#)==begin link(tail):=#; tail:=link(tail); + end +@y +@d tail_append(#)==begin link(tail):=#; tail:=link(tail); + end +@d prev_append(#)==begin link(prev_node):=#; + link(link(prev_node)):=tail; prev_node:=link(prev_node); + end +@z + +@x [16.215] l.4477 - pTeX: last_jchar, direction, adjust_dir, prev_node +mode:=vmode; head:=contrib_head; tail:=contrib_head; +@y +mode:=vmode; head:=contrib_head; tail:=contrib_head; prev_node:=tail; +direction:=dir_yoko; adjust_dir:=direction; prev_disp:=0; last_jchr:=null; +@z + +@x [16.216] l.4496 - pTeX: last_jchr, displacement. +incr(nest_ptr); head:=get_avail; tail:=head; prev_graf:=0; mode_line:=line; +@y +incr(nest_ptr); head:=new_null_box; tail:=head; prev_node:=tail; +prev_graf:=0; prev_disp:=0; last_jchr:=null; mode_line:=line; +@z + +@x [16.217] l.4504 - pTeX: pop_nest last_jchr +@p procedure pop_nest; {leave a semantic level, re-enter the old} +begin free_avail(head); decr(nest_ptr); cur_list:=nest[nest_ptr]; +end; +@y +@p procedure pop_nest; {leave a semantic level, re-enter the old} +begin +fast_delete_glue_ref(space_ptr(head)); fast_delete_glue_ref(xspace_ptr(head)); +free_node(head,box_node_size); decr(nest_ptr); cur_list:=nest[nest_ptr]; +end; +@z + +@x [16.218] l.4521 - pTeX: show_activities : direction + print_nl("### "); print_mode(m); +@y + print_nl("### "); print_direction(nest[p].dir_field); + print(", "); print_mode(m); +@z + +@x [17.224] l.4711 - pTeX: kanji_skip_code xkanji_skip_code, jfm_skip +@d thin_mu_skip_code=15 {thin space in math formula} +@d med_mu_skip_code=16 {medium space in math formula} +@d thick_mu_skip_code=17 {thick space in math formula} +@d glue_pars=18 {total number of glue parameters} +@y +@d kanji_skip_code=15 {between kanji-kanji space} +@d xkanji_skip_code=16 {between latin-kanji or kanji-latin space} +@d thin_mu_skip_code=17 {thin space in math formula} +@d med_mu_skip_code=18 {medium space in math formula} +@d thick_mu_skip_code=19 {thick space in math formula} +@d jfm_skip=20 {space refer from JFM} +@d glue_pars=21 {total number of glue parameters} +@z + +@x [17.224] l.4739 - kanji_skip, xkanji_skip +@d thick_mu_skip==glue_par(thick_mu_skip_code) +@y +@d thick_mu_skip==glue_par(thick_mu_skip_code) +@d kanji_skip==glue_par(kanji_skip_code) +@d xkanji_skip==glue_par(xkanji_skip_code) +@z + +@x [17.225] l.4767 - pTeX: kanji_skip_code xkanji_skip_code +thick_mu_skip_code: print_esc("thickmuskip"); +othercases print("[unknown glue parameter!]") +@y +thick_mu_skip_code: print_esc("thickmuskip"); +kanji_skip_code: print_esc("kanjiskip"); +xkanji_skip_code: print_esc("xkanjiskip"); +jfm_skip: print("refer from jfm"); +othercases print("[unknown glue parameter!]") +@z + +@x [17.226] l.4813 - pTeX: kanji_skip_code xkanji_skip_code +primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ +@!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> +@y +primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/ +@!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@> +primitive("kanjiskip",assign_glue,glue_base+kanji_skip_code);@/ +@!@:kanji_skip_}{\.{\\kanjiskip} primitive@> +primitive("xkanjiskip",assign_glue,glue_base+xkanji_skip_code);@/ +@!@:xkanji_skip_}{\.{\\xkanjiskip} primitive@> +@z + +@x [17.230] l.4867 - pTeX: cat_code_size, cur_jfont_loc, auto_spacing, auto_xspacing, inhibit_xsp_code, cur_tfont_loc +@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} +@d cat_code_base=math_font_base+48 + {table of 256 command codes (the ``catcodes'')} +@d lc_code_base=cat_code_base+256 {table of 256 lowercase mappings} +@y +@d math_font_base=cur_font_loc+1 {table of 48 math font numbers} +@d cur_jfont_loc=math_font_base+48 +@d cur_tfont_loc=cur_jfont_loc+1 +@d auto_spacing_code=cur_tfont_loc+1 +@d auto_xspacing_code=auto_spacing_code+1 +@d cat_code_base=auto_xspacing_code+1 + {table of 256 command codes (the ``catcodes'')} +@d kcat_code_base=cat_code_base+256 + {table of 256 command codes for the wchar's catcodes } +@d auto_xsp_code_base=kcat_code_base+256 {table of 256 auto spacer flag} +@d inhibit_xsp_code_base=auto_xsp_code_base+256 +@d kinsoku_base=inhibit_xsp_code_base+256 {table of 256 kinsoku mappings} +@d kansuji_base=kinsoku_base+256 {table of 10 kansuji mappings} +@d lc_code_base=kansuji_base+10 {table of 256 lowercase mappings} +@z + +@x [17.230] l.4900 - pTeX: +@d char_sub_code(#)==equiv(char_sub_code_base+#) + {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} +@y +@d char_sub_code(#)==equiv(char_sub_code_base+#) + {Note: |char_sub_code(c)| is the true substitution info plus |min_halfword|} +@# +@d cur_jfont==equiv(cur_jfont_loc) {pTeX: } +@d cur_tfont==equiv(cur_tfont_loc) +@d auto_spacing==equiv(auto_spacing_code) +@d auto_xspacing==equiv(auto_xspacing_code) +@d kcat_code(#)==equiv(kcat_code_base+#) +@d auto_xsp_code(#)==equiv(auto_xsp_code_base+#) +@d inhibit_xsp_type(#)==eq_type(inhibit_xsp_code_base+#) +@d inhibit_xsp_code(#)==equiv(inhibit_xsp_code_base+#) +@d kinsoku_type(#)==eq_type(kinsoku_base+#) +@d kinsoku_code(#)==equiv(kinsoku_base+#) +@d kansuji_char(#)==equiv(kansuji_base+#) +@z + +@x [17.232] l.4959 - pTeX: initialize cat_code, cur_jfont, cur_tfont +cur_font:=null_font; eq_type(cur_font_loc):=data; +eq_level(cur_font_loc):=level_one;@/ +@y +cur_font:=null_font; eq_type(cur_font_loc):=data; +eq_level(cur_font_loc):=level_one;@/ +cur_jfont:=null_font; eq_type(cur_jfont_loc):=data; +eq_level(cur_jfont_loc):=level_one;@/ +cur_tfont:=null_font; eq_type(cur_tfont_loc):=data; +eq_level(cur_tfont_loc):=level_one;@/ +@z + +@x [17.232] l.4965 - pTeX: initialize cat_code, cur_jfont, cur_tfont +for k:=0 to 255 do + begin cat_code(k):=other_char; math_code(k):=hi(k); sf_code(k):=1000; + end; +@y +eqtb[auto_spacing_code]:=eqtb[cat_code_base]; +eqtb[auto_xspacing_code]:=eqtb[cat_code_base]; +for k:=0 to 255 do + begin cat_code(k):=other_char; kcat_code(k):=other_kchar; + math_code(k):=hi(k); sf_code(k):=1000; + auto_xsp_code(k):=0; inhibit_xsp_code(k):=0; inhibit_xsp_type(k):=0; + kinsoku_code(k):=0; kinsoku_type(k):=0; + end; +@z +@x [17.232] l.4971 - pTeX: initialize cat_code, cur_jfont, cur_tfont +for k:="0" to "9" do math_code(k):=hi(k+var_code); +for k:="A" to "Z" do + begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ + math_code(k):=hi(k+var_code+@"100); + math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ + lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ + uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ + sf_code(k):=999; + end; +@y +for k:="0" to "9" do + begin math_code(k):=hi(k+var_code); + auto_xsp_code(k):=3; + end; +kansuji_char(0):=toDVI(fromJIS(@"213B)); +kansuji_char(1):=toDVI(fromJIS(@"306C)); +kansuji_char(2):=toDVI(fromJIS(@"4673)); +kansuji_char(3):=toDVI(fromJIS(@"3B30)); +kansuji_char(4):=toDVI(fromJIS(@"3B4D)); +kansuji_char(5):=toDVI(fromJIS(@"385E)); +kansuji_char(6):=toDVI(fromJIS(@"4F3B)); +kansuji_char(7):=toDVI(fromJIS(@"3C37)); +kansuji_char(8):=toDVI(fromJIS(@"482C)); +kansuji_char(9):=toDVI(fromJIS(@"3665)); +for k:="A" to "Z" do + begin cat_code(k):=letter; cat_code(k+"a"-"A"):=letter;@/ + math_code(k):=hi(k+var_code+@"100); + math_code(k+"a"-"A"):=hi(k+"a"-"A"+var_code+@"100);@/ + lc_code(k):=k+"a"-"A"; lc_code(k+"a"-"A"):=k+"a"-"A";@/ + uc_code(k):=k; uc_code(k+"a"-"A"):=k;@/ + auto_xsp_code(k):=3; auto_xsp_code(k+"a"-"A"):=3;@/ + sf_code(k):=999; + end; +@t\hskip10pt@>kcat_code(@"20+1):=other_kchar; {1 ku} +@t\hskip10pt@>kcat_code(@"20+2):=other_kchar; {2 ku} +@+@t\1@>for k:=3 to 6 do kcat_code(@"20+k):=kana; {3 ku ... 6 ku} +@+@t\1@>for k:=7 to 8 do kcat_code(@"20+k):=other_kchar; {7 ku ... 8 ku} +@+@t\1@>for k:=16 to 84 do kcat_code(@"20+k):=kanji; {16 ku ... 84 ku} +{ $\.{@@"20}+|k| = |kcatcodekey|(|fromKUTEN|(|HILO|(k,1))$ } +@z + +@x +@ @= +if n= +if n +@y +primitive("newlinechar",assign_int,int_base+new_line_char_code);@/ +@!@:new_line_char_}{\.{\\newlinechar} primitive@> +primitive("jfam",assign_int,int_base+cur_jfam_code);@/ +@!@:cur_jfam_}{\.{\\jfam} primitive@> +primitive("jcharwidowpenalty",assign_int,int_base+jchr_widow_penalty_code);@/ +@!@:jchr_widow_penalty}{\.{\\jcharwidowpenalty} primitive@> +@z + +@x [17.247] l.5490 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift +@d h_offset_code=18 {amount of horizontal offset when shipping pages out} +@d v_offset_code=19 {amount of vertical offset when shipping pages out} +@d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} +@d dimen_pars=21 {total number of dimension parameters} +@d scaled_base=dimen_base+dimen_pars + {table of 256 user-defined \.{\\dimen} registers} +@d eqtb_size=scaled_base+255 {largest subscript of |eqtb|} +@y +@d h_offset_code=18 {amount of horizontal offset when shipping pages out} +@d v_offset_code=19 {amount of vertical offset when shipping pages out} +@d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking} +@d t_baseline_shift_code=21 {shift amount when mixing TATE-kumi and Alphabet} +@d y_baseline_shift_code=22 {shift amount when mixing YOKO-kumi and Alphabet} +@d dimen_pars=23 {total number of dimension parameters} +@d scaled_base=dimen_base+dimen_pars + {table of 256 user-defined \.{\\dimen} registers} +@d kinsoku_penalty_base=scaled_base+256 {table of 256 kinsoku registers} +@d eqtb_size=kinsoku_penalty_base+255 {largest subscript of |eqtb|} +@z + +@x l.5498 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift +@d dimen(#)==eqtb[scaled_base+#].sc +@d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} +@y +@d dimen(#)==eqtb[scaled_base+#].sc +@d dimen_par(#)==eqtb[dimen_base+#].sc {a scaled quantity} +@d kinsoku_penalty(#)==eqtb[kinsoku_penalty_base+#].int +@z + +@x l.5518 - pTeX: +@d h_offset==dimen_par(h_offset_code) +@d v_offset==dimen_par(v_offset_code) +@y +@d h_offset==dimen_par(h_offset_code) +@d v_offset==dimen_par(v_offset_code) +@d t_baseline_shift==dimen_par(t_baseline_shift_code) +@d y_baseline_shift==dimen_par(y_baseline_shift_code) +@z + +@x l.5542 - pTeX: +h_offset_code:print_esc("hoffset"); +v_offset_code:print_esc("voffset"); +emergency_stretch_code:print_esc("emergencystretch"); +othercases print("[unknown dimen parameter!]") +@y +h_offset_code:print_esc("hoffset"); +v_offset_code:print_esc("voffset"); +t_baseline_shift_code:print_esc("tbaselineshift"); +y_baseline_shift_code:print_esc("ybaselineshift"); +emergency_stretch_code:print_esc("emergencystretch"); +othercases print("[unknown dimen parameter!]") +@z + +@x [17.248] l.5588 - pTeX: rotate offset +primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ +@!@:h_offset_}{\.{\\hoffset} primitive@> +primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ +@!@:v_offset_}{\.{\\voffset} primitive@> +@y +primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/ +@!@:h_offset_}{\.{\\hoffset} primitive@> +primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/ +@!@:v_offset_}{\.{\\voffset} primitive@> +primitive("tbaselineshift",assign_dimen,dimen_base+t_baseline_shift_code);@/ +@!@:t_baseline_shift_}{\.{\\tbaselineshift} primitive@> +primitive("ybaselineshift",assign_dimen,dimen_base+y_baseline_shift_code);@/ +@!@:y_baseline_shift_}{\.{\\ybaselineshift} primitive@> +@z + +@x [17.252] l.5622 - pTeX: show eqtb +else if n<=eqtb_size then @ +else print_char("?"); {this can't happen either} +end; +tats +@y +else if n +else if n<=eqtb_size then print("kinsoku") +else print_char("?"); {this can't happen either} +end; +tats +@z + +@x [18.265] l.5903 - pTeX: \jfont \tfont +primitive("font",def_font,0);@/ +@!@:font_}{\.{\\font} primitive@> +@y +primitive("font",def_font,0);@/ +@!@:font_}{\.{\\font} primitive@> +primitive("jfont",def_jfont,0);@/ +@!@:jfont_}{\.{\\jfont} primitive@> +primitive("tfont",def_tfont,0);@/ +@!@:tfont_}{\.{\\tfont} primitive@> +@z + +@x [18.266] l.5979 - pTeX: \jfont, \tfont +def_font: print_esc("font"); +@y +def_font: print_esc("font"); +def_jfont: print_esc("jfont"); +def_tfont: print_esc("tfont"); +@z + +@x [20.289] l.6387 - pTeX: cs_token_flag +@d cs_token_flag==@'7777 {amount added to the |eqtb| location in a + token that stands for a control sequence; is a multiple of~256, less~1} +@y +@d cs_token_flag==@"FFFF {amount added to the |eqtb| location in a +token that stands for a control sequence; is a multiple of~256, less~1} +@z + +@x [20.293] l.6496 - pTeX: show_token_list +@ @= +if (pmem_end) then + begin print_esc("CLOBBERED."); return; +@.CLOBBERED@> + end; +if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) +else begin m:=info(p) div @'400; c:=info(p) mod @'400; + if info(p)<0 then print_esc("BAD.") +@.BAD@> + else @; + end +@y +@ @= +if (pmem_end) then + begin print_esc("CLOBBERED."); return; +@.CLOBBERED@> + end; +if info(p)>=cs_token_flag then print_cs(info(p)-cs_token_flag) {|wchar_token|} +else begin + if check_kanji(info(p)) then {|wchar_token|} + begin m:=kcat_code(kcatcodekey(info(p))); c:=info(p); + end + else begin m:=Hi(info(p)); c:=Lo(info(p)); + end; + if (m256) then print_esc("BAD.") +@.BAD@> + else @; +end +@z + +@x [20.294] l.6512 - pTeX: show_token_list +@= +case m of +left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, + letter,other_char: print(c); +@y +@= +case m of +kanji,kana,other_kchar: print_kanji(KANJI(c)); +left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer, + letter,other_char: print(c); +@z + +@x [21.298] l.6632 - pTeX: print KANJI +other_char: chr_cmd("the character "); +@y +other_char: chr_cmd("the character "); +kanji,kana,other_kchar: begin print("kanji character "); + print_kanji(KANJI(chr_code)); end; +@z + +@x [22.303] l.6726 - pTeX: state mid_kanji +1) |state=mid_line| is the normal state.\cr +2) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr +3) |state=new_line| is the state at the beginning of a line.\cr}}$$ +@y +1) |state=mid_line| is the normal state.\cr +2) |state=mid_kanji| is like |mid_line|, and internal KANJI string.\cr +3) |state=skip_blanks| is like |mid_line|, but blanks are ignored.\cr +4) |state=new_line| is the state at the beginning of a line.\cr}}$$ +@z + +@x [22.303] l.6736 - pTeX: state mid_kanji +@d mid_line=1 {|state| code when scanning a line of characters} +@d skip_blanks=2+max_char_code {|state| code when ignoring blanks} +@d new_line=3+max_char_code+max_char_code {|state| code at start of line} +@y +@d mid_line=1 {|state| code when scanning a line of characters} +@d mid_kanji=2+max_char_code {|state| code when scanning a line of characters} +@d skip_blanks=3+max_char_code+max_char_code {|state| code when ignoring blanks} +@d new_line=4+max_char_code+max_char_code+max_char_code + {|state| code at start of line} +@z + +@x [22.311] l.6986 - pTeX: label +@p procedure show_context; {prints where the scanner is} +label done; +var old_setting:0..max_selector; {saved |selector| setting} +@y +@p procedure show_context; {prints where the scanner is} +label done, done1; +var old_setting:0..max_selector; {saved |selector| setting} +@!s: pointer; {temporary pointer} +@z + +@x [22.316] l.7110 - pTeX: init kcode_pos +@d begin_pseudoprint== + begin l:=tally; tally:=0; selector:=pseudo; + trick_count:=1000000; + end +@y +@d begin_pseudoprint== + begin l:=tally; tally:=0; selector:=pseudo; kcode_pos:=0; + trick_count:=1000000; + end +@z + +@x [22.316] l.7114 - pTeX: kcode_pos +@d set_trick_count== + begin first_count:=tally; + trick_count:=tally+1+error_line-half_error_line; + if trick_count0)and(trick_buf2[(first_count-1)mod error_line]=1) then + incr(first_count); + trick_count:=first_count+1+error_line-half_error_line; + if trick_count= +begin_pseudoprint; +if token_type= +begin_pseudoprint; +if token_typenull) then + begin if (link(start)=null)and(check_kanji(info(start))) then {|wchar_token|} + begin cur_input:=input_stack[base_ptr-1]; + s:=get_avail; info(s):=Lo(info(loc)); + cur_input:=input_stack[base_ptr]; + link(start):=s; + show_token_list(start,loc,100000); + free_avail(s);link(start):=null; + goto done1; + end; + end; + show_token_list(start,loc,100000); + end +else show_token_list(link(start),loc,100000); {avoid reference count} +done1: +@z + +@x [24.341] l.7479 - pTeX: set last_chr +@!cat:0..max_char_code; {|cat_code(cur_chr)|, usually} +@y +@!cat:escape..max_char_code; {|cat_code(cur_chr)|, usually} +@!l:0..buf_size; {temporary index into |buffer|} +@z + +@x [24.343] l.7500 - pTeX: input external file +@ @= +@^inner loop@> +begin switch: if loc<=limit then {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + reswitch: cur_cmd:=cat_code(cur_chr); +@y +@ @= +@^inner loop@> +begin switch: if loc<=limit then {current line not yet finished} + begin cur_chr:=buffer[loc]; incr(loc); + if multistrlen(ustringcast(buffer), limit+1, loc-1)=2 then + begin cur_chr:=fromBUFF(ustringcast(buffer), limit+1, loc-1); + cur_cmd:=kcat_code(kcatcodekey(cur_chr)); + incr(loc); + end + else reswitch: cur_cmd:=cat_code(cur_chr); +@z + +@x [24.344] l.7535 - pTeX: ASCII-KANJI space handling +@d any_state_plus(#) == mid_line+#,skip_blanks+#,new_line+# +@y +@d any_state_plus(#) == mid_line+#,mid_kanji+#,skip_blanks+#,new_line+# +@z + +@x [24.347] l.7569 - pTeX: scaner +@ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, + #+sub_mark,#+letter,#+other_char +@y +@ @d add_delims_to(#)==#+math_shift,#+tab_mark,#+mac_param, + #+sub_mark,#+letter,#+other_char +@d all_jcode(#)==#+kanji,#+kana,#+other_kchar +@z + +@x [24.347] l.7573 - pTeX: scaner +mid_line+spacer:@; +mid_line+car_ret:@; +skip_blanks+car_ret,any_state_plus(comment): + @; +new_line+car_ret:@; +mid_line+left_brace: incr(align_state); +skip_blanks+left_brace,new_line+left_brace: begin + state:=mid_line; incr(align_state); + end; +mid_line+right_brace: decr(align_state); +skip_blanks+right_brace,new_line+right_brace: begin + state:=mid_line; decr(align_state); + end; +add_delims_to(skip_blanks),add_delims_to(new_line): state:=mid_line; +@y +mid_kanji+spacer,mid_line+spacer:@; +mid_line+car_ret:@; +mid_kanji+car_ret: if skip_mode then @ + else @; +skip_blanks+car_ret,any_state_plus(comment): + @; +new_line+car_ret:@; +mid_line+left_brace,mid_kanji+left_brace: incr(align_state); +skip_blanks+left_brace,new_line+left_brace: begin + state:=mid_line; incr(align_state); + end; +mid_line+right_brace,mid_kanji+right_brace: decr(align_state); +skip_blanks+right_brace,new_line+right_brace: begin + state:=mid_line; decr(align_state); + end; +add_delims_to(skip_blanks),add_delims_to(new_line),add_delims_to(mid_kanji): + state:=mid_line; +all_jcode(skip_blanks),all_jcode(new_line),all_jcode(mid_line): + state:=mid_kanji; + +@ @= +skip_mode:boolean; + +@ @= +skip_mode:=true; +@z + +@x [24.354] l.7659 - pTeX: scan control sequence +@= +begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} +else begin start_cs: k:=loc; cur_chr:=buffer[k]; cat:=cat_code(cur_chr); + incr(k); + if cat=letter then state:=skip_blanks + else if cat=spacer then state:=skip_blanks + else state:=mid_line; + if (cat=letter)and(k<=limit) then + @ + else @; + cur_cs:=single_base+buffer[loc]; incr(loc); + end; +found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); +if cur_cmd>=outer_call then check_outer_validity; +end +@y +@= +begin if loc>limit then cur_cs:=null_cs {|state| is irrelevant in this case} +else begin k:=loc; cur_chr:=buffer[k]; incr(k); + if multistrlen(ustringcast(buffer), limit+1, k-1)=2 then + begin cat:=kcat_code(kcatcodekey(fromBUFF(ustringcast(buffer), limit+1, k-1))); incr(k); + end + else cat:=cat_code(cur_chr); +start_cs: + if (cat=letter)or(cat=kanji)or(cat=kana) then state:=skip_blanks + else if cat=spacer then state:=skip_blanks + else state:=mid_line; + if cat=other_kchar then + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end + else if ((cat=letter)or(cat=kanji)or(cat=kana))and(k<=limit) then + @ + else @; + cur_cs:=single_base+buffer[loc]; incr(loc); + end; +found: cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); +if cur_cmd>=outer_call then check_outer_validity; +end +@z + +@x +@= +begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then + begin hex_to_cur_chr; buffer[k-1]:=cur_chr; + end + else if c<@'100 then buffer[k-1]:=c+@'100 + else buffer[k-1]:=c-@'100; + limit:=limit-d; first:=first-d; + while k<=limit do + begin buffer[k]:=buffer[k+d]; incr(k); + end; + goto start_cs; + end; + end; +end +@y +@= +begin if buffer[k]=cur_chr then @+if cat=sup_mark then @+if k2 then + begin hex_to_cur_chr; buffer[k-1]:=cur_chr; + end + else if c<@'100 then buffer[k-1]:=c+@'100 + else buffer[k-1]:=c-@'100; + limit:=limit-d; first:=first-d; + l:=k; cur_chr:=buffer[k-1]; cat:=cat_code(cur_chr); + while l<=limit do + begin buffer[l]:=buffer[l+d]; incr(l); + end; + goto start_cs; + end; + end; +end +@z + +@x [24.356] l.7727 - pTeX: scan control sequence (cont) +@ @= +begin repeat cur_chr:=buffer[k]; cat:=cat_code(cur_chr); incr(k); +until (cat<>letter)or(k>limit); +@; +if cat<>letter then decr(k); + {now |k| points to first nonletter} +if k>loc+1 then {multiletter control sequence has been scanned} + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end; +end +@y +@ @= +begin repeat cur_chr:=buffer[k]; incr(k); + if multistrlen(ustringcast(buffer), limit+1, k-1)=2 then + begin cat:=kcat_code(kcatcodekey(fromBUFF(ustringcast(buffer), limit+1, k-1))); incr(k); + end + else cat:=cat_code(cur_chr); + while (buffer[k]=cur_chr)and(cat=sup_mark)and(k2 then + begin hex_to_cur_chr; + end + else if c<@'100 then cur_chr:=c+@'100 + else cur_chr:=c-@'100; + cat:=cat_code(cur_chr); + if (cat=letter)or(cat=sup_mark) then + begin buffer[k-1]:=cur_chr; + limit:=limit-d; first:=first-d; + l:=k; + while l<=limit do + begin buffer[l]:=buffer[l+d]; incr(l); + end; + end; + end; + end; +until not((cat=letter)or(cat=kanji)or(cat=kana))or(k>limit); +{@@;} +if not((cat=letter)or(cat=kanji)or(cat=kana)) then decr(k); +if cat=other_kchar then decr(k); {now |k| points to first nonletter} +if k>loc+1 then {multiletter control sequence has been scanned} + begin cur_cs:=id_lookup(loc,k-loc); loc:=k; goto found; + end; +end +@z + +@x [24.357] l.7771 - pTeX: input from token list +@= +if loc<>null then {list not exhausted} +@^inner loop@> + begin t:=info(loc); loc:=link(loc); {move to next} + if t>=cs_token_flag then {a control sequence token} + begin cur_cs:=t-cs_token_flag; + cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); + if cur_cmd>=outer_call then + if cur_cmd=dont_expand then + @ + else check_outer_validity; + end + else begin cur_cmd:=t div @'400; cur_chr:=t mod @'400; + case cur_cmd of + left_brace: incr(align_state); + right_brace: decr(align_state); + out_param: @; + othercases do_nothing + endcases; + end; + end +else begin {we are done with this token list} + end_token_list; goto restart; {resume previous level} + end +@y +@= +if loc<>null then {list not exhausted} +@^inner loop@> + begin t:=info(loc); loc:=link(loc); {move to next} + if t>=cs_token_flag then {a control sequence token} + begin cur_cs:=t-cs_token_flag; + cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs); + if cur_cmd>=outer_call then + if cur_cmd=dont_expand then + @ + else check_outer_validity; + end + else if check_kanji(t) then {|wchar_token|} + begin cur_chr:=t; cur_cmd:=kcat_code(kcatcodekey(t)); + end + else + begin cur_cmd:=Hi(t); cur_chr:=Lo(t); + case cur_cmd of + left_brace: incr(align_state); + right_brace: decr(align_state); + out_param: @; + othercases do_nothing + endcases; + end; + end +else begin {we are done with this token list} + end_token_list; goto restart; {resume previous level} + end +@z + +@x [24.365] l.7935 - pTeX: get_token +@p procedure get_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|} +begin no_new_control_sequence:=false; get_next; no_new_control_sequence:=true; +@^inner loop@> +if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +end; +@y +@p procedure get_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|} +begin no_new_control_sequence:=false; get_next; no_new_control_sequence:=true; +@^inner loop@> +if cur_cs=0 then + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|} + cur_tok:=cur_chr + else cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +end; +@z + +@x [25.374] l.8073 - pTeX: get_chr +@ @= +j:=first; p:=link(r); +while p<>null do + begin if j>=max_buf_stack then + begin max_buf_stack:=j+1; + if max_buf_stack=buf_size then + overflow("buffer size",buf_size); +@:TeX capacity exceeded buffer size}{\quad buffer size@> + end; + buffer[j]:=info(p) mod @'400; incr(j); p:=link(p); + end; +@y +@ @= +j:=first; p:=link(r); +while p<>null do + begin if j>=max_buf_stack then + begin max_buf_stack:=j+1; + if max_buf_stack=buf_size then + overflow("buffer size",buf_size); +@:TeX capacity exceeded buffer size}{\quad buffer size@> + end; + if check_kanji(info(p)) then {|wchar_token|} + begin buffer[j]:=Hi(info(p)); incr(j); + end; + buffer[j]:=Lo(info(p)); incr(j); p:=link(p); + end; +@z + +@x [25.380] l.8221 - pTeX: get_x_token +@p procedure get_x_token; {sets |cur_cmd|, |cur_chr|, |cur_tok|, + and expands macros} +label restart,done; +begin restart: get_next; +@^inner loop@> +if cur_cmd<=max_command then goto done; +if cur_cmd>=call then + if cur_cmd +if cur_cmd<=max_command then goto done; +if cur_cmd>=call then + if cur_cmdmax_command do + begin expand; + get_next; + end; +if cur_cs=0 then cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +@y +@p procedure x_token; {|get_x_token| without the initial |get_next|} +begin while cur_cmd>max_command do + begin expand; + get_next; + end; +if cur_cs=0 then + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + cur_tok:=cur_chr + else cur_tok:=(cur_cmd*@'400)+cur_chr +else cur_tok:=cs_token_flag+cur_cs; +@z + +@x [26.413] l.8341 - pTeX: scan_something_internal +@p procedure scan_something_internal(@!level:small_number;@!negative:boolean); +@y +@p @t\4@>@@t@>@/ +procedure scan_something_internal(@!level:small_number;@!negative:boolean); +@z +@x [26.413] l.8343 - pTeX: scan_something_internal +var m:halfword; {|chr_code| part of the operand token} +@y +var m:halfword; {|chr_code| part of the operand token} +@!tx:pointer; {effective tail node} +@!qx:halfword; {general purpose index} +@z +@x [26.413] l.8345 - pTeX: scan_something_internal +begin m:=cur_chr; +case cur_cmd of +def_code: @; +toks_register,assign_toks,def_family,set_font,def_font: @; +@y +@!q,@!r:pointer; +begin m:=cur_chr; +case cur_cmd of +assign_kinsoku: @; +assign_inhibit_xsp_code: @; +def_code: @; +toks_register,assign_toks,def_family,set_font,def_font,def_jfont,def_tfont: + @; +@z + +@x [26.414] l.8373 - pTeX: +if m=math_code_base then scanned_result(ho(math_code(cur_val)))(int_val) +else if mnull)and(box_dir(q)<>abs(direction)) do q:=link(q); + if q=null then + begin r:=link(qx); link(qx):=null; + q:=new_dir_node(qx,abs(direction)); link(qx):=r; + cur_val:=mem[q+m].sc; + delete_glue_ref(space_ptr(q)); delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end + else cur_val:=mem[q+m].sc; + end; +@z + +@x [26.424] l.8508 - pTeX: disp_node +legal in similar contexts. +@y +legal in similar contexts. + +The macro |find_effective_tail_pTeX| sets |tx| to the last non-|disp_node| +of the current list. +@z + +@x [26.424] l.8510 - pTeX: disp_node +@= +@y +@d find_effective_tail_pTeX== +tx:=tail; +if not is_char_node(tx) then + if type(tx)=disp_node then + begin tx:=prev_node; + if not is_char_node(tx) then + if type(tx)=disp_node then {|disp_node| from a discretionary} + begin tx:=head; q:=link(head); + while q<>prev_node do + begin if is_char_node(q) then tx:=q + else if type(q)<>disp_node then tx:=q; + end; + q:=link(q); + end; + end +@# +@d find_effective_tail==find_effective_tail_pTeX + +@= +@z + +@x [26.424] l.8516 - pTeX: Fetch an item ...: disp_node +else begin if cur_chr=glue_val then cur_val:=zero_glue@+else cur_val:=0; +@y +else begin if cur_chr=glue_val then cur_val:=zero_glue@+else cur_val:=0; + find_effective_tail; +@z +@x [26.424] l.8518 - pTeX: Fetch an item ...: disp_node + if not is_char_node(tail)and(mode<>0) then + case cur_chr of + int_val: if type(tail)=penalty_node then cur_val:=penalty(tail); + dimen_val: if type(tail)=kern_node then cur_val:=width(tail); + glue_val: if type(tail)=glue_node then + begin cur_val:=glue_ptr(tail); + if subtype(tail)=mu_glue then cur_val_level:=mu_val; + end; +@y + if not is_char_node(tx)and(tx<>head)and(mode<>0) then + case cur_chr of + int_val: if type(tx)=penalty_node then cur_val:=penalty(tx); + dimen_val: if type(tx)=kern_node then cur_val:=width(tx); + glue_val: if type(tx)=glue_node then + begin cur_val:=glue_ptr(tx); + if subtype(tx)=mu_glue then cur_val_level:=mu_val; + end; +@z +@x [26.424] l.8527 - pTeX: Fetch an item ...: disp_node + else if (mode=vmode)and(tail=head) then +@y + else if (mode=vmode)and(tx=head) then +@z + +@x [26.435] l.8940 - pTeX: scan_char_num +procedure scan_char_num; +begin scan_int; +if (cur_val<0)or(cur_val>255) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@y +procedure scan_char_num; +begin scan_int; +if not is_char_ascii(cur_val) and not is_char_kanji(cur_val) then + begin print_err("Bad character code"); +@.Bad character code@> + help2("A character number must be between 0 and 255, or KANJI code.")@/ + ("I changed this one to zero."); int_error(cur_val); cur_val:=0; + end; +end; +@z + +@x [26.442] l.9045 - pTeX: KANJI character scanning +@= +begin get_token; {suppress macro expansion} +if cur_tok255 then + begin print_err("Improper alphabetic constant"); +@.Improper alphabetic constant@> + help2("A one-character control sequence belongs after a ` mark.")@/ + ("So I'm essentially inserting \0 here."); + cur_val:="0"; back_error; + end +else @; +end +@y +@= +begin get_token; {suppress macro expansion} +if cur_tok255)and((cur_cmdmax_char_code)) then + begin print_err("Improper alphabetic or KANJI constant"); +@.Improper alphabetic constant@> + help2("A one-character control sequence belongs after a ` mark.")@/ + ("So I'm essentially inserting \0 here."); + cur_val:="0"; back_error; + end +else @; +skip_mode:=true; +end +@z + +@x [26.455] l.9288 - pTeX: zw, zh: zenkaku width & height +if scan_keyword("em") then v:=(@) +@.em@> +else if scan_keyword("ex") then v:=(@) +@.ex@> +else goto not_found; +@y +if scan_keyword("em") then v:=(@) +@.em@> +else if scan_keyword("ex") then v:=(@) +@.ex@> +else if scan_keyword("zw") then @ +@.ze@> +else if scan_keyword("zh") then @ +@.zh@> +else goto not_found; +@z + +@x [26.458] l.9345 - pTeX: dimension unit: Q, H (1/4 mm) +else if scan_keyword("sp") then goto done +@.sp@> +@y +else if scan_keyword("H") then set_conversion(7227)(10160) +@.H@> +else if scan_keyword("Q") then set_conversion(7227)(10160) +@.Q@> +else if scan_keyword("sp") then goto done +@.sp@> +@z + +@x [27.464] l.9475 - pTeX: str_toks + if t=" " then t:=space_token + else t:=other_token+t; +@y + if multistrlen(ustringcast(str_pool), pool_ptr, k)=2 then + begin t:=fromBUFF(ustringcast(str_pool), pool_ptr, k); incr(k); + end + else if t=" " then t:=space_token + else t:=other_token+t; +@z + +@x [27.468] l.9531 - pTeX: convert KANJI code +@d number_code=0 {command code for \.{\\number}} +@d roman_numeral_code=1 {command code for \.{\\romannumeral}} +@d string_code=2 {command code for \.{\\string}} +@d meaning_code=3 {command code for \.{\\meaning}} +@d font_name_code=4 {command code for \.{\\fontname}} +@d job_name_code=5 {command code for \.{\\jobname}} +@y +@d number_code=0 {command code for \.{\\number}} +@d roman_numeral_code=1 {command code for \.{\\romannumeral}} +@d kansuji_code=2 {command code for \.{\\kansuji}} +@d string_code=3 {command code for \.{\\string}} +@d meaning_code=4 {command code for \.{\\meaning}} +@d font_name_code=5 {command code for \.{\\fontname}} +@d euc_code=6 {command code for \.{\\euc}} +@d sjis_code=7 {command code for \.{\\sjis}} +@d jis_code=8 {command code for \.{\\jis}} +@d kuten_code=9 {command code for \.{\\kuten}} +@d ptex_convert_codes=10 {end of \eTeX's command codes} +@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}} +@z + +@x [27.468] l.9547 - pTeX: +primitive("fontname",convert,font_name_code);@/ +@!@:font_name_}{\.{\\fontname} primitive@> +@y +primitive("fontname",convert,font_name_code);@/ +@!@:font_name_}{\.{\\fontname} primitive@> +primitive("kansuji",convert,kansuji_code); +@!@:kansuji_}{\.{\\kansuji} primitive@> +primitive("euc",convert,euc_code); +@!@:euc_}{\.{\\euc} primitive@> +primitive("sjis",convert,sjis_code); +@!@:sjis_}{\.{\\sjis} primitive@> +primitive("jis",convert,jis_code); +@!@:jis_}{\.{\\jis} primitive@> +primitive("kuten",convert,kuten_code); +@!@:kuten_}{\.{\\kuten} primitive@> +@z + +@x [27.469] l.9558 - pTeX: + font_name_code: print_esc("fontname"); +@y + font_name_code: print_esc("fontname"); + kansuji_code: print_esc("kansuji"); + euc_code:print_esc("euc"); + sjis_code:print_esc("sjis"); + jis_code:print_esc("jis"); + kuten_code:print_esc("kuten"); +@z + +@x [27.470] l.9566 - pTeX: convert KANJI code continue +@p procedure conv_toks; +var old_setting:0..max_selector; {holds |selector| setting} +@y +@p procedure conv_toks; +var old_setting:0..max_selector; {holds |selector| setting} +@!cx:KANJI_code; {temporary register for KANJI} +@z + +@x [27.471] l.9577 - pTeX: convert KANJI code continue +@ @= +case c of +number_code,roman_numeral_code: scan_int; +string_code, meaning_code: begin save_scanner_status:=scanner_status; + scanner_status:=normal; get_token; scanner_status:=save_scanner_status; + end; +@y +@ @= +KANJI(cx):=0; +case c of +number_code,roman_numeral_code, +kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int; +string_code, meaning_code: begin save_scanner_status:=scanner_status; + scanner_status:=normal; get_token; + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|} + KANJI(cx):=cur_tok; + scanner_status:=save_scanner_status; + end; +@z + +@x [27.471] l.9587 - pTeX: convert KANJI code continue +@ @= +case c of +number_code: print_int(cur_val); +roman_numeral_code: print_roman_int(cur_val); +string_code:if cur_cs<>0 then sprint_cs(cur_cs) + else print_char(cur_chr); +@y +@ @= +case c of +number_code: print_int(cur_val); +roman_numeral_code: print_roman_int(cur_val); +jis_code: print_int(fromJIS(cur_val)); +euc_code: print_int(fromEUC(cur_val)); +sjis_code: print_int(fromSJIS(cur_val)); +kuten_code: print_int(fromKUTEN(cur_val)); +kansuji_code: print_kansuji(cur_val); +string_code:if cur_cs<>0 then sprint_cs(cur_cs) + else if KANJI(cx)=0 then print_char(cur_chr) + else print_kanji(cx); +@z + +@x [28.487] l.9852 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +@d if_case_code=16 { `\.{\\ifcase}' } +@y +@d if_case_code=16 { `\.{\\ifcase}' } +@# +@d if_tdir_code=if_case_code+1 { `\.{\\iftdir}' } +@d if_ydir_code=if_tdir_code+1 { `\.{\\ifydir}' } +@d if_ddir_code=if_ydir_code+1 { `\.{\\ifddir}' } +@d if_mdir_code=if_ddir_code+1 { `\.{\\ifmdir}' } +@d if_tbox_code=if_mdir_code+1 { `\.{\\iftbox}' } +@d if_ybox_code=if_tbox_code+1 { `\.{\\ifybox}' } +@d if_dbox_code=if_ybox_code+1 { `\.{\\ifdbox}' } +@z + +@x [28.487] l.9887 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +primitive("ifcase",if_test,if_case_code); +@!@:if_case_}{\.{\\ifcase} primitive@> +@y +primitive("ifcase",if_test,if_case_code); +@!@:if_case_}{\.{\\ifcase} primitive@> +primitive("iftdir",if_test,if_tdir_code); +@!@:if_tdir_}{\.{\\iftdir} primitive@> +primitive("ifydir",if_test,if_ydir_code); +@!@:if_ydir_}{\.{\\ifydir} primitive@> +primitive("ifddir",if_test,if_ddir_code); +@!@:if_ddir_}{\.{\\ifddir} primitive@> +primitive("ifmdir",if_test,if_mdir_code); +@!@:if_mdir_}{\.{\\ifmdir} primitive@> +primitive("iftbox",if_test,if_tbox_code); +@!@:if_tbox_}{\.{\\iftbox} primitive@> +primitive("ifybox",if_test,if_ybox_code); +@!@:if_ybox_}{\.{\\ifybox} primitive@> +primitive("ifdbox",if_test,if_dbox_code); +@!@:if_dbox_}{\.{\\ifdbox} primitive@> +@z + +@x [28.488] l.9907 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox + if_case_code:print_esc("ifcase"); +@y + if_case_code:print_esc("ifcase"); + if_tdir_code:print_esc("iftdir"); + if_ydir_code:print_esc("ifydir"); + if_ddir_code:print_esc("ifddir"); + if_mdir_code:print_esc("ifmdir"); + if_tbox_code:print_esc("iftbox"); + if_ybox_code:print_esc("ifybox"); + if_dbox_code:print_esc("ifdbox"); +@z + +@x [28.501] l.10073 - pTeX: iftdir, ifydir, ifddir, iftbox, ifybox, ifdbox +if_void_code, if_hbox_code, if_vbox_code: @; +@y +if_tdir_code: b:=(abs(direction)=dir_tate); +if_ydir_code: b:=(abs(direction)=dir_yoko); +if_ddir_code: b:=(abs(direction)=dir_dtou); +if_mdir_code: b:=(direction<0); +if_void_code, if_hbox_code, if_vbox_code, if_tbox_code, if_ybox_code, if_dbox_code: + @; +@z + +@x [28.505] l.10118 - pTeX: Test box register status : iftbox, ifybox, ifdbox +if this_if=if_void_code then b:=(p=null) +else if p=null then b:=false +else if this_if=if_hbox_code then b:=(type(p)=hlist_node) +else b:=(type(p)=vlist_node); +@y +if this_if=if_void_code then b:=(p=null) +else if p=null then b:=false +else begin + if type(p)=dir_node then p:=list_ptr(p); + if this_if=if_hbox_code then b:=(type(p)=hlist_node) + else if this_if=if_vbox_code then b:=(type(p)=vlist_node) + else if this_if=if_tbox_code then b:=(box_dir(p)=dir_tate) + else if this_if=if_ybox_code then b:=(box_dir(p)=dir_yoko) + else b:=(box_dir(p)=dir_dtou); + end +@z + +@x [28.502] l.10138 - pTeX: ifx : Test character : KANJI character +if (cur_cmd>active_char)or(cur_chr>255) then {not a character} + begin m:=relax; n:=256; + end +else begin m:=cur_cmd; n:=cur_chr; + end; +get_x_token_or_active_char; +if (cur_cmd>active_char)or(cur_chr>255) then + begin cur_cmd:=relax; cur_chr:=256; + end; +@y +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin m:=cur_cmd; n:=cur_chr; + end +else if (cur_cmd>active_char)or(cur_chr>255) then + begin m:=relax; n:=256; + end +else begin m:=cur_cmd; n:=cur_chr; + end; +get_x_token_or_active_char; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin cur_cmd:=cur_cmd; + end {dummy} +else if (cur_cmd>active_char)or(cur_chr>255) then + begin cur_cmd:=relax; cur_chr:=256; + end; +@z + +@x [29.526] l.10668 - pTeX: scan file name +loop@+begin if (cur_cmd>other_char)or(cur_chr>255) then {not a character} + begin back_input; goto done; + end; + {If |cur_chr| is a space and we're not scanning a token list, check + whether we're at the end of the buffer. Otherwise we end up adding + spurious spaces to file names in some cases.} + if (cur_chr=" ") and (state<>token_list) and (loc>limit) then goto done; + if not more_name(cur_chr) then goto done; + get_x_token; + end; +done: end_name; name_in_progress:=false; +@y +skip_mode:=false; +loop@+begin + if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {is kanji} + begin str_room(2); + append_char(Hi(cur_chr)); {kanji upper byte} + append_char(Lo(cur_chr)); {kanji lower byte} + end + else if (cur_cmd>other_char)or(cur_chr>255) then {not a alphabet} + begin back_input; goto done; + end + {If |cur_chr| is a space and we're not scanning a token list, check + whether we're at the end of the buffer. Otherwise we end up adding + spurious spaces to file names in some cases.} + else if ((cur_chr=" ") and (state<>token_list) and (loc>limit)) or not more_name(cur_chr) then goto done; + get_x_token; + end; +done: end_name; name_in_progress:=false; +skip_mode:=true; +@z + +@x [29.536] l.10834 - pTeX: +begin +if src_specials_p or file_line_error_style_p or parse_first_line_p +then + wlog(banner_k) +else + wlog(banner); +@y +begin +if src_specials_p or file_line_error_style_p or parse_first_line_p +then + wlog(banner_k) +else + wlog(banner); + wlog(' ('); + wlog(conststringcast(get_enc_string)); + wlog(')'); +@z + +@x [30.560] l.10968 - pTeX: +This is called BigEndian order. +@!@^BigEndian order@> +@y +This is called BigEndian order. +@!@^BigEndian order@> + +We use to get \TeX\ knowledge about KANJI fonts from \.{JFM} files. +The \.{JFM} format holds more two 16-bit integers ,|id| and |nt|, +at the top of the file. +$$\vbox{\halign{\hfil#&$\null=\null$#\hfil\cr +|id|&identification code of the file;\cr +|nt|&number of words in the |char_type| table;\cr}}$$ +The identification byte, |id| equals~11 or~9. When \TeX read a font file, +the |id| equals~11 or~9 then the font is the \.{JFM}, othercases it is +the \.{TFM} file. The \.{TFM} holds |lf| at the same postion of |id|, +usually it take a larger number than~9 or~11. +The |nt| is nonngative and less than $2^{15}$. + +We must have |ec=0|, +$$\hbox{|lf=7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np|.}$$ + +@d yoko_jfm_id=11 {for `yoko-kumi' fonts} +@d tate_jfm_id=9 {for `tate-kumi' fonts} +@z + +@x [30.544] l.11085 - pTeX: gk_tag +operation looks for both |list_tag| and |ext_tag|. +@y +operation looks for both |list_tag| and |ext_tag|. + +If the \.{JFM}, the |lig_tag| is called |gk_tag|. The |gk_tag| means that +this character has a glue/kerning program starting at position |remainder| +in the |glue_kern| array. And a \.{JFM} not used |tag=2| and |tag=3|. +@z + +@x [30.544] l.11088 - pTeX: gk_tag +@d lig_tag=1 {character has a ligature/kerning program} +@y +@d lig_tag=1 {character has a ligature/kerning program} +@d gk_tag=1 {character has a glue/kerning program} +@z + +@x [30.549] l.11228 - pTeX: +@= +@!font_info: ^fmemory_word; +@y +@= +@!font_info: ^memory_word; {pTeX: use halfword for |char_type| table.} +@!font_dir: ^eight_bits; + {pTeX: direction of fonts, 0 is default, 1 is Yoko, 2 is Tate} +@!font_num_ext: ^integer; + {pTeX: number of the |char_type| table.} +@z + +@x [30.550] l.11270 - pTeX: +@!char_base: ^integer; + {base addresses for |char_info|} +@y +@!char_base: ^integer; + {base addresses for |char_info|} +@!ctype_base: ^integer; + {pTeX: base addresses for KANJI character type parameters} +@z + +@x [30.554] l.11373 - pTeX: +@d orig_char_info_end(#)==#].qqqq +@d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end +@y +@d orig_char_info_end(#)==#].qqqq +@d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end +@# +@d kchar_code_end(#)==#].hh.rh +@d kchar_code(#)==font_info[ctype_base[#]+kchar_code_end +@d kchar_type_end(#)==#].hh.lhfield +@d kchar_type(#)==font_info[ctype_base[#]+kchar_type_end +@z + +@x [30.557] l.11413 - pTeX: glue_kern_start +@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} +@y +@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program} +@d glue_kern_start(#)==lig_kern_base[#]+rem_byte + {beginning of glue/kern program} +@z + +@x [30.560] l.11457 - pTeX: jfm_flag, jfm_id, nt, cx +var k:font_index; {index into |font_info|} +@y +var k:font_index; {index into |font_info|} +@!jfm_flag:dir_default..dir_tate; {direction of the \.{JFM}} +@!nt:halfword; {number of the |char_type| tables} +@!cx:KANJI_code; {kanji code} +@z + +@x [30.565] l.11548 - pTeX: read tfm size +@ @= +begin read_sixteen(lf); +fget; read_sixteen(lh); +fget; read_sixteen(bc); +fget; read_sixteen(ec); +if (bc>ec+1)or(ec>255) then abort; +if bc>255 then {|bc=256| and |ec=255|} + begin bc:=1; ec:=0; + end; +fget; read_sixteen(nw); +fget; read_sixteen(nh); +fget; read_sixteen(nd); +fget; read_sixteen(ni); +fget; read_sixteen(nl); +fget; read_sixteen(nk); +fget; read_sixteen(ne); +fget; read_sixteen(np); +if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; +if (nw=0)or(nh=0)or(nd=0)or(ni=0) then abort; +end +@y +@ @= +begin read_sixteen(lf); +fget; read_sixteen(lh); +if lf=yoko_jfm_id then + begin jfm_flag:=dir_yoko; nt:=lh; + fget; read_sixteen(lf); + fget; read_sixteen(lh); + end +else if lf=tate_jfm_id then + begin jfm_flag:=dir_tate; nt:=lh; + fget; read_sixteen(lf); + fget; read_sixteen(lh); + end +else begin jfm_flag:=dir_default; nt:=0; + end; +fget; read_sixteen(bc); +fget; read_sixteen(ec); +if (bc>ec+1)or(ec>255) then abort; +if bc>255 then {|bc=256| and |ec=255|} + begin bc:=1; ec:=0; + end; +fget; read_sixteen(nw); +fget; read_sixteen(nh); +fget; read_sixteen(nd); +fget; read_sixteen(ni); +fget; read_sixteen(nl); +fget; read_sixteen(nk); +fget; read_sixteen(ne); +fget; read_sixteen(np); +if jfm_flag<>dir_default then + begin if lf<>7+lh+nt+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; + end +else + begin if lf<>6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ne+np then abort; + end; +if (nw=0)or(nh=0)or(nd=0)or(ni=0) then abort; +end +@z + +@x [30.566] l.11574 - pTeX: set font_dir & font_num_ext +@= +lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} +if np<7 then lf:=lf+7-np; {at least seven parameters will appear} +if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then + @; +f:=font_ptr+1; +char_base[f]:=fmem_ptr-bc; +width_base[f]:=char_base[f]+ec+1; +height_base[f]:=width_base[f]+nw; +depth_base[f]:=height_base[f]+nh; +italic_base[f]:=depth_base[f]+nd; +lig_kern_base[f]:=italic_base[f]+ni; +kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; +exten_base[f]:=kern_base[f]+kern_base_offset+nk; +param_base[f]:=exten_base[f]+ne +@y +@= +if jfm_flag<>dir_default then + lf:=lf-7-lh {If \.{JFM}, |lf| holds more two-16bit records than \.{TFM}} +else + lf:=lf-6-lh; {|lf| words should be loaded into |font_info|} +if np<7 then lf:=lf+7-np; {at least seven parameters will appear} +if (font_ptr=font_max)or(fmem_ptr+lf>font_mem_size) then + @; +f:=font_ptr+1; +font_dir[f]:=jfm_flag; +font_num_ext[f]:=nt; +ctype_base[f]:=fmem_ptr; +char_base[f]:=ctype_base[f]+nt-bc; +width_base[f]:=char_base[f]+ec+1; +height_base[f]:=width_base[f]+nw; +depth_base[f]:=height_base[f]+nh; +italic_base[f]:=depth_base[f]+nd; +lig_kern_base[f]:=italic_base[f]+ni; +kern_base[f]:=lig_kern_base[f]+nl-kern_base_offset; +exten_base[f]:=kern_base[f]+kern_base_offset+nk; +param_base[f]:=exten_base[f]+ne; +@z + +@x [30.569] l.11619 - pTeX: read char_type +@ @= +for k:=fmem_ptr to width_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@y +@ @= +if jfm_flag<>dir_default then + for k:=ctype_base[f] to ctype_base[f]+nt-1 do + begin + fget; read_sixteen(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|} + fget; read_sixteen(cx); font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|} + end; +for k:=char_base[f]+bc to width_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@z + +@x [30.570] l.11638 - pTeX: +@d current_character_being_worked_on==k+bc-fmem_ptr +@y +@d current_character_being_worked_on==k-char_base[f] +@z + +@x [30.573] l.11704 - pTeX: jfm + if a>128 then + begin if 256*c+d>=nl then abort; + if a=255 then if k=lig_kern_base[f] then bchar:=b; + end + else begin if b<>bchar then check_existence(b); + if c<128 then check_existence(d) {check ligature} + else if 256*(c-128)+d>=nk then abort; {check kern} + if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; + end; + end; +@y + if a>128 then + begin if 256*c+d>=nl then abort; + if a=255 then if k=lig_kern_base[f] then bchar:=b; + end + else begin if b<>bchar then check_existence(b); + if c<128 then begin + if jfm_flag<>dir_default then begin if d>=ne then abort; end + else check_existence(d); {check ligature} + end else if 256*(c-128)+d>=nk then abort; {check kern} + if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; + end; + end; +@z + +@x [30.574] l.11720 - pTeX: read jfm exten +for k:=exten_base[f] to param_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@y +if jfm_flag<>dir_default then + for k:=exten_base[f] to param_base[f]-1 do + store_scaled(font_info[k].sc) {NOTE: this area subst for glue program} +else for k:=exten_base[f] to param_base[f]-1 do + begin store_four_quarters(font_info[k].qqqq); +@z + +@x [30.576] l.11765 - pTeX: adjust ctype_base +adjust(char_base); adjust(width_base); adjust(lig_kern_base); +@y +adjust(ctype_base); +adjust(char_base); adjust(width_base); adjust(lig_kern_base); +@z + +@x [30.577] l.11778 - pTeX: jfont, tfont +if cur_cmd=def_font then f:=cur_font +@y +if cur_cmd=def_jfont then f:=cur_jfont +else if cur_cmd=def_tfont then f:=cur_tfont +else if cur_cmd=def_font then f:=cur_font +@z + +@x [30.581] +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +@y +@d print_lc_hex(#)==l:=#; + if l<10 then print_char(l+"0")@+else print_char(l-10+"a") + +@p procedure char_warning(@!f:internal_font_number;@!c:eight_bits); +var @!l:0..255; {small indices or counters} +@z +@x [30.581] + print_ASCII(c); print(" in font "); +@y + if (c<" ")or(c>"~") then + begin print_char("^"); print_char("^"); + if c<64 then print_char(c+64) + else if c<128 then print_char(c-64) + else begin print_lc_hex(c div 16); print_lc_hex(c mod 16); end + end + else print_ASCII(c); + print(" in font "); +@z + +@x [31.586] l.12189 - pTeX: define set2 +@d set1=128 {typeset a character and move right} +@y +@d set1=128 {typeset a character and move right} +@d set2=129 {typeset a character and move right} +@z +@x [31.586] l.12214 - pTeX: define dirchg +@d post_post=249 {postamble ending} +@y +@d post_post=249 {postamble ending} +@d dirchg=255 {direction change} +@z + +@x [31.587] l.12246 - pTeX: ex_id_byte +@d id_byte=2 {identifies the kind of \.{DVI} files described here} +@y +@d id_byte=2 {identifies the kind of \.{DVI} files described here} +@d ex_id_byte=3 {identifies the kind of extended \.{DVI} files} +@z + +@x [32.590] l.12329 - pTeX: ex_id_byte: This dvi is extended! +@ The last part of the postamble, following the |post_post| byte that +signifies the end of the font definitions, contains |q|, a pointer to the +|post| command that started the postamble. An identification byte, |i|, +comes next; this currently equals~2, as in the preamble. +@y +@ The last part of the postamble, following the |post_post| byte that +signifies the end of the font definitions, contains |q|, a pointer to the +|post| command that started the postamble. An identification byte, |i|, +comes next; this equals~2 or~3. If not used p\TeX primitives then the +identification byte equals~2, othercase this is set to~3. +@z + +@x [32.592] l.12405 - pTeX: + {character and font in current |char_node|} +@!c:quarterword; +@!f:internal_font_number; +@y + {character and font in current |char_node|} +@!c:quarterword; +@!f:internal_font_number; +@!dir_used:boolean; {Is this dvi extended?} +@z + +@x [32.593] l.12414 - pTeX: dir_used: Is this dvi extended? +doing_leaders:=false; dead_cycles:=0; cur_s:=-1; +@y +doing_leaders:=false; dead_cycles:=0; cur_s:=-1; dir_used:=false; +@z + +@x [32.617] l.12846 - pTeX: Initialize dvi_dir as shipout begins +dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; +@y +dvi_h:=0; dvi_v:=0; cur_h:=h_offset; dvi_f:=null_font; +dvi_dir:=dir_yoko; cur_dir_hv:=dvi_dir; +@z + +@x [32.619] l.12892 - pTeX: hlist_out Kanji, disp_node +procedure hlist_out; {output an |hlist_node| box} +label reswitch, move_past, fin_rule, next_p, continue, found; +var base_line: scaled; {the baseline coordinate for this box} +@y +procedure hlist_out; {output an |hlist_node| box} +label reswitch, move_past, fin_rule, next_p, continue, found; +var base_line: scaled; {the baseline coordinate for this box} +@!disp: scaled; {displacement} +@!save_dir:eight_bits; {what |dvi_dir| should pop to} +@!jc:KANJI_code; {temporary register for KANJI codes} +@!ksp_ptr:pointer; {position of |auto_spacing_glue| in the hlist} +@z +@x [32.619] l.12913 - pTeX: hlist_out Kanji, disp_node +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; left_edge:=cur_h; +@y +ksp_ptr:=space_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; +synch_dir; +base_line:=cur_v; left_edge:=cur_h; disp:=0; +@z + +@x [32.622] l.12945 - pTeX: chain +@= +reswitch: if is_char_node(p) then + begin synch_h; synch_v; + repeat f:=font(p); c:=character(p); + if f<>dvi_f then @; + if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then + if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} + begin if c>=qi(128) then dvi_out(set1); + dvi_out(qo(c));@/ + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); + goto continue; + end; + if mltex_enabled_p then + @; +continue: + p:=link(p); + until not is_char_node(p); + dvi_h:=cur_h; + end +else @ +@y +@= +reswitch: if is_char_node(p) then + begin synch_h; synch_v; + chain:=false; + repeat f:=font(p); c:=character(p); + if f<>dvi_f then @; + if font_dir[f]=dir_default then + begin chain:=false; + if font_ec[f]>=qo(c) then if font_bc[f]<=qo(c) then + if char_exists(orig_char_info(f)(c)) then {N.B.: not |char_info|} + begin if c>=qi(128) then dvi_out(set1); + dvi_out(qo(c));@/ + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); + goto continue; + end; + if mltex_enabled_p then + @; +continue: + end + else + begin if chain=false then chain:=true + else begin cur_h:=cur_h+width(ksp_ptr); + if g_sign<>normal then + begin if g_sign=stretching then + begin if stretch_order(ksp_ptr)=g_order then + cur_h:=cur_h+round(float(glue_set(this_box))*stretch(ksp_ptr)); +@^real multiplication@> + end + else + begin if shrink_order(ksp_ptr)=g_order then + cur_h:=cur_h-round(float(glue_set(this_box))*shrink(ksp_ptr)); +@^real multiplication@> + end; + end; + synch_h; + end; + p:=link(p); + jc:=toDVI(KANJI(info(p))); + dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc)); + cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); {not |jc|} + end; + dvi_h:=cur_h; p:=link(p); + until not is_char_node(p); + chain:=false; + end +else @ +@z + +@x [32.623] l.12982 - pTeX: disp_node, dir_node +@ @= +begin case type(p) of +hlist_node,vlist_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +whatsit_node: @; +@y +@ @= +begin case type(p) of +hlist_node,vlist_node,dir_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +whatsit_node: @; +disp_node: begin disp:=disp_dimen(p); cur_v:=base_line+disp; end; +@z + +@x [32.624] l.13000 - pTeX: output a box(and dir_node) with disp +@ @= +if list_ptr(p)=null then cur_h:=cur_h+width(p) +else begin save_h:=dvi_h; save_v:=dvi_v; + cur_v:=base_line+shift_amount(p); {shift the box down} +@y +@ @= +if list_ptr(p)=null then cur_h:=cur_h+width(p) +else begin save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; + cur_v:=base_line+disp+shift_amount(p); {shift the box down} +@z +@x [32.624] l.13005 - pTeX: output a box(and dir_node) with disp + if type(p)=vlist_node then vlist_out@+else hlist_out; + dvi_h:=save_h; dvi_v:=save_v; + cur_h:=edge+width(p); cur_v:=base_line; + end +@y + case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; + endcases; + dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; + cur_h:=edge+width(p); cur_v:=base_line+disp; cur_dir_hv:=save_dir; + end +@z + +@x [32.625] l.13010 - pTeX: Output a rule with disp +@ @= +if is_running(rule_ht) then rule_ht:=height(this_box); +if is_running(rule_dp) then rule_dp:=depth(this_box); +@y +@ @= +if is_running(rule_ht) then rule_ht:=height(this_box)+disp; +if is_running(rule_dp) then rule_dp:=depth(this_box)-disp; +@z + +@x [32.629] l.13103 - pTeX: Output a leader box(and dir_node) with disp +@= +begin cur_v:=base_line+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ +synch_h; save_h:=dvi_h; temp_ptr:=leader_box; +@y +@= +begin cur_v:=base_line+disp+shift_amount(leader_box); synch_v; save_v:=dvi_v;@/ +synch_h; save_h:=dvi_h; save_dir:=dvi_dir; temp_ptr:=leader_box; +@z +@x [32.629] l.13107 - pTeX: Output a leader box(and dir_node) with disp +if type(leader_box)=vlist_node then vlist_out@+else hlist_out; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; cur_v:=base_line; +cur_h:=save_h+leader_wd+lx; +end +@y +case type(leader_box) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; +cur_v:=base_line; cur_h:=save_h+leader_wd+lx; cur_dir_hv:=save_dir; +end +@z + +@x [32.630] l.13133 - pTeX: vlist_out +begin cur_g:=0; cur_glue:=float_constant(0); +this_box:=temp_ptr; g_order:=glue_order(this_box); +g_sign:=glue_sign(this_box); p:=list_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; left_edge:=cur_h; cur_v:=cur_v-height(this_box); +@y +@!save_dir:integer; {what |dvi_dir| should pop to} +begin cur_g:=0; cur_glue:=float_constant(0); +this_box:=temp_ptr; g_order:=glue_order(this_box); +g_sign:=glue_sign(this_box); p:=list_ptr(this_box); +incr(cur_s); +if cur_s>0 then dvi_out(push); +if cur_s>max_push then max_push:=cur_s; +save_loc:=dvi_offset+dvi_ptr; +synch_dir; +left_edge:=cur_h; cur_v:=cur_v-height(this_box); +@z + +@x [32.632] l.13155 - pTeX: output non-char-node +@ @= +begin case type(p) of +hlist_node,vlist_node:@; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +@y +@ @= +begin case type(p) of +hlist_node,vlist_node,dir_node: @; +rule_node: begin rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p); + goto fin_rule; + end; +@z + +@x [32.633] l.13175 - pTeX: Output a box in a vlist +@= +if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) +else begin cur_v:=cur_v+height(p); synch_v; + save_h:=dvi_h; save_v:=dvi_v; +@y +@= +if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) +else begin cur_v:=cur_v+height(p); synch_v; + save_h:=dvi_h; save_v:=dvi_v; save_dir:=dvi_dir; +@z +@x [32.633] l.13181 - pTeX: Output a box in a vlist + if type(p)=vlist_node then vlist_out@+else hlist_out; + dvi_h:=save_h; dvi_v:=save_v; + cur_v:=save_v+depth(p); cur_h:=left_edge; + end +@y + case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; + endcases; + dvi_h:=save_h; dvi_v:=save_v; dvi_dir:=save_dir; + cur_v:=save_v+depth(p); cur_h:=left_edge; cur_dir_hv:=save_dir; + end +@z + +@x [32.637] l.13256 - pTeX: Output a leader in a vlist +@= +@y +@= +@z +@x [32.637] l.13258 - pTeX: Output a leader in a vlist +cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; +temp_ptr:=leader_box; +outer_doing_leaders:=doing_leaders; doing_leaders:=true; +if type(leader_box)=vlist_node then vlist_out@+else hlist_out; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; cur_h:=left_edge; +cur_v:=save_v-height(leader_box)+leader_ht+lx; +end +@y +cur_v:=cur_v+height(leader_box); synch_v; save_v:=dvi_v; save_dir:=dvi_dir; +temp_ptr:=leader_box; +outer_doing_leaders:=doing_leaders; doing_leaders:=true; +case type(leader_box) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +doing_leaders:=outer_doing_leaders; +dvi_v:=save_v; dvi_h:=save_h; dvi_dir:=save_dir; +cur_h:=left_edge; cur_v:=save_v-height(leader_box)+leader_ht+lx; +cur_dir_hv:=save_dir; +end +@z + +@x [32.638] l.13270 - pTeX: ship out +@p procedure ship_out(@!p:pointer); {output the box |p|} +label done; +var page_loc:integer; {location of the current |bop|} +@y +@p procedure ship_out(@!p:pointer); {output the box |p|} +label done; +var page_loc:integer; {location of the current |bop|} +@!del_node:pointer; {used when delete the |dir_node| continued box} +@z +@x [32.640] l.13294 - pTeX: ship out +@; +@y +if type(p)=dir_node then + begin del_node:=p; p:=list_ptr(p); + delete_glue_ref(space_ptr(del_node)); + delete_glue_ref(xspace_ptr(del_node)); + free_node(del_node,box_node_size); + end; +flush_node_list(link(p)); link(p):=null; +if box_dir(p)<>dir_yoko then p:=new_dir_node(p,dir_yoko); +@; +@z + +@x [32.641] l.13327 - pTeX: dir_node +if type(p)=vlist_node then vlist_out@+else hlist_out; +@y +case type(p) of + hlist_node:hlist_out; + vlist_node:vlist_out; + dir_node:dir_out; +endcases; +@z + +@x [33.642] l.13394 - pTeX: postamble's id_byte + @; + dvi_out(post_post); dvi_four(last_bop); dvi_out(id_byte);@/ +@y + @; + dvi_out(post_post); dvi_four(last_bop); + if dir_used then dvi_out(ex_id_byte) else dvi_out(id_byte);@/ +@z + +@x [33.647] l.13515 - pTeX: cur_kanji_skip, cur_xkanji_skip, last_disp +@< Glob...@>= +@!adjust_tail:pointer; {tail of adjustment list} +@y +@< Glob...@>= +@!adjust_tail:pointer; {tail of adjustment list} +@!last_disp:scaled; {displacement at end of list} +@!cur_kanji_skip:pointer; +@!cur_xkanji_skip:pointer; +@z + +@x [33.648] l.13518 - pTeX: cur_kanji_skip, cur_xkanji_skip +@ @=adjust_tail:=null; last_badness:=0; +@y +@ @=adjust_tail:=null; last_badness:=0; + cur_kanji_skip:=zero_glue; cur_xkanji_skip:=zero_glue; +{ koko + |incr(glue_ref_count(cur_kanji_skip));| + |incr(glue_ref_count(cur_xkanji_skip));| +} +@z + +@x [33.649] l.13522 - pTeX: hpack +@p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; +label reswitch, common_ending, exit; +var r:pointer; {the box node that will be returned} +@y +@p function hpack(@!p:pointer;@!w:scaled;@!m:small_number):pointer; +label reswitch, common_ending, exit; +var r:pointer; {the box node that will be returned} +@!k:pointer; {points to a |kanji_space| specification} +@!disp:scaled; {displacement} +@z + +@x [33.649] l.13535 - pTeX: hpack +q:=r+list_offset; link(q):=p;@/ +h:=0; @; +@y +space_ptr(r):=cur_kanji_skip; xspace_ptr(r):=cur_xkanji_skip; +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +k:=cur_kanji_skip; +q:=r+list_offset; link(q):=p;@/ +h:=0; @; +disp:=0; +@z +@x [33.649] l.13537 - pTeX: hpack +while p<>null do @; +if adjust_tail<>null then link(adjust_tail):=null; +height(r):=h; depth(r):=d;@/ +@; +common_ending: @; +exit: hpack:=r; +end; +@y +while p<>null do @; +if adjust_tail<>null then link(adjust_tail):=null; +height(r):=h; depth(r):=d;@/ +@; +common_ending: + @; +exit: last_disp:=disp; hpack:=r; +end; +@z + +@x [33.651] l.13556 - pTeX: dir_node, disp_node, reset chain +@ @= +@^inner loop@> +begin reswitch: while is_char_node(p) do + @; +if p<>null then + begin case type(p) of + hlist_node,vlist_node,rule_node,unset_node: + @; + ins_node,mark_node,adjust_node: if adjust_tail<>null then + @; + whatsit_node:@; +@y +@ @= +@^inner loop@> +begin reswitch: chain:=false; +while is_char_node(p) do + @; +if p<>null then + begin case type(p) of + hlist_node,vlist_node,dir_node,rule_node,unset_node: + @; + ins_node,mark_node,adjust_node: + if adjust_tail<>null then @; + whatsit_node:@; + disp_node:disp:=disp_dimen(p); +@z + +@x [33.653] l.13589 - pTeX: displacement +@= +begin x:=x+width(p); +if type(p)>=rule_node then s:=0 @+else s:=shift_amount(p); +if height(p)-s>h then h:=height(p)-s; +if depth(p)+s>d then d:=depth(p)+s; +end +@y +@= +begin x:=x+width(p); +if type(p)>=rule_node then s:=disp @+else s:=shift_amount(p)+disp; +if height(p)-s>h then h:=height(p)-s; +if depth(p)+s>d then d:=depth(p)+s; +end +@z + +@x [33.654] l.13601 - pTeX: auto spacing, displacement +@= +begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); +x:=x+char_width(f)(i);@/ +s:=char_height(f)(hd);@+if s>h then h:=s; +s:=char_depth(f)(hd);@+if s>d then d:=s; +p:=link(p); +end +@y +@= +begin f:=font(p); i:=char_info(f)(character(p)); hd:=height_depth(i); +x:=x+char_width(f)(i);@/ +s:=char_height(f)(hd)-disp; if s>h then h:=s; +s:=char_depth(f)(hd)+disp; if s>d then d:=s; +if font_dir[f]<>dir_default then + begin p:=link(p); + if chain then + begin x:=x+width(k);@/ + o:=stretch_order(k); total_stretch[o]:=total_stretch[o]+stretch(k); + o:=shrink_order(k); total_shrink[o]:=total_shrink[o]+shrink(k); + end + else chain:=true; + end +else chain:=false; +p:=link(p); +end +@z + +@x [33.668] l.13779 - pTeX: vpackage +begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; +subtype(r):=min_quarterword; shift_amount(r):=0; +@y +begin last_badness:=0; r:=get_node(box_node_size); type(r):=vlist_node; +subtype(r):=min_quarterword; shift_amount(r):=0; +space_ptr(r):=zero_glue; xspace_ptr(r):=zero_glue; +add_glue_ref(zero_glue); add_glue_ref(zero_glue); +@z + +@x [33.669] l.13797 - pTeX: dir_node +@ @= +begin if is_char_node(p) then confusion("vpack") +@:this can't happen vpack}{\quad vpack@> +else case type(p) of + hlist_node,vlist_node,rule_node,unset_node: + @; +@y +@ @= +begin if is_char_node(p) then confusion("vpack") +@:this can't happen vpack}{\quad vpack@> +else case type(p) of + hlist_node,vlist_node,dir_node,rule_node,unset_node: + @; +@z + +@x [34.681] l.14026 - pTeX: math noad +@d noad_size=4 {number of words in a normal noad} +@d nucleus(#)==#+1 {the |nucleus| field of a noad} +@d supscr(#)==#+2 {the |supscr| field of a noad} +@d subscr(#)==#+3 {the |subscr| field of a noad} +@y +\yskip\hang In Japanese, |math_type(q)=math_jchar| means that |fam(q)| +refers to one of the sixteen kanji font families, and |KANJI(q)| is the +internal kanji code number. +@^Japanese extentions@> + +@d noad_size=5 {number of words in a normal noad} +@d nucleus(#)==#+1 {the |nucleus| field of a noad} +@d supscr(#)==#+2 {the |supscr| field of a noad} +@d subscr(#)==#+3 {the |subscr| field of a noad} +@d kcode_noad(#)==#+4 +@d math_kcode(#)==info(#+4) {the |kanji character| field of a noad} +@d kcode_noad_nucleus(#)==#+3 +@d math_kcode_nucleus(#)==info(#+3) + {the |kanji character| field offset from nucleus} +@# +@d math_jchar=5 +@d math_text_jchar=6 +@z + +@x [34.683] radical with japanese char +@d left_delimiter(#)==#+4 {first delimiter field of a noad} +@d right_delimiter(#)==#+5 {second delimiter field of a fraction noad} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=5 {number of |mem| words in a radical noad} +@y +@d left_delimiter(#)==#+5 {first delimiter field of a noad} +@d right_delimiter(#)==#+4 {second delimiter field of a fraction noad} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=6 {number of |mem| words in a radical noad} +@z + +@x [34.686] l.14129 - pTeX: new_noad +mem[supscr(p)].hh:=empty_field; +new_noad:=p; +@y +mem[supscr(p)].hh:=empty_field; +mem[kcode_noad(p)].hh:=empty_field; +new_noad:=p; +@z + +@x [34.687] accent with japanese char +@d accent_noad_size=5 {number of |mem| words in an accent noad} +@d accent_chr(#)==#+4 {the |accent_chr| field of an accent noad} +@y +@d accent_noad_size=6 {number of |mem| words in an accent noad} +@d accent_chr(#)==#+5 {the |accent_chr| field of an accent noad} +@z + +@x [34.691] l.14236 - pTeX: print_fam_and_char +procedure print_fam_and_char(@!p:pointer); {prints family and character} +begin print_esc("fam"); print_int(fam(p)); print_char(" "); +print_ASCII(qo(character(p))); +@y +procedure print_fam_and_char(@!p:pointer;@!t:small_number); + {prints family and character} +var @!cx:KANJI_code; {temporary register for KANJI} +begin print_esc("fam"); print_int(fam(p)); print_char(" "); +if t=math_char then print_ASCII(qo(character(p))) +else begin KANJI(cx):=math_kcode_nucleus(p); print_kanji(cx); + end; +@z + +@x [34.692] l.14266 - pTeX: print_subsidiary_data + math_char: begin print_ln; print_current_string; print_fam_and_char(p); +@y + math_char, math_jchar: begin print_ln; print_current_string; + print_fam_and_char(p,math_type(p)); +@z + +@x [34.696] l.14327 - pTeX: print_fam_and_char +accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p)); +@y +accent_noad: begin print_esc("accent"); + print_fam_and_char(accent_chr(p),math_char); +@z + +@x [35.715] l.14687 - pTeX: rebox + begin if type(b)=vlist_node then b:=hpack(b,natural); + p:=list_ptr(b); + if (is_char_node(p))and(link(p)=null) then + begin f:=font(p); v:=char_width(f)(char_info(f)(character(p))); + if v<>width(b) then link(p):=new_kern(width(b)-v); + end; +@y + begin if type(b)<>hlist_node then b:=hpack(b,natural); + p:=list_ptr(b); + if is_char_node(p) then + if font_dir[font(p)]<>dir_default then + begin if link(link(p))=null then + begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); + if v<>width(b) then link(link(p)):=new_kern(width(b)-v); + end + end + else if link(p)=null then + begin f:=font(p); v:=char_width(f)(orig_char_info(f)(character(p))); + if v<>width(b) then link(p):=new_kern(width(b)-v); + end; + delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); +@z + +@x [36.720] l.14783 - pTeX: clean_box +function clean_box(@!p:pointer;@!s:small_number):pointer; +@y +function clean_box(@!p:pointer;@!s:small_number;@!jc:halfword):pointer; +@z + +@x [36.720] l.14790 - pTeX: clean_box +math_char: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; + end; +@y +math_char: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; + end; +math_jchar: begin cur_mlist:=new_noad; mem[nucleus(cur_mlist)]:=mem[p]; + math_kcode(cur_mlist):=jc; + end; +@z + +@x [36.720] l.14802 - pTeX: clean_box +found: if is_char_node(q)or(q=null) then x:=hpack(q,natural) + else if (link(q)=null)and(type(q)<=vlist_node)and(shift_amount(q)=0) then + x:=q {it's already clean} + else x:=hpack(q,natural); +@y +found: if is_char_node(q)or(q=null) then x:=hpack(q,natural) + else if (link(q)=null)and(type(q)<=dir_node)and(shift_amount(q)=0) then + x:=q {it's already clean} + else x:=hpack(q,natural); +@z + +@x [36.721] l.14814 - pTeX: skip 2nd kanji node +if is_char_node(q) then + begin r:=link(q); +@y +if is_char_node(q) then + begin if font_dir[font(q)]<>dir_default then q:=link(q); + r:=link(q); +@z + +@x [36.722] l.14833 - pTeX: fetch +else begin if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then + cur_i:=orig_char_info(cur_f)(cur_c) + else cur_i:=null_character; + if not(char_exists(cur_i)) then + begin char_warning(cur_f,qo(cur_c)); + math_type(a):=empty; + end; + end; +@y +else begin if font_dir[cur_f]<>dir_default then + cur_c:=qi(get_jfm_pos(KANJI(math_kcode_nucleus(a)),cur_f)); + if (qo(cur_c)>=font_bc[cur_f])and(qo(cur_c)<=font_ec[cur_f]) then + cur_i:=orig_char_info(cur_f)(cur_c) + else cur_i:=null_character; + if not(char_exists(cur_i)) then + begin char_warning(cur_f,qo(cur_c)); + math_type(a):=empty; + end; + end; +@z + +@x [36.726] l.14892 - pTeX: mlist_to_hlist +var mlist:pointer; {beginning of the given list} +@!penalties:boolean; {should penalty nodes be inserted?} +@!style:small_number; {the given style} +@y +var mlist:pointer; {beginning of the given list} +@!penalties:boolean; {should penalty nodes be inserted?} +@!style:small_number; {the given style} +@!u:pointer; {temporary register} +@z + +@x [36.726] l.14913 - pTeX: mlist_to_hlist +@; +end; +@y +@; +p:=new_null_box; link(p):=link(temp_head); +adjust_hlist(p,false); link(temp_head):=link(p); +delete_glue_ref(space_ptr(p)); delete_glue_ref(xspace_ptr(p)); +free_node(p,box_node_size); +end; +@z + +@x [36.727] l.14928 - pTeX: free box +free_node(z,box_node_size); +@y +delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); +free_node(z,box_node_size); +@z + +@x [36.730] l.14976 - pTeX: free box: disp_node +kern_node: begin math_kern(q,cur_mu); goto done_with_node; + end; +@y +kern_node: begin math_kern(q,cur_mu); goto done_with_node; + end; +disp_node: goto done_with_node; +@z + +@x [36.734] l.15046 - pTeX: make_over:clean_box + overbar(clean_box(nucleus(q),cramped_style(cur_style)),@| +@y + overbar(clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)),@| +@z + +@x [36.735] l.15055 - pTeX: make_under:clean_box +begin x:=clean_box(nucleus(q),cur_style); +@y +begin x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +@z + +@x [36.736] l.15069 - pTeX: make_under:clean_box +if type(v)<>vlist_node then confusion("vcenter"); +@y +if type(v)=dir_node then + begin if type(list_ptr(v))<>vlist_node then confusion("dircenter") + end +else begin if type(v)<>vlist_node then confusion("vcenter") + end; +@z + +@x [36.737] l.15089 - pTeX: make_radical:clean_box +begin x:=clean_box(nucleus(q),cramped_style(cur_style)); +@y +begin x:=clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)); +@z + +@x [36.738] l.15123 - pTeX: make_math_accent:clean_box + x:=clean_box(nucleus(q),cramped_style(cur_style)); w:=width(x); h:=height(x); +@y + x:=clean_box(nucleus(q),cramped_style(cur_style),math_kcode(q)); + w:=width(x); h:=height(x); +@z + +@x [36.742] l.15186 - pTeX: make_math_accent:clean_box +x:=clean_box(nucleus(q),cur_style); delta:=delta+height(x)-h; h:=height(x); +@y +x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +delta:=delta+height(x)-h; h:=height(x); +@z + +@x [36.744] l.15211 - pTeX: make_fraction:clean_box +x:=clean_box(numerator(q),num_style(cur_style)); +z:=clean_box(denominator(q),denom_style(cur_style)); +@y +x:=clean_box(numerator(q),num_style(cur_style),math_kcode(q)); +z:=clean_box(denominator(q),denom_style(cur_style),math_kcode(q)); +@z + +@x [36.749] l.15304 - pTeX: make_op:clean_box + delta:=char_italic(cur_f)(cur_i); x:=clean_box(nucleus(q),cur_style); +@y + delta:=char_italic(cur_f)(cur_i); + x:=clean_box(nucleus(q),cur_style,math_kcode(q)); +@z + +@x [36.750] l.15321 - pTeX: make_op:clean_box +begin x:=clean_box(supscr(q),sup_style(cur_style)); +y:=clean_box(nucleus(q),cur_style); +z:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin x:=clean_box(supscr(q),sup_style(cur_style),math_kcode(q)); +y:=clean_box(nucleus(q),cur_style,math_kcode(q)); +z:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.751] l.15342 - pTeX: free box node + begin free_node(x,box_node_size); list_ptr(v):=y; + end +@y + begin + delete_glue_ref(space_ptr(x)); delete_glue_ref(xspace_ptr(x)); + free_node(x,box_node_size); list_ptr(v):=y; + end +@z + +@x [36.751] l.15350 - pTeX: free box node +if math_type(subscr(q))=empty then free_node(z,box_node_size) +@y +if math_type(subscr(q))=empty then begin + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size) +end +@z + +@x [36.752] l.15369 - pTeX: make_ord +procedure make_ord(@!q:pointer); +label restart,exit; +var a:integer; {address of lig/kern instruction} +@!p,@!r:pointer; {temporary registers for list manipulation} +begin restart:@t@>@;@/ +if math_type(subscr(q))=empty then if math_type(supscr(q))=empty then + if math_type(nucleus(q))=math_char then + begin p:=link(q); + if p<>null then if (type(p)>=ord_noad)and(type(p)<=punct_noad) then + if math_type(nucleus(p))=math_char then + if fam(nucleus(p))=fam(nucleus(q)) then + begin math_type(nucleus(q)):=math_text_char; + fetch(nucleus(q)); + if char_tag(cur_i)=lig_tag then + begin a:=lig_kern_start(cur_f)(cur_i); + cur_c:=character(nucleus(p)); + cur_i:=font_info[a].qqqq; + if skip_byte(cur_i)>stop_flag then + begin a:=lig_kern_restart(cur_f)(cur_i); + cur_i:=font_info[a].qqqq; + end; + loop@+ begin @; + if skip_byte(cur_i)>=stop_flag then return; + a:=a+qo(skip_byte(cur_i))+1; + cur_i:=font_info[a].qqqq; + end; + end; + end; + end; +exit:end; +@y +procedure make_ord(@!q:pointer); +label restart,exit; +var a:integer; {address of lig/kern instruction} +@!gp,@!gq,@!p,@!r:pointer; {temporary registers for list manipulation} +@!rr:halfword; +begin restart:@t@>@;@/ +if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@| +((math_type(nucleus(q))=math_char)or(math_type(nucleus(q))=math_jchar)) then + begin p:=link(q); + if p<>null then if (type(p)>=ord_noad)and(type(p)<=punct_noad) then + if fam(nucleus(p))=fam(nucleus(q)) then + if math_type(nucleus(p))=math_char then + begin math_type(nucleus(q)):=math_text_char; + fetch(nucleus(q)); + if char_tag(cur_i)=lig_tag then + begin a:=lig_kern_start(cur_f)(cur_i); + cur_c:=character(nucleus(p)); + cur_i:=font_info[a].qqqq; + if skip_byte(cur_i)>stop_flag then + begin a:=lig_kern_restart(cur_f)(cur_i); + cur_i:=font_info[a].qqqq; + end; + loop@+ begin @; + if skip_byte(cur_i)>=stop_flag then return; + a:=a+qo(skip_byte(cur_i))+1; + cur_i:=font_info[a].qqqq; + end; + end; + end + else if math_type(nucleus(p))=math_jchar then + begin math_type(nucleus(q)):=math_text_jchar; + fetch(nucleus(p)); a:=cur_c; fetch(nucleus(q)); + if char_tag(cur_i)=gk_tag then + begin cur_c:=a; a:=glue_kern_start(cur_f)(cur_i); + {|cur_c|:=qi(|get_jfm_pos|(|math_kcode|(p), + |fam_fnt|(fam(nucleus(p))+|cur_size|)));} + repeat + cur_i:=font_info[a].qqqq; + if next_char(cur_i)=cur_c then + if op_byte(cur_i)null then begin + while((type(gp)<>rr)and(link(gp)<>null)) do begin gp:=link(gp); + end; + gq:=glue_ptr(gp); + end + else begin gp:=get_node(small_node_size); + font_glue[cur_f]:=gp; gq:=null; + end; + if gq=null then + begin type(gp):=rr; gq:=new_spec(zero_glue); glue_ptr(gp):=gq; + a:=exten_base[cur_f]+qi((qo(rr))*3); width(gq):=font_info[a].sc; + stretch(gq):=font_info[a+1].sc; shrink(gq):=font_info[a+2].sc; + add_glue_ref(gq); link(gp):=get_node(small_node_size); + gp:=link(gp); glue_ptr(gp):=null; link(gp):=null; + end; + p:=new_glue(gq); link(p):=link(q); link(q):=p; return; + end + else begin p:=new_kern(char_kern(cur_f)(cur_i)); + link(p):=link(q); link(q):=p; return; + end; + incr(a); + until skip_byte(cur_i)>=stop_flag; + end; + end; + end; +exit:end; +@z + +@x [36.754] l.15452 - pTeX: +math_char, math_text_char: +@y +math_char, math_text_char, math_jchar, math_text_jchar: +@z + +@x [36.755] l.15475 - pTeX: convert math text to KANJI char_node + begin delta:=char_italic(cur_f)(cur_i); p:=new_character(cur_f,qo(cur_c)); + if (math_type(nucleus(q))=math_text_char)and(space(cur_f)<>0) then + delta:=0; {no italic correction in mid-word of text font} + if (math_type(subscr(q))=empty)and(delta<>0) then + begin link(p):=new_kern(delta); delta:=0; +@y + begin delta:=char_italic(cur_f)(cur_i); p:=new_character(cur_f,qo(cur_c)); + u:=p; + if font_dir[cur_f]<>dir_default then begin + link(u):=get_avail; u:=link(u); info(u):=math_kcode(q); + end; + if ((math_type(nucleus(q))=math_text_char)or + (math_type(nucleus(q))=math_text_jchar))and(space(cur_f)<>0) then + delta:=0; {no italic correction in mid-word of text font} + if (math_type(subscr(q))=empty)and(delta<>0) then begin + link(u):=new_kern(delta); delta:=0; +@z + +@x [36.756] l.15505 - pTeX: free box + shift_down:=depth(z)+sub_drop(t); + free_node(z,box_node_size); + end; +@y + shift_down:=depth(z)+sub_drop(t); + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size); + end; +@z + +@x [36.757] l.15526 - pTeX: make_scripts:clean_box +begin x:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin x:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.758] l.15538 - pTeX: make_scripts:clean_box +begin x:=clean_box(supscr(q),sup_style(cur_style)); +@y +begin x:=clean_box(supscr(q),sup_style(cur_style),math_kcode(q)); +@z + +@x [36.758] l.15555 - pTeX: make_scripts:clean_box +begin y:=clean_box(subscr(q),sub_style(cur_style)); +@y +begin y:=clean_box(subscr(q),sub_style(cur_style),math_kcode(q)); +@z + +@x [36.760] l.15616 - pTeX: disp_node +othercases confusion("mlist3") +@y +disp_node: begin link(p):=q; p:=q; q:=link(q); link(p):=null; goto done; + end; +othercases confusion("mlist3") +@z + +@x [37.796] l.16276 - pTeX: call adjust_hlist + begin adjust_tail:=cur_tail; u:=hpack(link(head),natural); w:=width(u); +@y + begin adjust_tail:=cur_tail; adjust_hlist(head,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + u:=hpack(link(head),natural); w:=width(u); +@z + +@x [37.799] l.16331 - pTeX: call adjust_hlist + begin p:=hpack(link(head),natural); +@y + begin adjust_hlist(head,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(link(head),natural); +@z + +@x [37.800] l.16353 - pTeX: call adjust_hlist +var @!p,@!q,@!r,@!s,@!u,@!v: pointer; {registers for the list operations} +@y +var @!p,@!q,@!r,@!s,@!u,@!v,@!z: pointer; {registers for the list operations} +@z + +@x [37.804] l.16456 - pTeX: call adjust_hlist + p:=hpack(preamble,saved(1),saved(0)); overfull_rule:=rule_save; +@y + z:=new_null_box; link(z):=preamble; + adjust_hlist(z,false); + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=space_ptr(z); cur_xkanji_skip:=xspace_ptr(z); + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(preamble,saved(1),saved(0)); overfull_rule:=rule_save; + delete_glue_ref(space_ptr(z)); delete_glue_ref(xspace_ptr(z)); + free_node(z,box_node_size); +@z + +@x [37.807] l.16499 - pTeX: unset box -> BOX +glue_order(q):=glue_order(p); glue_sign(q):=glue_sign(p); +glue_set(q):=glue_set(p); shift_amount(q):=o; +r:=link(list_ptr(q)); s:=link(list_ptr(p)); +@y +set_box_dir(q)(abs(direction)); +glue_order(q):=glue_order(p); glue_sign(q):=glue_sign(p); +glue_set(q):=glue_set(p); shift_amount(q):=o; +r:=link(list_ptr(q)); s:=link(list_ptr(p)); +@z + +@x [37.809] l.16541 - pTeX: unset box -> BOX +s:=link(s); link(u):=new_null_box; u:=link(u); t:=t+width(s); +if mode=-vmode then width(u):=width(s)@+else + begin type(u):=vlist_node; height(u):=width(s); + end +@y +s:=link(s); link(u):=new_null_box; u:=link(u); t:=t+width(s); +if mode=-vmode then width(u):=width(s)@+else + begin type(u):=vlist_node; height(u):=width(s); + end; +set_box_dir(u)(abs(direction)) +@z + +@x [37.810] l.16564 - pTeX: unset box -> BOX +width(r):=w; type(r):=hlist_node; +end +@y +width(r):=w; type(r):=hlist_node; +set_box_dir(r)(abs(direction)); +end +@z + +@x [37.811] l.16585 - pTeX: unset box -> BOX +height(r):=w; type(r):=vlist_node; +@y +height(r):=w; type(r):=vlist_node; +set_box_dir(r)(abs(direction)); +@z + +@x [38.816] l.16687 - pTeX: init chain, delete disp_node +link(temp_head):=link(head); +if is_char_node(tail) then tail_append(new_penalty(inf_penalty)) +else if type(tail)<>glue_node then tail_append(new_penalty(inf_penalty)) +@y +first_use:=true; chain:=false; +delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); +cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head); +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +link(temp_head):=link(head); +if not is_char_node(tail)and(type(tail)=disp_node) then + begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null + end; +if is_char_node(tail) then tail_append(new_penalty(inf_penalty)) +else if type(tail)<>glue_node then tail_append(new_penalty(inf_penalty)) +@z + +@x [38.828] l.16946 - pTeX: Global variable |chain| +@!cur_p:pointer; {the current breakpoint under consideration} +@y +@!cur_p:pointer; {the current breakpoint under consideration} +@!chain:boolean; {chain current line and next line?} +@z + +% chain ¤¬¿¿¤Î¾ì¹ç¡¢¸å¤í¤Ë cur_kanji_skip ¤¬ÁÞÆþ¤µ¤ì¤ë¤Î¤Ç¡¢¤³¤³¤Ç +% break_width ¤«¤é°ú¤¤¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ +@x [38.837] l.17125 - pTeX: add kanji_skip width, ita_kern +begin no_break_yet:=false; do_all_six(set_break_width_to_background); +s:=cur_p; +if break_type>unhyphenated then if cur_p<>null then + @; +while s<>null do + begin if is_char_node(s) then goto done; +@y +begin no_break_yet:=false; do_all_six(set_break_width_to_background); +s:=cur_p; +if break_type>unhyphenated then if cur_p<>null then + @; +while s<>null do + begin if is_char_node(s) then + begin if chain then + begin break_width[1]:=break_width[1]-width(cur_kanji_skip); + break_width[2+stretch_order(cur_kanji_skip)]:= + break_width[2+stretch_order(cur_kanji_skip)]-stretch(cur_kanji_skip); + break_width[6]:=break_width[6]-shrink(cur_kanji_skip); + end; + goto done end; +@z + +@x [38.837] l.17135 - pTeX: + kern_node: if subtype(s)<>explicit then goto done + else break_width[1]:=break_width[1]-width(s); +@y + kern_node: if (subtype(s)<>explicit)and(subtype(s)<>ita_kern) then + goto done + else break_width[1]:=break_width[1]-width(s); +@z + +@x [38.841] l.17186 - pTeX: +if is_char_node(v) then + begin f:=font(v); + break_width[1]:=break_width[1]-char_width(f)(char_info(f)(character(v))); + end +else case type(v) of + ligature_node: begin f:=font(lig_char(v));@/ + break_width[1]:=@|break_width[1]- + char_width(f)(char_info(f)(character(lig_char(v)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + break_width[1]:=break_width[1]-width(v); + othercases confusion("disc1") +@:this can't happen disc1}{\quad disc1@> + endcases +@y +if is_char_node(v) then + begin f:=font(v); + break_width[1]:=break_width[1]-char_width(f)(orig_char_info(f)(character(v))); + if font_dir[f]<>dir_default then v:=link(v); + end +else case type(v) of + ligature_node: begin f:=font(lig_char(v));@/ + break_width[1]:=@|break_width[1]- + char_width(f)(orig_char_info(f)(character(lig_char(v)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + break_width[1]:=break_width[1]-width(v); + disp_node: do_nothing; + othercases confusion("disc1") +@:this can't happen disc1}{\quad disc1@> + endcases +@z + +@x [38.842] l.17204 - pTeX: + break_width[1]:=@|break_width[1]+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + break_width[1]:=break_width[1]+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + break_width[1]:=break_width[1]+width(s); +@y + break_width[1]:=@|break_width[1]+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + break_width[1]:=break_width[1]+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + break_width[1]:=break_width[1]+width(s); + disp_node: do_nothing; +@z + +@x [38.856] l.17467 - pTeX: print symbolic feasibe node +if cur_p=null then print_esc("par") +else if type(cur_p)<>glue_node then + begin if type(cur_p)=penalty_node then print_esc("penalty") + else if type(cur_p)=disc_node then print_esc("discretionary") +@y +if cur_p=null then print_esc("par") +else if (type(cur_p)<>glue_node)and(not is_char_node(cur_p)) then + begin if type(cur_p)=penalty_node then print_esc("penalty") + else if type(cur_p)=disc_node then print_esc("discretionary") +@z + +@x [39.862] l.17584 - pTeX: local valiable for line breaking +@!auto_breaking:boolean; {is node |cur_p| outside a formula?} +@!prev_p:pointer; {helps to determine when glue nodes are breakpoints} +@!q,@!r,@!s,@!prev_s:pointer; {miscellaneous nodes of temporary interest} +@!f:internal_font_number; {used when calculating character widths} +@y +@!auto_breaking:boolean; {is node |cur_p| outside a formula?} +@!prev_p:pointer; {helps to determine when glue nodes are breakpoints} +@!q,@!r,@!s,@!prev_s:pointer; {miscellaneous nodes of temporary interest} +@!f,@!post_f:internal_font_number; {used when calculating character widths} +@!post_p:pointer; +@!cc:ASCII_code; +@!first_use:boolean; +@z + +@x [39.866] l.17677 - pTeX: dir_node, disp_node, ita_kern +case type(cur_p) of +hlist_node,vlist_node,rule_node: act_width:=act_width+width(cur_p); +@y +case type(cur_p) of +hlist_node,vlist_node,dir_node,rule_node: act_width:=act_width+width(cur_p); +@z + +@x [39.866] l.17685 - pTeX: +kern_node: if subtype(cur_p)=explicit then kern_break + else act_width:=act_width+width(cur_p); +@y +kern_node: if (subtype(cur_p)=explicit)or(subtype(cur_p)=ita_kern) then + kern_break + else act_width:=act_width+width(cur_p); +@z + +@x [39.866] l.17694 - pTeX: +mark_node,ins_node,adjust_node: do_nothing; +@y +disp_node,mark_node,ins_node,adjust_node: do_nothing; +@z + +% ¤³¤³¤Ç¡¢Ï¢Â³¤¹¤ë´Á»ú¥³¡¼¥É´Ö¤Ë cur_kanji_skip ¤òÁÞÆþ¤¹¤ë¡£ +% penalty_node ¤ä box_node ¤Ë¤Ï¡¢adjust_hlist ¥ë¡¼¥Á¥ó¤Ë¤è¤Ã¤Æ´û¤Ë¼ÂºÝ¤Î +% glue_node ¤¬ÁÞÆþ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È²¾Äꤷ¤Æ¤¤¤ë¡£ +% chain ¤Ï¡¢try_break ¤Ç cur_kanji_skip ¤Î¥¢¥¸¥ã¥¹¥È¤Î¤¿¤á¤Ë»È¤ï¤ì¤ë¡£ +@x [39.867] l.17708 - pTeX: add kanji char width +@= +begin prev_p:=cur_p; +repeat f:=font(cur_p); +act_width:=act_width+char_width(f)(char_info(f)(character(cur_p))); +cur_p:=link(cur_p); +until not is_char_node(cur_p); +end +@y +@= +begin chain:=false; +if is_char_node(cur_p) then + if font_dir[font(cur_p)]<>dir_default then + begin case type(prev_p) of + hlist_node,vlist_node,dir_node,rule_node, + ligature_node,disc_node,math_node: begin + cur_p:=prev_p; try_break(0,unhyphenated); cur_p:=link(cur_p); + end; + othercases do_nothing; + endcases; + end; + prev_p:=cur_p; post_p:=cur_p; post_f:=font(post_p); + repeat f:=post_f; cc:=character(cur_p); + act_width:=act_width+char_width(f)(orig_char_info(f)(cc)); + post_p:=link(cur_p); + if font_dir[f]<>dir_default then + begin prev_p:=cur_p; cur_p:=post_p; post_p:=link(post_p); + if is_char_node(post_p) then + begin post_f:=font(post_p); + if font_dir[post_f]<>dir_default then chain:=true else chain:=false; + try_break(0,unhyphenated); + end + else + begin chain:=false; + case type(post_p) of + hlist_node,vlist_node,dir_node,rule_node,ligature_node, + disc_node,math_node: try_break(0,unhyphenated); + othercases do_nothing; + endcases; + end; + if chain then + begin if first_use then + begin check_shrinkage(cur_kanji_skip); + first_use:=false; + end; + act_width:=act_width+width(cur_kanji_skip);@| + active_width[2+stretch_order(cur_kanji_skip)]:=@| + active_width[2+stretch_order(cur_kanji_skip)] + +stretch(cur_kanji_skip);@/ + active_width[6]:=active_width[6]+shrink(cur_kanji_skip); + end; + prev_p:=cur_p; + end + else if is_char_node(post_p) then + begin post_f:=font(post_p); chain:=false; + if font_dir[post_f]<>dir_default then try_break(0,unhyphenated); + end; + cur_p:=post_p; + until not is_char_node(cur_p); +chain:=false; +end +@z + +@x [39.868] l.17723 - pTeX: ita_kern + else if (type(prev_p)=kern_node)and(subtype(prev_p)<>explicit) then + try_break(0,unhyphenated); +@y + else if type(prev_p)=kern_node then + if (subtype(prev_p)<>explicit)and(subtype(prev_p)<>ita_kern) then + try_break(0,unhyphenated); +@z + +@x [39.871] l.17756 - pTeX: add kanji char width, dir_node width, disp_node + disc_width:=disc_width+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + disc_width:=disc_width+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + disc_width:=disc_width+width(s); +@y + disc_width:=disc_width+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s) + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + disc_width:=disc_width+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + disc_width:=disc_width+width(s); + disp_node: do_nothing; +@z + +@x [39.872] l.17772 - pTeX: add kanji char width, dir_node width, disp_node + act_width:=act_width+char_width(f)(char_info(f)(character(s))); + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + act_width:=act_width+ + char_width(f)(char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,rule_node,kern_node: + act_width:=act_width+width(s); +@y + act_width:=act_width+char_width(f)(orig_char_info(f)(character(s))); + if font_dir[f]<>dir_default then s:=link(s) + end +else case type(s) of + ligature_node: begin f:=font(lig_char(s)); + act_width:=act_width+ + char_width(f)(orig_char_info(f)(character(lig_char(s)))); + end; + hlist_node,vlist_node,dir_node,rule_node,kern_node: + act_width:=act_width+width(s); + disp_node: do_nothing; +@z + +@x [39.877] l.17879 - pTeX: last_disp +cur_line:=prev_graf+1; +@y +cur_line:=prev_graf+1; last_disp:=0; +@z + +@x [39.879] l.17919 - pTeX: ita_kern + if type(q)=kern_node then if subtype(q)<>explicit then goto done1; +@y + if type(q)=kern_node then + if (subtype(q)<>explicit)and(subtype(q)<>ita_kern) then goto done1; +@z + +@x [39.881] l.17950 - pTeX: |q| may be a |char_node| +if q<>null then {|q| cannot be a |char_node|} + if type(q)=glue_node then + begin delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=right_skip; + subtype(q):=right_skip_code+1; add_glue_ref(right_skip); + goto done; + end + else begin if type(q)=disc_node then + @ +@y +if q<>null then {|q| may be a |char_node|} + begin if not is_char_node(q) then + if type(q)=glue_node then + begin delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=right_skip; + subtype(q):=right_skip_code+1; add_glue_ref(right_skip); + goto done; + end + else begin if type(q)=disc_node then + @ +@z +@x [39.881] l.17961 - pTeX: |q| may be a |char_node| + end +@y + end + end +@z + +@x [39.887] l.18014 - pTeX: disp_node at begin-of-line +r:=link(q); link(q):=null; q:=link(temp_head); link(temp_head):=r; +@y +r:=link(q); link(q):=null; q:=link(temp_head); link(temp_head):=r; +if last_disp<>0 then begin + r:=get_node(small_node_size); + type(r):=disp_node; disp_dimen(r):=last_disp; + link(r):=q; q:=r; + end; +@z + +@x [40.896] l.18177 - pTeX: hyphenation +loop@+ begin if is_char_node(s) then + begin c:=qo(character(s)); hf:=font(s); + end +@y +loop@+ begin if is_char_node(s) then + begin hf:=font(s); + if font_dir[hf]<>dir_default then + begin prev_s:=s; s:=link(prev_s); c:=info(s); goto continue; + end else c:=qo(character(s)); + end + else if type(s)=disp_node then goto continue + else if (type(s)=penalty_node)and(not subtype(s)=normal) then goto continue +@z + +@x [40.899] l.18248 - pTeX: disp_node + whatsit_node,glue_node,penalty_node,ins_node,adjust_node,mark_node: + goto done4; +@y + disp_node: do_nothing; + whatsit_node,glue_node,penalty_node,ins_node,adjust_node,mark_node: + goto done4; +@z + +@x [44.968] l.19535 - pTeX: dir_node + hlist_node,vlist_node,rule_node:@; +@y + hlist_node,vlist_node,dir_node,rule_node: + @; +@z + +@x [44.973] l.19626 - pTeX: dir_node +hlist_node,vlist_node,rule_node: begin@t@>@;@/ + cur_height:=cur_height+prev_dp+height(p); prev_dp:=depth(p); +@y +hlist_node,vlist_node,dir_node,rule_node: begin@t@>@;@/ + cur_height:=cur_height+prev_dp+height(p); prev_dp:=depth(p); +@z + +@x [44.977] l.19710 - pTeX: free box node +var v:pointer; {the box to be split} +@y +var v:pointer; {the box to be split} +w:pointer; {|dir_node|} +@z + +@x [44.977] l.19722 - pTeX: free box node +q:=prune_page_top(q); p:=list_ptr(v); free_node(v,box_node_size); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else box(n):=vpack(q,natural); +vsplit:=vpackage(p,h,exactly,split_max_depth); +@y +q:=prune_page_top(q); p:=list_ptr(v); +if q=null then box(n):=null {the |eq_level| of the box stays the same} +else begin + box(n):=vpack(q,natural); set_box_dir(box(n))(box_dir(v)); + end; +q:=vpackage(p,h,exactly,split_max_depth); +set_box_dir(q)(box_dir(v)); +delete_glue_ref(space_ptr(v)); delete_glue_ref(xspace_ptr(v)); +free_node(v,box_node_size); +vsplit:=q; +@z + +@x [44.978] l.19732 - pTeX: bad box for vsplit +if type(v)<>vlist_node then + begin print_err(""); print_esc("vsplit"); print(" needs a "); + print_esc("vbox"); +@:vsplit_}{\.{\\vsplit needs a \\vbox}@> + help2("The box you are trying to split is an \hbox.")@/ + ("I can't split such a box, so I'll leave it alone."); + error; vsplit:=null; return; + end +@y +if type(v)=dir_node then begin + w:=v; v:=list_ptr(v); + delete_glue_ref(space_ptr(w)); + delete_glue_ref(xspace_ptr(w)); + free_node(w,box_node_size); +end; +if type(v)<>vlist_node then begin + print_err(""); print_esc("vsplit"); print(" needs a "); + print_esc("vbox"); +@:vsplit_}{\.{\\vsplit needs a \\vbox}@> + help2("The box you are trying to split is an \hbox.")@/ + ("I can't split such a box, so I'll leave it alone."); + error; vsplit:=null; return; +end; +flush_node_list(link(v)); link(v):=null +@z + +@x [45.993] l.20053 - pTeX: ensure_vbox +begin p:=box(n); +if p<>null then if type(p)=hlist_node then + begin print_err("Insertions can only be added to a vbox"); +@y +begin p:=box(n); +if p<>null then if type(p)=dir_node then + begin p:=list_ptr(p); + delete_glue_ref(space_ptr(box(n))); + delete_glue_ref(xspace_ptr(box(n))); + free_node(box(n),box_node_size); + box(n):=p +end; +if p<>null then if type(p)<>vlist_node then begin + print_err("Insertions can only be added to a vbox"); +@z + +@x [45.1000] l.20146 - pTeX: dir_node +hlist_node,vlist_node,rule_node: if page_contents +@y +hlist_node,vlist_node,dir_node,rule_node: if page_contents +@z + +@x [45.1009] l.20291 - pTeX: ins_dir +if box(n)=null then height(r):=0 +else height(r):=height(box(n))+depth(box(n)); +@y +if box(n)=null then height(r):=0 +else + begin if ins_dir(p)<>box_dir(box(n)) then + begin print_err("Insertions can only be added to a same direction vbox"); +@.Insertions can only...@> + help3("Tut tut: You're trying to \insert into a")@/ + ("\box register that now have a different direction.")@/ + ("Proceed, and I'll discard its present contents."); + box_error(n) + end + else + height(r):=height(box(n))+depth(box(n)); + end; +@z + +@x [45.1017] l.20470 - pTeX: page dir +box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); +@y +box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); +set_box_dir(box(255))(page_dir); +@z + +@x [45.1020] l.20513 - pTeX: check ins_dir +if best_ins_ptr(r)=null then wait:=true +else begin wait:=false; s:=last_ins_ptr(r); link(s):=ins_ptr(p); +@y +if best_ins_ptr(r)=null then wait:=true +else begin wait:=false; + n:=qo(subtype(p)); + case box_dir(box(n)) of + any_dir: + if ins_dir(p)<>box_dir(box(n)) then begin + print_err("Insertions can only be added to a same direction vbox"); +@.Insertions can only...@> + help3("Tut tut: You're trying to \insert into a")@/ + ("\box register that now have a different direction.")@/ + ("Proceed, and I'll discard its present contents."); + box_error(n); + box(n):=new_null_box; last_ins_ptr(r):=box(n)+list_offset; + end; + othercases + set_box_dir(box(n))(ins_dir(p)); + endcases; + s:=last_ins_ptr(r); link(s):=ins_ptr(p); +@z + +@x [45.1021] l.20537 - pTeX: free box node, ins_dir + free_node(temp_ptr,box_node_size); wait:=true; +@y + delete_glue_ref(space_ptr(temp_ptr)); + delete_glue_ref(xspace_ptr(temp_ptr)); + free_node(temp_ptr,box_node_size); wait:=true; +@z + +@x [45.1021] l.20543 - pTeX: free box node, ins_dir +free_node(box(n),box_node_size); +box(n):=vpack(temp_ptr,natural); +@y +delete_glue_ref(space_ptr(box(n))); +delete_glue_ref(xspace_ptr(box(n))); +flush_node_list(link(box(n))); +free_node(box(n),box_node_size); +box(n):=vpack(temp_ptr,natural); set_box_dir(box(n))(ins_dir(p)); +@z + +@x [46.1030] l.20687 - pTeX:main_control +@d append_normal_space=120 {go here to append a normal space between words} +@y +@d append_normal_space=120 {go here to append a normal space between words} +@d main_loop_j=130 {like |main_loop|, but |cur_chr| holds a KANJI code} +@d skip_loop=141 +@d again_2=150 +@z + +@x [46.1030] l.20691 - pTeX: main_control +procedure main_control; {governs \TeX's activities} +label big_switch,reswitch,main_loop,main_loop_wrapup, +@y +procedure main_control; {governs \TeX's activities} +label big_switch,reswitch,main_loop,main_loop_wrapup, + main_loop_j,main_loop_j+1,main_loop_j+3,skip_loop,again_2, +@z + +@x [46.1030] l.20697 - pTeX: main_control +var@!t:integer; {general-purpose temporary variable} +@y +var@!t:integer; {general-purpose temporary variable} +@!cx:KANJI_code; {kanji character} +@!kp:pointer; {kinsoku penalty register} +@!gp,gq:pointer; {temporary registers for list manipulation} +@!disp:scaled; {displacement register} +@!ins_kp:boolean; {whether insert kinsoku penalty} +@z + +@x [46.1030] l.20701 - pTeX: main_control +case abs(mode)+cur_cmd of +hmode+letter,hmode+other_char,hmode+char_given: goto main_loop; +hmode+char_num: begin scan_char_num; cur_chr:=cur_val; goto main_loop;@+end; +hmode+no_boundary: begin get_x_token; + if (cur_cmd=letter)or(cur_cmd=other_char)or(cur_cmd=char_given)or + (cur_cmd=char_num) then cancel_boundary:=true; + goto reswitch; + end; +@y +ins_kp:=false; +case abs(mode)+cur_cmd of +hmode+letter,hmode+other_char: goto main_loop; +hmode+kanji,hmode+kana,hmode+other_kchar: goto main_loop_j; +hmode+char_given: + if is_char_ascii(cur_chr) then goto main_loop else goto main_loop_j; +hmode+char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then goto main_loop else goto main_loop_j; + end; +hmode+no_boundary: begin get_x_token; + if (cur_cmd=letter)or(cur_cmd=other_char)or + (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar)or + (cur_cmd=char_given)or(cur_cmd=char_num) then cancel_boundary:=true; + goto reswitch; + end; +@z + +@x [46.1030] l.20715 - pTeX: main_control +main_loop:@; +@y +main_loop_j:@; +main_loop:@; +@z + +@x [46.1034] l.20788 - pTeX: disp_node +@= +if ((head=tail) and (mode>0)) then begin + if (insert_src_special_auto) then append_src_special; +end; +adjust_space_factor;@/ +@y +@= +if ((head=tail) and (mode>0)) then begin + if (insert_src_special_auto) then append_src_special; +end; +adjust_space_factor;@/ +if direction=dir_tate then disp:=t_baseline_shift else disp:=y_baseline_shift; +@; +@z + +%@x [46.1035] l.20850 - pTeX: kinsoku penalty +%@= +%wrapup(rt_hit) +%@y +%@= +%wrapup(rt_hit); +%if ins_kp=true then +% begin cx:=KANJI(cur_l); @; +% ins_kp:=false; +% end +%@z + +@x [46.1036] l.20854 - pTeX: disp_node +if lig_stack=null then goto reswitch; +@y +if lig_stack=null then + begin @; + goto reswitch; + end; +@z + +@x [46.1037] l.20886 - pTeX: Look ahead for another character +@= +get_next; {set only |cur_cmd| and |cur_chr|, for speed} +if cur_cmd=letter then goto main_loop_lookahead+1; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then goto main_loop_lookahead+1; +x_token; {now expand and set |cur_cmd|, |cur_chr|, |cur_tok|} +if cur_cmd=letter then goto main_loop_lookahead+1; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then goto main_loop_lookahead+1; +if cur_cmd=char_num then + begin scan_char_num; cur_chr:=cur_val; goto main_loop_lookahead+1; + end; +if cur_cmd=no_boundary then bchar:=non_char; +cur_r:=bchar; lig_stack:=null; goto main_lig_loop; +main_loop_lookahead+1: adjust_space_factor; +fast_get_avail(lig_stack); font(lig_stack):=main_f; +cur_r:=qi(cur_chr); character(lig_stack):=cur_r; +if cur_r=false_bchar then cur_r:=non_char {this prevents spurious ligatures} +@y +@= +get_next; {set only |cur_cmd| and |cur_chr|, for speed} +if cur_cmd=letter then goto main_loop_lookahead+1; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + @; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then + begin if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +x_token; {now expand and set |cur_cmd|, |cur_chr|, |cur_tok|} +if cur_cmd=letter then goto main_loop_lookahead+1; +if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + @; +if cur_cmd=other_char then goto main_loop_lookahead+1; +if cur_cmd=char_given then + begin if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +if cur_cmd=char_num then + begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then goto main_loop_lookahead+1 + else @; + end; +if cur_cmd=inhibit_glue then + begin inhibit_glue_flag:=true; goto main_loop_lookahead; + end; +if cur_cmd=no_boundary then bchar:=non_char; +cur_r:=bchar; lig_stack:=null; goto main_lig_loop; +main_loop_lookahead+1: adjust_space_factor; +fast_get_avail(lig_stack); font(lig_stack):=main_f; +cur_r:=qi(cur_chr); character(lig_stack):=cur_r; +if cur_r=false_bchar then cur_r:=non_char {this prevents spurious ligatures} + +@ @= +begin bchar:=non_char; cur_r:=bchar; lig_stack:=null; +if ligature_present then pack_lig(rt_hit); +if ins_kp=true then + begin cx:=cur_l; @; + end; +ins_kp:=false; +goto main_loop_j; +end +@z + +@x [46.1041] l.20999 - pTeX: disp_node +link(tail):=temp_ptr; tail:=temp_ptr; +@y +if not is_char_node(tail)and(type(tail)=disp_node) then + begin link(prev_node):=temp_ptr; link(temp_ptr):=tail; prev_node:=temp_ptr; + end +else begin link(tail):=temp_ptr; tail:=temp_ptr; + end; +@z + +@x [46.1043] l.21029 - pTeX: disp_node +link(tail):=q; tail:=q; +@y +if not is_char_node(tail)and(type(tail)=disp_node) then + begin link(prev_node):=q; link(q):=tail; prev_node:=q; + end +else begin link(tail):=q; tail:=q; + end +@z + +@x [47.1061] l.21277 - pTeX: append kern +begin s:=cur_chr; scan_dimen(s=mu_glue,false,false); +tail_append(new_kern(cur_val)); subtype(tail):=s; +end; +@y +begin s:=cur_chr; scan_dimen(s=mu_glue,false,false); +if not is_char_node(tail)and(type(tail)=disp_node) then + begin prev_append(new_kern(cur_val)); subtype(prev_node):=s; + end +else + begin tail_append(new_kern(cur_val)); subtype(tail):=s; + end; +end; +@z + +@x [47.1068] l.21377 - pTeX: +var p,@!q:pointer; {for short-term use} +@y +var p,@!q:pointer; {for short-term use} +@!r:pointer; {temporaly} +@z + +@x [47.1071] l.21485 - pTeX: \tate, \yoko, \dtou +primitive("hbox",make_box,vtop_code+hmode);@/ +@!@:hbox_}{\.{\\hbox} primitive@> +@y +primitive("hbox",make_box,vtop_code+hmode);@/ +@!@:hbox_}{\.{\\hbox} primitive@> +primitive("tate",chg_dir,dir_tate);@/ +@!@:tate_}{\.{\\tate} primitive@> +primitive("yoko",chg_dir,dir_yoko);@/ +@!@:yoko_}{\.{\\yoko} primitive@> +primitive("dtou",chg_dir,dir_dtou);@/ +@!@:dtou_}{\.{\\dtou} primitive@> +@z + +@x [47.1072] l.21506 - pTeX: \tate, \yoko, \dtou + othercases print_esc("hbox") + endcases; +leader_ship: if chr_code=a_leaders then print_esc("leaders") +@y + othercases print_esc("hbox") + endcases; +chg_dir: + case chr_code of + dir_yoko: print_esc("yoko"); + dir_tate: print_esc("tate"); + dir_dtou: print_esc("dtou"); + endcases; +leader_ship: if chr_code=a_leaders then print_esc("leaders") +@z + +@x [47.1073] l.21523 - pTeX: \tate, \yoko +any_mode(make_box): begin_box(0); +@y +any_mode(make_box): begin_box(0); +any_mode(chg_dir): + begin if cur_group<>align_group then + if head=tail then + begin direction:=cur_chr; + if mode=vmode then page_dir:=cur_chr; + end + else begin print_err("Use `"); print_cmd_chr(cur_cmd,cur_chr); + print("' at top of list"); + help2("Direction change command is available only while") + ("current list is null."); error; + end + else begin print_err("You can't use `"); print_cmd_chr(cur_cmd,cur_chr); + print("' in an align"); + help2("To change direction in an align,") + ("you shold use \hbox or \vbox with \tate or \yoko."); error; + end + end; +@z + +@x [47.1075] l.21538 - pTeX: box_end +var p:pointer; {|ord_noad| for new box in math mode} +@y +var p:pointer; {|ord_noad| for new box in math mode} +q:pointer; +@z + +@x [47.1076] l.21553 - pTeX: box_dir adjust + begin shift_amount(cur_box):=box_context; +@y + begin p:=link(cur_box); link(cur_box):=null; + while p<>null do begin + q:=p; p:=link(p); + if box_dir(q)=abs(direction) then + begin list_ptr(q):=cur_box; cur_box:=q; link(cur_box):=null; + end + else begin + delete_glue_ref(space_ptr(q)); + delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end; + end; + if box_dir(cur_box)<>abs(direction) then + cur_box:=new_dir_node(cur_box,abs(direction)); + shift_amount(cur_box):=box_context; +@z + +@x [47.1078] l.21585 - pTeX: box_dir adjust + begin append_glue; subtype(tail):=box_context-(leader_flag-a_leaders); + leader_ptr(tail):=cur_box; + end +@y + begin append_glue; subtype(tail):=box_context-(leader_flag-a_leaders); + if type(cur_box)<=dir_node then + begin p:=link(cur_box); link(cur_box):=null; + while p<>null do + begin q:=p; p:=link(p); + if box_dir(q)=abs(direction) then + begin list_ptr(q):=cur_box; cur_box:=q; link(cur_box):=null; + end + else begin + delete_glue_ref(space_ptr(q)); + delete_glue_ref(xspace_ptr(q)); + free_node(q,box_node_size); + end; + end; + if box_dir(cur_box)<>abs(direction) then + cur_box:=new_dir_node(cur_box,abs(direction)); + end; + leader_ptr(tail):=cur_box; + end +@z + +@x [47.1079] l.20920 - pTeX: disp_node, adjust direction +@!m:quarterword; {the length of a replacement list} +@y +@!r:pointer; {running behind |p|} +@!fd:boolean; {a final |disp_node| pair?} +@!disp,@!pdisp:scaled; {displacement} +@!a_dir:eight_bits; {adjust direction} +@!tx:pointer; {effective tail node} +@!m:quarterword; {the length of a replacement list} +@z + +@x [47.1080] l.20937 - pTeX: disp_node, check head=tail +@ Note that the condition |not is_char_node(tail)| implies that |head<>tail|, +since |head| is a one-word node. +@y +@ Note that in \TeX\ the condition |not is_char_node(tail)| implies that +|head<>tail|, since |head| is a one-word node; this is not so for p\TeX. +@z + +@x [47.1080] l.20940 - pTeX: disp_node +@= +@y +@d check_effective_tail_pTeX(#)== +tx:=tail; +if not is_char_node(tx) then + if type(tx)=disp_node then + begin tx:=prev_node; + if not is_char_node(tx) then + if type(tx)=disp_node then #; {|disp_node| from a discretionary} + end +@# +@d fetch_effective_tail_pTeX(#)== {extract |tx|, merge |disp_node| pair} +q:=head; p:=null; disp:=0; pdisp:=0; +repeat r:=p; p:=q; fd:=false; +if not is_char_node(q) then + if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tx then #; + end + else if type(q)=disp_node then + begin pdisp:=disp; disp:=disp_dimen(q); fd:=true;@+end; +q:=link(p); +until q=tx; {found |r|$\to$|p|$\to$|q=tx|} +q:=link(tx); link(p):=q; link(tx):=null; +if q=null then tail:=p +else if fd then {|r|$\to$|p=disp_node|$\to$|q=disp_node|} + begin prev_node:=r; prev_disp:=pdisp; link(p):=null; tail:=p; + disp_dimen(p):=disp_dimen(q); free_node(q,small_node_size); + end +else prev_node:=p +@# +@d check_effective_tail==check_effective_tail_pTeX +@d fetch_effective_tail==fetch_effective_tail_pTeX + +@= +@z + +@x [47.1080] l.20950 - pTeX: disp_node, check head=tail +else begin if not is_char_node(tail) then + if (type(tail)=hlist_node)or(type(tail)=vlist_node) then + @; + end; +@y +else begin check_effective_tail(goto done); + if not is_char_node(tx)and(head<>tx) then + if (type(tx)=hlist_node)or(type(tx)=vlist_node) + or(type(tx)=dir_node) then + @; + done:end; +@z + +@x [47.1081] l.20957 - pTeX: disp_node +begin q:=head; +repeat p:=q; +if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then goto done; + end; +q:=link(p); +until q=tail; +cur_box:=tail; shift_amount(cur_box):=0; +tail:=p; link(p):=null; +done:end +@y +begin fetch_effective_tail(goto done); +cur_box:=tx; shift_amount(cur_box):=0; +if type(cur_box)=dir_node then + begin link(list_ptr(cur_box)):=cur_box; + cur_box:=list_ptr(cur_box); + list_ptr(link(cur_box)):=null; + end +else + if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction)); +end +@z + +@x [47.1083] l.20989 - pTeX: adjust_dir +if k=hmode then + if (box_context; + end; +pop_nest; box_end(saved(0)); +end; +@y +begin d:=box_max_depth; + delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + if auto_spacing>0 then cur_kanji_skip:=kanji_skip + else cur_kanji_skip:=zero_glue; + if auto_xspacing>0 then cur_xkanji_skip:=xkanji_skip + else cur_xkanji_skip:=zero_glue; + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + unsave; save_ptr:=save_ptr-3; + if mode=-hmode then begin + cur_box:=hpack(link(head),saved(2),saved(1)); + set_box_dir(cur_box)(abs(direction)); pop_nest; + end else begin + cur_box:=vpackage(link(head),saved(2),saved(1),d); + set_box_dir(cur_box)(abs(direction)); pop_nest; + if c=vtop_code then + @; + end; + box_end(saved(0)); +end; +@z + +@x [47.1090] l.21079 - pTeX: apend vmode case +vmode+letter,vmode+other_char,vmode+char_num,vmode+char_given, + vmode+math_shift,vmode+un_hbox,vmode+vrule, + vmode+accent,vmode+discretionary,vmode+hskip,vmode+valign, + vmode+ex_space,vmode+no_boundary:@t@>@;@/ + begin back_input; new_graf(true); + end; +@y +vmode+letter,vmode+other_char,vmode+char_num,vmode+char_given, + vmode+math_shift,vmode+un_hbox,vmode+vrule, + vmode+accent,vmode+discretionary,vmode+hskip,vmode+valign, + vmode+kanji,vmode+kana,vmode+other_kchar, + vmode+ex_space,vmode+no_boundary:@t@>@;@/ + begin back_input; new_graf(true); + end; +@z + +@x [47.1091] l.21096 - pTeX: new_graf, adjust direction +push_nest; mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@y +push_nest; adjust_dir:=abs(direction); +mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@z + +@x [47.1096] l.21155 - pTeX: end_graf, call adjust_hlist + begin if head=tail then pop_nest {null paragraphs are ignored} + else line_break(widow_penalty); +@y + begin if head=tail then pop_nest {null paragraphs are ignored} + else begin adjust_hlist(head,true); line_break(widow_penalty) + end; +@z + +@x [47.1099] l.21184 - pTeX: insert and adjust +new_save_level(insert_group); scan_left_brace; normal_paragraph; +push_nest; mode:=-vmode; prev_depth:=ignore_depth; +@y +new_save_level(insert_group); scan_left_brace; normal_paragraph; +push_nest; mode:=-vmode; direction:=adjust_dir; prev_depth:=ignore_depth; +@z + +@x [47.1100] l.21189 - pTeX: free box node, ins_dir +insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q); + d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr); + {now |saved(0)| is the insertion number, or 255 for |vadjust|} + p:=vpack(link(head),natural); pop_nest; + if saved(0)<255 then + begin tail_append(get_node(ins_node_size)); + type(tail):=ins_node; subtype(tail):=qi(saved(0)); + height(tail):=height(p)+depth(p); ins_ptr(tail):=list_ptr(p); + split_top_ptr(tail):=q; depth(tail):=d; float_cost(tail):=f; + end + else begin tail_append(get_node(small_node_size)); + type(tail):=adjust_node;@/ + subtype(tail):=0; {the |subtype| is not used} + adjust_ptr(tail):=list_ptr(p); delete_glue_ref(q); + end; + free_node(p,box_node_size); + if nest_ptr=0 then build_page; + end; +@y +insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q); + d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr); + {now |saved(0)| is the insertion number, or 255 for |vadjust|} + p:=vpack(link(head),natural); set_box_dir(p)(abs(direction)); pop_nest; + if saved(0)<255 then + begin r:=get_node(ins_node_size); + type(r):=ins_node; subtype(r):=qi(saved(0)); + height(r):=height(p)+depth(p); ins_ptr(r):=list_ptr(p); + split_top_ptr(r):=q; depth(r):=d; float_cost(r):=f; + ins_dir(r):=box_dir(p); + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(r) + else tail_append(r); + end + else begin + if box_dir(p)<>adjust_dir then + begin print_err("Direction Incompatible."); + help1("\vadjust's argument and outer vlist must have same direction."); + error; flush_node_list(list_ptr(p)); + end + else begin + r:=get_node(small_node_size); type(r):=adjust_node;@/ + adjust_ptr(r):=list_ptr(p); delete_glue_ref(q); + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(r) + else tail_append(r); + end; + end; + delete_glue_ref(space_ptr(p)); + delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); + if nest_ptr=0 then build_page; + end; +@z + +@x [47.1101] l.21214 - pTeX: mark_node, prev_append +mark_ptr(p):=def_ref; link(tail):=p; tail:=p; +@y +mark_ptr(p):=def_ref; +if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(p) +else tail_append(p); +@z + +@x [47.1103] l.21224 - pTeX: penalty, prev_append +procedure append_penalty; +begin scan_int; tail_append(new_penalty(cur_val)); +if mode=vmode then build_page; +end; +@y +procedure append_penalty; +begin scan_int; + if not is_char_node(tail)and(type(tail)=disp_node) then + prev_append(new_penalty(cur_val)) + else tail_append(new_penalty(cur_val)); + if mode=vmode then build_page; +end; +@z + +@x [47.1105] l.21246 - pTeX: delete_last: disp_node +@!m:quarterword; {the length of a replacement list} +@y +@!r:pointer; {running behind |p|} +@!fd:boolean; {a final |disp_node| pair?} +@!disp,@!pdisp:scaled; {displacement} +@!tx:pointer; {effective tail node} +@!m:quarterword; {the length of a replacement list} +@z + +@x [47.1105] l.21250 - pTeX: delete_last: disp_node +else begin if not is_char_node(tail) then if type(tail)=cur_chr then + begin q:=head; + repeat p:=q; + if not is_char_node(q) then if type(q)=disc_node then + begin for m:=1 to replace_count(q) do p:=link(p); + if p=tail then return; + end; + q:=link(p); + until q=tail; + link(p):=null; flush_node_list(tail); tail:=p; +@y +else begin check_effective_tail(return); + if not is_char_node(tx) then if type(tx)=cur_chr then + begin fetch_effective_tail(return); + flush_node_list(tx); +@z + +@x [47.1110] l.21310 -pTeX: free box node, delete kanji_skip +var p:pointer; {the box} +@!c:box_code..copy_code; {should we copy?} +@y +var p:pointer; {the box} +@!c:box_code..copy_code; {should we copy?} +@!disp:scaled; {displacement} +@z + +@x [47.1110] l.21314 - pTeX: free box node, delete kanji_skip +if (abs(mode)=mmode)or((abs(mode)=vmode)and(type(p)<>vlist_node))or@| + ((abs(mode)=hmode)and(type(p)<>hlist_node)) then + begin print_err("Incompatible list can't be unboxed"); +@.Incompatible list...@> + help3("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox an \hbox in vertical mode or vice versa.")@/ + ("And I can't open any boxes in math mode.");@/ + error; return; + end; +if c=copy_code then link(tail):=copy_node_list(list_ptr(p)) +else begin link(tail):=list_ptr(p); box(cur_val):=null; + free_node(p,box_node_size); + end; +@y +if type(p)=dir_node then p:=list_ptr(p); +if (abs(mode)=mmode)or((abs(mode)=vmode)and(type(p)<>vlist_node))or@| + ((abs(mode)=hmode)and(type(p)<>hlist_node)) then + begin print_err("Incompatible list can't be unboxed"); +@.Incompatible list...@> + help3("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox an \hbox in vertical mode or vice versa.")@/ + ("And I can't open any boxes in math mode.");@/ + error; return; +end; +case box_dir(p) of + any_dir: + if abs(direction)<>box_dir(p) then begin + print_err("Incompatible direction list can't be unboxed"); + help2("Sorry, Pandora. (You sneaky devil.)")@/ + ("I refuse to unbox a box in differrent direction.");@/ + error; return; + end; +endcases; +disp:=0; +if c=copy_code then link(tail):=copy_node_list(list_ptr(p)) +else + begin if type(box(cur_val))=dir_node then + begin delete_glue_ref(space_ptr(box(cur_val))); + delete_glue_ref(xspace_ptr(box(cur_val))); + free_node(box(cur_val),box_node_size); + end; + flush_node_list(link(p)); + link(tail):=list_ptr(p); box(cur_val):=null; + delete_glue_ref(space_ptr(p)); + delete_glue_ref(xspace_ptr(p)); + free_node(p,box_node_size); + end; +@z +@x [47.1110] l.22014 - pTeX: free box node, delete kanji_skip +while link(tail)<>null do tail:=link(tail); +@y +while link(tail)<>null do + begin p:=tail; tail:=link(tail); + if not is_char_node(tail) then + case type(tail) of + glue_node : + if (subtype(tail)=kanji_skip_code+1) + or(subtype(tail)=xkanji_skip_code+1) then + begin link(p):=link(tail); + delete_glue_ref(glue_ptr(tail)); + free_node(tail,small_node_size); tail:=p; + end; + penalty_node : + if subtype(tail)=widow_pena then + begin link(p):=link(tail); free_node(tail,small_node_size); + tail:=p; + end; + disp_node : + begin prev_disp:=disp; disp:=disp_dimen(tail); prev_node:=p; + end; + endcases; + end; +@z + +@x [47.1113] l.22028 - pTeX: italic correction, ita_kern +procedure append_italic_correction; +label exit; +var p:pointer; {|char_node| at the tail of the current list} +@!f:internal_font_number; {the font in the |char_node|} +begin if tail<>head then + begin if is_char_node(tail) then p:=tail + else if type(tail)=ligature_node then p:=lig_char(tail) + else return; + f:=font(p); + tail_append(new_kern(char_italic(f)(char_info(f)(character(p))))); + subtype(tail):=explicit; + end; +@y +procedure append_italic_correction; +label exit; +var p:pointer; {|char_node| at the tail of the current list} +@!f:internal_font_number; {the font in the |char_node|} +@!d:pointer; {|disp_node|} +begin if tail<>head then + begin + if not is_char_node(tail)and(type(tail)=disp_node) then + begin d:=tail; tail:=prev_node; + end + else d:=null; + if (last_jchr<>null)and(link(last_jchr)=tail)and(is_char_node(tail)) then + p:=last_jchr + else if is_char_node(tail) then p:=tail + else if type(tail)=ligature_node then p:=lig_char(tail) + else return; + f:=font(p); + tail_append(new_kern(char_italic(f)(char_info(f)(character(p))))); + subtype(tail):=ita_kern; + if d<>null then + begin prev_node:=tail; tail_append(d); + end; + end; +@z + +@x [47.1120] l.22119 - pTeX: discretionary with disp_node +decr(save_ptr); return; +@y +decr(save_ptr); +prev_node:=tail; tail_append(get_node(small_node_size)); +type(tail):=disp_node; disp_dimen(tail):=0; prev_disp:=0; +return; +@z + +@x [47.1121] l.22127 - pTeX: discretionary with disp_node + begin if not is_char_node(p) then if type(p)>rule_node then + if type(p)<>kern_node then if type(p)<>ligature_node then + begin print_err("Improper discretionary list"); +@y + begin if not is_char_node(p) then + if (type(p)>rule_node)and(type(p)<>kern_node)and + (type(p)<>ligature_node)and(type(p)<>disp_node) then + if (type(p)=penalty_node)and(subtype(p)<>normal) then + begin link(q):=link(p); free_node(p,small_node_size); p:=q; + end + else + begin print_err("Improper discretionary list"); +@z + +@x [47.1123] l.22160 - pTeX: make_accent, Kanji, insert disp_node +var s,@!t: real; {amount of slant} +@y +var s,@!t: real; {amount of slant} +@!disp:scaled; {displacement} +@!cx:KANJI_code; {temporary register for KANJI} +@z + +@x [47.1123] l.22165 - pTeX: make_accent, Kanji, insert disp_node +begin scan_char_num; f:=cur_font; p:=new_character(f,cur_val); +@y +begin scan_char_num; +if not is_char_ascii(cur_val) then + begin KANJI(cx):=cur_val; + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + p:=new_character(f,get_jfm_pos(KANJI(cx),f)); + if p<>null then + begin + link(p):=get_avail; info(link(p)):=KANJI(cx); + end; + end +else begin f:=cur_font; p:=new_character(f,cur_val); + end; +@z + +@x [47.1123] l.22175 - pTeX: make_accent, Kanji, insert disp_node + link(tail):=p; tail:=p; space_factor:=1000; +@y + link(tail):=p; + if link(p)<>null then tail:=link(p) else tail:=p; + @; + space_factor:=1000; +@z + +@x [47.1124] l.22180 - pTeX: make_accent Kanji, insert disp_node +q:=null; f:=cur_font; +if (cur_cmd=letter)or(cur_cmd=other_char)or(cur_cmd=char_given) then + q:=new_character(f,cur_chr) +else if cur_cmd=char_num then + begin scan_char_num; q:=new_character(f,cur_val); + end +else back_input +@y +q:=null; f:=cur_font; KANJI(cx):=empty; +if (cur_cmd=letter)or(cur_cmd=other_char) then + q:=new_character(f,cur_chr) +else if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then + begin if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + cx:=cur_chr; + end +else if cur_cmd=char_given then + if is_char_ascii(cur_chr) then q:=new_character(f,cur_chr) + else begin + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + KANJI(cx):=cur_chr + end + else if cur_cmd=char_num then + begin scan_char_num; + if is_char_ascii(cur_val) then q:=new_character(f,cur_val) + else begin + if direction=dir_tate then f:=cur_tfont else f:=cur_jfont; + KANJI(cx):=cur_val + end + end +else back_input; +if direction=dir_tate then + begin if font_dir[f]=dir_tate then disp:=0 + else if font_dir[f]=dir_yoko then disp:=t_baseline_shift-y_baseline_shift + else disp:=t_baseline_shift + end +else begin if font_dir[f]=dir_yoko then disp:=0 + else if font_dir[f]=dir_tate then disp:=y_baseline_shift-t_baseline_shift + else disp:=y_baseline_shift + end; +@; +if KANJI(cx)<>empty then + begin q:=new_character(f,get_jfm_pos(KANJI(cx),f)); + link(q):=get_avail; info(link(q)):=KANJI(cx); last_jchr:=q; + end; +@z + +@x [47.1125] l.22200 - pTeX: make_accent Kanji +if h<>x then {the accent must be shifted up or down} + begin p:=hpack(p,natural); shift_amount(p):=x-h; + end; +@y +if h<>x then {the accent must be shifted up or down} + begin delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); + cur_kanji_skip:=zero_glue; cur_xkanji_skip:=zero_glue; + add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); + p:=hpack(p,natural); shift_amount(p):=x-h; + end; +@z + +@x [47.1125] pTeX: make accent Kanji +tail:=new_kern(-a-delta); subtype(tail):=acc_kern; link(p):=tail; p:=q; +@y +tail:=new_kern(-a-delta); subtype(tail):=acc_kern; +if h=x then begin + if font_dir[font(p)]<>dir_default then link(link(p)):=tail + else link(p):=tail; end +else link(p):=tail; +{ bugfix: if |p| is KANJI char, |link(p)|:=|tail| collapses |p| and kern after accent. } +p:=q; +@z + +@x [48.1138] l.22385 - pTeX: init math : direction < 0 ... math direction +if (cur_cmd=math_shift)and(mode>0) then @ +else begin back_input; @; + end; +@y +if (cur_cmd=math_shift)and(mode>0) then @ +else begin back_input; @; + end; +direction:=-abs(direction); +@z + +@x [48.1145] l.22435 - pTeX: Call adjust_hlist at begin of display +else begin line_break(display_widow_penalty);@/ +@y +else begin adjust_hlist(head,true); line_break(display_widow_penalty);@/ +@z + +@x [48.1147] l.22471 - pTeX: Skip kanji 2nd node, dir_node +reswitch: if is_char_node(p) then + begin f:=font(p); d:=char_width(f)(char_info(f)(character(p))); + goto found; + end; +case type(p) of +hlist_node,vlist_node,rule_node: begin d:=width(p); goto found; + end; +@y +reswitch: if is_char_node(p) then + begin f:=font(p); d:=char_width(f)(orig_char_info(f)(character(p))); + if font_dir[f]<>dir_default then p:=link(p); + goto found; + end; +case type(p) of +hlist_node,vlist_node,dir_node,rule_node: begin d:=width(p); goto found; + end; +@z + +@x [48.1150] l.22541 - pTeX: scan_math +mmode+left_brace: begin tail_append(new_noad); + back_input; scan_math(nucleus(tail)); + end; +@y +mmode+left_brace: begin tail_append(new_noad); + back_input; scan_math(nucleus(tail),kcode_noad(tail)); + end; +@z + +@x [48.1151] l.22555 - pTeX: scan_math: use Kanji in math_mode +procedure scan_math(@!p:pointer); +label restart,reswitch,exit; +var c:integer; {math character code} +begin restart:@; +reswitch:case cur_cmd of +letter,other_char,char_given: begin c:=ho(math_code(cur_chr)); + if c=@'100000 then + begin @; + goto restart; + end; + end; +@y +procedure scan_math(@!p,@!q:pointer); +label restart,reswitch,exit; +var c:integer; {math character code} +cx:KANJI_code; {temporary register for KANJI} +begin KANJI(cx):=0; +restart: @; +reswitch:case cur_cmd of +letter,other_char,char_given: + if (is_char_ascii(cur_chr) or (cur_chr=256)) then begin + c:=ho(math_code(cur_chr)); + if c=@'100000 then + begin @; + goto restart; + end; + end + else + KANJI(cx):=cur_chr; +kanji,kana,other_kchar: cx:=cur_chr; +@z + +@x [48.1151] l.22576 - pTeX: scan_math: use Kanji in math_mode +math_type(p):=math_char; character(p):=qi(c mod 256); +if (c>=var_code)and fam_in_range then fam(p):=cur_fam +else fam(p):=(c div 256) mod 16; +@y +if KANJI(cx)=0 then + begin math_type(p):=math_char; character(p):=qi(c mod 256); + if (c>=var_code)and(fam_in_range) then fam(p):=cur_fam + else fam(p):=(c div 256) mod 16; + if font_dir[fam_fnt(fam(p)+cur_size)]<>dir_default then + begin print_err("Not one-byte family"); + help1("IGNORE.");@/ + error; + end + end +else begin + if q=null then + begin math_type(p):=sub_mlist; info(p):=new_noad; + p:=nucleus(info(p)); q:=kcode_noad_nucleus(p); + end; + math_type(p):=math_jchar; fam(p):=cur_jfam; character(p):=qi(0); + math_kcode(p-1):=KANJI(cx); + if font_dir[fam_fnt(fam(p)+cur_size)]=dir_default then + begin print_err("Not two-byte family"); + help1("IGNORE.");@/ + error; + end + end; +@z + +@x [48.1154] l.22605 - pTeX: math mode +mmode+letter,mmode+other_char,mmode+char_given: + set_math_char(ho(math_code(cur_chr))); +mmode+char_num: begin scan_char_num; cur_chr:=cur_val; + set_math_char(ho(math_code(cur_chr))); + end; +@y +mmode+letter,mmode+other_char,mmode+char_given: + if is_char_ascii(cur_chr) then + if cur_chr<128 then set_math_char(ho(math_code(cur_chr))) + else set_math_char(cur_chr) + else set_math_kchar(cur_chr); +mmode+kanji,mmode+kana,mmode+other_kchar: begin + cx:=cur_chr; set_math_kchar(KANJI(cx)); + end; +mmode+char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then + if cur_chr<128 then set_math_char(ho(math_code(cur_chr))) + else set_math_char(cur_chr) + else set_math_kchar(cur_chr); + end; +@z + +@x [48.1155] l.22635 - pTeX: set_math_char + link(tail):=p; tail:=p; +@y + link(tail):=p; tail:=p; + if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]<>dir_default then begin + print_err("Not one-byte family"); + help1("IGNORE.");@/ + error; + end +@z + +@x [48.1158] l.22690 - pTeX: scan_math + type(tail):=cur_chr; scan_math(nucleus(tail)); +@y + type(tail):=cur_chr; scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1163] l.22750 - pTeX: scan_math +scan_delimiter(left_delimiter(tail),true); scan_math(nucleus(tail)); +@y +scan_delimiter(left_delimiter(tail),true); +scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1164] l.22770 - pTeX: scan_math +scan_math(nucleus(tail)); +@y +scan_math(nucleus(tail),kcode_noad(tail)); +@z + +@x [48.1164] l.22790 - pTeX: vcenter : dir +vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2; + p:=vpack(link(head),saved(1),saved(0)); pop_nest; + tail_append(new_noad); type(tail):=vcenter_noad; + math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p; + end; +@y +vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2; + p:=vpack(link(head),saved(1),saved(0)); + set_box_dir(p)(abs(direction)); pop_nest; + if box_dir(p)<>abs(direction) then p:=new_dir_node(p,abs(direction)); + tail_append(new_noad); type(tail):=vcenter_noad; + math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p; + end; +@z + +@x [48.1176] l.22864 - pTeX: scan_math +scan_math(p); +@y +scan_math(p,null); +@z + +@x [48.1186] l.23006 - pTeX: copy kanji code + if math_type(supscr(p))=empty then + begin mem[saved(0)].hh:=mem[nucleus(p)].hh; +@y + if ((math_type(supscr(p))=empty)and(math_kcode(p)=null)) then + begin mem[saved(0)].hh:=mem[nucleus(p)].hh; +@z + +@x [48.1194] l.23078 - pTeX: set cur_kanji_skip, cur_xkanji_skip +var l:boolean; {`\.{\\leqno}' instead of `\.{\\eqno}'} +@y +var l:boolean; {`\.{\\leqno}' instead of `\.{\\eqno}'} +@!disp:scaled; {displacement} +@z + +@x [48.1194] l.23087 - pTeX: set cur_kanji_skip, cur_xkanji_skip +m:=mode; l:=false; p:=fin_mlist(null); {this pops the nest} +@y +delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip); +if auto_spacing>0 then cur_kanji_skip:=kanji_skip +else cur_kanji_skip:=zero_glue; +if auto_xspacing>0 then cur_xkanji_skip:=xkanji_skip +else cur_xkanji_skip:=zero_glue; +add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip); +m:=mode; l:=false; p:=fin_mlist(null); {this pops the nest} +@z + +@x [48.1196] l.23134 - pTeX: insert disp_node +begin tail_append(new_math(math_surround,before)); +cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist; +link(tail):=link(temp_head); +while link(tail)<>null do tail:=link(tail); +tail_append(new_math(math_surround,after)); +space_factor:=1000; unsave; +end +@y +begin if direction=dir_tate then disp:=t_baseline_shift + else disp:=y_baseline_shift; +@; +tail_append(new_math(math_surround,before)); +cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist; +link(tail):=link(temp_head); +while link(tail)<>null do tail:=link(tail); +tail_append(new_math(math_surround,after)); +@; +space_factor:=1000; unsave; +end +@z + +@x [48.1200] l.23203 - pTeX: adjust direction +push_nest; mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@y +push_nest; adjust_dir:=abs(direction); +mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang; +@z + +@x [48.1201] l.23217 - pTeX: free box node + begin free_node(b,box_node_size); +@y + begin delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); + free_node(b,box_node_size); +@z + +@x [48.1201] l.23222 - pTeX: free box node + begin free_node(b,box_node_size); +@y + begin delete_glue_ref(space_ptr(b)); delete_glue_ref(xspace_ptr(b)); + free_node(b,box_node_size); +@z + +@x [49.1210] l.23361 - pTeX: set_auto_spacing +any_mode(toks_register), +any_mode(assign_toks), +any_mode(assign_int), +@y +any_mode(assign_kinsoku), +any_mode(assign_inhibit_xsp_code), +any_mode(set_auto_spacing), +any_mode(set_kansuji_char), +any_mode(toks_register), +any_mode(assign_toks), +any_mode(assign_int), +any_mode(def_jfont), +any_mode(def_tfont), +@z + +@x [49.1211] l.23397 - pTeX: prefixed_command +procedure prefixed_command; +label done,exit; +var a:small_number; {accumulated prefix codes so far} +@y +procedure prefixed_command; +label done,exit; +var a:small_number; {accumulated prefix codes so far} +@!m:integer; {ditto} +@z + +@x [49.1217] l.23487 - pTeX: select cur font +set_font: define(cur_font_loc,data,cur_chr); +@y +set_font: begin + if font_dir[cur_chr]=dir_yoko then + define(cur_jfont_loc,data,cur_chr) + else if font_dir[cur_chr]=dir_tate then + define(cur_tfont_loc,data,cur_chr) + else + define(cur_font_loc,data,cur_chr) +end; +@z + +@x l.23504 - pTeX +primitive("futurelet",let,normal+1);@/ +@!@:future_let_}{\.{\\futurelet} primitive@> + +@ @= +let: if chr_code<>normal then print_esc("futurelet")@+else print_esc("let"); + +@ @= +let: begin n:=cur_chr; +@y +primitive("futurelet",let,normal+1);@/ +@!@:future_let_}{\.{\\futurelet} primitive@> + +@ @= +let: if chr_code<>normal then print_esc("futurelet")@+else print_esc("let"); + +@ @= +let: begin n:=cur_chr; +@z + +@x [49.1228] l.23785 - pTeX: assign jfam +assign_int: begin p:=cur_chr; scan_optional_equals; scan_int; + word_define(p,cur_val); + end; +@y +assign_int: begin p:=cur_chr; scan_optional_equals; scan_int; + if p=int_base+cur_fam_code then + begin if font_dir[fam_fnt(cur_val)]<>dir_default then + word_define(int_base+cur_jfam_code,cur_val) + else word_define(p,cur_val); + end + else word_define(p,cur_val); + end; +@z + +@x [49.1230] l.23812 - pTeX: xspcode, kcatcode +@= +primitive("catcode",def_code,cat_code_base); +@!@:cat_code_}{\.{\\catcode} primitive@> +@y +@= +primitive("catcode",def_code,cat_code_base); +@!@:cat_code_}{\.{\\catcode} primitive@> +primitive("kcatcode",def_code,kcat_code_base); +@!@:cat_code_}{\.{\\kcatcode} primitive@> +primitive("xspcode",def_code,auto_xsp_code_base); +@!@:auto_xsp_code_}{\.{\\xspcode} primitive@> +@z + +@x [49.1231] l.23842 - pTeX: xspcode, kcatcode +def_code: if chr_code=cat_code_base then print_esc("catcode") + else if chr_code=math_code_base then print_esc("mathcode") +@y +def_code: if chr_code=cat_code_base then print_esc("catcode") + else if chr_code=kcat_code_base then print_esc("kcatcode") + else if chr_code=auto_xsp_code_base then print_esc("xspcode") + else if chr_code=math_code_base then print_esc("mathcode") +@z + +@x [49.1232] l.23857 - pTeX: kcatcode +def_code: begin @; + p:=cur_chr; scan_char_num; p:=p+cur_val; scan_optional_equals; + scan_int; + if ((cur_val<0)and(pn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p; + @; + p:=cur_chr; scan_char_num; + if p=kcat_code_base then p:=p+kcatcodekey(cur_val) + else if not is_char_ascii(cur_val) then p:=p+Hi(cur_val) + { If |cur_val| is a KANJI code, we use its upper half, as the case of retrieving. } + else p:=p+cur_val; + scan_optional_equals; scan_int; + if ((cur_valn) then + begin print_err("Invalid code ("); print_int(cur_val); +@.Invalid code@> + if p= +if cur_chr=cat_code_base then n:=max_char_code +@y +@ @= +if cur_chr=kcat_code_base then m:=kanji else m:=0 + +@ @= +if cur_chr=cat_code_base then n:=invalid_char {1byte |max_char_code|} +else if cur_chr=kcat_code_base then n:=max_char_code +@z + +@x [49.1247] l.24083 - pTeX: alter_box_dimen : box_dir +procedure alter_box_dimen; +var c:small_number; {|width_offset| or |height_offset| or |depth_offset|} +@y +procedure alter_box_dimen; +var c:small_number; {|width_offset| or |height_offset| or |depth_offset|} +@!p,q:pointer; {temporary registers} +@z +@x [49.1247] l.24087 - pTeX: alter_box_dimen : box_dir +scan_normal_dimen; +if box(b)<>null then mem[box(b)+c].sc:=cur_val; +end; +@y +scan_normal_dimen; +if box(b)<>null then + begin q:=box(b); p:=link(q); + while p<>null do + begin if abs(direction)=box_dir(p) then q:=p; + p:=link(p); + end; + if box_dir(q)<>abs(direction) then + begin p:=link(box(b)); link(box(b)):=null; + q:=new_dir_node(q,abs(direction)); list_ptr(q):=null; + link(q):=p; link(box(b)):=q; + end; + mem[q+c].sc:=cur_val; + end; +end; +@z + +@x [49.1256] l.24163 - pTeX: def_tfont +def_font: new_font(a); +@y +def_tfont,def_jfont,def_font: new_font(a); +@z + +@x [49.1292] l.24451 - pTeX: shift_case +@= +t:=info(p); +if t0 then info(p):=t-c+equiv(b+c); + end +@y +@= +t:=info(p); +if (t0 then info(p):=t-c+equiv(b+c); + end +@z + +@x [49.1291] l.24467 - pTeX: show_mode +@d show_lists=3 { \.{\\showlists} } +@y +@d show_lists=3 { \.{\\showlists} } +@d show_mode=4 { \.{\\showmode} } +@z + +@x [49.1291] l.24476 - pTeX: show_mode +primitive("showlists",xray,show_lists); +@!@:show_lists_}{\.{\\showlists} primitive@> +@y +primitive("showlists",xray,show_lists); +@!@:show_lists_}{\.{\\showlists} primitive@> +primitive("showmode",xray,show_mode); +@!@:show_mode_}{\.{\\showmode} primitive@> +@z + +@x [49.1292] l.24483 - pTeX: show_mode + othercases print_esc("show") +@y + show_mode:print_esc("showmode"); + othercases print_esc("show") +@z + +@x [49.1293] l.24495 - pTeX: show_mode +show_code: @; +@y +show_code: @; +show_mode: @; +@z + +@x l.24982 +font_info:=xmalloc_array(fmemory_word, font_mem_size); +@y +font_info:=xmalloc_array(memory_word, font_mem_size); +@z + +@x [50.1320] l.24988 - pTeX: +@ @= +begin +dump_things(font_check[null_font], font_ptr+1-null_font); +@y +@ @= +begin +dump_things(font_dir[null_font], font_ptr+1-null_font); +dump_things(font_num_ext[null_font], font_ptr+1-null_font); +dump_things(font_check[null_font], font_ptr+1-null_font); +@z + +@x [50.1321] l.25000 - pTeX: +dump_things(char_base[null_font], font_ptr+1-null_font); +@y +dump_things(ctype_base[null_font], font_ptr+1-null_font); +dump_things(char_base[null_font], font_ptr+1-null_font); +@z + +@x [50.1322] l.25024 - pTeX: +@= +begin {Allocate the font arrays} +@y +@= +begin {Allocate the font arrays} +font_dir:=xmalloc_array(eight_bits, font_max); +font_num_ext:=xmalloc_array(integer, font_max); +@z + +@x [50.1322] l.25040 - pTeX: +char_base:=xmalloc_array(integer, font_max); +@y +ctype_base:=xmalloc_array(integer, font_max); +char_base:=xmalloc_array(integer, font_max); +@z + +@x [50.1322] l.25050 - pTeX: +undump_things(font_check[null_font], font_ptr+1-null_font); +@y +undump_things(font_dir[null_font], font_ptr+1-null_font); +undump_things(font_num_ext[null_font], font_ptr+1-null_font); +undump_things(font_check[null_font], font_ptr+1-null_font); +@z + +@x [50.1322] l.25064 - pTeX: +undump_things(char_base[null_font], font_ptr+1-null_font); +@y +undump_things(ctype_base[null_font], font_ptr+1-null_font); +undump_things(char_base[null_font], font_ptr+1-null_font); +@z + +@x l.25363 - pTeX + font_info:=xmalloc_array (fmemory_word, font_mem_size); +@y + font_info:=xmalloc_array (memory_word, font_mem_size); +@z + +@x [51.1337] l.25563 - pTeX: + font_check:=xmalloc_array(four_quarters, font_max); +@y + font_dir:=xmalloc_array(eight_bits, font_max); + font_num_ext:=xmalloc_array(integer, font_max); + font_check:=xmalloc_array(four_quarters, font_max); +@z + +@x [51.1337] l.25577 - pTeX: + char_base:=xmalloc_array(integer, font_max); +@y + ctype_base:=xmalloc_array(integer, font_max); + char_base:=xmalloc_array(integer, font_max); +@z + +@x [51.1337] l.25587 - pTeX: + font_ptr:=null_font; fmem_ptr:=7; +@y + font_ptr:=null_font; fmem_ptr:=7; + font_dir[null_font]:=dir_default; + font_num_ext[null_font]:=0; +@z + +@x [51.1337] l.25594 - pTeX: + char_base[null_font]:=0; width_base[null_font]:=0; +@y + ctype_base[null_font]:=0; char_base[null_font]:=0; width_base[null_font]:=0; +@z + +@x [53.1376] l.26309 - pTeX: +@ = +@!debug_format_file: boolean; +@y +@ = +@!debug_format_file: boolean; + +@ @= +@!debug debug_format_file:=true; @+gubed; +@z + +@x l.26984 - pTeX +@* \[54] System-dependent changes. +@y +@* \[55/p\TeX] System-dependent changes for p\TeX. +This section described extended variables, procesures, functions and so on +for pTeX. + +@= +function get_jfm_pos(@!kcode:KANJI_code;@!f:internal_font_number):eight_bits; +var @!jc:KANJI_code; {temporary register for KANJI} +@!sp,@!mp,@!ep:pointer; +begin@/ +if f=null_font then + begin get_jfm_pos:=kchar_type(null_font)(0); return; + end; +jc:=toDVI(kcode); +sp:=1; { start position } +ep:=font_num_ext[f]-1; { end position } +if (ep>=1)and(kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then + begin while (sp <= ep) do + begin mp:=sp+((ep-sp) div 2); + if jckchar_code(f)(mp) then sp:=mp+1 + else + begin get_jfm_pos:=kchar_type(f)(mp); return; + end; + end; + end; +get_jfm_pos:=kchar_type(f)(0); +end; + +@ Following codes are used to calcutation a KANJI width and height. + +@= +@!t: eight_bits; + +@ @= +if direction=dir_tate then + v:=char_width(cur_tfont)(orig_char_info(cur_tfont)(qi(0))) +else + v:=char_width(cur_jfont)(orig_char_info(cur_jfont)(qi(0))) + +@ @= +if direction=dir_tate then begin + t:=height_depth(orig_char_info(cur_tfont)(qi(0))); + v:=char_height(cur_tfont)(t)+char_depth(cur_tfont)(t); +end else begin + t:=height_depth(orig_char_info(cur_jfont)(qi(0))); + v:=char_height(cur_jfont)(t)+char_depth(cur_jfont)(t); +end + +@ set a kansuji character. + +@ @= +primitive("kansujichar",set_kansuji_char,0); +@!@:kansujichar_}{\.{\\kansujichar} primitive@> + +@ @= +set_kansuji_char: print_esc("kansujichar"); + +@ @= +set_kansuji_char: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if not is_char_kanji(cur_val) then + begin print_err("Invalid KANSUJI char ("); + print_hex(cur_val); print_char(")"); +@.Invalid KANSUJI char@> + help1("I'm skip this control sequences.");@/ + error; return; + end +else if (n<0)or(n>9) then + begin print_err("Invalid KANSUJI number ("); print_int(n); print_char(")"); +@.Invalid KANSUJI number@> + help1("I'm skip this control sequences.");@/ + error; return; + end +else + define(kansuji_base+n,n,tokanji(toDVI(cur_val))); +end; + +@ |print_kansuji| procedure converts a number to KANJI number. + +@ @= +procedure print_kansuji(@!n:integer); +var @!k:0..23; {index to current digit; we assume that $|n|<10^{23}$} +@!cx: KANJI_code; {temporary register for KANJI} +begin k:=0; + if n<0 then return; {nonpositive input produces no output} + repeat dig[k]:=n mod 10; n:=n div 10; incr(k); + until n=0; + begin while k>0 do + begin decr(k); + cx:=kansuji_char(dig[k]); + print_kanji(fromDVI(cx)); + end; + end; +end; + +@ pTeX inserts a glue specified by \.{\\kanjiskip} between 2byte-characters, +automatically, if \.{\\autospacing}. This glue is suppressed by +\.{\\noautospacing}. +\.{\\xkanjiskip}, \.{\\noautoxspacing}, \.{\\autoxspacing}, \.{\\xspcode} is +used to control between 2byte and 1byte characters. + +@d reset_auto_spacing_code=0 +@d set_auto_spacing_code=1 +@d reset_auto_xspacing_code=2 +@d set_auto_xspacing_code=3 + +@= +primitive("autospacing",set_auto_spacing,set_auto_spacing_code); +@!@:auto_spacing_}{\.{\\autospacing} primitive@> +primitive("noautospacing",set_auto_spacing,reset_auto_spacing_code); +@!@:no_auto_spacing_}{\.{\\noautospacing} primitive@> +primitive("autoxspacing",set_auto_spacing,set_auto_xspacing_code); +@!@:auto_xspacing_}{\.{\\autoxspacing} primitive@> +primitive("noautoxspacing",set_auto_spacing,reset_auto_xspacing_code); +@!@:no_auto_xspacing_}{\.{\\noautoxspacing} primitive@> + +@ @= +set_auto_spacing:begin + if (chr_code mod 2)=0 then print_esc("noauto") else print_esc("auto"); + if chr_code<2 then print("spacing") else print("xspacing"); +end; + +@ @= +set_auto_spacing:begin + if cur_chr<2 then p:=auto_spacing_code + else begin p:=auto_xspacing_code; cur_chr:=(cur_chr mod 2); end; + define(p,data,cur_chr); +end; + +@ Following codes are used in section 49. + +@= +begin print_nl("> "); +if auto_spacing>0 then print("auto spacing mode; ") + else print("no auto spacing mode; "); +print_nl("> "); +if auto_xspacing>0 then print("auto xspacing mode") + else print("no auto xspacing mode"); +goto common_ending; +end + +@ The \.{\\inhibitglue} primitive control to insert a glue specified +JFM (Japanese Font Metic) file. The \.{\\inhibitxspcode} is used to control +inserting a space between 2byte-char and 1byte-char. + +@d inhibit_both=0 {disable to insert space before 2byte-char and after it} +@d inhibit_previous=1 {disable to insert space before 2byte-char} +@d inhibit_after=2 {disable to insert space after 2byte-char} +@d no_entry=1000 +@d new_pos=0 +@d cur_pos=1 + +@= + inhibit_glue_flag:boolean; + +@ @= + inhibit_glue_flag:=false; + +@ @= + any_mode(inhibit_glue): inhibit_glue_flag:=true; + +@ @= +primitive("inhibitglue",inhibit_glue,0); +@!@:inhibit_glue_}{\.{\\inhibitglue} primitive@> +primitive("inhibitxspcode",assign_inhibit_xsp_code,inhibit_xsp_code_base); +@!@:inhibit_xsp_code_}{\.{\\inhibitxspcode} primitive@> + +@ @= +inhibit_glue: print_esc("inhibitglue"); +assign_inhibit_xsp_code: print_esc("inhibitxspcode"); + +@ @= +function get_inhibit_pos(c:KANJI_code; n:small_number):pointer; +label done, done1; +var p,s:pointer; +begin s:=calc_pos(c); p:=s; +if n=new_pos then + begin repeat + if (inhibit_xsp_code(p)=0)or(inhibit_xsp_code(p)=c) then goto done; + incr(p); if p>255 then p:=0; + until s=p; p:=no_entry; + end +else + begin repeat + if inhibit_xsp_code(p)=0 then goto done1; + if inhibit_xsp_code(p)=c then goto done; + incr(p); if p>255 then p:=0; + until s=p; +done1: p:=no_entry; + end; +done: get_inhibit_pos:=p; +end; + +@ @= +assign_inhibit_xsp_code: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if is_char_kanji(n) then + begin j:=get_inhibit_pos(tokanji(n),new_pos); + if j=no_entry then + begin print_err("Inhibit table is full!!"); + help1("I'm skip this control sequences.");@/ + error; return; + end; + define(inhibit_xsp_code_base+j,cur_val,n); + end +else + begin print_err("Invalid KANJI code ("); print_hex(n); print_char(")"); +@.Invalid KANJI code@> + help1("I'm skip this control sequences.");@/ + error; return; + end; +end; + +@ @= +begin scan_int; q:=get_inhibit_pos(tokanji(cur_val),cur_pos); +cur_val_level:=int_val; cur_val:=3; +if q<>no_entry then cur_val:=inhibit_xsp_type(q); +end + +@ The \.{\\prebreakpenalty} is used to specified amount of penalties inserted +before the 2byte-char which is first argument of this primitive. +The \.{\\postbreakpenalty} is inserted after the 2byte-char. + +@d pre_break_penalty_code=1 +@d post_break_penalty_code=2 + +@= +primitive("prebreakpenalty",assign_kinsoku,pre_break_penalty_code); +@!@:pre_break_penalty_}{\.{\\prebreakpenalty} primitive@> +primitive("postbreakpenalty",assign_kinsoku,post_break_penalty_code); +@!@:post_break_penalty_}{\.{\\postbreakpenalty} primitive@> + +@ @= +assign_kinsoku: case chr_code of + pre_break_penalty_code: print_esc("prebreakpenalty"); + post_break_penalty_code: print_esc("postbreakpenalty"); + endcases; + +@ @= +function get_kinsoku_pos(c:KANJI_code; n:small_number):pointer; +label done, done1; +var p,s:pointer; +begin s:=calc_pos(c); p:=s; +@!debug +print_ln; print("c:="); print_int(c); print(", p:="); print_int(s); +if p+kinsoku_base<0 then + begin print("p is negative value"); print_ln; + end; +gubed +if n=new_pos then + begin repeat + if (kinsoku_type(p)=0)or(kinsoku_code(p)=c) then goto done; + incr(p); if p>255 then p:=0; + until s=p; + p:=no_entry; + end +else + begin repeat + if kinsoku_type(p)=0 then goto done1; + if kinsoku_code(p)=c then goto done; + incr(p); if p>255 then p:=0; + until s=p; +done1: p:=no_entry; + end; +done: get_kinsoku_pos:=p; +end; + +@ @= +assign_kinsoku: +begin p:=cur_chr; scan_int; n:=cur_val; scan_optional_equals; scan_int; +if is_char_ascii(n) or is_char_kanji(n) then + begin j:=get_kinsoku_pos(tokanji(n),new_pos); + if j=no_entry then + begin print_err("KINSOKU table is full!!"); + help1("I'm skip this control sequences.");@/ + error; return; + end; + if (p=pre_break_penalty_code)or(p=post_break_penalty_code) then + begin define(kinsoku_base+j,p,tokanji(n)); + word_define(kinsoku_penalty_base+j,cur_val); + end + else confusion("kinsoku"); +@:this can't happen kinsoku}{\quad kinsoku@> + end +else + begin print_err("Invalid KANJI code for "); + if p=pre_break_penalty_code then print("pre") + else if p=post_break_penalty_code then print("post") + else print_char("?"); + print("breakpenalty ("); print_hex(n); print_char(")"); +@.Invalid KANJI code@> + help1("I'm skip this control sequences.");@/ + error; return; + end; +end; + +@ @= +begin scan_int; q:=get_kinsoku_pos(tokanji(cur_val),cur_pos); +cur_val_level:=int_val; cur_val:=0; +if (q<>no_entry)and(m=kinsoku_type(q)) then + scanned_result(kinsoku_penalty(q))(int_val); +end + +@ Following codes are used in |main_control|. + +@= +begin kp:=get_kinsoku_pos(cx,cur_pos); +if kp<>no_entry then + begin if kinsoku_type(kp)=pre_break_penalty_code then + begin if not is_char_node(cur_q)and(type(cur_q)=penalty_node) then + penalty(cur_q):=penalty(cur_q)+kinsoku_penalty(kp) + else + begin main_p:=link(cur_q); link(cur_q):=new_penalty(kinsoku_penalty(kp)); + subtype(link(cur_q)):=kinsoku_pena; link(link(cur_q)):=main_p; + end; + end + else if kinsoku_type(kp)=post_break_penalty_code then + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ @= +begin kp:=get_kinsoku_pos(cur_chr,cur_pos); +if kp<>no_entry then + begin if kinsoku_type(kp)=pre_break_penalty_code then + if not is_char_node(tail)and(type(tail)=penalty_node) then + penalty(tail):=penalty(tail)+kinsoku_penalty(kp) + else + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ @= +begin kp:=get_kinsoku_pos(cx,cur_pos); +if kp<>no_entry then + begin if kinsoku_type(kp)=post_break_penalty_code then + begin tail_append(new_penalty(kinsoku_penalty(kp))); + subtype(tail):=kinsoku_pena; + end; + end; +end; + +@ This is a part of section 32. + +The procedure |synch_dir| is used in |hlist_out| and |vlist_out|. + +@d dvi_yoko=0 +@d dvi_tate=1 +@d dvi_dtou=3 + +@= +@!dvi_dir:integer; {a \.{DVI} reader program thinks we direct to} +@!cur_dir_hv:integer; {\TeX\ thinks we direct to} +@!page_dir:eight_bits; + +@ @= +page_dir:=dir_yoko; + +@ @= +procedure synch_dir; +var tmp:scaled; {temporary resister} +begin + case cur_dir_hv of + dir_yoko: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_yoko); + dir_used:=true; + case dvi_dir of + dir_tate: begin tmp:=cur_h; cur_h:=-cur_v; cur_v:=tmp end; + dir_dtou: begin tmp:=cur_h; cur_h:=cur_v; cur_v:=-tmp end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + dir_tate: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_tate); + dir_used:=true; + case dvi_dir of + dir_yoko: begin tmp:=cur_h; cur_h:=cur_v; cur_v:=-tmp end; + dir_dtou: begin cur_v:=-cur_v; cur_h:=-cur_h; end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + dir_dtou: + if dvi_dir<>cur_dir_hv then begin + synch_h; synch_v; dvi_out(dirchg); dvi_out(dvi_dtou); + dir_used:=true; + case dvi_dir of + dir_yoko: begin tmp:=cur_h; cur_h:=-cur_v; cur_v:=tmp end; + dir_tate: begin cur_v:=-cur_v; cur_h:=-cur_h; end; + endcases; + dvi_h:=cur_h; dvi_v:=cur_v; dvi_dir:=cur_dir_hv; + end; + othercases + confusion("synch_dir"); + endcases +end; + +@ This function is called from |adjust_hlist| to used to check, whether +a list which pointed |box_p| contain a printing character. +If the list contain such a character, then return `true', otherwise `false'. +If the first matter is a character, |first_char| is stored it. +|last_char| is stored a last character. If no printing characters exist +in the list, |first_char| and |last_char| is null. +@^recursion@> + +Note that |first_char| and |last_char| may be |math_node|. + +@= +@!first_char:pointer; {first printable character} +@!last_char:pointer; {last printable character} +@!find_first_char:boolean; {find for a first printable character?} + +@ @= +function check_box(box_p:pointer):boolean; +label done; +var @!p:pointer; {run through the current box} +@!flag:boolean; {found any printable character?} +begin flag:=false; p:=box_p; +while p<>null do + begin if is_char_node(p) then + repeat + if find_first_char then + begin first_char:=p; find_first_char:=false + end; + last_char:=p; flag:=true; + if font_dir[font(p)]<>dir_default then p:=link(p); + p:=link(p); + if p=null then goto done; + until not is_char_node(p); + case type(p) of + hlist_node: + begin flag:=true; + if shift_amount(p)=0 then + begin if check_box(list_ptr(p)) then flag:=true; + end + else if find_first_char then find_first_char:=false + else last_char:=null; + end; + ligature_node: if check_box(lig_ptr(p)) then flag:=true; + ins_node,disp_node,mark_node,adjust_node,whatsit_node,penalty_node: + do_nothing; + math_node: + if (subtype(p)=before)or(subtype(p)=after) then + begin if find_first_char then + begin find_first_char:=false; first_char:=p; + end; + last_char:=p; flag:=true; + end + else do_nothing; {\.{\\beginR} etc.} + othercases begin flag:=true; + if find_first_char then find_first_char:=false + else last_char:=null; + end; + endcases; + p:=link(p); + end; +done: check_box:=flag; +end; + +@ Following procedure |adjust_hlist| inserts \.{\\xkanjiskip} between +2byte-char and 1byte-char in hlist which pointed |p|. +Note that the skip is inserted into a place where too difficult to decide +whether inserting or not (i.e, before penalty, after penalty). + +If |pf| is true then insert |jchr_widow_penalty| that is penalty for +creating a widow KANJI character line. + +@d no_skip=0 +@d after_schar=1 {denote after single byte character} +@d after_wchar=2 {denote after double bytes character} + +@= +procedure adjust_hlist(p:pointer;pf:boolean); +label exit; +var q,s,t,u,v,x,z:pointer; + i,k:halfword; + a: pointer; { temporary pointer for accent } + insert_skip:no_skip..after_wchar; + cx:KANJI_code; {temporaly register for KANJI character} + ax:ASCII_code; {temporaly register for ASCII character} + do_ins:boolean; {for inserting |xkanji_skip| into prevous (or after) KANJI} +begin if link(p)=null then goto exit; +if auto_spacing>0 then + begin delete_glue_ref(space_ptr(p)); space_ptr(p):=kanji_skip; + add_glue_ref(kanji_skip); + end; +if auto_xspacing>0 then + begin delete_glue_ref(xspace_ptr(p)); xspace_ptr(p):=xkanji_skip; + add_glue_ref(xkanji_skip); + end; +u:=space_ptr(p); add_glue_ref(u); +s:=xspace_ptr(p); add_glue_ref(s); +if not is_char_node(link(p)) {p1.0.9d} + and(type(link(p))=glue_node)and(subtype(link(p))=jfm_skip+1) then + begin v:=link(p); link(p):=link(v); + fast_delete_glue_ref(glue_ptr(v)); free_node(v,small_node_size); + end; +i:=0; insert_skip:=no_skip; p:=link(p); v:=p; q:=p; +while p<>null do + begin if is_char_node(p) then + begin repeat @; + q:=p; p:=link(p); incr(i); + if (i>5)and pf then + begin if is_char_node(v) then + if font_dir[font(v)]<>dir_default then v:=link(v); + v:=link(v); + end; + until not is_char_node(p); + end + else + begin case type(p) of + hlist_node: @; + ligature_node: @; + penalty_node,disp_node: @; + kern_node: if subtype(p)=explicit then insert_skip:=no_skip + else if subtype(p)=acc_kern then begin + { When we insert \.{\\xkanjiskip}, we first ignore accent (and kerns) and + insert \.{\\xkanjiskip}, then we recover the accent. } + if q=p then begin t:=link(p); + { if p is beginning on the list, we have only to ignore nodes. } + if is_char_node(t) then + if font_dir[font(t)]<>dir_default then t:=link(t); + p:=link(link(t)); + if font_dir[font(p)]<>dir_default then + begin p:=link(p); insert_skip:=after_wchar; end + else insert_skip:=after_schar; + end + else begin + a:=p; t:=link(p); + if is_char_node(t) then + if font_dir[font(t)]<>dir_default then t:=link(t); + t:=link(link(t)); link(q):=t; p:=t; + @; incr(i); + if (i>5)and pf then + begin if is_char_node(v) then + if font_dir[font(v)]<>dir_default then v:=link(v); + v:=link(v); + end; + if link(q)<>t then link(link(q)):=a else link(q):=a; + end; + end; + math_node: @; + mark_node,adjust_node,ins_node,whatsit_node: + {These nodes are vanished when typeset is done} + do_nothing; + othercases insert_skip:=no_skip; + endcases; + q:=p; p:=link(p); + end; + end; +if not is_char_node(q)and(type(q)=glue_node)and(subtype(q)=jfm_skip+1) then + begin fast_delete_glue_ref(glue_ptr(q)); + glue_ptr(q):=zero_glue; add_glue_ref(zero_glue); + end; +delete_glue_ref(u); delete_glue_ref(s); +if (v<>null)and pf and(i>5) then @; +exit: +end; + +@ @= +if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); + if insert_skip=after_schar then @; + p:=link(p); insert_skip:=after_wchar; + end +else + begin ax:=qo(character(p)); + if insert_skip=after_wchar then @; + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end + +@ @= +begin find_first_char:=true; first_char:=null; last_char:=null; +if shift_amount(p)=0 then + begin if check_box(list_ptr(p)) then + begin if first_char<>null then @; + if last_char<>null then + begin @; + end else insert_skip:=no_skip; + end else insert_skip:=no_skip; + end else insert_skip:=no_skip; +end + +@ @= +if type(first_char)=math_node then + begin ax:=qo("0"); + if insert_skip=after_wchar then @; + end +else if font_dir[font(first_char)]<>dir_default then + begin KANJI(cx):=info(link(first_char)); + if insert_skip=after_schar then @ + else if insert_skip=after_wchar then @; + end +else + begin ax:=qo(character(first_char)); + if insert_skip=after_wchar then @; + end; + +@ @= +if type(last_char)=math_node then + begin ax:=qo("0"); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end +else if font_dir[font(last_char)]<>dir_default then + begin insert_skip:=after_wchar; KANJI(cx):=info(link(last_char)); + if is_char_node(link(p))and(font_dir[font(link(p))]<>dir_default) then + begin @; p:=link(p); + end; + end +else + begin ax:=qo(character(last_char)); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + +@ @= +begin if (subtype(p)=before)and(insert_skip=after_wchar) then + begin ax:=qo("0"); @; + insert_skip:=no_skip; + end +else if subtype(p)=after then + begin ax:=qo("0"); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end +else insert_skip:=no_skip; +end + +@ @= +begin t:=lig_ptr(p); +if is_char_node(t) then + begin ax:=qo(character(t)); + if insert_skip=after_wchar then @; + while link(t)<>null do t:=link(t); + if is_char_node(t) then + begin ax:=qo(character(t)); + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + end; +end + +@ @= +begin if is_char_node(link(p)) then + begin q:=p; p:=link(p); + if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); + if insert_skip=after_schar then @ + else if insert_skip=after_wchar then @; + p:=link(p); insert_skip:=after_wchar; + end + else + begin ax:=qo(character(p)); + if insert_skip=after_wchar then @; + if auto_xsp_code(ax)>=2 then + insert_skip:=after_schar else insert_skip:=no_skip; + end; + end +end + +@ @= +begin + begin x:=get_inhibit_pos(cx,cur_pos); + if x<>no_entry then + if (inhibit_xsp_type(x)=inhibit_both)or + (inhibit_xsp_type(x)=inhibit_previous) then + do_ins:=false else do_ins:=true + else do_ins:=true; + end; +if do_ins then + begin z:=new_glue(s); subtype(z):=xkanji_skip_code+1; + link(z):=link(q); link(q):=z; q:=z; + end; +end + +@ @= +begin if (auto_xsp_code(ax) mod 2)=1 then + begin x:=get_inhibit_pos(cx,cur_pos); + if x<>no_entry then + if (inhibit_xsp_type(x)=inhibit_both)or + (inhibit_xsp_type(x)=inhibit_after) then + do_ins:=false else do_ins:=true + else do_ins:=true; + end +else do_ins:=false; +if do_ins then + begin z:=new_glue(s); subtype(z):=xkanji_skip_code+1; + link(z):=link(q); link(q):=z; q:=z; + end; +end + +@ @= +begin z:=new_glue(u); subtype(z):=kanji_skip_code+1; +link(z):=link(q); link(q):=z; q:=z; +end + +@ @= +begin z:=new_glue(u); subtype(z):=kanji_skip_code+1; +link(z):=link(p); link(p):=z; p:=link(z); q:=z; +end + +@ @= +begin q:=v; p:=link(v); +if is_char_node(v)and(font_dir[font(v)]<>dir_default) then + begin q:=p; p:=link(p); + end; +t:=q; s:=null; +@; +if s<>null then + begin s:=link(t); + if not is_char_node(s)and(type(s)=penalty_node) then + penalty(s):=penalty(s)+jchr_widow_penalty + else if jchr_widow_penalty<>0 then + begin s:=new_penalty(jchr_widow_penalty); subtype(s):=widow_pena; + link(s):=link(t); link(t):=s; t:=link(s); + while(not is_char_node(t)) do + begin if (type(t)=glue_node)or(type(t)=kern_node) then goto exit; + t:=link(t); + end; + z:=new_glue(u); subtype(z):=kanji_skip_code+1; + link(z):=link(s); link(s):=z; + end; + end; +end; + +@ @= +while(p<>null) do +begin if is_char_node(p) then + begin if font_dir[font(p)]<>dir_default then + begin KANJI(cx):=info(link(p)); i:=kcat_code(kcatcodekey(cx)); k:=0; + if (i=kanji)or(i=kana) then begin t:=q; s:=p; end; + p:=link(p); q:=p; + end + else begin k:=k+1; + if k>1 then begin q:=p; s:=null; end; + end; + end +else begin case type(p) of + penalty_node,mark_node,adjust_node,whatsit_node, + glue_node,kern_node,math_node,disp_node: + do_nothing; + othercases begin q:=p; s:=null; end; + endcases; + end; +p:=link(p); +end + +@ @= +procedure dir_out; +var @!this_box: pointer; {pointer to containing box} +begin this_box:=temp_ptr; + temp_ptr:=list_ptr(this_box); + if (type(temp_ptr)<>hlist_node)and(type(temp_ptr)<>vlist_node) then + confusion("dir_out"); + case box_dir(this_box) of + dir_yoko: + case box_dir(temp_ptr) of + dir_tate: {Tate in Yoko} + begin cur_v:=cur_v-height(this_box); cur_h:=cur_h+depth(temp_ptr) end; + dir_dtou: {DtoU in Yoko} + begin cur_v:=cur_v+depth(this_box); cur_h:=cur_h+height(temp_ptr) end; + endcases; + dir_tate: + case box_dir(temp_ptr) of + dir_yoko: {Yoko in Tate} + begin cur_v:=cur_v+depth(this_box); cur_h:=cur_h+height(temp_ptr) end; + dir_dtou: {DtoU in Tate} + begin + cur_v:=cur_v+depth(this_box)-height(temp_ptr); + cur_h:=cur_h+width(temp_ptr) + end; + endcases; + dir_dtou: + case box_dir(temp_ptr) of + dir_yoko: {Yoko in DtoU} + begin cur_v:=cur_v-height(this_box); cur_h:=cur_h+depth(temp_ptr) end; + dir_tate: {Tate in DtoU} + begin + cur_v:=cur_v+depth(this_box)-height(temp_ptr); + cur_h:=cur_h+width(temp_ptr) + end; + endcases; + endcases; + cur_dir_hv:=box_dir(temp_ptr); + if type(temp_ptr)=vlist_node then vlist_out@+else hlist_out; +end; + +@ These routines are used to output diagnostic which related direction. + +@ @= +procedure print_dir(@!dir:eight_bits); {prints |dir| data} +begin if dir=dir_yoko then print_char("Y") +else if dir=dir_tate then print_char("T") +else if dir=dir_dtou then print_char("D") +end; +@# +procedure print_direction(@!d:integer); {print the direction represented by d} +begin case abs(d) of +dir_yoko: print("yoko"); +dir_tate: print("tate"); +dir_dtou: print("dtou"); +end; +if d<0 then print("(math)"); +print(" direction"); +end; + +@ The procedure |set_math_kchar| is same as |set_math_char| which +written in section 48. + +@= +procedure set_math_kchar(@!c:integer); +var p:pointer; {the new noad} +begin p:=new_noad; math_type(nucleus(p)):=math_jchar; +character(nucleus(p)):=qi(0); +math_kcode(p):=c; fam(nucleus(p)):=cur_jfam; +if font_dir[fam_fnt(fam(nucleus(p))+cur_size)]=dir_default then + begin print_err("Not two-byte family"); + help1("IGNORE.");@/ + error; + end; +type(p):=ord_noad; +link(tail):=p; tail:=p; +end; + +@ This section is a part of |main_control|. + +@= +if is_char_node(tail) then + begin cx:=qo(character(tail)); @; + end +else if type(tail)=ligature_node then + begin cx:=qo(character(lig_char(tail))); @; + end; +if direction=dir_tate then + begin if font_dir[main_f]=dir_tate then disp:=0 + else if font_dir[main_f]=dir_yoko then disp:=t_baseline_shift-y_baseline_shift + else disp:=t_baseline_shift; + main_f:=cur_tfont; + end +else + begin if font_dir[main_f]=dir_yoko then disp:=0 + else if font_dir[main_f]=dir_tate then disp:=y_baseline_shift-t_baseline_shift + else disp:=y_baseline_shift; + main_f:=cur_jfont; + end; +@; +ins_kp:=false; ligature_present:=false; +cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); +main_i:=orig_char_info(main_f)(qi(0)); +goto main_loop_j+3; +@# +main_loop_j+1: space_factor:=1000; + if main_f<>null_font then + begin fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l; + link(tail):=main_p; tail:=main_p; last_jchr:=tail; + fast_get_avail(main_p); info(main_p):=KANJI(cur_chr); + link(tail):=main_p; tail:=main_p; + cx:=cur_chr; @; + end; + ins_kp:=false; +again_2: + get_next; + main_i:=orig_char_info(main_f)(cur_l); + case cur_cmd of + kanji,kana,other_kchar: begin + cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); goto main_loop_j+3; + end; + letter,other_char: begin ins_kp:=true; cur_l:=qi(0); goto main_loop_j+3; + end; + endcases; + x_token; + case cur_cmd of + kanji,kana,other_kchar: cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + letter,other_char: begin ins_kp:=true; cur_l:=qi(0); end; + char_given: begin + if is_char_ascii(cur_chr) then + begin ins_kp:=true; cur_l:=qi(0); + end + else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + end; + char_num: begin scan_char_num; cur_chr:=cur_val; + if is_char_ascii(cur_chr) then + begin ins_kp:=true; cur_l:=qi(0); + end + else cur_l:=qi(get_jfm_pos(KANJI(cur_chr),main_f)); + end; + inhibit_glue: begin inhibit_glue_flag:=true; goto again_2; end; + othercases begin ins_kp:=max_halfword; + cur_l:=qi(0); cur_r:=non_char; lig_stack:=null; + end; + endcases; +@# +main_loop_j+3: + if ins_kp=true then @; + if main_f<>null_font then + begin @; + end + else inhibit_glue_flag:=false; + if ins_kp=false then begin { Kanji -> Kanji } + goto main_loop_j+1; + end else if ins_kp=true then begin { Kanji -> Ascii } + {@@;} + ins_kp:=false; goto main_loop; + end else begin { Kanji -> cs } + {@@;} + goto reswitch; + end; + +@ @= +begin if not is_char_node(tail)and(type(tail)=disp_node) then + begin if prev_disp=disp then + begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null; + end + else disp_dimen(tail):=disp; + end +else + if disp<>0 then + begin prev_node:=tail; tail_append(get_node(small_node_size)); + type(tail):=disp_node; disp_dimen(tail):=disp; prev_disp:=disp; + end; +end; + +@ @= +if disp<>0 then +begin if not is_char_node(tail)and(type(tail)=disp_node) then + begin disp_dimen(tail):=0; + end +else + begin prev_node:=tail; tail_append(get_node(small_node_size)); + type(tail):=disp_node; disp_dimen(tail):=0; prev_disp:=disp; + end; +end; + +@ @= +cur_q:=tail; +if inhibit_glue_flag<>true then + begin if char_tag(main_i)=gk_tag then + begin main_k:=glue_kern_start(main_f)(main_i); + repeat main_j:=font_info[main_k].qqqq; + if next_char(main_j)=cur_l then + begin if op_byte(main_j)null then + begin while((type(gp)<>cur_r)and(link(gp)<>null)) do gp:=link(gp); + gq:=glue_ptr(gp); + end + else + begin gp:=get_node(small_node_size); font_glue[main_f]:=gp; + gq:=null; + end; + if gq=null then + begin type(gp):=cur_r; gq:=new_spec(zero_glue); + glue_ptr(gp):=gq; + main_k:=exten_base[main_f]+qi((qo(cur_r))*3); + width(gq):=font_info[main_k].sc; + stretch(gq):=font_info[main_k+1].sc; + shrink(gq):=font_info[main_k+2].sc; + add_glue_ref(gq); link(gp):=get_node(small_node_size); + gp:=link(gp); glue_ptr(gp):=null; link(gp):=null; + end; + tail_append(new_glue(gq)); subtype(tail):=jfm_skip+1; + goto skip_loop; + end + else begin + tail_append(new_kern(char_kern(main_f)(main_j))); + goto skip_loop; + end; + end; + incr(main_k); + until skip_byte(main_j)>=stop_flag; + end; +end; +skip_loop: inhibit_glue_flag:=false; + +@ @= +procedure print_kanji(@!s:KANJI_code); {prints a single character} +begin +if s>255 then + begin print_char(Hi(s)); print_char(Lo(s)); + end else print_char(s); +end; + +@* \[56] System-dependent changes. +@z diff --git a/src/texsourc/subroute.c b/src/texsourc/subroute.c index 6a5be83..554bd9e 100644 --- a/src/texsourc/subroute.c +++ b/src/texsourc/subroute.c @@ -115,14 +115,14 @@ void uexit (int unix_code) final_code = EXIT_FAILURE; else final_code = unix_code; -/*---->*/ + if (jump_used) { show_line("Jump Buffer already used\n", 1); exit(1); } + jump_used++; -/*<----*/ exit(final_code); } // round a double being careful about very large and very small values @@ -132,22 +132,6 @@ integer zround (double r) { integer i; - /* R can be outside the range of an integer if glue is stretching or - shrinking a lot. We can't do any better than returning the largest - or smallest integer possible in that case. It doesn't seem to make - any practical difference. Here is a sample input file which - demonstrates the problem, from phil@cs.arizona.edu: - \documentstyle{article} - \begin{document} - \begin{flushleft} - $\hbox{} $\hfill - \filbreak - \eject - - djb@silverton.berkeley.edu points out we should testing against - TeX's largest or smallest integer (32 bits), not the machine's. So - we might as well use a floating-point constant, and avoid potential - compiler bugs (also noted by djb, on BSDI). */ if (r > 2147483647.0) i = 2147483647; else if (r < -2147483647.0) @@ -159,122 +143,6 @@ integer zround (double r) return i; } -/****************************************************************************/ -// malloc with error checking and error message -/* kpathsea/xmalloc.c */ -void * xmalloc (unsigned size) -{ - void * new_mem = (void*) malloc (size ? size : 1); - - if (new_mem == NULL) { - sprintf(log_line, "malloc: Unable to honor request for %u bytes.\n", size); - show_line(log_line, 1); - abort(); // ??? - } -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "XMALLOC %d\n", size); /* 1996/Jan/20 */ - show_line(log_line, 0); - } -#endif - return new_mem; -} -// calloc with error checking - used by map_create -/* kpathsea/xcalloc.c */ -address xcalloc (unsigned nelem, unsigned elsize) -{ - address new_mem = (address) calloc (nelem, elsize); - if (new_mem == NULL) - { - sprintf(log_line, "Unable to honor request for %u elements of size %u.\n", nelem, elsize); - show_line(log_line, 1); - abort(); - } - return new_mem; -} -/* Return a copy of s in new storage. */ /* xmalloc does error checking */ -/* kpathsea/xstrdup.c */ -string xstrdup (string s) -{ - string pnew_string = (string) xmalloc (strlen (s) + 1); -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "XSTRDUP %d %s\n", strlen(s)+1, s); - show_line(log_line, 0); - } -#endif - return strcpy (pnew_string, s); -} -/* only used by line.c (which in turn is only used by fontmap.c) */ -/* kpathsea/xrealloc.c */ -address xrealloc (address old_ptr, unsigned size) -{ - address new_mem; - - if (old_ptr == NULL) new_mem = xmalloc (size); - else - { - new_mem = (address) realloc (old_ptr, size); - if (new_mem == NULL) - { - sprintf(log_line, "Unable to honor request for %u bytes.\n", size); - show_line(log_line, 1); - abort(); - } - } - return new_mem; -} -// returns newly allocated string -/* kpathsea/concat.c */ -string concat (string s1, string s2) -{ - string answer; -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "CONCAT %s and %s ", s1, s2); - show_line(log_line, 0); - } -#endif - answer = (string) xmalloc (strlen (s1) + strlen (s2) + 1); - strcpy (answer, s1); - strcat (answer, s2); -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "=> %s\n", answer); - show_line(log_line, 0); - } -#endif - return answer; -} -// returns newly allocated string -/* kpathsea/concat3.c */ -string concat3 (string s1, string s2, string s3) -{ - string answer; -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "CONCAT3 %s, %s, and %s ", s1, s2, s3); - show_line(log_line, 0); - } -#endif - answer = (string) xmalloc (strlen (s1) + strlen (s2) + strlen (s3) + 1); - strcpy (answer, s1); - strcat (answer, s2); - strcat (answer, s3); -#ifdef MYDEBUG - if (trace_flag) - { - sprintf(log_line, "=> %s\n", answer); - show_line(log_line, 0); - } -#endif - return answer; -} /***********************************************************************/ // following used only in itex.c on pool file /* Return true if we're at the end of FILE, else false. This implements */ @@ -296,6 +164,7 @@ bool test_eof (FILE * file) return true; /* We weren't at the end. Back up. */ (void) ungetc (c, file); + return false; } /* Return true on end-of-line in FILE or at the end of FILE, else false. */ @@ -317,100 +186,6 @@ bool eoln (FILE * file) } /***********************************************************************/ -// following used only by fontmap.c and openinou.c - -// #define FATAL_PERROR(s) do { perrormod (s); exit (errno); } while (0) - -// perrormod puts error message on stdout instead of stderr - -/* These routines just check the return status from standard library - routines and abort if an error happens. */ - -// xfopen used in open_input in openinou.c -/* kpathsea/xfopen.c */ -FILE * xfopen (char *filename, char * fmode) -{ - FILE *f; - - assert(filename && mode); -/* if share_flag is non-zero and we are opening for reading use fsopen */ -/* f = fopen (filename, mode); */ - if (share_flag == 0 || *fmode != 'r') - f = fopen (filename, fmode); - else - f = _fsopen (filename, fmode, share_flag); - if (f == NULL) - { -// FATAL_PERROR (filename); - perrormod(filename); - uexit(1); // ??? - } - return f; -} -// xfclose not used ... -/* kpathsea/xfopen.c */ -int xfclose (FILE *f, char *filename) -{ - assert(f); - - if (ferror(f) != 0 || fclose(f) != 0) - { -// FATAL_PERROR (filename); - perrormod(filename); - uexit(1); // ??? - } - return 0; -} -/********************************************************************************/ -// following used only in map_lookup -// return pointer to start of extension --- or NULL if there isn't one -/* kpathsea/find-suffix.c */ -string find_suffix (string name) -{ - string dot_pos; - string slash_pos; - - dot_pos = strrchr (name, '.'); -#ifdef MSDOS - if ((slash_pos = strrchr (name, PATH_SEP)) != NULL); - else if ((slash_pos = strrchr (name, '\\')) != NULL); - else if ((slash_pos = strrchr (name, ':')) != NULL); - else slash_pos = name; -#else - slash_pos = strrchr (name, PATH_SEP); -#endif - -/* If the name is `foo' or `/foo.bar/baz', we have no extension. */ - return dot_pos == NULL || dot_pos < slash_pos ? NULL : dot_pos + 1; -} -// remove extension of file name - returns copy or NULL -/* kpathsea/rm-suffix.c */ -string remove_suffix (string s) -{ - string ret; - string suffix = find_suffix (s); - - if (suffix) { - suffix--; /* Back up to before the dot. */ - ret = (char *) xmalloc (suffix - s + 1); - strncpy (ret, s, suffix - s); - ret[suffix - s] = '\0'; - } - else ret = NULL; - - return ret; -} -// add extension to file name unless it already has one -// returns copy or the old one (warning: danger when freeing) -/* kpathsea/extend-fname.c */ -string extend_filename (string name, string default_suffix) -{ - string new_s; - string suffix = find_suffix (name); - - new_s = (suffix == NULL ? concat3 (name, ".", default_suffix) : name); - return new_s; -} /****************************************************************************************/ #ifdef MALLOCLINE @@ -520,13 +295,6 @@ void set_paths (int path_bits) char *s, *t, *u; /* 94/Jan/6 */ char buffer[PATH_MAX]; -/* eliminated lots of junk not needed for TeX itself 93/Nov/20 bkph */ - -/* added code to look for pool file in format directory also */ -/* added code to look for fmt directory in tex directory also */ -/* added code to look for tfm directory in tex directory also */ -/* added code to look for some PC TeX flavour environment names 94/Jan/6 */ -/* which, in case of formats, could lead to I'm stymied errors ... */ if (path_bits & TEXFORMATPATHBIT) { @@ -596,39 +364,42 @@ void set_paths (int path_bits) /* if (t != TEXPOOL) free (t); */ } - if (path_bits & TFMFILEPATHBIT) { + if (path_bits & TFMFILEPATHBIT) + { s = "TEXFONTS"; -/* Introduce encoding specific TEXFONTS env variable 97/April/2 */ - if ((u = grabenv("ENCODING")) != NULL) { /* get ENCODING=... */ - encoding_name = u; /* remember for error mess */ -/* sprintf(log_line, "\nENCODING=%s\n", u); */ -/* ENCODING is defined, now see if matching env variable */ - if ((t = grabenv(u)) != NULL) { /* get TEXNANSI=c:\yandy\tfm; ... */ -/* sprintf(loglein, "\nset %s=%s\n", u, t); */ -/* prevent problems with TEXNANSI=1 and such mistakes! */ -/* should have a drive letter and not be a number */ - if (strchr(t, ':') != NULL && - sscanf(t, "%d", &n) == 0) { - s = u; /* look here instead of TEXFONTS=... */ -/* sprintf(log_line, "\nUSE %s\n", u); */ + + if ((u = grabenv("ENCODING")) != NULL) + { + encoding_name = u; + + if ((t = grabenv(u)) != NULL) + { + if (strchr(t, ':') != NULL && sscanf(t, "%d", &n) == 0) + { + s = u; } } } - t = TEXFONTS; /* #define TEXFONTS TEXPATH "tfm" */ -/* if (getenv(s) == NULL) { */ - if (grabenv(s) == NULL) { /* 1994/May/19 */ - strcpy(buffer, texpath); /* see if texpath\tfm is directory */ + t = TEXFONTS; + + if (grabenv(s) == NULL) + { + strcpy(buffer, texpath); strcat(buffer, PATH_SEP_STRING); strcat(buffer, "tfm"); - if (trace_flag) { + + if (trace_flag) + { sprintf(log_line, "Checking `%s' = %s %s %s\n", - buffer, texpath, PATH_SEP_STRING, "tfm"); /* 95/Jan/25 */ + buffer, texpath, PATH_SEP_STRING, "tfm"); show_line(log_line, 0); } -/* if (dir_p(buffer)) t = _strdup(buffer); */ - if (dir_p(buffer)) t = xstrdup(buffer); /* 96/Jan/20 */ - else { + + if (dir_p(buffer)) + t = xstrdup(buffer); + else + { s = "TEXTFMS"; /* added PC-TeX version 94/Jan/6 */ if (getenv(s) == NULL) s = "TEXTFM"; /* em-TeX uses TEXTFM ... */ } @@ -637,19 +408,20 @@ void set_paths (int path_bits) show_line(log_line, 0); } } -/* path_dirs[TFMFILEPATH] = initialize_path_list ("TEXFONTS", TEXFONTS); */ -/* path_dirs[TFMFILEPATH] = initialize_path_list (s, TEXFONTS); */ + path_dirs[TFMFILEPATH] = initialize_path_list (s, t); -/* if (t != TEXFONTS) free (t); */ + } - if (path_bits & TEXINPUTPATHBIT) { + if (path_bits & TEXINPUTPATHBIT) + { if (format_specific) { /* 1994/Oct/25 */ s = format_name; /* try specific */ if (grabenv(s) == NULL) s = "TEXINPUTS"; /* no format specific */ } - else s = "TEXINPUTS"; /* normal case */ -/* if (getenv(s) == NULL) */ + else + s = "TEXINPUTS"; /* normal case */ + if (grabenv(s) == NULL) { /* 1994/May/19 */ s = "TEXINPUT"; /* added PC-TeX vers 94/Jan/6 */ if (trace_flag) { @@ -1098,7 +870,7 @@ char *file_p (string fn) /* S_IFMT is file type mask 0170000 and S_IFDIR is directory 0040000 */ -#pragma optimize ("g", off) /* try and avoid compiler bug here _dos_find */ +//#pragma optimize ("g", off) /* try and avoid compiler bug here _dos_find */ /* NOTE: _dos_find... prevents running under Windows NT ??? */ /* and presently dir_method = true so we do use this _dos_find_first */ @@ -2092,7 +1864,7 @@ char *unixify (char * t) /* avoids heavy stack usage in tree search */ /* but ties up some global fixed space ... */ -#pragma optimize ("g", off) /* try and avoid compiler bug here _dos_find */ +//#pragma optimize ("g", off) /* try and avoid compiler bug here _dos_find */ /* Add DIRNAME to DIR_LIST and look for subdirectories, possibly recursively. We assume DIRNAME is the name of a directory. */ diff --git a/src/texsourc/test-for.c b/src/texsourc/test-for.c new file mode 100644 index 0000000..f9eaed3 --- /dev/null +++ b/src/texsourc/test-for.c @@ -0,0 +1,10 @@ +#include + +int main (void) +{ + unsigned char i; + //for (i = 0; i <= 255; i++) + for (i = 0; i++ < 255;) + printf("At: %d.", i); + return 0; +} diff --git a/src/texsourc/tex3.c b/src/texsourc/tex3.c index 49fff01..01fd47f 100644 --- a/src/texsourc/tex3.c +++ b/src/texsourc/tex3.c @@ -2311,9 +2311,7 @@ void start_input (void) /* we get here if extension is "", or file with extension failed to open */ /* if current extension is not `tex,' and `tex' is not irrelevant, try it */ /* string 785 is .tex */ -/* (! extensionirrelevantp(name_of_file, "tex"))){ */ - if ((cur_ext != 785) && (name_length + 5 < PATHMAX) && - (!extensionirrelevantp(name_of_file, name_length, "tex"))) + if ((cur_ext != 785) && (name_length + 5 < PATHMAX)) { //strcpy(name_of_file + name_length + 1, ".tex "); name_of_file[name_length + 1] = '.'; @@ -2338,8 +2336,6 @@ void start_input (void) if ((cur_ext == 335) && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH)) goto lab30; - if (maketextex() && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH)) - goto lab30; /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */ end_file_reading(); prompt_file_name("input file name", ".tex"); @@ -2469,13 +2465,7 @@ internal_font_number read_font_info_(halfword u, str_number nom, str_number aire if (!b_open_in(tfm_file)) /* new in C version d */ { - if (maketextfm ()) - { - if (!b_open_in(tfm_file)) - goto lab11; - } - else - goto lab11; + goto lab11; } /* was just: goto lab11; */ fileopened = true; diff --git a/src/texsourc/tex8.c b/src/texsourc/tex8.c index 11da08e..a2e6ad9 100644 --- a/src/texsourc/tex8.c +++ b/src/texsourc/tex8.c @@ -969,9 +969,7 @@ void open_or_close_in (void) /* we get here if extension is "", or file with extension failed to open */ /* if current extension is not `tex,' and `tex' is not irrelevant, try it */ /* string 785 is .tex */ - else if ((cur_ext != 785) && (name_length + 5 < PATHMAX) && -/* *** some changes in above file name handling *** */ - (!extensionirrelevantp(name_of_file, name_length, "tex"))) + else if ((cur_ext != 785) && (name_length + 5 < PATHMAX)) { name_of_file[name_length + 1] = '.'; name_of_file[name_length + 2] = 't'; @@ -989,8 +987,6 @@ void open_or_close_in (void) if ((cur_ext == 335) && a_open_in(read_file[n], TEXINPUTPATH)) read_open[n] = 1; - else if (maketextex() && a_open_in(read_file[n], TEXINPUTPATH)) - read_open[n] = 1; } } } diff --git a/src/texsourc/tex9.c b/src/texsourc/tex9.c index a1b0a14..96b9206 100644 --- a/src/texsourc/tex9.c +++ b/src/texsourc/tex9.c @@ -208,6 +208,7 @@ void close_files_and_terminate (void) (void) fprintf(log_file, "%c%ld%s", ' ', (long)hyph_count, " hyphenation exception"); if (hyph_count != 1) (void) putc('s', log_file); + (void) fprintf(log_file, "%s%ld\n", " out of ", (long) hyphen_prime); (void) fprintf(log_file, " "); (void) fprintf(log_file, "%ld%s", (long)max_in_stack, "i,"); @@ -311,7 +312,8 @@ void close_files_and_terminate (void) } } /* end of if (log_opened) */ #endif /* STAT */ - while (cur_s > -1) { + while (cur_s > -1) + { if (cur_s > 0) dvi_out(142); else diff --git a/src/texsourc/texd.h b/src/texsourc/texd.h index 252e159..730a735 100644 --- a/src/texsourc/texd.h +++ b/src/texsourc/texd.h @@ -114,7 +114,9 @@ /* type definitions follow */ typedef unsigned char ASCII_code; +typedef unsigned short KANJI_code; typedef unsigned char eight_bits; +typedef unsigned short sixteen_bits; typedef integer pool_pointer; typedef integer str_number; typedef unsigned char packed_ASCII_code; @@ -1237,7 +1239,6 @@ EXTERN int tfm_temp; /* only used in tex3.c 95/Jan/7 */ void uexit (int unix_code); /* in lib/uexit.c - bkph */ void t_open_in (void); /* in lib/texmf.c - bkph */ - bool extensionirrelevantp (unsigned char *base, int nlen, char *suffix); void call_edit (ASCII_code *filename, pool_pointer fnstart, integer fnlength, integer linenumber); /* from lib/texmf.c - bkph */ @@ -1247,9 +1248,6 @@ EXTERN int tfm_temp; /* only used in tex3.c 95/Jan/7 */ void get_date_and_time (integer *minutes, integer *day, integer *month, integer *year); /* in lib/texmf.c - bkph */ - bool maketextex (void); /* in openinou.c */ - bool maketextfm (void); /* in openinou.c */ - char *unixify (char *); /* in pathsrch.c bkph */ #ifdef _WINDOWS diff --git a/src/texsourc/texmf.c b/src/texsourc/texmf.c index cb4bcfe..1cd4f45 100644 --- a/src/texsourc/texmf.c +++ b/src/texsourc/texmf.c @@ -31,7 +31,7 @@ #pragma warning(disable:4996) #pragma warning(disable:4131) // old style declarator -#pragma warning(disable:4135) // conversion between different integral types +#pragma warning(disable:4135) // conversion between different integral types #pragma warning(disable:4127) // conditional expression is constant #include @@ -47,10 +47,6 @@ /* Note: INITEX definition in makefile only affects included *.h files */ -#ifdef MSDOS -// int __cdecl read (int, void *, unsigned int); -#endif - /* Instantiate data in `texd.h' or `mfd.h' here. */ #ifdef TeX @@ -72,15 +68,11 @@ // #include "c-ctype.h" // #include "c-pathch.h" -/* For `struct tm'. */ - #include // needed for time, struct tm etc. +#include extern struct tm * localtime(); -/* Catch interrupts. */ -#include // needed for signal, SIGINT, SIG_IGN, SIG_ERR etc. - /* following may be found in local.c --- used for key replacement */ extern char * replacement[]; /* pointers to replacement strings */ @@ -294,11 +286,12 @@ void t_open_in (void) static RETSIGTYPE catch_interrupt (int err) { - (void) signal (SIGINT, SIG_IGN); /* turn off interrupts for now */ -/* interrupt = 1; */ /* make sure interrupt declared volatile */ -// if (interrupt++ >= 3) uexit(1); /* emergency exit -- bkph */ - if (interrupt++ >= 3) exit(1); /* emergency exit -- bkph */ - (void) signal (SIGINT, catch_interrupt); /* turn them back on again */ + (void) signal (SIGINT, SIG_IGN); + + if (interrupt++ >= 3) + exit(1); + + (void) signal (SIGINT, catch_interrupt); } /* Besides getting the date and time here, we also set up the interrupt @@ -307,19 +300,16 @@ catch_interrupt (int err) ``Get the first line of input and prepare to start''), this is as good a place as any. */ -void get_date_and_time (integer *minutes, integer *pday, integer *pmonth, integer *pyear) +void get_date_and_time (integer *sys_minutes, integer *sys_day, integer *sys_month, integer *sys_year) { -/* int sig=0; */ time_t clock; struct tm *tmptr; -/* time_t clock = time ((long *) 0); */ -/* clock = time (NULL); */ (void) time (&clock); /* - seconds since 1970 */ if (trace_flag) { - sprintf(log_line, "The time is %u\n", clock); /* debugging */ + sprintf(log_line, "The time is %u\n", clock); show_line(log_line, 0); } @@ -334,23 +324,26 @@ void get_date_and_time (integer *minutes, integer *pday, integer *pmonth, intege { sprintf(log_line, "Cannot convert time (%0ld)!\n", clock); show_line(log_line, 1); - *pyear = 2038; - *pmonth = 1; - *pday = 18; - *minutes = 22 * 60 + 14; + *sys_year = 2038; + *sys_month = 1; + *sys_day = 18; + *sys_minutes = 22 * 60 + 14; } else { - *minutes = tmptr->tm_hour * 60 + tmptr->tm_min; - *pday = tmptr->tm_mday; - *pmonth = tmptr->tm_mon + 1; - *pyear = tmptr->tm_year + 1900; + *sys_minutes = tmptr->tm_hour * 60 + tmptr->tm_min; + *sys_day = tmptr->tm_mday; + *sys_month = tmptr->tm_mon + 1; + *sys_year = tmptr->tm_year + 1900; if (trace_flag) { sprintf(log_line, "%d-%d-%d %d:%d\n", - tmptr->tm_year + 1900, tmptr->tm_mon + 1, tmptr->tm_mday, - tmptr->tm_hour, tmptr->tm_min); + tmptr->tm_year + 1900, + tmptr->tm_mon + 1, + tmptr->tm_mday, + tmptr->tm_hour, + tmptr->tm_min); show_line(log_line, 0); } } diff --git a/src/texsourc/texmf.exp b/src/texsourc/texmf.exp new file mode 100644 index 0000000000000000000000000000000000000000..e5e259a03811c655fbe51116360e4d80ee92ef8c GIT binary patch literal 4323 zcmeH~%a2o49LIkH107z&lzA|~03950P^f*(ql2I$FF|ocA%vKQYiVywp^uy1+i4{% z3^D3LBPN&_UvZ&{Q5P&+sL{lQF~%5UA`2HRSZKn+phja{sQCT;&OLpcPWTHvnfc!D z`JB^x+tYi#zuUuIi|D1HlSc=a6Fo@My25rQ<)u`I^}u4H436*N$n7BhXYm)#*r%$w zv7^kmy@v5~OO@9;OMQFT^EEW{7*s`9DCHp}ZXfv>m!l+=rsfB5-#~?;~iB zxC!W8;y#5g6PJMU>jU&T6fps}3%Wzx7tj^rW}#tmUqSiZ252AjZgJm0SBX0aE6~;AjzDALet`CgI|hx5y9y18I|1eQ9iVH_HR6)cNpU|y`^7y0of3B) zIv_3sofh{qbWq%BD1YVv{R$ltSAfol`vbaGoCDn{?l0)DI1hS{xWA$6#MPm^UI8Km z-+FQ9p}WO(gKZG^6!czkJzyi^o`&8hZY9`8anC_##r1)068AjxesKd}o5fv(a`Xmh z7%U|25_GS)5wKBluR!^G!rcVMxg4O^q5H*+f!!wVE$9Jp<6vXr-iAIPZadiR;@*WG z6c+*8D((a5A#oF6cZlnT{)Yb-aVz&x7k`xIT2+ZH-}Xzn3O((WLoYZ=HV@}9NY;+83|hNdcahd_H;s1D#kaNfIm zwx7g|dHZVY2hJ8?-oe%_vUwD9R_ZxAecMBtr|<@s(=43UyiUEm9A<22k1!tfN{_g396HM1zuPB@>*-uRks-sDZ#`bfxo zVKKSq=J>IJ&ZDbHCFjgzNQ#dpYSv{?O=^!+G6>kltH$OcXi<8`ATfHuAaQ!xAQSYC zK_=-FgG|wv2AQVs4U(X12AQE>+DSA*{}?1nD-Z*KSPl6U(HLztNStO3GC_|UWRlJp zWQrVvOjFGu33}EbGjyq)#3J;DL8A1&L1OfoLE`kSK_=*`K_=k*si4g& Rnby@&etxxAN~^BR+kZ)Y@>>7^ literal 0 HcmV?d00001 diff --git a/src/texsourc/texmf.h b/src/texsourc/texmf.h index 3d2892f..383916e 100644 --- a/src/texsourc/texmf.h +++ b/src/texsourc/texmf.h @@ -75,13 +75,13 @@ extern bool input_line (FILE *); #define b_close a_close #define w_close a_close -/* This routine has to return four values. */ -#define dateandtime(i, j, k, l) get_date_and_time (&(i), &(j), &(k), &(l)) +/* sec 0241 */ +#define fix_date_and_time(i, j, k, l) get_date_and_time (&(i), &(j), &(k), &(l)) /* If we're running under Unix, use system calls instead of standard I/O to read and write the output files; also, be able to make a core dump. */ #ifndef unix - #define dumpcore() exit (1) + #define dumpcore() exit(1) #else /* unix */ #define dumpcore abort #endif @@ -199,19 +199,6 @@ extern void get_date_and_time(); extern void t_open_in(); // extern void call_edit(); // extern int call_edit(); -extern bool extensionirrelevantp(); extern bool input_line(); // extern void do_dump(); // extern void do_undump(); - -#ifdef TeX -extern bool maketextex(); -extern bool maketextfm(); -#else -extern void main_body(); -extern bool initscreen(); -extern bool maketexmf(); -extern void updatescreen(); -extern void blankrectangle(); -extern void paintrow(); -#endif /* not TeX */ diff --git a/src/texsourc/texmf.lib b/src/texsourc/texmf.lib new file mode 100644 index 0000000000000000000000000000000000000000..dcbbb7949bb0695748049c0901ed15e46570fb3c GIT binary patch literal 7794 zcmcIp&2JM&6n{x51P2o5gM@ryTIh#_D8zPRB-DnIqDF)eg>dc0*t>~~zvOj@dn)3H zDx^yM0f^o>aX{*Y19v1UQHg6W2ysCC1yuAmpSxpww|1Pa^gJ_f-pp_3&71e$tdE~h zS2A1QM81xh&)N97)ZBdXOzND;KO>uG6G>U!h!D|5qP{mo{k=p3=ZU5-37Y9AVl?$y z(ruKW=v_(gP=ba|2^xP)#At9;(DWnB1Dcu=G`@&_(9u_t@+g5h_CQhsC1`XX#y>?_ zmh=)O=*T@uM^S=CQi6u=1E0|cLBm-hPA^b`Mji^9xI@Hf@`<2{3A90zD}pB8qW#vg zmaeQ`U0b&nzrS{IZE1D=>Y7!xYXyfaYvua#a$`6B!uv(<`VZGvE?bKi)-OOlS14On zt&q;=OBwPilJ8b4+3hm;sv`MLscaX)mZjom@+H@1Y*`WfOsSYjSIJVPpBq?wdl_{T#&sy%!Zq+U*0H!Xzam)v|1@**s$c4g?*bX zV-B~R-YMR~(U3B_ZAwW6D?^rYrE>C#BziB1j0_Ph#kZn zIJW+}zjwRn?^i9qgj3$Gx@rR1@b~+>MZK<9qoX%N?R)vTlyLYPk&|%qZ~BOO`-#pE z5M7#vzn>v`4c~klbT>-$4s>dW=LAf0$S~i%i1sV^+dQZj^k9rA0opf8^b~Ss zlrKT|j=-OTQX@q7G0z83c9`e|=plG_;A@{u3ZJ`z@-5m3J=8_r)Jq5H5RFoVrf8aG z=on2>j3#KDj?fq#r4bsYAsVD84NxC_M#t$SouE&tpAOJ|+DC`!6FEoY3~GGX*dCm) zw*9_5lmV_+>}7y+408uf{IWFhkkcg4)KO69$K)CZM2ebGChXLRxtK(#t6%~FE=tT0 z;2@iNKQThPW7E@WHuu>|6d?r8UO7x2K$<##5k^(?@QpSCkl;6sgTgN~Io850h>=2w zA75!Lngh?^moXhk&5Vq7LEqdoonVORytpgdD!ov4DoW%84Yp}mo@sNkW%_RImzCX_ z9$CF+m{ocSS?&tKL7qbJkv7?V{d4 zy>m(#dbhlNQVC!{9?7%I({|040pP!~`$Q@!^Zbp-a#s)iHu~eW16}al@U_g{p3d4g zwl_~)6HTITQTbIhWVt}m?@s5k>1z7Ktm=Xbr{|!*C8G!B0-bp#<>n+CKAh+ukdkBk z1&TfEMj3^lXU{>ss4r+ZdH@_Y8+#C>$az0>C6}p`+>%p`eYy5kYu?=5b;;tQXIZ8hSH-r2_^#u zX_=(QVSGeZ{jk}I=5?E4;l{C>fD>RK5xvkBEo3$!6N4DDkZx`vf8dqGt2Va~T&j%6 zXCZOb!7Su=)sQ8#kpE%lTiH?MFVJ$prLAq9%_ka8)n5Pz(^<%=N-8xmBV?z_|M*T- zLh+g0pQ<6tJ=AS0`b5qabk}WHn{j1;ut4HRa=DB7DWr^edez0%cZAzU(BD2x1SF%# zI5k4t2hsL9O3X`>s9Ob76w7HFBCK8nwT+dWZH^TKRu8-?zmPZFFg-wBYtcs};?41p z_`}g+ZT@6IPu~8z66#ph=@1tUp3|#4pvZkaAYE&9Js~*z`Fg}1S7bPPcF#Oo#hGia zH(YiQl9=8Ej>?@nKvH48PII`f0mp|VvN8{-ZQDzPARY7}$sDHxq-20!_#A7BFr<)N z(u38t7WXU}aE{rnxlf@szx8OS_ANgQ^^ihsewFF~HOyxnW`3mpe%1k2JV3AbXn>nL zc2nf>ogf6*3yUKI8e!Hu#a^vN+X&NFlp*N5hP-@qu$nMmIA~z8dyNOAYpt$H{Si>- zIavNS#B4xan>)b>@fpK@4Dnr7FQNT&ln99QEd3i1TC2bRb%GXParjV%Z&lnL>b_!o zV7k`oK85ITlwp~dRz3YLbQlut#~70TKHLdTKo*0~hxp2;arjl+gVD8C^%jCM?xFC{ zGJ0;$*7pEq!a#AoxxHGeC?R>vq=zCuJnVio@qkmr^5rRpqdsYP5N+oXVHndKL;ktd z2}Z#AWD#LTVDSGRJP2KDaYw>daf~C#fBf{syEu;_9y-P`)PHIoh_3CyI*xM;`Q=bg HOp$*9D1pG% literal 0 HcmV?d00001 diff --git a/src/texsourc/zen-cls.bat b/src/texsourc/zen-cls.bat new file mode 100644 index 0000000..e6db3d6 --- /dev/null +++ b/src/texsourc/zen-cls.bat @@ -0,0 +1,5 @@ +del *.exe +del *.map +del *.obj +del *.res +del *~ -- 2.11.0