Re: kpesewhich & BeOS (long)

2003-02-19 Thread Olaf Weber
Thomas Esser writes:

>> I am trying to use tetex in BeOS and have managed to compile it making 
>> some small changes that I will post later for reference.
> ...
>> fmtutil: config file `fmtutil.cnf' not found.

> kpathsea translates search path read from texmf.cnf on unix-like
> systems by replacing ";" -> ":". The unix-defection can be found in
> texk/kpathsea/cnf.c:

> /* gcc -ansi doesn't predefine `unix', since ANSI forbids it.  And AIX
>generally doesn't predefine unix, who knows why.  HP-UX is, of course,
>also different.  Apple's MacOsX is also unix-like.  */
> #ifndef unix
> #if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE)
> #define unix
> #elif defined (__APPLE__) && defined (__MACH__)
> #define unix
> #elif defined (__NetBSD__)
> #define unix
> #endif
> #endif

Which is quite a mess, and what is worse, here we test for a feature
that we've also determined elsewhere, and in an unrelated way.  No
wonder we're running into trouble.  As far as I can tell, we can
trivially ditch this mess by replacing it as follows:

Index: cnf.c
===
RCS file: /usr/local/cvsroot/texk/texk/kpathsea/cnf.c,v
retrieving revision 1.11
diff -u -d -r1.11 cnf.c
--- cnf.c   14 Dec 2002 12:10:31 -  1.11
+++ cnf.c   19 Feb 2003 20:11:23 -
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -126,22 +127,7 @@
  -DALLOW_SEMICOLON_IN_FILENAMES.  (And there's no way to get :'s in
  your filenames, sorry.)  */

-/* gcc -ansi doesn't predefine `unix', since ANSI forbids it.  And AIX
-   generally doesn't predefine unix, who knows why.  HP-UX is, of course,
-   also different.  Apple's MacOsX is also unix-like.  */
-#ifndef unix
-#if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE)
-#define unix
-#elif defined (__APPLE__) && defined (__MACH__)
-#define unix
-#elif defined (__NetBSD__)
-#define unix
-#endif
-#endif
-
-/* DJGPP defines `unix' (for portability), but generates MSDOS programs.  */
-#ifndef __DJGPP__
-#if !defined (ALLOW_SEMICOLON_IN_FILENAMES) && defined (unix)
+#if IS_ENV_SEP(':') && !defined (ALLOW_SEMICOLON_IN_FILENAMES)
   {
 string loc;
 for (loc = value; *loc; loc++) {
@@ -149,7 +135,6 @@
 *loc = ':';
 }
   }
-#endif
 #endif

   /* We want TEXINPUTS.prog to override plain TEXINPUTS.  The simplest



Does anyone care to test?

-- 
Olaf Weber

   (This space left blank for technical reasons.)



Re: kpesewhich & BeOS (long)

2003-02-19 Thread [EMAIL PROTECTED]
Thomas,

I have make the modifications you suggested and they worked. Also, in 
your message you said:

> kpathsea translates search path read from texmf.cnf on unix-like 
> systemsby replacing ";" -> ":". The unix-defection can be found in 
> texk/kpathsea/cnf.c:
> ... (snip)
>
> Argh... If only these #ifdef's could be replaced by a proper autoconf
> check...

I don not know anything about autoconf (yes, yes, shame on me), and 
maybe I am saying something really really silly but, cannot the PATH 
variable be checked? If it exists and has the : char as separator, 
then you can assume unix for kpathsea.

Regards,

Alberto Molina




Re: kpesewhich & BeOS (long)

2003-02-19 Thread [EMAIL PROTECTED]
Hi there,

I have to publicly apologize for the size of the messageĀ—--it is ten 
times bigger than I thought because I made a mistake when checking the 
lines. It will not happen again and I hope that it has not created too 
much trouble to anybody.

Regards,

Alberto Molina



Re: kpesewhich & BeOS (long)

2003-02-18 Thread Thomas Esser
> I am trying to use tetex in BeOS and have managed to compile it making 
> some small changes that I will post later for reference.
...
> fmtutil: config file `fmtutil.cnf' not found.

kpathsea translates search path read from texmf.cnf on unix-like systems
by replacing ";" -> ":". The unix-defection can be found in texk/kpathsea/cnf.c:

/* gcc -ansi doesn't predefine `unix', since ANSI forbids it.  And AIX
   generally doesn't predefine unix, who knows why.  HP-UX is, of course,
   also different.  Apple's MacOsX is also unix-like.  */
#ifndef unix
#if defined (__unix__) || defined (_AIX) || defined (_HPUX_SOURCE)
#define unix
#elif defined (__APPLE__) && defined (__MACH__)
#define unix
#elif defined (__NetBSD__)
#define unix
#endif
#endif

I think that your system needs to be added with an appropriate detection.
Note, that the same detection is implemented in texk/dviljk/config.h.

To explain why some of your searches work, while others don't: kpathsea
has one search path that it never takes from texmf.cnf and that's the
search path for texmf.cnf itself. If you say
  kpsewhich fmtutil.cnf
then kpathsea does not search in the "web2c files" search path, but in
the path for texmf.cnf (.cnf format).

The same happens if you say
  kpsewhich --format='web2c\ files' fmtutil.cnf
or
  kpsewhich --format='blubber kpathsea does not know' fmtutil.cnf

The "web2c files" format (if you don't cripple it by misspelling it with
a backslash), however is read via texmf.cnf and there, you are hit by
the missing ";" -> ":" translation.

Argh... If only these #ifdef's could be replaced by a proper autoconf
check...

Thomas



kpesewhich & BeOS (long)

2003-02-18 Thread Alberto Molina
Hi there,

I am trying to use tetex in BeOS and have managed to compile it making 
some small changes that I will post later for reference.

But when I try to install it and run "make install", I ge the following 
error:

if test -f /boot/apps/tetex/bin/i586-pc-beos/fmtutil; then \
  TEXMFMAIN=/boot/apps/tetex/texmf PATH=/boot/apps/tetex/bin/i586-pc-
beos:/boot/apps/tetex/bin/i586-pc-beos:.:/boot/home/config/bin:/bin:/
boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:/
boot/develop/tools/gnupro/bin \
/boot/apps/tetex/bin/i586-pc-beos/fmtutil --all; \
else :; fi
fmtutil: config file `fmtutil.cnf' not found.
make: *** [install] Error 1

Apparently, the command:

kpsewhich --format='web2c files' $cnf

cannot find the file $cnf (in this case, fmtutil.cnf). And the file is 
there, under web2c. In fact, if I try to run the command:

kpsewhich fmtutil.cnf

I get the correct answer: /boot/apps/tetex/texmf/web2c/fmtutil.cnf. 
Maybe it is related to some problems with the libraries used by 
kpsewhich? This is the result of running the las command using the "--
debug -1" option:

==
kdebug:fopen(../bin/i586-pc-beos/kpsewhich, r) => 0x80017030
kdebug:fclose(0x80017030) => 0
kdebug:Search path for cnf files (from compile-time paths.h)
kdebug:  = /boot/apps/tetex/bin/i586-pc-beos:/boot/apps/tetex/bin:/boot
/apps/tetex:/boot/apps/tetex/bin/i586-pc-beos/share/texmf-local/web2c:/
boot/apps/tetex/bin/share/texmf-local/web2c:/boot/apps/tetex/share/
texmf-local/web2c:/boot/apps/tetex/bin/i586-pc-beos/texmf-local/web2c:/
boot/apps/tetex/bin/texmf-local/web2c:/boot/apps/tetex/texmf-local/
web2c:/boot/apps/tetex/bin/i586-pc-beos/share/texmf/web2c:/boot/apps/
tetex/bin/share/texmf/web2c:/boot/apps/tetex/share/texmf/web2c:/boot/
apps/tetex/bin/i586-pc-beos/texmf/web2c:/boot/apps/tetex/bin/texmf/
web2c:/boot/apps/tetex/texmf/web2c::/boot/apps/tetex/texmf/web2c:/boot/
apps/tetex/texmf/web2c
kdebug:  before expansion = 
{$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/
web2c}:$TETEXDIR:/boot/apps/tetex/texmf/web2c:/boot/apps/tetex/texmf/
web2c
kdebug:  application override path = (none)
kdebug:  application config file path = (none)
kdebug:  texmf.cnf path = (none)
kdebug:  compile-time path = 
{$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/
web2c}:$TETEXDIR:/boot/apps/tetex/texmf/web2c:/boot/apps/tetex/texmf/
web2c
kdebug:  default suffixes = .cnf
kdebug:  other suffixes = (none)
kdebug:  search only with suffix = 0
kdebug:  numeric format value = 8
kdebug:  runtime generation program = (none)
kdebug:  runtime generation command = (none)
kdebug:  program enabled = 0
kdebug:  program enable level = 0
kdebug:start search(file=texmf.cnf, must_exist=1, find_all=1, path=/
boot/apps/tetex/bin/i586-pc-beos:/boot/apps/tetex/bin:/boot/apps/tetex:
/boot/apps/tetex/bin/i586-pc-beos/share/texmf-local/web2c:/boot/apps/
tetex/bin/share/texmf-local/web2c:/boot/apps/tetex/share/texmf-local/
web2c:/boot/apps/tetex/bin/i586-pc-beos/texmf-local/web2c:/boot/apps/
tetex/bin/texmf-local/web2c:/boot/apps/tetex/texmf-local/web2c:/boot/
apps/tetex/bin/i586-pc-beos/share/texmf/web2c:/boot/apps/tetex/bin/
share/texmf/web2c:/boot/apps/tetex/share/texmf/web2c:/boot/apps/tetex/
bin/i586-pc-beos/texmf/web2c:/boot/apps/tetex/bin/texmf/web2c:/boot/
apps/tetex/texmf/web2c::/boot/apps/tetex/texmf/web2c:/boot/apps/tetex/
texmf/web2c).
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos) => 1
kdebug:path element /boot/apps/tetex/bin/i586-pc-beos => /boot/apps/
tetex/bin/i586-pc-beos/
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos/
texmf.cnf) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin) => 1
kdebug:path element /boot/apps/tetex/bin => /boot/apps/tetex/bin/
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/texmf.cnf) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex) => 1
kdebug:path element /boot/apps/tetex => /boot/apps/tetex/
kdebug:kpse_normalize_path (/boot/apps/tetex/texmf.cnf) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos/share/
texmf-local/web2c) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos/share/
texmf-local/web2c) => 1
kdebug:path element /boot/apps/tetex/bin/i586-pc-beos/share/texmf-local
/web2c =>
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/share/texmf-local/
web2c) => 1
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/share/texmf-local/
web2c) => 1
kdebug:path element /boot/apps/tetex/bin/share/texmf-local/web2c =>
kdebug:kpse_normalize_path (/boot/apps/tetex/share/texmf-local/web2c) =
> 1
kdebug:kpse_normalize_path (/boot/apps/tetex/share/texmf-local/web2c) =
> 1
kdebug:path element /boot/apps/tetex/share/texmf-local/web2c =>
kdebug:kpse_normalize_path (/boot/apps/tetex/bin/i586-pc-beos/texmf-
local/we