[tex-k] pointing kpathsea to the correct texmf tree

Peter Breitenlohner peb at mppmu.mpg.de
Thu Apr 22 10:00:38 CEST 2010


On Wed, 21 Apr 2010, Karl Berry wrote:

>    I'm trying to use kpathsea as a separate library.
>
> Good luck.
>
>    So, kpsewhich still finds psfonts.map, but my program doesn't.
>
> Sorry, I don't know the answer off the top of my head.  I don't see
> anything obvious that kpsewhich is doing and your program isn't.  I see
> you don't call kpathsea_init_prog, but it seems to me that should not be
> necessary.  Evidently texmf.cnf is not being found despite your setting
> TEXMFCNF, but I can't say why.

Hi Oleg,

there are problems at two levels:

(1) how to find texmf.cnf.

The default mechanism is to use SELFAUTO*, but you can set TEXMFCNF in the
environment.

(2) how to find everything else, based on the contents of texmf.cnf.

Most probably your texmf.cnf again defines the various search paths in terms
SELFAUTO* variables.  And again environment variables can override this.

===================

The basic idea is, that the whole TeX installation works independently from
where it is installed.  Thus for an executable located at, say
    SOMEWHERE/parent/dir/loc/executable
the kpathsea initialization sets
    SELFAUTOLOC = SOMEWHERE/parent/dir/loc
    SELFAUTODIR = SOMEWHERE/parent/dir
    SELFAUTOPARENT = SOMEWHERE/parent
(see kpathsea/progname.c) and the search paths in the standard texmf.cnf are
based on these three variables.  Since your program is located differently,
all this doesn't work.

You might want to look at the dvipng sources with the configure option
'--enable-selfauto-set', to see how this can handled inside the program.

Regards
Peter Breitenlohner <peb at mppmu.mpg.de>


More information about the tex-k mailing list