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



Re: kpesewhich & BeOS

2003-02-18 Thread Alberto Molina
Hi,

I will answer myself and make a new question:

> 
> 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. 
> 

Well, if I run:

kpsewhich --format='web2c\ files' fmtutil.cnf

the file is found. So the problem is with the space included in the --
format option. The problem is that I suppose that there can be spaces 
included in a lot of --format options all over the place, and I would 
need a global solution.

Has anybody else solved a similar issue? Any suggestion?

Regards,

Alberto Molina