[tex-k] Failure to compile TeX; ! Incomplete \if; all text was ignored after line ...

Jay F Shachter jay at m5.chicago.il.us
Sun Sep 4 22:54:51 CEST 2011


I am failing to compile TeX from source. The source is
not corrupt, and was successfully compiled several years
ago, on a different platform.  The error message is:

 make SHELL='/bin/sh' CC='gcc' CFLAGS='-O2 ' CCLD='gcc' LDFLAGS='-O2 -s' LIBS='../lib/lib.a ../../kpathsea/kpathsea.a ' LN='ln -s' initex
 make[2]: Entering directory `/opt/TeX/web2c-6.1/web2c/tex'
 gcc -DTeX -I./../lib -I../.. -DINITEX -DINI -O2 -c iextra.c
 iextra.c: In function 'main':
 iextra.c:73: error: 'TEXformatdefault' undeclared (first use in this function)
 iextra.c:73: error: (Each undeclared identifier is reported only once
 iextra.c:73: error: for each function it appears in.)
 iextra.c:74: error: 'formatdefaultlength' undeclared (first use in this function)
 iextra.c:74: warning: incompatible implicit declaration of built-in function 'strlen'
 iextra.c:69: warning: return type of 'main' is not 'int'
 iextra.c: In function 'topenin':
 iextra.c:132: error: 'buffer' undeclared (first use in this function)
 iextra.c:132: error: 'first' undeclared (first use in this function)

   [other error messages follow, omitted for brevity ]

tex/iextra.c (like mf/iextra.c and mf/vextra.c) is a
symbolic link to lib/texmf.c and that file #defines the
symbolic constant dump_default_var to be either
TEXformatdefault or MFbasedefault depending on whether or
not the symbolic constant TeX is #defined.  Also, in the
former case texd.h is #included prior to the #definitions
whereas in the latter case mfd.h is #included.  Judging
from their modification times, both files are created
during the build process (mf was successfully built
yesterday evening). However, mf/mfd.h contains the line

 EXTERN ccharpointer MFbasedefault ;

whereas tex/texd.h contains no similar line for

Further inquiry reveals that tex/texd.h is supposed to
be created during the running of the tex/convert script.
This script consists of the following lines:

 cat ../lib/common.defines ../lib/texmf.defines tex.p |
 ../web2c/web2c -t -htexmf.h |
 ../web2c/fixwrites -t |
 ../web2c/regfix |

 cat coerce.h coerce.add > xcoerce.h
 mv xcoerce.h coerce.h

The 5-component pipeline shown above is failing at the
2nd component. Thus, if one runs:

 cat ../lib/common.defines ../lib/texmf.defines tex.p |
 2>&1 ../web2c/web2c -t -htexmf.h

from the tex directory, one sees the following output on
the screen:

 #include "texmf.h"
 /* 1 9998 9999 */
 #define memmax 30000
 #define memmin 0
 #define bufsize 500
 #define errorline 72
 #define halferrorline 42
 #define maxprintline 79
 #define stacksize 200
 #define maxinopen 6
 #define fontmax 75
 #define fontmemsize 20000
 #define paramsize 60
 #define nestsize 40
 #define maxstrings 3000
 #define stringvacancies 8000
 #define poolsize 32000
 #define savesize 600
 #define triesize 8000
 #define trieopsize 500
 #define dvibufsize 800
 #define filenamesize 40
 #define poolname "TeXformats:TEX.POOL "
 typedef unsigned char ASCIIcode ;
 typedef unsigned char eightbits ;

 #include "coerce.h"
 syntax error
 Last token = 297, error buffer = `alphafile',
 last id = `alphafile' (type).

Note the syntax error, which presumably indicates an
error that interrupted the generation of output.
Presumably, had this error not occurred, the output
would have eventually included a declaration of
TEXformatdefault, and other variables, similar to the
declaration of MFbasedefault, and other variables, that
appears in mf/mfd.h but I do not know enough about web2c
to determine the cause of the failure and to repair it.
I note that

  @define type alphafile;

is the first "@define type" line in lib/common.defines,
but I am reluctant to ascribe significance to this,
since there is a convert script in the mf directory
that also passes lib/common.defines as input to web2c
(web2c -htexmf.h -m rather than web2c -t -htexmf.h, and
no, there is no significance to altering the order of
the options, I checked that already) and which does not
choke.  In the mf directory the convert script inserts
a sed script prior to web2c, but that also seems not to
be significant.  The significant difference seems to be
only that the convert script in the mf directory has
web2c read mf/mf.p as its last input, whereas the
convert script in the tex directory has web2c read
tex/tex.p as its last input -- even though,
paradoxically, the error message appears to be coming
from lib/common.defines, long before tex.p is read.

Search engine inquiries on this web2c error messages are
fruitless.  Your expert advice at this point is greatly

You may also be able to help me with another problem,
the solution of which would render it unnecessary for me
to compile TeX from source (although, on general
principles, I still wish to be able to do so).  I have
not built TeX from source since moving from Solaris 7 to
SuSe Linux 10, since the latter comes with TeX
pre-packaged.  After "upgrading" (I place the word in
quotation marks, for reasons that will soon be clear) to
a newer version of TeX, I have lost all of my Hebrew
vowel macros.  This is because the vowel macros employ
conditional expansions which used to work perfectly, and
which now yield a mysterious error message (that is why I
have fallen back to my copy of the source, and attempted
to rebuild a version of TeX that accepted my vowel

 Nu? etex testfile
 This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
 entering extended mode
 (./testfile (/var/lib/texmf/macros/mac.tex
 ! Incomplete \if; all text was ignored after line 7.
 <inserted text>
 <to be read again>
 \hiriq ...w {A}\if \l \alef \outer \gdef \hadjust
 {-0.076}\fi \if \l \vet \o...
 l.7 \xiriq{\qof}


Here is the \xiriq macro:

 \def\x{\Kaf}\ifx\l\x \outer\gdef\hadjust{-0.079}\fi%
 \if\l\lamed \outer\gdef\hadjust{-0.135}\fi%
 \def\x{\Lamed}\ifx\l\x \outer\gdef\hadjust{-0.135}\fi%
 \if\l\mem \outer\gdef\hadjust{-0.126}\fi%
 \def\x{\Mem}\ifx\l\x \outer\gdef\hadjust{-0.126}\fi%
 \if\l\ayin \outer\gdef\hadjust{-0.11}\fi%
 \if\l\peh \outer\gdef\hadjust{-0.1}\fi%
 \if\l\qof \outer\gdef\hadjust{-0.12}\fi%there should also be a redefinition of vadjust
 \if\l\sinwithdot \def\vow{K}\outer\gdef\hadjust{0}\fi%
 \if\l\shinwithdot \def\vow{K}\outer\gdef\hadjust{0}\fi%
 \def\x{\Sinwithdot}\ifx\l\x \def\vow{K}\outer\gdef\hadjust{0}\fi%
 \def\x{\Shinwithdot}\ifx\l\x \def\vow{K}\outer\gdef\hadjust{0}\fi%
 \if\l\shin \def\vow{K}\outer\gdef\hadjust{0}\fi%
 \def\x{\Tav}\ifx\l\x \outer\gdef\hadjust{-0.1}\fi%
 \beginL\l\kern\hadjust em\vow\kern-\hadjust em{}\endL}

As you can see, there is no incomplete \if.  And yet the
new TeX -- but not the old TeX, which I cannot retrieve
-- has the delusion that the first (and presumably,
every subsequent) \if is incomplete.  The same is true,
of course, of all of my vowel macros, not just the xiriq
macro, they are all written similarly.

A Google search has produced no useful information.
Someone reported a similar problem and said that he
solved it with a \protect.  I do not know what \protect
is; I see no \protect in the index of the TeXbook; and I
have no notion of what needs to be \protected, since I
am doing nothing complex, I am simply defining \hadjust
conditional on what letter is being vocalized, it is
both logically and programmatically very simple.

Thank you in advance for your replies to both of these
questions.  If you believe that your answers would not
be of general interest, you can contact me privately at
jay at m5 dot chicago dot il dot us.

			Jay F. Shachter
			6424 N Whipple St
			Chicago IL  60645-4111
				jay at m5.chicago.il.us

			"Quidquid latine dictum sit, altum videtur"

More information about the tex-k mailing list