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

Oleg Parashchenko olpa at xmlhack.ru
Tue Apr 20 13:14:29 CEST 2010


Hello,

I'm trying to use kpathsea as a separate library. I've got it from
subversion, succesfully compiled it and created a test program:

-----
#include <stdio.h>
#include <kpathsea/kpathsea.h>
int main(int argc, char **argv) {
  kpathsea kpse = kpathsea_new();
  kpathsea_set_program_name(kpse, argv[0], NULL);
  char *fname = kpathsea_find_file(kpse, "psfonts.map", kps
e_fontmap_format, 1);
  printf("psfonts.map=%s\n", fname);
  kpathsea_finish(kpse);
  exit(0);
}
-----

Now I'm trying to ask program/kpathsea to search in MacTeX texmf tree:

$ kpsexpand '$TEXMFCNF'
{/usr/local/texlive/2009/bin/universal-darwin,/usr/local/te
xlive/2009/bin,/usr/local/texlive/2009}{,{/share,}/texmf{-l
ocal,}/web2c}
$ export TEXMFCNF='{/usr/local/texlive/2009/bin/universal-d
arwin,/usr/local/texlive/2009/bin,/usr/local/texlive/2009}{
,{/share,}/texmf{-local,}/web2c}'
$ kpsewhich psfonts.map
/usr/local/texlive/2009/texmf-var/fo nts/map/dvips/updmap/p
sfonts.map
$ ./a.out
psfonts.map=(null)

So, kpsewhich still finds psfonts.map, but my program doesn't. Using
KPATHSEA_DEBUG I find that before searching for the file, the set of
paths doesn't include "/usr/local/texlive/...." anymore:

kdebug:  = .:/Users/olpa/.texlive2009/texmf-config/fonts/map
/a.out//:/Users/olpa/.texlive2009/texmf-var/fonts/map/a.out/
/:/Users/olpa/Library/texmf/fonts/map/a.out//:!!/Users/texmf
-config/fonts/map/a.out//:!!/Users/texmf-var/fonts/map/a.out
//:!!/Users/texmf/fonts/map/a.out//:!!/Users/../texmf-local/
fonts/map/a.out//:!!/Users/texmf-dist/fonts/map/a.out//:/Use
rs/olpa/.texlive2009/texmf-config/fonts/map/pdftex//:/Users/
olpa/.texlive2009/texmf-var/fonts/map/pdftex//:/Users/olpa/L
ibrary/texmf/fonts/map/pdftex//:!!/Users/texmf-config/fonts/
map/pdftex//:!!/Users/texmf-var/fonts/map/pdftex//:!!/Users/
texmf/fonts/map/pdftex//:!!/Users/../texmf-local/fonts/map/p
dftex//:!!/Users/texmf-dist/fonts/map/pdftex//:/Users/olpa/.
texlive2009/texmf-config/fonts/map/dvips//:/Users/olpa/.texl
ive2009/texmf-var/fonts/map/dvips//:/Users/olpa/Library/texm
f/fonts/map/dvips//:!!/Users/texmf-config/fonts/map/dvips//:
!!/Users/texmf-var/fonts/map/dvips//:!!/Users/texmf/fonts/ma
p/dvips//:!!/Users/../texmf-local/fonts/map/dvips//:!!/Users
/texmf-dist/fonts/map/dvips//:/Users/olpa/.texlive2009/texmf
-config/fonts/map///:/Users/olpa/.texlive2009/texmf-var/font
s/map///:/Users/olpa/Library/texmf/fonts/map///:!!/Users/tex
mf-config/fonts/map///:!!/Users/texmf-var/fonts/map///:!!/Us
ers/texmf/fonts/map///:!!/Users/../texmf-local/fonts/map///:
!!/Users/texmf-dist/fonts/map///

The question is: what is required to make test.c working?

Thanks!


-- 
Oleg Parashchenko  olpa@ http://uucode.com/
http://uucode.com/blog/  XML, TeX, Python, Mac, Chess



More information about the tex-k mailing list