2 kpath.cc -- glue kpathsea to lily. Need some ugly kludges for gcc 2.96
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
14 The problem, as far as I can tell, is that MacOS X has its getopt
15 prototype in <unistd.h>, while I think other operating systems have it
16 in other places. <unistd.h> is included by kpathsea.h, so you end up
17 renaming both conflicting prototypes to YAKLUDGE.
19 I found a somewhat more elegant patch for this: Just #include
20 <unistd.h> before defining YAKLUDGE.
26 #define popen REALLYUGLYKLUDGE
27 #define pclose ANOTHERREALLYUGLYKLUDGE
28 #define getopt YAKLUDGE
30 #if HAVE_KPATHSEA_KPATHSEA_H
32 #include <kpathsea/kpathsea.h>
33 #include <kpathsea/tex-file.h>
37 #include "file-path.hh"
44 ly_find_afm (char const * name
)
46 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
47 char * name_ptr
= kpse_find_file (name
, kpse_afm_format
, true);
52 don't mutter about afms, since we try to find them first, and lots of
55 // warning (_f("kpathsea couldn't find AFM file `%s'", name));
65 ly_find_tfm (char const * name
)
67 String p
= global_path
.find (String (name
) + ".tfm");
72 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
73 char * name_ptr
= kpse_find_file (name
, kpse_tfm_format
, true);
76 warning (_f("Kpathsea couldn't find TFM file `%s'", name
));
87 ly_init_kpath (char *av0
)
89 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
91 We take two pronged approach to tfms:
93 * the lilypond tfms (feta*.tfm) are found through our own routines.
95 * the TeX tfms are found through vanilla kpathsea.
97 (* other TFMs are not found, i.e. don't use them. )
101 - TFM and AFM checksums always match in Lily.
103 - less hassle, no kpathsea spaghetti
107 - feta PK files are often recreated, locally
108 Solution: cache PK files locally?
110 - need env. vars to make sure that TeX finds the TFMs
112 - Outdated PK (TFM?) font files are not automatically removed,
113 since VERSION is not part of the standard location.
118 we have tried to come up with schemes that leave this kind of work
119 to kpathsea with objective of fixing the CONs, but miserably
120 failed. TeX installations and kpathsea itself form a buggy,
121 inconsistent, and unorderly mess.
128 kpse_set_program_name (av0
, NULL
);
129 kpse_maketex_option ("tfm", TRUE
);