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

Karl Berry karl at freefriends.org
Fri Jun 28 01:08:28 CEST 2013


    peb> or in our case in texk/web2c
       #ifdef HAVE_CONFIG_H
       #include <w2c/c-auto.h>
       #endif

I hope you mean w2c/config.h?  c-auto.h just has the autoconf defines.
ptexlib.h starts by including <w2c/config.h>.

It seems we should add guards to w2c/config.h, for the sake of the
programs besides luatex.

But all I could deal with today was luatex.  I just installed the
following changes to include ptexlib.h first (and check for it).  It
compiles and passes make check for me, so fingers crossed ...

It's certainly possible that other symbols could be #defined, i.e., this
surely doesn't catch every possible prior #include, but at least it's a
start.  Of course feel free to hack as needed.

I didn't bother using #error, #pragma, or any other #command to create
the error.  That just seems like it will induce useless
compiler-specific problems to get exactly the right #command without
creating spurious other problems.  Just junk text will do the job, as
far as I can see.

k


2013-06-28  Karl Berry  <karl at tug.org>

	* ptexlib.h: complain if various common things are #defined;
        this must be the first #include.
                
               
Index: luatexdir/font/mapfile.w
===================================================================
--- luatexdir/font/mapfile.w	(revision 30985)
+++ luatexdir/font/mapfile.w	(working copy)
@@ -23,8 +23,8 @@
     "$Id: mapfile.w 4442 2012-05-25 22:40:34Z hhenkel $"
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/font/mapfile.w $";
 
+#include "ptexlib.h"
 #include <math.h>
-#include "ptexlib.h"
 #include <kpathsea/c-auto.h>
 #include <kpathsea/c-memstr.h>
 #include <string.h>
Index: luatexdir/font/sfnt.w
===================================================================
--- luatexdir/font/sfnt.w	(revision 30985)
+++ luatexdir/font/sfnt.w	(working copy)
@@ -25,6 +25,8 @@
     "$Id: sfnt.w 4457 2012-07-13 13:16:19Z taco $"
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/font/sfnt.w $";
 
+#include "ptexlib.h"
+
 #if  HAVE_CONFIG_H
 #  include <w2c/config.h>
 #endif                          /* |HAVE_CONFIG_H_| */
@@ -31,7 +33,6 @@
 
 #include <string.h>
 
-#  include "ptexlib.h"
 #include "font/sfnt.h"
 
 @ type:
Index: luatexdir/font/tt_table.w
===================================================================
--- luatexdir/font/tt_table.w	(revision 30985)
+++ luatexdir/font/tt_table.w	(working copy)
@@ -24,8 +24,9 @@
     "$Id: tt_table.w 4442 2012-05-25 22:40:34Z hhenkel $"
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/font/tt_table.w $";
 
+#include "ptexlib.h"
+
 #include <stdio.h>
-#include "ptexlib.h"
 #include "font/sfnt.h"
 #include "font/tt_table.h"
 
Index: luatexdir/lang/hyphen.w
===================================================================
--- luatexdir/lang/hyphen.w	(revision 30985)
+++ luatexdir/lang/hyphen.w	(working copy)
@@ -42,6 +42,8 @@
     "$Id: hyphen.w 4599 2013-03-19 15:41:07Z taco $ "
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/lang/hyphen.w $";
 
+#include "lang/hyphen.h"        /* includes ptexlib.h */
+
 #include <stdlib.h>             /* for NULL, malloc */
 #include <stdio.h>              /* for fprintf */
 #include <string.h>             /* for strdup */
@@ -58,7 +60,6 @@
 #define noVERBOSE
 
 #include "lang/hnjalloc.h"
-#include "lang/hyphen.h"
 
 @ TODO: should be moved to separate library
 
Index: luatexdir/lua/lstrlibext.c
===================================================================
--- luatexdir/lua/lstrlibext.c	(revision 30985)
+++ luatexdir/lua/lstrlibext.c	(working copy)
@@ -1,6 +1,6 @@
 /* lstrlibext.c
    
-   Copyright 2012 Taco Hoekwater <taco at luatex.org>
+   Copyright 2012-2013 Taco Hoekwater <taco at luatex.org>
 
    This file is part of LuaTeX.
 
@@ -21,6 +21,8 @@
    otherwise some of the defines that are needed for lua_sdump
    come out wrong.
  */
+#include "ptexlib.h"
+
 #define LUA_CORE
 #include "lua.h"
 #include "luaconf.h"
@@ -27,8 +29,6 @@
 #include "lapi.h"
 #include "lundump.h"
 
-#include "ptexlib.h"
-
 static const char _svn_version[] =
     "$Id: lstrlibext.c 4544 2012-12-25 14:07:44Z oneiros $ $URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/lua/lstrlibext.c $";
 
Index: luatexdir/lua/luainit.w
===================================================================
--- luatexdir/lua/luainit.w	(revision 30985)
+++ luatexdir/lua/luainit.w	(working copy)
@@ -22,9 +22,10 @@
     "$Id: luainit.w 4524 2012-12-20 15:38:02Z taco $"
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/lua/luainit.w $";
 
+#include "ptexlib.h"
+
 #include <kpathsea/c-stat.h>
 
-#include "ptexlib.h"
 #include "lua/luatex-api.h"
 
 @
Index: luatexdir/luatex.c
===================================================================
--- luatexdir/luatex.c	(revision 30985)
+++ luatexdir/luatex.c	(working copy)
@@ -1,4 +1,4 @@
-/* texmf.c: Hand-coded routines for TeX or Metafont in C.  Originally
+/* luatex.c: Hand-coded routines for TeX or Metafont in C.  Originally
    written by Tim Morgan, drawing from other Unix ports of TeX.  This is
    a collection of miscellany, everything that's easier (or only
    possible) to do in C.
@@ -9,8 +9,8 @@
    changed to include texd.h or mfd.h.  The ?d.h file is what
    #defines TeX or MF, which avoids the need for a special
    Makefile rule.  */
+#include "ptexlib.h"
 #include "luatex.h"
-#include "ptexlib.h"
 #include "lua/luatex-api.h"
 #include "luatex_svnversion.h"
 
Index: luatexdir/ptexlib.h
===================================================================
--- luatexdir/ptexlib.h	(revision 30985)
+++ luatexdir/ptexlib.h	(working copy)
@@ -1,7 +1,7 @@
 /* ptexlib.h
 
    Copyright 1996-2006 Han The Thanh <thanh at pdftex.org>
-   Copyright 2006-2012 Taco Hoekwater <taco at luatex.org>
+   Copyright 2006-2013 Taco Hoekwater <taco at luatex.org>
 
    This file is part of LuaTeX.
 
@@ -23,6 +23,10 @@
 #ifndef PTEXLIB_H
 #  define PTEXLIB_H
 
+#if defined (_OFF_T_DEFINED) || defined (EOF) || defined (assert) || defined (_FEATURES_H)
+ptexlib.h must be included first!!!
+#endif
+
 #ifdef HAVE_CONFIG_H
 #include <w2c/config.h>
 #endif
Index: luatexdir/tex/texfileio.w
===================================================================
--- luatexdir/tex/texfileio.w	(revision 30985)
+++ luatexdir/tex/texfileio.w	(working copy)
@@ -22,8 +22,9 @@
     "$Id: texfileio.w 4521 2012-12-14 13:54:54Z taco $"
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/tex/texfileio.w $";
 
+#include "ptexlib.h"
+
 #include <string.h>
-#include "ptexlib.h"
 #include <kpathsea/absolute.h>
 
 @ @c
Index: luatexdir/utils/unistring.w
===================================================================
--- luatexdir/utils/unistring.w	(revision 30985)
+++ luatexdir/utils/unistring.w	(working copy)
@@ -23,8 +23,8 @@
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/utils/unistring.w $";
 
 @ @c
+#include "ptexlib.h"
 #include <string.h>
-#include "ptexlib.h"
 
 @ @c
 static void utf_error(void)
Index: luatexdir/utils/utils.w
===================================================================
--- luatexdir/utils/utils.w	(revision 30985)
+++ luatexdir/utils/utils.w	(working copy)
@@ -24,6 +24,8 @@
     "$URL: https://foundry.supelec.fr/svn/luatex/tags/beta-0.76.0/source/texk/web2c/luatexdir/utils/utils.w $";
 
 @ @c
+#include "ptexlib.h"
+
 #include <kpathsea/config.h> /* this is a trick to load mingw32's io.h early,
 				using a macro redefinition of |eof()|. */
 #include "sys/types.h"
@@ -33,7 +35,6 @@
 #include <time.h>
 #include <float.h>              /* for |DBL_EPSILON| */
 #include "zlib.h"
-#include "ptexlib.h"
 #include "md5.h"
 
 #include "lua/luatex-api.h"     /* for ptexbanner */




More information about the tex-live mailing list