Some generic problems you might encounter (for other machine-specific
problems, see MACHINES):

* Question: I know all about slow starting TeX :-).
  How do I organize the directory scheme to avoid the slowness, while at
  the same time enjoying a structured inputs directory?

The answer has been moved to the Kpathsea manual, in the section
`Subdirectory problems', so I don't have to keep it in two places.
Please read that.


* If you run out of memory space making plain.fmt, because memsize=3000,
  somehow the trip constants have persisted. make clean-triptrap and
  make again.


* wchar_t is the source of endless problems compiling x11[-Xt].c. See
  xdvi.h in my xdvik distribution for all the details; I'm not going to
  repeat all that here. You can try defining NO_FOIL_X_WCHAR_T.

* For DOS, you may have to change the definitions of WORDS_BIGENDIAN and
  DOS in lib/c-auto.h.  Here are some additional notes:
  
From: Richard Mansfield <melvin@math.psu.edu>
Date: Mon, 9 Nov 92 14:24:10 -0500

Make the changes in site.h. I don't know if I got the default
directories to work. TEXPOOL seemed to work fine (using /), but I had trouble
with TEXINPUTS. After minimal attempts to get it right, I punted
and decided to use environmental variables. In the variables I use 
\ and ; as a separator as in DOS. Thinking about in some more as I write
this, my troubles could have been caused by not correctly reading tex.pool
although I don't know.  

My method for getting the source files was to do
make TeX > tex.log
on the SUN and then editing tex.log to become tex.bat. I then carried
the .c and .h files home on a floppy and compiled them at home.

DOS gcc does have yacc and bison, but I did not use them.

If you want to see my exact set up. ftp to ftp.math.psu.edu,
look in directory pub/melvin/pctex and get the files read.me
and tex.zip.

* GNU sed 1.06 cannot handle the sed script in mf/convert; neither can
  1.07.  1.08 and later fix it.

* Likewise, sed on a 386/bsd machine can't handle it, according to
  bsd@yrloc.ipsa.reuter.com.
  
* GNU Make 3.57 does not pass arguments to shell scripts (like convert),
under system V.  3.56 does not have this problem, and neither do later
versions.

* On an i386 machine, GNU C 1.36 does not compile tex5.c correctly when
making a 32-bit TeX.  1.37 fixes this bug.

* On the AT&T 3b2, under System V release 3.2, cc thinks that
eject_penalty (which is -1000, defined at line 3216), is a very large
positive number.  oc@vmp.com is developing a port for the 3b2; he has
contributed some (incomplete) patches; they are below.

* On a Sun 3 running 3.x, cc cannot compile mf2.c or mf4.c, because the
preprocessor puts a # directive at the end of line 1811 (or
thereabouts), instead of at the beginning.  You have to manually move
it.

* On a Sun 386i running 4.0.1, cc cannot compile Metafont with -O, because it
can't compile x = x + y correctly.  Don't use -O, or don't use cc. 
(From morgan@ics.uci.edu.)

* Make loses heavily if you are using a networked filesystem, and the
  server and the local machine have different times.  You might have
  this problem if `initex' gets made twice, for instance.

* On a 386 machine running 386/ix, cc cannot compile itex.c, according
to Reiner Petersen <reiner@db0tui62.bitnet>.  Here is an ed script to
get around the problem (alternatively, you can get gcc, and compile with
that):

:
#       Reiner Petersen (reiner@coma.uucp)
#       Technical University of Berlin
#
ed - $1 << end-of-edscript
!echo change:
/  register integer for_end; i = 1 ; for_end = 31 ; if ( i <= for_end) do
+1,.+2p
-2,.c
  register integer for_end;
   register char j;             /* 386/ix cc bug workaround  rp */
   i = 1 ;
   for_end = 31 ;
   if ( i <= for_end) do 
        j = i;
        xchr [ j ] = chr ( i ) ;
    
    while ( i++ < for_end ) ; 
.
!echo to:
-8,.p
w $1
end-of-edscript

If you want, you can put this into the pipeline in ./tex/convert.

* undump doesn't work under 386/ix.  Here is a diff to undump.SYS_V.c to
fix this, again contributed by reiner:
*** undump.SYS_V.c      Mon Apr 20 00:57:23 1987
--- undump.c    Fri Aug 19 17:55:27 1988
***************
*** 1,7 ****
  /*
   * undump - resurrect a core file into a running program.
   *
!  *    for UNIX System V on a 3Bx
   *    that uses the Common Object File Format
   *
   * Author:
--- 1,7 ----
  /*
   * undump - resurrect a core file into a running program.
   *
!  *    for UNIX System V on a 3Bx or Interactive 386/ix
   *    that uses the Common Object File Format
   *
   * Author:
***************
*** 9,14 ****
--- 9,19 ----
   *    New York University
   *    Tue Mar  3 13:18:25 EST 1987
   *
+  * Additions for 386/ix:
+  *    Reiner Petersen (reiner@coma.uucp)
+  *    Technical University of Berlin
+  *    Thu Aug 18 13:40:20 MET DST 1988
+  *
   * Adapted from:
   *     Spencer Thomas's undump and the file unexec.c in GNU emacs
   */
***************
*** 15,22 ****
--- 20,33 ----

  #include <sys/param.h>
  #include <sys/types.h>
+
+ #ifndef       ISC_386ix       /* not availible in ISC 386/ix */
+
  #include <sys/psw.h>
  #include <sys/pcb.h>
+
+ #endif        /* ISC_386ix */
+
  #include <sys/signal.h>
  #include <sys/fs/s5dir.h>
  #include <sys/user.h>
***************
*** 37,46 ****
--- 48,66 ----
  struct scnhdr dsc;
  struct scnhdr bsc;

+ #ifdef        ISC_386ix
+ struct scnhdr csc;            /* Comment section used by ISC 386/ix */
+ #endif        /* ISC_386ix */
+
  long bias;
  long lnnoptr;
  long text_scnptr;
  long data_scnptr;
+
+ #ifdef        ISC_386ix
+ long comment_scnptr;
+ #endif        /* ISC_386ix */
+
  long symlocptr;

  main(argc, argv)
***************
*** 89,94 ****
--- 109,118 ----
                        dsc = sc;
                 else if (strcmp(sc.s_name, ".bss") == 0) 
                        bsc = sc;
+ #ifdef        ISC_386ix
+                else if (strcmp(sc.s_name, ".comment") == 0) 
+                       csc = sc;
+ #endif        /* ISC_386ix */
                
        

***************
*** 97,103 ****
        if (u.u_exdata.ux_tsize != aout.tsize ||
            u.u_exdata.ux_dsize != aout.dsize ||
            u.u_exdata.ux_bsize != aout.bsize) 
!               fprintf("mismatch between %s and %s sizes\n", a_out_name,
 core_name);
                exit(1);
        

--- 121,128 ----
        if (u.u_exdata.ux_tsize != aout.tsize ||
            u.u_exdata.ux_dsize != aout.dsize ||
            u.u_exdata.ux_bsize != aout.bsize) 
!               fprintf( stderr, "mismatch between %s and %s sizes\n",
!                                                       a_out_name, core_name);
                exit(1);
        

***************
*** 122,128 ****
--- 147,159 ----
        bsc.s_paddr = bsc.s_vaddr = aout.data_start + aout.dsize;
        bsc.s_size = aout.bsize;
        bsc.s_scnptr = 0L;
+ #ifndef       ISC_386ix
        bias = dsc.s_scnptr + dsc.s_size - lnnoptr;
+ #else
+       comment_scnptr = csc.s_scnptr;
+       csc.s_scnptr = dsc.s_scnptr + dsc.s_size;
+       bias = csc.s_scnptr + csc.s_size - lnnoptr;
+ #endif        /* ISC_386ix */

        if (fh.f_symptr > 0L)
                fh.f_symptr += bias;
***************
*** 139,149 ****
--- 170,186 ----
                Perror("ds write");
        if (fwrite(&bsc, sizeof(bsc), 1, nfp) != 1)
                Perror("bs write");
+       if (fwrite(&csc, sizeof(csc), 1, nfp) != 1)
+               Perror("cs write");
        fseek(nfp, (long)text_scnptr, 0);
        copy(afp, nfp, aout.tsize);
        fseek(cfp, off, 0);
        fseek(nfp, (long)data_scnptr, 0);
        copy(cfp, nfp, size);
+ #ifdef        ISC_386ix
+       fseek(afp, (long)comment_scnptr, 0);
+       copy(afp, nfp, csc.s_size);
+ #endif        /* ISC_386ix */
        copy_syms(afp, nfp);
        fclose(nfp);
        fclose(afp);

These patches for the 3b2 machine are meant to serve as a starting point
only, as they are for pre-2.992 TeX.  If you work on this, contact oc@vmp.com.

#
# 3b2patch.sh, to fix web2c for 3B2s
#      for TeX 2.9*
#
# First, make sure we have EXTRA.c and ITEX.c that are the
# same as the distribution versions of extra.c and itex.c
# since we're going to modify those files.
#
if [ -f EXTRA.c ]
then
	cp EXTRA.c extra.c
else
	cp extra.c EXTRA.c
fi
if [ -f ITEX.c ]
then
	cp ITEX.c itex.c
else
	cp itex.c ITEX.c
fi
#
# Then use a "sed" script to fix the "too may case statements"
# in tex8.c
#
sed '/maincontrol/a\
  int fallthrough;
	/switch/i\
  fallthrough = 0;
	/case 71/i\
  default : fallthgrough = 1 ; break ;\
  }\
  if ( fallthrough )\
  switch ( abs ( curlist .modefield ) + curcmd ) {' <tex8.c >$$t8 &&
mv $$t8 tex8.c
#
# Then find those screwy negative array pointers in texd.h
# and fix them throughout all the files
#
# first find the base numbers we're looking for
#
XEQL=`sed -n 's/^#define xeqlevel (.*-\([0-9][0-9]*\).*/\1/p' <texd.h`
HASH=`sed -n 's/^#define hash (.*-\([0-9][0-9]*\).*/\1/p' <texd.h`
#
# then get rid of the negatives in texd.h
#
sed 's/\(#define xeqlevel (.*\)-[0-9][0-9]*/\1/
	s/\(#define hash (.*\)-[0-9][0-9]*/\1/' <texd.h >$$td &&
mv $$td texd.h
#
# finally fix all the *.c files to do the subtraction
# at array addressing time
#
for i in tex[0-8].c extra.c itex.c
do
	sed 's/\([^a-z]xeqlevel \[\)/\1 -'${XEQL}' +/g
	     s/\([^a-z]hash \[\)/\1 -'${HASH}' +/g' < $i > tkshl$$ &&
		mv tkshl$$ $i
done

When compiling for an Atari ST, some of Metafont's constants have to be
decreased (even beyond small.sed), according to
ridderbusch.pad@nixdorf.com.

*** /tmp/,RCSt1a00228	Tue Nov 20 09:44:11 1990
--- cmf.ch	Mon Nov 19 10:11:30 1990
***************
*** 143,149 ****
  @d file_name_size == FILENAMESIZE {Get value from \.{site.h}.}
  
  @<Constants...@>=
! @!mem_max=60000; {greatest index in \MF's internal |mem| array;
    must be strictly less than |max_halfword|;
    must be equal to |mem_top| in \.{INIMF}, otherwise |>=mem_top|}
  @!max_internal=100; {maximum number of internal quantities}
--- 143,149 ----
  @d file_name_size == FILENAMESIZE {Get value from \.{site.h}.}
  
  @<Constants...@>=
! @!mem_max=30000; {greatest index in \MF's internal |mem| array;
    must be strictly less than |max_halfword|;
    must be equal to |mem_top| in \.{INIMF}, otherwise |>=mem_top|}
  @!max_internal=100; {maximum number of internal quantities}
***************
*** 166,172 ****
    length of \MF's own strings, which is currently about 22000}
  @!move_size=5000; {space for storing moves in a single octant}
  @!max_wiggle=300; {number of autorounded points per cycle}
! @!gf_buf_size=16384; {size of the output buffer, must be a multiple of 8}
  @!pool_name='mf.pool';
    {string of length |file_name_size|; tells where the string pool appears}
  @!path_size=300; {maximum number of knots between breakpoints of a path}
--- 166,172 ----
    length of \MF's own strings, which is currently about 22000}
  @!move_size=5000; {space for storing moves in a single octant}
  @!max_wiggle=300; {number of autorounded points per cycle}
! @!gf_buf_size=4096; {size of the output buffer, must be a multiple of 8}
  @!pool_name='mf.pool';
    {string of length |file_name_size|; tells where the string pool appears}
  @!path_size=300; {maximum number of knots between breakpoints of a path}
***************
*** 177,183 ****
    at least 255 and at most 32510}
  @!max_kerns=500; {maximum number of distinct kern amounts}
  @!max_font_dimen=50; {maximum number of \&{fontdimen} parameters}
! @!mem_top=60000; {largest index in the |mem| array dumped by \.{INIMF};
    must be substantially larger than |mem_min|
    and not greater than |mem_max|}
  @z
--- 177,183 ----
    at least 255 and at most 32510}
  @!max_kerns=500; {maximum number of distinct kern amounts}
  @!max_font_dimen=50; {maximum number of \&{fontdimen} parameters}
! @!mem_top=30000; {largest index in the |mem| array dumped by \.{INIMF};
    must be substantially larger than |mem_min|
    and not greater than |mem_max|}
  @z
