[tex-live] laulatex quiting: fix your writable cache path

Peter Breitenlohner peb at mppmu.mpg.de
Thu Jun 27 10:52:55 CEST 2013


On Wed, 26 Jun 2013, Karl Berry wrote:

> Somehow this is the first I've ever heard of this requirement.  It is
> nontrivial and painful to comply with such things.  It would be even
> better to not require any particular loading order, but I suppose that
> is impossible.

Hi Karl,

this is completely equivalent to the requirement in any project using
Autoconf to always first do this
   #ifdef HAVE_CONFIG_H
   #include <config.h>
   #endif
or in our case in texk/web2c
   #ifdef HAVE_CONFIG_H
   #include <w2c/c-auto.h>
   #endif

This is necessary because, e.g., for the GNU C library the first system
header includes <features.h> making decisions that may depend on on the
contents of config.h or w2c/c-auto.h as determined by configure.  And this
may be more than just LFS.

In luatexdir this is achieved by always first including "ptexlib.h".

>    Is there a #define that can be tested against portably? (EOF maybe?)

I think there is no need to do that portably.  Practically all development
is done on Linux or Windows systems and it would suffice to detect the
problem on those systems (with a test that acts as no-op on all other
systems).  I would also tend to make any violation a hard error; that might
at first be painful (mostly for me) but would guarantee the correct
behaviour.

In that case ptexlib.h could contain
   #if defined(__linux__) && defined(_FEATURES_H)
   #error ptexlib.h must be included first
   #endif
plus something analogous for MSVC.

Regards
Peter


More information about the tex-live mailing list