[tex-k] Cygwin and cross compile patches

Jan Nieuwenhuizen janneke@gnu.org
Sat, 28 Sep 2002 13:53:57 +0200


--=-=-=


As per Thomas Esser's suggestion and the discussion on tetex-pretest,
find new patches attached.

In anticipation of any outcome of the thread at:

    http://www.mail-archive.com/tetex-pretest@informatik.uni-hannover.de/msg00481.html

or specific requests, I assumed that web2c-7.3.7 was the correct
version to patch against, so that's what I did: find new diffs
attached.  I've chosen to send context diffs instead of the more
commonly requested unified diffs as (the somewhat hidden)
texk/kpathsea/BUGS requests that, assuming the request probably goes
for the whole tree?

Greetings,
Jan.


Background:

    >   I suggest: you get the main stuff working with Olaf Weber then, we
    >   see what we do about the remaining parts. Only very few files are
    >   actually maintained by me myself.  ...

    I've split the patch into a patch with Cygwin fixes, and a patch that
    enables cross compilation, and made some cleanups.

    The Cygwin patch contains corrections for the assumption that Cygwin
    would be DOSISH (Cygwin is like UNIX), an extention to klibtool to
    create shared object libraries for Cygwin with code fixes for DLL
    creation, and some small Makefile fixes (let CXXFLAGS be
    user-overridable, use $(MAKE) instead of make).  There's also a
    feature for #if __CYGWIN__ only, in elt-dirs.c, with some
    documentation.

    The cross compiling patch enables cross compilation, by using a
    different compiler (and make rules) when cross compiling, but using
    the native compiler to compile build tools.  For now, I've opted not
    to change the workings when not cross compiling.  Also I've not
    removed any (seemingly) disfunctional cross compile configure and
    Makefile code chunks that I encountered, only commented out some
    conflicting stuff.  If all is ok, removing old cruft can be done
    later.

    Olaf, it's still a patch against the tetex-20020911 prerelease tree,
    as that's the easiest way for me to juggle versions and test if
    everything is ok.  I think that should be good enough to get a
    discussion going?  If you would really need to get it differently,
    please tell me how.

    I would appreciate it very much if you could have a look at the
    patches, so that we can see what needs to be done to get them
    merged.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=cygwin-2.patch
Content-Description: Cygwin patch

diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/klibtool ./texk/klibtool
*** ../web2c-7.3.7/texk/klibtool	Thu Jan 14 19:56:54 1999
--- ./texk/klibtool	Sat Sep 28 11:55:11 2002
*************** case $mode in
*** 215,221 ****
        args_STATIC_compile args_SHARED_compile
        args_STATIC_archive STATIC_ranlib args_SHARED_archive
        args_SHARED_link
!       SHARED_postinstall"
      for v in $config_vars; do
        # Preserve existing value of a couple variables.
        case $v in
--- 215,224 ----
        args_STATIC_compile args_SHARED_compile
        args_STATIC_archive STATIC_ranlib args_SHARED_archive
        args_SHARED_link
!       SHARED_postinstall
!       import_lib
!       shared_prefix
!       shared_postverext"
      for v in $config_vars; do
        # Preserve existing value of a couple variables.
        case $v in
*************** case $mode in
*** 224,230 ****
        esac
      done
      test -z "$LIBTOOL_OBJTYPES" && LIBTOOL_OBJTYPES=STATIC
!     shared_ext=so
      libpath_var=LD_LIBRARY_PATH
      STATIC_ranlib=$RANLIB
  
--- 227,236 ----
        esac
      done
      test -z "$LIBTOOL_OBJTYPES" && LIBTOOL_OBJTYPES=STATIC
!     shared_ext='.so'
!     import_lib=
!     shared_postverext=
!     shared_prefix=lib
      libpath_var=LD_LIBRARY_PATH
      STATIC_ranlib=$RANLIB
  
*************** case $mode in
*** 313,323 ****
          SHARED_postinstall='ldconfig -m $libdir'
          ;;
  
        hppa*-*-hpux*)
          if test $compiler = gcc; then
            shared_support=true
            args_SHARED_archive='-shared -fPIC'
!           shared_ext='sl'
          fi
          ;;
  
--- 319,340 ----
          SHARED_postinstall='ldconfig -m $libdir'
          ;;
  
+       *-cygwin*)
+         shared_support=true
+ 	args_SHARED_compile="-DKPSE_DLL"
+ 	SHARED_postinstall=
+ 	args_SHARED_archive='-shared -Wl,--image-base=0x10000000 -Wl,--out-implib,`eval echo $lib_base | sed -e ''s@${shared_prefix}@lib@'' -e s/[-.]\\\\\([0-9][0-9]*\\\\\)//g`.a'
+ 	shared_prefix=cyg
+ 	shared_ext=
+ 	shared_postverext=.dll
+ 	import_lib='`eval echo $libname | sed -e ''s@${shared_prefix}@lib@'' -e s/[-.]\\\\\([0-9][0-9]*\\\\\)//g`.a'
+ 	;;
+ 	
        hppa*-*-hpux*)
          if test $compiler = gcc; then
            shared_support=true
            args_SHARED_archive='-shared -fPIC'
!           shared_ext='.sl'
          fi
          ;;
  
*************** case $mode in
*** 408,414 ****
                  $verbose "$0: running $0 version $newarg."
                  verstring=`$0 version $newarg`
                  $verbose "$0: got version $verstring."
!                 libname=`echo $newarg | sed 's/\.a$/\.'$shared_ext$verstring/`
                else
                  libname=$newarg
                fi
--- 425,435 ----
                  $verbose "$0: running $0 version $newarg."
                  verstring=`$0 version $newarg`
                  $verbose "$0: got version $verstring."
!                 libname=`echo $newarg | sed 's/\.a$/$shared_ext$verstring/'`
! 		if test "$shared_prefix" = "cyg"; then
! 		    verstring=`echo ${verstring} | sed -e 's/[.]\([0-9][0-9]*\)/-\1/g'`
! 		    libname=`echo $newarg | sed -e 's@lib@${shared_prefix}@' -e 's/\.a$/${verstring}${shared_postverext}/'`
! 		fi
                else
                  libname=$newarg
                fi
*************** case $mode in
*** 426,432 ****
                  # If it supports shared libraries, it supports symlinks.
                  # Although this is unnecessary on (e.g.) SunOS, it
                  # doesn't hurt, and it is necessary on (e.g.) Solaris.
!                 post="&& rm -f $lib_base && ln -s $lib_basename $lib_base"
                elif test $ot = STATIC; then
                  ranlib=`eval echo '$'${ot}_ranlib`
                  $verbose "${ot}_ranlib = $ranlib."
--- 447,455 ----
                  # If it supports shared libraries, it supports symlinks.
                  # Although this is unnecessary on (e.g.) SunOS, it
                  # doesn't hurt, and it is necessary on (e.g.) Solaris.
! 		if test "$lib_basename" != "$lib_base"; then
! 		    post="&& rm -f $lib_base && ln -s $lib_basename $lib_base"
! 		fi
                elif test $ot = STATIC; then
                  ranlib=`eval echo '$'${ot}_ranlib`
                  $verbose "${ot}_ranlib = $ranlib."
*************** case $mode in
*** 605,611 ****
          case $ot in
            SHARED) # needs shared extension and version number.
              verstring=`$0 version $arg`
!             libname=`echo $arg | sed 's/\.la$/\.'$shared_ext$verstring/`
              ;;
            STATIC) # just get rid of the `l'.
              libname=`echo $arg | sed 's/l\(.\)$/\1/'`
--- 628,639 ----
          case $ot in
            SHARED) # needs shared extension and version number.
              verstring=`$0 version $arg`
!             libname=`echo $arg | sed 's/\.la$/'$shared_ext$verstring/`
! 	    if test "$shared_prefix" = "cyg"; then
! 		verstring=`echo ${verstring} | sed -e 's/[.]\([0-9][0-9]*\)/-\1/g'`
! 		##libname=`echo $arg | sed -e 's@/lib@/${shared_prefix}@' -e 's/\.la$/${shared_ext}${verstring}${shared_postverext}/'`
! 		libname=`echo $arg | sed -e "s@/lib@/${shared_prefix}@" -e "s/\.la$/${shared_ext}${verstring}${shared_postverext}/"`
! 	    fi
              ;;
            STATIC) # just get rid of the `l'.
              libname=`echo $arg | sed 's/l\(.\)$/\1/'`
*************** case $mode in
*** 626,632 ****
            # Link libfoo.so to libfoo.so.1.2.3.
            lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'`          
            $verbose "$0: linking $libdir/$lib_base to $lib_basename"
!           (cd $libdir && rm -f $lib_base && ln -s $lib_basename $lib_base)
          fi
          #
          # Run ldconfig, etc.
--- 654,667 ----
            # Link libfoo.so to libfoo.so.1.2.3.
            lib_base=`echo $lib_basename | sed 's/[.0-9]*$//'`          
            $verbose "$0: linking $libdir/$lib_base to $lib_basename"
! 	  if test "$lib_base" != "$lib_basename"; then
! 	      (cd $libdir && rm -f $lib_base && ln -s $lib_basename $lib_base)
! 	  fi
! 	  if test -n "$import_lib"; then
! 	      bindir="$libdir/../bin/"
! 	      cmd="${INSTALL_PROGRAM-cp} $libname $bindir/"
! 	      cmd="$cmd && ${INSTALL_DATA-cp} $import_lib $libdir/"
! 	  fi
          fi
          #
          # Run ldconfig, etc.
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/Makefile.in ./texk/kpathsea/Makefile.in
*** ../web2c-7.3.7/texk/kpathsea/Makefile.in	Tue Oct 23 14:01:44 2001
--- ./texk/kpathsea/Makefile.in	Sat Sep 28 11:55:11 2002
*************** library = kpathsea
*** 36,42 ****
  KPATHSEA_CC = $(LIBTOOL) compile "$(CC)"
  .SUFFIXES: .lo
  .c.lo:
! 	$(KPATHSEA_CC) $< $(ALL_CFLAGS)
  
  default all: kpsewhich kpsestat access readlink $(library).info manfiles
  
--- 36,42 ----
  KPATHSEA_CC = $(LIBTOOL) compile "$(CC)"
  .SUFFIXES: .lo
  .c.lo:
! 	$(KPATHSEA_CC) $< $(ALL_CFLAGS) -DMAKE_KPSE_DLL
  
  default all: kpsewhich kpsestat access readlink $(library).info manfiles
  
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/c-pathch.h ./texk/kpathsea/c-pathch.h
*** ../web2c-7.3.7/texk/kpathsea/c-pathch.h	Mon Nov 12 08:45:59 2001
--- ./texk/kpathsea/c-pathch.h	Sat Sep 28 11:55:11 2002
*************** Foundation, Inc., 59 Temple Place - Suit
*** 70,79 ****
--- 70,92 ----
  #ifndef NAME_BEGINS_WITH_DEVICE
  #define NAME_BEGINS_WITH_DEVICE(name) 0 
  #endif
+ 
+ #if defined (__CYGWIN__) && 0
+ #define IS_UNC_NAME(name) (strlen (name) >= 3 && IS_DIR_SEP (*name)  \
+                             && IS_DIR_SEP (*(name+1)) \
+                             && (IS_DIR_SEP (*(name+2)) || isalnum(*(name+2))))
+ #endif
+ 
  #ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
  #define IS_UNC_NAME(name) 0
  #endif
  
+ #ifdef WIN32
+ #  define DEVICE_SEP_LEN 1
+ #else  
+ #  define DEVICE_SEP_LEN 0
+ #endif
+ 
  /* What separates elements in environment variable path lists?  */
  #ifndef ENV_SEP
  #ifdef VMS
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/c-proto.h ./texk/kpathsea/c-proto.h
*** ../web2c-7.3.7/texk/kpathsea/c-proto.h	Sat Nov 17 23:14:56 2001
--- ./texk/kpathsea/c-proto.h	Sat Sep 28 11:55:11 2002
*************** Foundation, Inc., 59 Temple Place - Suit
*** 19,39 ****
  #ifndef KPATHSEA_C_PROTO_H
  #define KPATHSEA_C_PROTO_H
  
! #if defined(WIN32)
! #ifdef KPSE_DLL
  #ifdef MAKE_KPSE_DLL
! #define KPSEDLL __declspec( dllexport)
! #else
! #define KPSEDLL __declspec( dllimport)
! #endif
! #else
  #define KPSEDLL
  #endif
! #else /* ! WIN32 */
  #define KPSEDLL
  #endif
  
- 
  /* These macros munge function declarations to make them work in both
     cases.  The P?H macros are used for declarations, the P?C for
     definitions.  Cf. <ansidecl.h> from the GNU C library.  P1H(void)
--- 19,44 ----
  #ifndef KPATHSEA_C_PROTO_H
  #define KPATHSEA_C_PROTO_H
  
! #define KPSE_DLL
! 
! #if (defined (WIN32) || defined (__CYGWIN__)) && defined (KPSE_DLL)
  #ifdef MAKE_KPSE_DLL
! #ifdef __CYGWIN__
  #define KPSEDLL
+ #define KPSEDLL_EXPORT
+ #else /* ! CYGWIN */
+ #define KPSEDLL
+ #define KPSEDLL_EXPORT __declspec(dllexport)
+ #endif /* ! CYGWIN */
+ #else /* ! MAKE_KPSE_DLL */
+ #define KPSEDLL __declspec(dllimport)
+ #define KPSEDLL_EXPORT
  #endif
! #else /* ( !WIN32 && ! __CYGWIN__) || ! KPSE_DLL */
  #define KPSEDLL
+ #define KPSEDLL_EXPORT
  #endif
  
  /* These macros munge function declarations to make them work in both
     cases.  The P?H macros are used for declarations, the P?C for
     definitions.  Cf. <ansidecl.h> from the GNU C library.  P1H(void)
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/config.h ./texk/kpathsea/config.h
*** ../web2c-7.3.7/texk/kpathsea/config.h	Sun Apr  2 13:07:52 2000
--- ./texk/kpathsea/config.h	Sat Sep 28 11:55:11 2002
*************** Foundation, Inc., 59 Temple Place - Suit
*** 33,42 ****
  #endif
  
  /* If we have either DOS or OS2, we are DOSISH.  */
! #if defined(__i386_pc_gnu__) || \
!     defined(OS2) || \
      defined(MSDOS) || defined(__MSDOS__) || defined(DOS) || \
!     defined(WIN32) || defined(__WIN32__) || defined(_WIN32)
  #define DOSISH
  #endif
  
--- 33,42 ----
  #endif
  
  /* If we have either DOS or OS2, we are DOSISH.  */
! #if !defined (__CYGWIN__) && \
!    (defined(OS2) || \
      defined(MSDOS) || defined(__MSDOS__) || defined(DOS) || \
!     defined(WIN32) || defined(__WIN32__) || defined(_WIN32))
  #define DOSISH
  #endif
  
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/elt-dirs.c ./texk/kpathsea/elt-dirs.c
*** ../web2c-7.3.7/texk/kpathsea/elt-dirs.c	Mon Oct 22 23:31:30 2001
--- ./texk/kpathsea/elt-dirs.c	Sat Sep 28 11:55:11 2002
*************** expand_elt P3C(str_llist_type *, str_lis
*** 357,362 ****
--- 357,363 ----
       handle well filenames like c://dir/foo. So canonicalize the names.
       The resulting name will always be shorter than the one passed, so no
       problem.
+    - Similarly for Cygwin, re(mem)move multiple leading slashes.
     - If possible, we merely skip multiple leading slashes to prevent
       expanding from the root of a UNIX filesystem tree.
  */
*************** kpse_normalize_path P1C(string, elt)
*** 365,371 ****
  {
    unsigned ret;
    unsigned i;
! 
    if (NAME_BEGINS_WITH_DEVICE(elt)) {
        if (*elt >= 'A' && *elt <= 'Z')
            *elt += 'a' - 'A';
--- 366,372 ----
  {
    unsigned ret;
    unsigned i;
!   
    if (NAME_BEGINS_WITH_DEVICE(elt)) {
        if (*elt >= 'A' && *elt <= 'Z')
            *elt += 'a' - 'A';
*************** kpse_normalize_path P1C(string, elt)
*** 375,389 ****
            memmove(elt+3, elt+i, strlen(elt+i) + 1);
        ret = 2;
    } else if (IS_UNC_NAME(elt)) {
!       for (ret = 2; elt[ret] && !IS_DIR_SEP(elt[ret]); ++ret)
            ;
        for (i = ret; elt[i] && IS_DIR_SEP(elt[i]); ++i)
            ;
!       if (i > ret+1)
!           memmove(elt+ret+1, elt+i, strlen(elt+i) + 1);
    } else {
        for (ret = 0; IS_DIR_SEP(elt[ret]); ++ret)
            ;
    }
    
    if (KPSE_DEBUG_P (KPSE_DEBUG_STAT))
--- 376,413 ----
            memmove(elt+3, elt+i, strlen(elt+i) + 1);
        ret = 2;
    } else if (IS_UNC_NAME(elt)) {
!       for (ret = 1 + DEVICE_SEP_LEN; elt[ret] && !IS_DIR_SEP(elt[ret]); ++ret)
            ;
        for (i = ret; elt[i] && IS_DIR_SEP(elt[i]); ++i)
            ;
!       if (i > ret + DEVICE_SEP_LEN)
!           memmove(elt+ret+DEVICE_SEP_LEN, elt+i, strlen(elt+i) + 1);
    } else {
+       char* p;
        for (ret = 0; IS_DIR_SEP(elt[ret]); ++ret)
            ;
+ #ifdef __CYGWIN__
+       /* We've got a dilemma here.
+ 	 
+ 	 Currently, things like //share/texmf-local and //texmf/web2c
+ 	 get expanded; which is clearly wrong: those are UNC paths,
+ 	 and trigger hostname lookups.
+ 
+ 	 Otoh, something like //texserver/c/cygwin/usr/share/texmf//
+ 	 would be perfectly valid, and should not get collapsed to
+ 	 /texserver/c/...; but we should also not start a recursive
+ 	 search at //texserver.  So we collapse UNC prefixes, unless
+ 	 evironment var KPSE_SEARCH_UNC is set.
+ 
+ 	 It doesn't seem a brilliant idea to overload the use of //,
+ 	 in this case meaning recursive search.  Using another
+ 	 character, like /usr/share/texmf/@, would probably cause less
+ 	 trouble. --jcn */
+ 
+       p = getenv ("KPSE_SEARCH_UNC");
+       if (ret > 1 && !(p && strcasecmp (p, "no")))
+ 	memmove(elt, elt+ret-1, strlen(elt+ret) + 1);
+ #endif
    }
    
    if (KPSE_DEBUG_P (KPSE_DEBUG_STAT))
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/getopt.h ./texk/kpathsea/getopt.h
*** ../web2c-7.3.7/texk/kpathsea/getopt.h	Mon Apr  3 21:35:25 2000
--- ./texk/kpathsea/getopt.h	Sat Sep 28 11:55:11 2002
***************
*** 26,42 ****
  #ifndef __STDC__
  #define __STDC__ 1
  #endif
- #if defined (KPSE_DLL) || defined (GNUW32_DLL)
- #if defined (MAKE_KPSE_DLL) || defined (MAKE_GNUW32_DLL)
- #define KPSEDLL __declspec( dllexport)
- #else
- #define KPSEDLL __declspec( dllimport)
  #endif
! #else
  #define KPSEDLL
  #endif
! #else /* ! WIN32 */
  #define KPSEDLL
  #endif
  
  #ifdef	__cplusplus
--- 26,51 ----
  #ifndef __STDC__
  #define __STDC__ 1
  #endif
  #endif
! 
! #define KPSE_DLL
! 
! #if (defined (WIN32) || defined (__CYGWIN__)) && defined (KPSE_DLL)
! #ifdef MAKE_KPSE_DLL
! #ifdef __CYGWIN__
! #define KPSEDLL
! #define KPSEDLL_EXPORT
! #else /* ! CYGWIN */
  #define KPSEDLL
+ #define KPSEDLL_EXPORT __declspec(dllexport)
+ #endif /* ! CYGWIN */
+ #else /* ! MAKE_KPSE_DLL */
+ #define KPSEDLL __declspec(dllimport)
+ #define KPSEDLL_EXPORT
  #endif
! #else /* ( !WIN32 && ! __CYGWIN__) || ! KPSE_DLL */
  #define KPSEDLL
+ #define KPSEDLL_EXPORT
  #endif
  
  #ifdef	__cplusplus
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/mktex.opt ./texk/kpathsea/mktex.opt
*** ../web2c-7.3.7/texk/kpathsea/mktex.opt	Sat Nov 10 21:15:51 2001
--- ./texk/kpathsea/mktex.opt	Sat Sep 28 11:55:11 2002
*************** fi
*** 26,32 ****
  # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
  # directories in path lists whereas Unix uses `:'.
  # Create a variable that holds the right character to be used by the scripts.
! if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi
  
  # TEMPDIR needs to be unique to each process because of the possibility of two
  # people running dvips (or whatever) simultaneously.
--- 26,36 ----
  # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
  # directories in path lists whereas Unix uses `:'.
  # Create a variable that holds the right character to be used by the scripts.
! case `uname -s` in
!     CYGWIN*|Cygwin*|cygwin*) ;;
!     *) if test -n "$COMSPEC" -o -n "$ComSpec"; then DOSISH=yes; fi
! esac
! if test -z "$DOSISH" -o "$DOSISH" = "no"; then SEP=':'; else SEP=';'; fi
  
  # TEMPDIR needs to be unique to each process because of the possibility of two
  # people running dvips (or whatever) simultaneously.
*************** test -n "$MT_MKTEX_CNF" && test -r "$MT_
*** 91,100 ****
  
  # Possible features: appendonlydir dosnames fontmaps nomfdrivers nomode
  #                    stripsupplier striptypeface varfonts.
! if test -n "$COMSPEC"; then
!   : ${MT_FEATURES=appendonlydir:dosnames}
! else
    : ${MT_FEATURES=appendonlydir}
  fi
  : ${MODE=ljfour}
  : ${BDPI=600}
--- 95,104 ----
  
  # Possible features: appendonlydir dosnames fontmaps nomfdrivers nomode
  #                    stripsupplier striptypeface varfonts.
! if test -z "$DOSISH" -o "$DOSISH" = "no"; then
    : ${MT_FEATURES=appendonlydir}
+ else
+   : ${MT_FEATURES=appendonlydir:dosnames}
  fi
  : ${MODE=ljfour}
  : ${BDPI=600}
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/mktexlsr ./texk/kpathsea/mktexlsr
*** ../web2c-7.3.7/texk/kpathsea/mktexlsr	Fri Aug 25 20:53:55 2000
--- ./texk/kpathsea/mktexlsr	Sat Sep 28 11:55:11 2002
*************** build ls-R for. Else all directories in 
*** 25,31 ****
  # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
  # directories in path lists whereas Unix uses `:'.
  # Create a variable that holds the right character to be used by the scripts.
! if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi
  
  # Add the location of the script to the PATH if necessary.  This must
  # be done before kpsewhich can be called, and thus cannot be put into
--- 25,35 ----
  # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use `;' to separate
  # directories in path lists whereas Unix uses `:'.
  # Create a variable that holds the right character to be used by the scripts.
! case `uname -s` in
!     CYGWIN*|Cygwin*|cygwin*) ;;
!     *) if test -n "$COMSPEC" -o -n "$ComSpec"; then DOSISH=yes; fi
! esac
! if test -z "$DOSISH" -o "$DOSISH" = "no"; then SEP=':'; else SEP=';'; fi
  
  # Add the location of the script to the PATH if necessary.  This must
  # be done before kpsewhich can be called, and thus cannot be put into
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/version.c ./texk/kpathsea/version.c
*** ../web2c-7.3.7/texk/kpathsea/version.c	Tue Jan 26 21:34:19 1999
--- ./texk/kpathsea/version.c	Sat Sep 28 11:55:11 2002
***************
*** 1,7 ****
  #include "c-auto.h"
  #include <kpathsea/c-proto.h>
  
! KPSEDLL char *kpathsea_version_string = (char *) KPSEVERSION;
  
  /* If you are redistributing a modified version of my original
     distribution, please change this address.
--- 1,7 ----
  #include "c-auto.h"
  #include <kpathsea/c-proto.h>
  
! KPSEDLL_EXPORT char *kpathsea_version_string = (char *) KPSEVERSION;
  
  /* If you are redistributing a modified version of my original
     distribution, please change this address.
*************** KPSEDLL char *kpathsea_version_string = 
*** 11,15 ****
  
     Thanks.  --kb@cs.umb.edu  */
  
! KPSEDLL char *kpse_bug_address = (char *) 
    "Email bug reports to tex-k@mail.tug.org.\n";
--- 11,15 ----
  
     Thanks.  --kb@cs.umb.edu  */
  
! KPSEDLL_EXPORT char *kpse_bug_address = (char *) 
    "Email bug reports to tex-k@mail.tug.org.\n";
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/kpathsea/xdirname.c ./texk/kpathsea/xdirname.c
*** ../web2c-7.3.7/texk/kpathsea/xdirname.c	Sat Nov 17 22:33:10 2001
--- ./texk/kpathsea/xdirname.c	Sat Sep 28 11:55:11 2002
*************** xdirname P1C(const_string, name)
*** 37,43 ****
    
    if (NAME_BEGINS_WITH_DEVICE(name)) {
        limit = 2;
! #ifdef WIN32
    } else if (IS_UNC_NAME(name)) {
        for (limit = 2; name[limit] && !IS_DIR_SEP(name[limit]); limit++)
            ;
--- 37,43 ----
    
    if (NAME_BEGINS_WITH_DEVICE(name)) {
        limit = 2;
! #if defined (WIN32) || defined (__CYGWIN__)
    } else if (IS_UNC_NAME(name)) {
        for (limit = 2; name[limit] && !IS_DIR_SEP(name[limit]); limit++)
            ;
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache ../web2c-7.3.7/texk/web2c/fmtutil.in ./texk/web2c/fmtutil.in
*** ../web2c-7.3.7/texk/web2c/fmtutil.in	Thu Jan  1 01:00:00 1970
--- ./texk/web2c/fmtutil.in	Sat Sep 28 12:43:37 2002
***************
*** 0 ****
--- 1,96 ----
+ # Thomas Esser, Copyright 1998, 1999. Public domain.
+ # fmtutil.cnf: configuration file for fmtutil.
+ 
+ # Customize this file to your needs, e.g.
+ #   - remove or uncomment formats that you don't need
+ #   - add your own formats
+ #   - change default engine / flags for standard formats
+ 
+ # Some notes:
+ #   1) tex and amstex just load hyphen.tex. No customization.
+ #   You can have you own customized (via babel's hyphen.cfg)
+ #   formats on top of plain by using "bplain.tex" instead of
+ #   plain.tex (see e.g. bplain.ini file for bplain format).
+ #
+ #   2) etex loads language.def, not language.dat.
+ #
+ #   3) The symbolic link to the right engines (e.g. bplain -> tex)
+ #      will be generated by the "texlinks" script. So, if you call
+ #      fmtutil "by hand" and not via texconfig, please also call
+ #      texlinks afterwards.
+ # 
+ #   4) usual commenta start with "# ", whereas disabled configurations
+ #      start with "#! " in this file.
+ 
+ # The format of the table is:
+ 
+ # format	engine		pattern-file	arguments
+ 
+ # The last part of "arguments" must be the name of the file to run
+ # initex (or another "ini"-engine) on.
+ 
+ # metafont and metapost:
+ mf		mf		-		mf.ini
+ @MFN@mfw		mfw		-		mf.ini
+ mpost		mpost		-		mpost.mp
+ metafun		mpost		-		metafun.mp
+ 
+ # Standard formats (plain, latex) with all engines:
+ 
+ tex		@TEXBIN@		-		tex.ini
+ latex		@TEXBIN@		language.dat	latex.ini
+ @ETEX@etex		etex		language.def	*etex.ini
+ @ETEX@elatex		etex		language.dat	*elatex.ini
+ @PTEX@pdftex		pdftex		language.dat	pdftex.ini
+ @PTEX@pdflatex	pdftex		language.dat	pdflatex.ini
+ @PETEX@pdfetex		pdfetex		language.def	*pdfetex.ini
+ @PETEX@pdfelatex	pdfetex		language.dat	*pdfelatex.ini
+ @OMEGA@omega		omega		language.dat	omega.ini
+ @OMEGA@lambda		omega		language.dat	lambda.ini
+ 
+ # The amstex format:
+ #! amstex	@TEXBIN@		-		amstex.ini
+ 
+ # Variants of plain and amstex which allow to customize hyphenation:
+ #! bplain	@TEXBIN@		language.dat	bplain.ini
+ #! bamstex	@TEXBIN@		language.dat	bamstex.ini
+ #! pdfamstex	pdftex			language.dat	pdfamstex.ini
+ 
+ # Context formats:
+ #! cont-cz	pdfetex		cont-usr.tex	*cont-cz.ini
+ #! cont-de	pdfetex		cont-usr.tex	*cont-de.ini
+ @PETEX@cont-en	pdfetex		cont-usr.tex	*cont-en.ini
+ #! cont-nl	pdfetex		cont-usr.tex	*cont-nl.ini
+ #! cont-uk	pdfetex		cont-usr.tex	*cont-uk.ini
+ 
+ # language-specific things:
+ 
+ # - Cyrillic:
+ #! cyrtex	tex		language.dat	cyrtex.ini
+ #! cyrtexinfo	tex		language.dat	cyrtxinf.ini
+ #! cyramstex	tex		language.dat	cyramstx.ini
+ 
+ # - Polish:
+ #! platex		tex		language.dat	platex.ini
+ #! pdfplatex		pdftex		language.dat	pdfplatex.ini
+ #! mex		tex		mexconf.tex	mex.ini
+ #! pdfmex		pdftex		mexconf.tex	pdfmex.ini
+ #! pdfemex		pdfetex		mexconf.tex	*pdfemex.ini
+ 
+ # - Polish with translated messages (experimental):
+ #! platex-pl	tex		-		nls=tex-pl,il2-pl platex.ini
+ #! mex-pl		tex		mexconf.tex	nls=tex-pl,il2-pl mex.ini
+ #! pdfmex-pl	pdftex		mexconf.tex	nls=pdftex-pl,il2-pl pdfmex.ini
+ #! pdfemex-pl		pdfetex		mexconf.tex	nls=pdfetex-pl,il2-pl *pdfemex.ini
+ 
+ # - Czech / Slovak:
+ #! csplain	tex		-		csplain.ini
+ #! cslatex	tex		language.dat	cslatex.ini
+ #! pdfcsplain	pdftex		-		csplain.ini
+ #! pdfcslatex	pdftex		language.dat    cslatex.ini
+ 
+ # Other formats:
+ #! eplain	tex		language.dat	eplain.ini
+ 
+ # mptopdf utility
+ @PETEX@mptopdf		pdfetex		-		mptopdf.tex

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=cross-2.patch
Content-Description: Cross compile patch

diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/Makefile.in ./Makefile.in
*** ../xweb2c-7.3.7-cygwin/Makefile.in	Wed Apr 19 13:38:53 2000
--- ./Makefile.in	Sat Sep 28 12:03:11 2002
*************** exec_prefix = @exec_prefix@
*** 46,51 ****
--- 46,52 ----
  datadir = @datadir@
  bindir = @bindir@
  scriptdir = $(bindir)
+ runscriptdir = @runscriptdir@
  manext = 1
  mandir = @mandir@/man$(manext)
  infodir = @infodir@
*************** default: all
*** 78,104 ****
  install: all 
  	for dir in $(ESUBDIRS); do \
  	   echo making $@ in $$dir; \
! 	     (cd $$dir && PATH=$(scriptdir):$(bindir):$(PATH) \
                  $(MAKE) $@) || exit 1; \
  	done
  	$(srcdir)/selfautofix "$(bindir)" "$(texmf)/web2c"
  	cd $(bindir); for i in $(ALLPROGS); do test -f $$i && { echo strip $$i; strip $$i || true; }; done; true
  	test -f $(scriptdir)/mktexlsr && \
! 	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/mktexlsr
  	test -f $(scriptdir)/texconfig && \
! 	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/texconfig init
  
  install-exec:
  	for dir in $(ESUBDIRS); do \
  	   echo making $@ in $$dir; \
! 	   (cd $$dir && PATH=$(scriptdir):$(bindir):$(PATH) \
                $(MAKE) $@) || exit 1; \
  	done
  	cd $(bindir); for i in $(ALLPROGS); do test -f $$i && { echo strip $$i; strip $$i || true; }; done; true
  	test -f $(scriptdir)/texlinks && \
! 	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/texlinks
  
  strip:
--- 79,105 ----
  install: all 
  	for dir in $(ESUBDIRS); do \
  	   echo making $@ in $$dir; \
! 	     (cd $$dir && PATH=$(runscriptdir):$(bindir):$(PATH) \
                  $(MAKE) $@) || exit 1; \
  	done
  	$(srcdir)/selfautofix "$(bindir)" "$(texmf)/web2c"
  	cd $(bindir); for i in $(ALLPROGS); do test -f $$i && { echo strip $$i; strip $$i || true; }; done; true
  	test -f $(scriptdir)/mktexlsr && \
! 	  TEXMFMAIN=$(texmf) PATH=$(runscriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/mktexlsr
  	test -f $(scriptdir)/texconfig && \
! 	  TEXMFMAIN=$(texmf) PATH=$(runscriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/texconfig init
  
  install-exec:
  	for dir in $(ESUBDIRS); do \
  	   echo making $@ in $$dir; \
! 	   (cd $$dir && PATH=$(runscriptdir):$(bindir):$(PATH) \
                $(MAKE) $@) || exit 1; \
  	done
  	cd $(bindir); for i in $(ALLPROGS); do test -f $$i && { echo strip $$i; strip $$i || true; }; done; true
  	test -f $(scriptdir)/texlinks && \
! 	  TEXMFMAIN=$(texmf) PATH=$(runscriptdir):$(bindir):$(PATH) \
  	    $(scriptdir)/texlinks
  
  strip:
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/configure.in ./configure.in
*** ../xweb2c-7.3.7-cygwin/configure.in	Tue Nov 20 12:56:24 2001
--- ./configure.in	Sat Sep 28 11:59:58 2002
*************** sinclude(texk/kpathsea/withenable.ac)
*** 44,49 ****
--- 44,50 ----
  sinclude(texk/kpathsea/xt.ac)
  sinclude(texk/web2c/withenable.ac)
  sinclude(texk/xdvik/withenable.ac)
+ sinclude(texk/cross.ac)
  sinclude(libs/libwww/withenable.ac)
  sinclude(libs/ncurses/withenable.ac)
  sinclude(libs/libpng/withenable.ac)
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/configure.in ./texk/configure.in
*** ../xweb2c-7.3.7-cygwin/texk/configure.in	Mon Apr  3 20:37:13 2000
--- ./texk/configure.in	Sat Sep 28 11:59:58 2002
*************** dnl options, they must be added, so conf
*** 34,39 ****
--- 34,40 ----
  dnl will show all the options.
  sinclude(acklibtool.m4)
  sinclude(withenable.ac)
+ sinclude(cross)	
  sinclude(kpathsea/withenable.ac)
  sinclude(web2c/withenable.ac)
  sinclude(xdvik/withenable.ac)
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/cross.ac ./texk/cross.ac
*** ../xweb2c-7.3.7-cygwin/texk/cross.ac	Thu Jan  1 01:00:00 1970
--- ./texk/cross.ac	Sat Sep 28 11:59:58 2002
***************
*** 0 ****
--- 1,80 ----
+ dnl cross.ac: cross compilation stuff -*-autoconf-*-
+ 
+ ## Cross building	
+ if test "$cross_compiling" = "yes"; then
+   AC_MSG_CHECKING(cc for build)
+   ## /usr/bin/cc still uses wrong assembler
+   ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
+   CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
+ else
+   CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+ fi   
+ AC_ARG_WITH(cc-for-build,
+   [  --with-cc-for-build=CC  native C compiler, to be used during build])
+ test -n "$with_cc_for_build" && CC_FOR_BUILD="$with_cc_for_build"
+      
+ ## AC_MSG_CHECKING("if we are cross compiling")
+ ## AC_MSG_RESULT($cross_compiling)
+ if test "$cross_compiling" = "yes"; then
+    AC_MSG_RESULT($CC_FOR_BUILD)
+ fi
+ 
+ ## No need as yet to be more elaborate
+ CCLD_FOR_BUILD="$CC_FOR_BUILD"
+ 
+ AC_SUBST(cross_compiling)
+ AC_SUBST(CC_FOR_BUILD)
+ AC_SUBST(CCLD_FOR_BUILD)
+ 	
+ if test "$cross_compiling" = "yes"; then
+   for_build='-for-build'
+   runscriptdir=/usr/bin
+   AC_PATH_PROG(DVIPS, dvips, /usr/bin/dvips)
+   AC_PATH_PROG(ETEX, etex, /usr/bin/etex)
+   AC_PATH_PROG(KPSEWHICH, kpsewhich, /usr/bin/kpsewhich)
+   AC_PATH_PROG(MF, mf, /usr/bin/mf)
+   AC_PATH_PROG(MPOST, mpost, /usr/bin/mpost)
+   AC_PATH_PROG(OMEGA, omega, /usr/bin/omega)
+   AC_PATH_PROG(OTANGLE, otangle, /usr/bin/otangle)
+   AC_PATH_PROG(PDFETEX, pdfetex, /usr/bin/pdfetex)
+   AC_PATH_PROG(PDFTEX, pdftex, /usr/bin/pdftex)
+   AC_PATH_PROG(PLTOTF, pltotf, /usr/bin/pltotf)
+   AC_PATH_PROG(TANGLE, tangle, /usr/bin/tangle)
+   AC_PATH_PROG(TEX, tex, /usr/bin/tex)
+   AC_PATH_PROG(TFTOPL, tftopl, /usr/bin/tftopl)
+   AC_PATH_PROG(TIE, tie, /usr/bin/tie)
+ else
+   for_build=
+   runscriptdir='$(bindir)'
+   DVIPS=./dvips
+   ETEX=./etex
+   KPSEWHICH='$(kpathsea_dir)/kpsewhich'
+   MF=./mf
+   MPOST=./mpost
+   OMEGA=./omega
+   OTANGLE=./otangle
+   PDFETEX=./pdfetex
+   PDFTEX=./pdftex
+   PLTOTF=./pltotf
+   TANGLE=./tangle
+   TEX=./tex
+   TFTOPL=./tftopl
+   TIE=./tie
+ fi
+ 
+ AC_SUBST(for_build)
+ AC_SUBST(runscriptdir)
+ AC_SUBST(DVIPS)
+ AC_SUBST(ETEX)
+ AC_SUBST(KPSEWHICH)
+ AC_SUBST(MF)
+ AC_SUBST(MPOST)
+ AC_SUBST(OMEGA)
+ AC_SUBST(OTANGLE)
+ AC_SUBST(PDFETEX)
+ AC_SUBST(PDFTEX)
+ AC_SUBST(PLTOTF)
+ AC_SUBST(TANGLE)
+ AC_SUBST(TEX)
+ AC_SUBST(TFTOPL)
+ AC_SUBST(TIE)
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/etc/autoconf/acsite.m4 ./texk/etc/autoconf/acsite.m4
*** ../xweb2c-7.3.7-cygwin/texk/etc/autoconf/acsite.m4	Wed Mar  4 14:19:45 1998
--- ./texk/etc/autoconf/acsite.m4	Sat Sep 28 12:00:22 2002
*************** AC_SUBST(LIBTOOL_LIBOBJS)dnl
*** 15,21 ****
  
  dnl Check if gcc asm for i386 needs external symbols with an underscore.
  dnl Peter Breitenlohner, April 15, 1996.
! undefine([pb_AC_ASM_UNDERSCORE])
  AC_DEFUN(pb_AC_ASM_UNDERSCORE,
  [AC_REQUIRE_CPP()dnl
  AC_CACHE_CHECK(whether gcc asm needs underscore, pb_cv_asm_underscore,
--- 15,21 ----
  
  dnl Check if gcc asm for i386 needs external symbols with an underscore.
  dnl Peter Breitenlohner, April 15, 1996.
! # undefine([pb_AC_ASM_UNDERSCORE])
  AC_DEFUN(pb_AC_ASM_UNDERSCORE,
  [AC_REQUIRE_CPP()dnl
  AC_CACHE_CHECK(whether gcc asm needs underscore, pb_cv_asm_underscore,
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/etc/autoconf/acspecific.m4 ./texk/etc/autoconf/acspecific.m4
*** ../xweb2c-7.3.7-cygwin/texk/etc/autoconf/acspecific.m4	Mon Apr  3 10:57:39 2000
--- ./texk/etc/autoconf/acspecific.m4	Sat Sep 28 12:00:22 2002
*************** else
*** 117,159 ****
  fi
  ])
  
- AC_DEFUN(AC_PROG_CXX,
- [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
- AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc)
- 
- AC_PROG_CXX_WORKS
- AC_PROG_CXX_GNU
- 
- if test $ac_cv_prog_gxx = yes; then
-   GXX=yes
- else
-   GXX=
- fi
- 
- dnl Check whether -g works, even if CXXFLAGS is set, in case the package
- dnl plays around with CXXFLAGS (such as to build both debugging and
- dnl normal versions of a library), tasteless as that idea is.
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=
- AC_PROG_CXX_G
- if test "$ac_test_CXXFLAGS" = set; then
-   CXXFLAGS="$ac_save_CXXFLAGS"
- elif test $ac_cv_prog_cxx_g = yes; then
-   if test "$GXX" = yes; then
-     CXXFLAGS="-g -O2"
-   else
-     CXXFLAGS="-g"
-   fi
- else
-   if test "$GXX" = yes; then
-     CXXFLAGS="-O2"
-   else
-     CXXFLAGS=
-   fi
- fi
- ])
- 
  dnl Determine a Fortran 77 compiler to use.  If `F77' is not already set
  dnl in the environment, check for `g77', `f77' and `f2c', in that order.
  dnl Set the output variable `F77' to the name of the compiler found.
--- 117,122 ----
*************** AC_SUBST(X_LIBS)dnl
*** 2687,2692 ****
--- 2650,2693 ----
  AC_SUBST(X_EXTRA_LIBS)dnl
  ])
  
+ dnl Check for C++.  Do this after checking all libraries -- jcn
+ AC_DEFUN(AC_PROG_CXX,
+ [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
+ AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc)
+ 
+ AC_PROG_CXX_WORKS
+ AC_PROG_CXX_GNU
+ 
+ if test $ac_cv_prog_gxx = yes; then
+   GXX=yes
+ else
+   GXX=
+ fi
+ 
+ dnl Check whether -g works, even if CXXFLAGS is set, in case the package
+ dnl plays around with CXXFLAGS (such as to build both debugging and
+ dnl normal versions of a library), tasteless as that idea is.
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=
+ AC_PROG_CXX_G
+ if test "$ac_test_CXXFLAGS" = set; then
+   CXXFLAGS="$ac_save_CXXFLAGS"
+ elif test $ac_cv_prog_cxx_g = yes; then
+   if test "$GXX" = yes; then
+     CXXFLAGS="-g -O2"
+   else
+     CXXFLAGS="-g"
+   fi
+ else
+   if test "$GXX" = yes; then
+     CXXFLAGS="-O2"
+   else
+     CXXFLAGS=
+   fi
+ fi
+ ])
+ 
  dnl The old Cygwin32 macro is deprecated.
  AC_DEFUN(AC_CYGWIN32,
  [AC_OBSOLETE([$0], [; instead use AC_CYGWIN])dnl
*************** dnl Setting ac_exeext will implicitly ch
*** 2777,2787 ****
  ac_exeext=$EXEEXT
  AC_SUBST(EXEEXT)])
  
  dnl Unset CC to run configure with cross compiler.
! AC_DEFUN(AC_UNSET_CC, [
  ZZ=
  if test "$cross_compiling" = yes &&
!    (test "x$CC" = "xdos-gcc" || test "x$CC" = "xi386-mingw32-gcc" || test "x$CC" = "xgnuwin32gcc") ; then
  ZZ=$CC
  unset CC
  cross_compiling=no
--- 2778,2792 ----
  ac_exeext=$EXEEXT
  AC_SUBST(EXEEXT)])
  
+ 
+ dnl This is completely and utterly broken -- jcn
+ dnl Non-autoconf functions should not be prefixed 'AC_' anyway
+ 
  dnl Unset CC to run configure with cross compiler.
! AC_DEFUN(BROKEN_AC_UNSET_CC, [
  ZZ=
  if test "$cross_compiling" = yes &&
!   (test "x$CC" = "xdos-gcc" || test "x$CC" = "xi386-mingw32-gcc" || test "x$CC" = "xgnuwin32gcc") ; then
  ZZ=$CC
  unset CC
  cross_compiling=no
*************** fi
*** 2789,2801 ****
  ])
  
  dnl Restore CC that has been unset by AC_UNSET_CC
! AC_DEFUN(AC_RESET_CC, [
  if test "x$ZZ" = "xdos-gcc" || test "x$ZZ" = "xi386-mingw32-gcc" || test "x$ZZ" = "xgnuwin32gcc" ; then
  CC=$ZZ
  cross_compiling=yes
  fi
  ])
  
  
  dnl ### Checks for UNIX variants
  dnl These are kludges which should be replaced by a single POSIX check.
--- 2794,2809 ----
  ])
  
  dnl Restore CC that has been unset by AC_UNSET_CC
! AC_DEFUN(BROKEN_AC_RESET_CC, [
  if test "x$ZZ" = "xdos-gcc" || test "x$ZZ" = "xi386-mingw32-gcc" || test "x$ZZ" = "xgnuwin32gcc" ; then
  CC=$ZZ
  cross_compiling=yes
  fi
  ])
  
+ AC_DEFUN(AC_UNSET_CC, true)
+ AC_DEFUN(AC_RESET_CC, true)
+ 
  
  dnl ### Checks for UNIX variants
  dnl These are kludges which should be replaced by a single POSIX check.
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/make/common.mk ./texk/make/common.mk
*** ../xweb2c-7.3.7-cygwin/texk/make/common.mk	Mon Jun 28 22:09:57 1999
--- ./texk/make/common.mk	Sat Sep 28 12:00:23 2002
*************** kpathsea = $(kpathsea_dir)/libkpathsea.l
*** 48,51 ****
--- 48,88 ----
  @MAINT@XDEFS = -Wpointer-arith $(warn_more)
  @MAINT@CFLAGS = -pipe -g $(XCFLAGS)
  @MAINT@endif
+ 
+ 
+ 
+ ## Cross build stuff -- jcn
+ 
+ cross_compiling = @cross_compiling@
+ for-build = @for_build@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+ CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
+ CFLAGS_FOR_BUILD = '-Duexit=exit' $(ALL_CFLAGS)
+ 
+ 
+ ## Override default rule; this should be compiled for BUILD host.
+ %-for-build.o: %.c
+ 	if [ "$(cross_compiling)" = "yes" ]; then \
+ 		$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c -o $@ $<; \
+ 	else \
+ 		$(compile) $<; \
+ 	fi
+ 
+ ## Override default rule; this should run on BUILD host.
+ %-for-build: %-for-build.o
+ 	@rm -f $@
+ 	if [ "$(cross_compiling)" = "yes" ]; then \
+ 		$(CCLD_FOR_BUILD) -o $@ $< $(LOADLIBES_FOR_BUILD); \
+ 	else \
+ 		$(kpathsea_link) $< $(LOADLIBES); \
+ 	fi
+ 
+ %: %.exe
+ 	cp -f $< $@
+ 
+ %-for-build: %-for-build.exe
+ 	cp -f $< $@
+ 
+ 
+ 
  # End of common.mk.
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/make/programs.mk ./texk/make/programs.mk
*** ../xweb2c-7.3.7-cygwin/texk/make/programs.mk	Sat Oct 27 12:21:12 2001
--- ./texk/make/programs.mk	Sat Sep 28 12:00:23 2002
*************** LDFLAGS = @LDFLAGS@ $(XLDFLAGS)
*** 7,13 ****
  # proglib is for web2c; 
  # XLOADLIBES is for the installer.
  LIBS = @LIBS@
! LOADLIBES = $(proglib) $(kpathsea) $(LIBS) $(XLOADLIBES)
  
  # May as well separate linking from compiling, just in case.
  CCLD = $(CC)
--- 7,14 ----
  # proglib is for web2c; 
  # XLOADLIBES is for the installer.
  LIBS = @LIBS@
! LOADLIBES = $(proglib) $(kpathsea) $(XLOADLIBES)
! LOADLIBES_FOR_BUILD = $(proglib-for-build) -lkpathsea -lm 
  
  # May as well separate linking from compiling, just in case.
  CCLD = $(CC)
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/web2c/Makefile.in ./texk/web2c/Makefile.in
*** ../xweb2c-7.3.7-cygwin/texk/web2c/Makefile.in	Tue Nov 20 13:41:59 2001
--- ./texk/web2c/Makefile.in	Sat Sep 28 13:11:53 2002
*************** version = @WEB2CVERSION@
*** 5,16 ****
  # install-fmts/install-bases/install-mems will install. plain.* is
  # created automatically (as a link).  See the Formats node in
  # doc/web2c.texi for details on the fmts.
! @TEX@fmts = latex.fmt # amstex.fmt eplain.fmt texinfo.fmt
! @ETEX@efmts = elatex.efmt
! @CTEX@cfmts = latex.efmt
! @PTEX@pdffmts = pdflatex.fmt
! @PETEX@pdfefmts = pdfelatex.efmt
! @OMEGA@ofmts = lambda.fmt
  bases = # I do not recommend building cmmf.base.
  mems =  # mfplain.mem is probably not generally useful.
  
--- 5,16 ----
  # install-fmts/install-bases/install-mems will install. plain.* is
  # created automatically (as a link).  See the Formats node in
  # doc/web2c.texi for details on the fmts.
! @HASH_TEX@fmts = latex.fmt # amstex.fmt eplain.fmt texinfo.fmt
! @HASH_ETEX@efmts = elatex.efmt
! @HASH_CTEX@cfmts = latex.efmt
! @HASH_PTEX@pdffmts = pdflatex.fmt
! @HASH_PETEX@pdfefmts = pdfelatex.efmt
! @HASH_OMEGA@ofmts = lambda.fmt
  bases = # I do not recommend building cmmf.base.
  mems =  # mfplain.mem is probably not generally useful.
  
*************** ac_include ../make/paths.mk
*** 26,31 ****
--- 26,42 ----
  DIFF = diff
  DIFFFLAGS =
  
+ KPSEWHICH = @KPSEWHICH@
+ TANGLE = @TANGLE@
+ OTANGLE = @OTANGLE@
+ TEX = @TEX@
+ ETEX = @ETEX@
+ PDFTEX = @PDFTEX@
+ PDFETEX = @PDFETEX@
+ MF = @MF@
+ MPOST = @MPOST@
+ OMEGA = @OMEGA@
+ 
  .SUFFIXES: # get rid of .p.o
  ac_include ../make/common.mk
  ac_include ../make/programs.mk
*************** install_makeargs = INSTALL='$(INSTALL)' 
*** 65,96 ****
    $(makevars) $(common_makeargs)  
  
  proglib = lib/lib.a
  windowlib = window/window.a
! @PTEX@ZLIBDIR=../../libs/zlib
! @PTEX@ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)
! @PTEX@LIBPNGDIR=../../libs/libpng
! @PTEX@LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)
! @PTEX@LIBTIFFDIR=../../libs/libtiff
! @PTEX@LIBTIFFSRCDIR=$(srcdir)/$(LIBTIFFDIR)
! @PTEX@LIBXPDFDIR=../../libs/xpdf
! @PTEX@LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR)
! @PTEX@pdflib = pdftexdir/libpdf.a
! @PTEX@LIBPNGDEP = @LIBPNGDEP@
! @PTEX@LDLIBPNG = @LDLIBPNG@
! @PTEX@LIBTIFFDEP = @LIBTIFFDEP@
! @PTEX@LDLIBTIFF = @LDLIBTIFF@
! @PTEX@ZLIBDEP = @ZLIBDEP@
! @PTEX@LDZLIB = @LDZLIB@
! @PTEX@LIBXPDFDEP = @LIBXPDFDEP@
! @PTEX@LDLIBXPDF = @LDLIBXPDF@
! @PTEX@pdftexlibs = $(pdflib) $(LDLIBTIFF) $(LDLIBPNG) $(LDZLIB) $(LDLIBXPDF)
! @PTEX@pdftexlibsdep = $(pdflib) $(LIBTIFFDEP) $(LIBPNGDEP) $(ZLIBDEP) $(LIBXPDFDEP)
  
  # The sh script that does the conversion:
  web2c = srcdir=$(srcdir) $(shared_env) $(SHELL) $(srcdir)/web2c/convert
  # Additional dependencies:
  web2c_aux = web2c/convert web2c/common.defines
! web2c_programs = web2c/fixwrites web2c/splitup web2c/web2c
  
  # Unfortunately, suffix rules can't have dependencies, or multiple
  # targets, and we can't assume all makes supports pattern rules.
--- 76,108 ----
    $(makevars) $(common_makeargs)  
  
  proglib = lib/lib.a
+ proglib-for-build = lib/lib-for-build.a
  windowlib = window/window.a
! @HASH_PTEX@ZLIBDIR=../../libs/zlib
! @HASH_PTEX@ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)
! @HASH_PTEX@LIBPNGDIR=../../libs/libpng
! @HASH_PTEX@LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)
! @HASH_PTEX@LIBTIFFDIR=../../libs/libtiff
! @HASH_PTEX@LIBTIFFSRCDIR=$(srcdir)/$(LIBTIFFDIR)
! @HASH_PTEX@LIBXPDFDIR=../../libs/xpdf
! @HASH_PTEX@LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR)
! @HASH_PTEX@pdflib = pdftexdir/libpdf.a
! @HASH_PTEX@LIBPNGDEP = @LIBPNGDEP@
! @HASH_PTEX@LDLIBPNG = @LDLIBPNG@
! @HASH_PTEX@LIBTIFFDEP = @LIBTIFFDEP@
! @HASH_PTEX@LDLIBTIFF = @LDLIBTIFF@
! @HASH_PTEX@ZLIBDEP = @ZLIBDEP@
! @HASH_PTEX@LDZLIB = @LDZLIB@
! @HASH_PTEX@LIBXPDFDEP = @LIBXPDFDEP@
! @HASH_PTEX@LDLIBXPDF = @LDLIBXPDF@
! @HASH_PTEX@pdftexlibs = $(pdflib) $(LDLIBTIFF) $(LDLIBPNG) $(LDZLIB) $(LDLIBXPDF)
! @HASH_PTEX@pdftexlibsdep = $(pdflib) $(LIBTIFFDEP) $(LIBPNGDEP) $(ZLIBDEP) $(LIBXPDFDEP)
  
  # The sh script that does the conversion:
  web2c = srcdir=$(srcdir) $(shared_env) $(SHELL) $(srcdir)/web2c/convert
  # Additional dependencies:
  web2c_aux = web2c/convert web2c/common.defines
! web2c_programs = web2c/fixwrites$(for-build) web2c/splitup$(for-build) web2c/web2c$(for-build)
  
  # Unfortunately, suffix rules can't have dependencies, or multiple
  # targets, and we can't assume all makes supports pattern rules.
*************** web2c_programs = web2c/fixwrites web2c/s
*** 98,104 ****
  .p.c: # really depends on $(web2c_programs), and generates .h.
  	$(web2c) $*
  .ch.p: # really depends on ./tangle; for mf/mp/tex, also generates .pool
! 	$(shared_env) ./tangle $(srcdir)/$*.web $<
  
  # These definitions have to come before the rules that expand them.
  # The *{ini,[0-2]}.c files are created by splitup, run as part of convert.
--- 110,116 ----
  .p.c: # really depends on $(web2c_programs), and generates .h.
  	$(web2c) $*
  .ch.p: # really depends on ./tangle; for mf/mp/tex, also generates .pool
! 	$(shared_env) $(TANGLE) $(srcdir)/$*.web $<
  
  # These definitions have to come before the rules that expand them.
  # The *{ini,[0-2]}.c files are created by splitup, run as part of convert.
*************** all_c = $(other_c) $(mf_c) $(mp_c) $(tex
*** 120,137 ****
  # Prevent Make from deleting the intermediate forms.
  .PRECIOUS: %.ch %.p %.c
  
! @TEX@tex = tex
! @ETEX@etex = etex
! @PTEX@pdftex = pdftex
! @PTEX@ttf2afm = ttf2afm
! @PETEX@pdfetex = pdfetex
! @OMEGA@omega = omega
! @OMEGA@odvicopy = odvicopy
! @OMEGA@odvitype = odvitype
! @OMEGA@otangle = otangle
! @MFW@mfw = mf
! @MFN@mfn = mf
! @MFW@@MFN@mfw = mfw
  programs = tie bibtex dvicopy dvitomp dvitype $(etex) gftodvi gftopk \
  gftype $(mfn) $(mfw) mft mpost $(odvicopy) $(odvitype) $(omega) $(otangle) \
  patgen $(pdftex) $(pdfetex) pktogf pktype pltotf pooltype tangle $(tex) \
--- 132,149 ----
  # Prevent Make from deleting the intermediate forms.
  .PRECIOUS: %.ch %.p %.c
  
! @HASH_TEX@tex = tex
! @HASH_ETEX@etex = etex
! @HASH_PTEX@pdftex = pdftex
! @HASH_PTEX@ttf2afm = ttf2afm
! @HASH_PETEX@pdfetex = pdfetex
! @HASH_OMEGA@omega = omega
! @HASH_OMEGA@odvicopy = odvicopy
! @HASH_OMEGA@odvitype = odvitype
! @HASH_OMEGA@otangle = otangle
! @HASH_MFW@mfw = mf
! @HASH_MFN@mfn = mf
! @HASH_MFW@@MFN@mfw = mfw
  programs = tie bibtex dvicopy dvitomp dvitype $(etex) gftodvi gftopk \
  gftype $(mfn) $(mfw) mft mpost $(odvicopy) $(odvitype) $(omega) $(otangle) \
  patgen $(pdftex) $(pdfetex) pktogf pktype pltotf pooltype tangle $(tex) \
*************** tftopl $(ttf2afm) vftovp vptovf weave
*** 140,147 ****
  mpware = mpware/dmp mpware/makempx mpware/mpto mpware/newer
  mpware_sources = mpware/dmp.c mpware/makempx.in mpware/mpto.c mpware/newer.c
  
! @OMEGA@omegafonts_programs = omegafonts/omfonts
! @OMEGA@otps_programs = otps/otp2ocp otps/outocp
  
  #  
  default all: programs dumps manpages doc/web2c.info
--- 152,159 ----
  mpware = mpware/dmp mpware/makempx mpware/mpto mpware/newer
  mpware_sources = mpware/dmp.c mpware/makempx.in mpware/mpto.c mpware/newer.c
  
! @HASH_OMEGA@omegafonts_programs = omegafonts/omfonts
! @HASH_OMEGA@otps_programs = otps/otp2ocp otps/outocp
  
  #  
  default all: programs dumps manpages doc/web2c.info
*************** gftopk: gftopk.o
*** 172,183 ****
  	$(kpathsea_link) gftopk.o $(LOADLIBES)
  gftype: gftype.o
  	$(kpathsea_link) gftype.o $(LOADLIBES)
! @MFW@$(mfw): $(mf_o) $(windowlib)
! @MFW@	$(kpathsea_link) $(mf_o) $(windowlink) $(LOADLIBES)
! @MFN@mfnowin.o: mfnowin.c
! @MFN@	$(compile) -DMFNOWIN $<
! @MFN@$(mfn): $(mf_nowin_o) window/trap.o
! @MFN@	$(kpathsea_link) $(mf_nowin_o) window/trap.o $(LOADLIBES)
  mft: mft.o
  	$(kpathsea_link) mft.o $(LOADLIBES)
  mpost: $(mp_o)
--- 184,195 ----
  	$(kpathsea_link) gftopk.o $(LOADLIBES)
  gftype: gftype.o
  	$(kpathsea_link) gftype.o $(LOADLIBES)
! @HASH_MFW@$(mfw): $(mf_o) $(windowlib)
! @HASH_MFW@	$(kpathsea_link) $(mf_o) $(windowlink) $(LOADLIBES)
! @HASH_MFN@mfnowin.o: mfnowin.c
! @HASH_MFN@	$(compile) -DMFNOWIN $<
! @HASH_MFN@$(mfn): $(mf_nowin_o) window/trap.o
! @HASH_MFN@	$(kpathsea_link) $(mf_nowin_o) window/trap.o $(LOADLIBES)
  mft: mft.o
  	$(kpathsea_link) mft.o $(LOADLIBES)
  mpost: $(mp_o)
*************** tex: $(tex_o)
*** 208,213 ****
--- 220,226 ----
  	$(kpathsea_link) $(tex_o) $(socketlibs) $(LOADLIBES)
  tie: tie.o
  	$(kpathsea_link) tie.o $(LOADLIBES)
+ tie-for-build: tie$(for-build).o
  tftopl: tftopl.o
  	$(kpathsea_link) tftopl.o $(LOADLIBES)
  vftovp: vftovp.o
*************** $(mpware): $(mpware_sources)
*** 225,231 ****
  bibtex.p dvicopy.p dvitomp.p dvitype.p etex.p gftopk.p gftodvi.p gftype.p \
    mf.p mft.p mp.p odvicopy.p odvitype.p omega.p otangle.p patgen.p pdfetex.p \
    pdftex.p pktogf.p pktype.p pltotf.p pooltype.p tex.p tftopl.p vftovp.p \
!   vptovf.p weave.p: tangle
  # We need to be explicit for a number of programs because there is a
  # $(srcdir) in the suffix rule.  This also means we can use a different
  # suffix for the change file than .ch, if we want to.
--- 238,244 ----
  bibtex.p dvicopy.p dvitomp.p dvitype.p etex.p gftopk.p gftodvi.p gftype.p \
    mf.p mft.p mp.p odvicopy.p odvitype.p omega.p otangle.p patgen.p pdfetex.p \
    pdftex.p pktogf.p pktype.p pltotf.p pooltype.p tex.p tftopl.p vftovp.p \
!   vptovf.p weave.p: $(TANGLE)
  # We need to be explicit for a number of programs because there is a
  # $(srcdir) in the suffix rule.  This also means we can use a different
  # suffix for the change file than .ch, if we want to.
*************** dvicopy.p: dvicopy.web dvicopy.ch
*** 234,240 ****
  dvitomp.p: dvitomp.web dvitomp.ch
  dvitype.p: dvitype.web dvitype.ch
  etex.p etex.pool: etex.web etex.ch
! 	$(shared_env) ./tangle etex.web etex.ch
  gftodvi.p: gftodvi.web gftodvi.ch
  gftopk.p: gftopk.web gftopk.ch
  gftype.p: gftype.web gftype.ch
--- 247,253 ----
  dvitomp.p: dvitomp.web dvitomp.ch
  dvitype.p: dvitype.web dvitype.ch
  etex.p etex.pool: etex.web etex.ch
! 	$(shared_env) $(TANGLE) etex.web etex.ch
  gftodvi.p: gftodvi.web gftodvi.ch
  gftopk.p: gftopk.web gftopk.ch
  gftype.p: gftype.web gftype.ch
*************** mf.p mf.pool: mf.web mf.ch
*** 242,259 ****
  mp.p mp.pool: mp.web mp.ch
  mft.p: mft.web mft.ch
  odvicopy.p: odvicopy.web odvicopy.ch
! 	$(shared_env) ./tangle odvicopy.web odvicopy.ch
  odvitype.p: odvitype.web odvitype.ch
! 	$(shared_env) ./tangle odvitype.web odvitype.ch
  otangle.p: otangle.web otangle.ch
! 	$(shared_env) ./tangle otangle.web otangle.ch
  omega.p omega.pool: otangle omega.web omega.ch
! 	$(shared_env) ./otangle omega.web omega.ch
  patgen.p: patgen.web patgen.ch
  pdftex.p pdftex.pool: pdftex.web pdftex.ch
! 	$(shared_env) ./tangle pdftex.web pdftex.ch
  pdfetex.p pdfetex.pool: pdfetex.web pdfetex.ch
! 	$(shared_env) ./tangle pdfetex.web pdfetex.ch
  pktogf.p: pktogf.web pktogf.ch
  pktype.p: pktype.web pktype.ch
  pltotf.p: pltotf.web pltotf.ch
--- 255,272 ----
  mp.p mp.pool: mp.web mp.ch
  mft.p: mft.web mft.ch
  odvicopy.p: odvicopy.web odvicopy.ch
! 	$(shared_env) $(TANGLE) odvicopy.web odvicopy.ch
  odvitype.p: odvitype.web odvitype.ch
! 	$(shared_env) $(TANGLE) odvitype.web odvitype.ch
  otangle.p: otangle.web otangle.ch
! 	$(shared_env) $(TANGLE) otangle.web otangle.ch
  omega.p omega.pool: otangle omega.web omega.ch
! 	$(shared_env) $(OTANGLE) omega.web omega.ch
  patgen.p: patgen.web patgen.ch
  pdftex.p pdftex.pool: pdftex.web pdftex.ch
! 	$(shared_env) $(TANGLE) pdftex.web pdftex.ch
  pdfetex.p pdfetex.pool: pdfetex.web pdfetex.ch
! 	$(shared_env) $(TANGLE) pdfetex.web pdfetex.ch
  pktogf.p: pktogf.web pktogf.ch
  pktype.p: pktype.web pktype.ch
  pltotf.p: pltotf.web pltotf.ch
*************** $(web2c_programs) $(programs) tangle tan
*** 322,332 ****
  tangle: tangle.o
  	$(kpathsea_link) tangle.o $(LOADLIBES)
  	$(MAKE) $(common_makeargs) tangleboot.p
  # tangle.p is a special case, since it is needed to compile itself.  We
  # convert and compile the (distributed) tangleboot.p to make a tangle
  # which we use to make the other programs.
! tangle.p: tangleboot tangle.web tangle.ch
! 	$(shared_env) ./tangleboot $(srcdir)/tangle.web $(srcdir)/tangle.ch
  tangle.web:
  	@echo "You seem to be missing tangle.web, perhaps because you" >&2
  	@echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
--- 335,346 ----
  tangle: tangle.o
  	$(kpathsea_link) tangle.o $(LOADLIBES)
  	$(MAKE) $(common_makeargs) tangleboot.p
+ tangle-for-build: tangle$(for-build).o
  # tangle.p is a special case, since it is needed to compile itself.  We
  # convert and compile the (distributed) tangleboot.p to make a tangle
  # which we use to make the other programs.
! tangle.p: tangleboot$(for-build) tangle.web tangle.ch
! 	$(shared_env) ./tangleboot$(for-build) $(srcdir)/tangle.web $(srcdir)/tangle.ch
  tangle.web:
  	@echo "You seem to be missing tangle.web, perhaps because you" >&2
  	@echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
*************** tangle.web:
*** 340,356 ****
  
  tangleboot: tangleboot.o
  	$(kpathsea_link) tangleboot.o $(LOADLIBES)
  tangleboot.c tangleboot.h: stamp-tangle $(web2c_programs) $(web2c_aux)
  	$(web2c) tangleboot
  # tangleboot.p is in the distribution
! stamp-tangle: tangleboot.p
  	date >stamp-tangle
  # This is not run unless tangle.web or tangle.ch is changed.
! # Only try to run ./tangle if it actually exists, otherwise
  # just touch tangleboot.p and build tangle.
  tangleboot.p: tangle.web tangle.ch
! 	if [ -r ./tangle ] || [ -r ./tangle.exe ]; then \
! 	  $(shared_env) ./tangle $(srcdir)/tangle.web $(srcdir)/tangle.ch; \
  	  mv tangle.p tangleboot.p; \
  	else \
  	  touch tangleboot.p; \
--- 354,375 ----
  
  tangleboot: tangleboot.o
  	$(kpathsea_link) tangleboot.o $(LOADLIBES)
+ tangleboot-for-build: tangleboot$(for-build).o
  tangleboot.c tangleboot.h: stamp-tangle $(web2c_programs) $(web2c_aux)
  	$(web2c) tangleboot
  # tangleboot.p is in the distribution
! stamp-tangle: $(srcdir)/tangleboot.p
  	date >stamp-tangle
+ %-for-build.c: %.c
+ 	cp -pv $< $@
+ %-for-build.p: %.p
+ 	cp -pv $< $@
  # This is not run unless tangle.web or tangle.ch is changed.
! # Only try to run $(TANGLE) if it actually exists, otherwise
  # just touch tangleboot.p and build tangle.
  tangleboot.p: tangle.web tangle.ch
! 	if [ -r $(TANGLE) ] || [ -r ./tangle.exe ]; then \
! 	  $(shared_env) $(TANGLE) $(srcdir)/tangle.web $(srcdir)/tangle.ch; \
  	  mv tangle.p tangleboot.p; \
  	else \
  	  touch tangleboot.p; \
*************** $(windowlib): mfd.h $(window_sources)
*** 374,414 ****
  	cd window && $(MAKE) $(window_makeargs)
  window/trap.o: $(srcdir)/window/trap.c
  	cd window && $(MAKE) $(common_makeargs) trap.o
! @PTEX@pdflib_sources = $(srcdir)/pdftexdir/*.c $(srcdir)/pdftexdir/*.cc \
! @PTEX@	$(srcdir)/pdftexdir/*.h
! @PTEX@pdftexdir/libpdf.a: $(pdflib_sources)
! @PTEX@	cd pdftexdir && $(MAKE) $(common_makeargs) libpdf.a
! @PTEX@$(LIBPNGDIR)/libpng.a: $(LIBPNGSRCDIR)/*.c
! @PTEX@	cd $(LIBPNGDIR) && $(MAKE) $(common_makeargs) libpng.a
! @PTEX@$(ZLIBDIR)/libz.a: $(ZLIBSRCDIR)
! @PTEX@	cd $(ZLIBDIR) && $(MAKE) $(common_makeargs) libz.a
! @PTEX@$(LIBTIFFDIR)/libtiff.a: $(LIBTIFFSRCDIR)/*.c
! @PTEX@	cd $(LIBTIFFDIR) && $(MAKE) $(common_makeargs) libtiff.a
! @PTEX@$(LIBXPDFDIR)/xpdf/libxpdf.a: $(LIBXPDFSRCDIR)/xpdf/*.cc \
! @PTEX@	$(LIBXPDFSRCDIR)/xpdf/*.h
! @PTEX@	cd $(LIBXPDFDIR)/xpdf; $(MAKE) $(common_makeargs) libxpdf.a
! @PTEX@$(LIBXPDFDIR)/goo/libGoo.a: $(LIBXPDFSRCDIR)/goo/*.cc \
! @PTEX@	$(LIBXPDFSRCDIR)/goo/*.c $(LIBXPDFSRCDIR)/goo/*.h
! @PTEX@	cd $(LIBXPDFDIR)/goo; $(MAKE) $(common_makeargs) libGoo.a
  
  # The web2c program consists of several executables.
! web2c/fixwrites: web2c/fixwrites.c
! 	cd web2c && $(MAKE) $(common_makeargs) fixwrites
! web2c/splitup: web2c/splitup.c
! 	cd web2c && $(MAKE) $(common_makeargs) splitup
! web2c/web2c: web2c/main.c web2c/web2c.h web2c/web2c.l web2c/web2c.y
! 	cd web2c && $(MAKE) $(common_makeargs) web2c
  
  ac_include ../make/tkpathsea.mk
  
  # 
  # Making dumps.
! @TEX@all_fmts = tex.fmt $(fmts)
! @ETEX@all_efmts = etex.efmt $(efmts)
! @CTEX@all_cfmts = tex.efmt $(cfmts)
! @OMEGA@all_ofmts = omega.fmt $(ofmts)
! @PTEX@all_pdffmts = pdftex.fmt $(pdffmts)
! @PETEX@all_pdfefmts = pdfetex.efmt $(pdfefmts)
  all_formats = $(all_fmts) $(all_efmts) $(all_cfmts) $(all_ofmts) $(all_pdffmts) $(all_pdfefmts)
  all_bases = mf.base $(bases)
  all_mems = mpost.mem $(mems)
--- 393,433 ----
  	cd window && $(MAKE) $(window_makeargs)
  window/trap.o: $(srcdir)/window/trap.c
  	cd window && $(MAKE) $(common_makeargs) trap.o
! @HASH_PTEX@pdflib_sources = $(srcdir)/pdftexdir/*.c $(srcdir)/pdftexdir/*.cc \
! @HASH_PTEX@	$(srcdir)/pdftexdir/*.h
! @HASH_PTEX@pdftexdir/libpdf.a: $(pdflib_sources)
! @HASH_PTEX@	cd pdftexdir && $(MAKE) $(common_makeargs) libpdf.a
! @HASH_PTEX@$(LIBPNGDIR)/libpng.a: $(LIBPNGSRCDIR)/*.c
! @HASH_PTEX@	cd $(LIBPNGDIR) && $(MAKE) $(common_makeargs) libpng.a
! @HASH_PTEX@$(ZLIBDIR)/libz.a: $(ZLIBSRCDIR)
! @HASH_PTEX@	cd $(ZLIBDIR) && $(MAKE) $(common_makeargs) libz.a
! @HASH_PTEX@$(LIBTIFFDIR)/libtiff.a: $(LIBTIFFSRCDIR)/*.c
! @HASH_PTEX@	cd $(LIBTIFFDIR) && $(MAKE) $(common_makeargs) libtiff.a
! @HASH_PTEX@$(LIBXPDFDIR)/xpdf/libxpdf.a: $(LIBXPDFSRCDIR)/xpdf/*.cc \
! @HASH_PTEX@	$(LIBXPDFSRCDIR)/xpdf/*.h
! @HASH_PTEX@	cd $(LIBXPDFDIR)/xpdf; $(MAKE) $(common_makeargs) libxpdf.a
! @HASH_PTEX@$(LIBXPDFDIR)/goo/libGoo.a: $(LIBXPDFSRCDIR)/goo/*.cc \
! @HASH_PTEX@	$(LIBXPDFSRCDIR)/goo/*.c $(LIBXPDFSRCDIR)/goo/*.h
! @HASH_PTEX@	cd $(LIBXPDFDIR)/goo; $(MAKE) $(common_makeargs) libGoo.a
  
  # The web2c program consists of several executables.
! web2c/fixwrites$(for-build): web2c/fixwrites.c
! 	cd web2c && $(MAKE) $(common_makeargs) fixwrites$(for-build)
! web2c/splitup$(for-build): web2c/splitup.c
! 	cd web2c && $(MAKE) $(common_makeargs) splitup$(for-build)
! web2c/web2c$(for-build): web2c/main.c web2c/web2c.h web2c/web2c.l web2c/web2c.y
! 	cd web2c && $(MAKE) $(common_makeargs) web2c$(for-build)
  
  ac_include ../make/tkpathsea.mk
  
  # 
  # Making dumps.
! @HASH_TEX@all_fmts = tex.fmt $(fmts)
! @HASH_ETEX@all_efmts = etex.efmt $(efmts)
! @HASH_CTEX@all_cfmts = tex.efmt $(cfmts)
! @HASH_OMEGA@all_ofmts = omega.fmt $(ofmts)
! @HASH_PTEX@all_pdffmts = pdftex.fmt $(pdffmts)
! @HASH_PETEX@all_pdfefmts = pdfetex.efmt $(pdfefmts)
  all_formats = $(all_fmts) $(all_efmts) $(all_cfmts) $(all_ofmts) $(all_pdffmts) $(all_pdfefmts)
  all_bases = mf.base $(bases)
  all_mems = mpost.mem $(mems)
*************** mems: $(all_mems)
*** 427,501 ****
  
  tex.fmt: tex
  	$(dumpenv) $(MAKE) progname=tex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./tex --fmt=tex --ini \\input plain \\dump </dev/null
  
  latex.fmt: tex
  	$(dumpenv) $(MAKE) progname=latex files="latex.ltx" prereq-check
! 	$(dumpenv) ./tex --progname=latex --ini \\input latex.ltx </dev/null
  
  etex.efmt: etex
  	$(dumpenv) $(MAKE) progname=etex files="etex.src plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./etex --efmt=etex --ini \*\\input etex.src \\dump </dev/null
  
  elatex.efmt: etex
  	$(dumpenv) $(MAKE) progname=elatex files="latex.ltx" prereq-check
! 	$(dumpenv) ./etex --efmt=elatex --ini \*\\input latex.ltx </dev/null
  
  tex.efmt: etex
  	$(dumpenv) $(MAKE) progname=tex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./etex --efmt=tex --ini \\input plain \\dump </dev/null
  
  latex.efmt: etex
  	$(dumpenv) $(MAKE) progname=latex files="latex.ltx" prereq-check
! 	$(dumpenv) ./etex --progname=latex --ini \\input latex.ltx </dev/null
  
  omega.fmt: omega
  	$(dumpenv) $(MAKE) progname=omega files="omega.tex" prereq-check
! 	$(dumpenv) ./omega --ini \\input omega.tex \\dump </dev/null
  
  lambda.fmt: omega
  	$(dumpenv) $(MAKE) progname=lambda files="lambda.tex" prereq-check
! 	$(dumpenv) ./omega --ini --progname=lambda \\input lambda.tex </dev/null
  
  pdftex.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdftex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./pdftex --fmt=pdftex --ini \\pdfoutput=1 \\input plain \\dump </dev/null
  
  pdflatex.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdflatex files="latex.ltx" prereq-check
! 	$(dumpenv) ./pdftex --fmt=pdflatex --ini \\pdfoutput=1 \\input latex.ltx </dev/null
  
  pdftexinfo.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdftexinfo files="pdftexinfo.ini" prereq-check
! 	$(dumpenv) ./pdftex --progname=pdftexinfo --ini pdftexinfo.ini </dev/null
  
  pdfetex.efmt: pdfetex
  	$(dumpenv) $(MAKE) progname=pdfetex files="etex.src plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./pdfetex --efmt=pdfetex --ini \*\\pdfoutput=1\\input etex.src \\dump </dev/null
  
  pdfelatex.efmt: pdfetex
  	$(dumpenv) $(MAKE) progname=pdfelatex files="latex.ltx" prereq-check
! 	$(dumpenv) ./pdfetex --efmt=pdfelatex --ini \*\\pdfoutput=1\\input latex.ltx </dev/null
  
  mltex.fmt: tex
  	$(dumpenv) $(MAKE) progname=mltex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) ./tex --mltex --fmt=mltex --ini \\input plain \\dump </dev/null
  
  mllatex.fmt: tex
  	$(dumpenv) $(MAKE) progname=mllatex files="latex.ltx" prereq-check
! 	$(dumpenv) ./tex --mltex --fmt=mllatex --ini \\input latex.ltx </dev/null
  
  mf.base: mf
  	$(dumpenv) $(MAKE) progname=mf files="plain.mf cmr10.mf $(localmodes).mf" prereq-check
! 	$(dumpenv) ./mf --base=mf --ini \\input plain input $(localmodes) dump </dev/null
  
  mpost.mem: mpost
  	$(dumpenv) $(MAKE) progname=mpost files=plain.mp prereq-check
! 	$(dumpenv) ./mpost --mem=mpost --ini \\input plain dump </dev/null
  
  # This is meant to be called recursively, with $(files) set.
  prereq-check: $(kpathsea_dir)/kpsewhich
! 	$(kpathsea_dir)/kpsewhich --progname=$(progname) $(files) >/dev/null || $(MAKE) prereq-lose >/dev/null
  
  prereq-lose:
  	@echo "You seem to be missing input files necessary to make the" >&2
--- 446,520 ----
  
  tex.fmt: tex
  	$(dumpenv) $(MAKE) progname=tex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(TEX) --fmt=tex --ini \\input plain \\dump </dev/null
  
  latex.fmt: tex
  	$(dumpenv) $(MAKE) progname=latex files="latex.ltx" prereq-check
! 	$(dumpenv) $(TEX) --progname=latex --ini \\input latex.ltx </dev/null
  
  etex.efmt: etex
  	$(dumpenv) $(MAKE) progname=etex files="etex.src plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(ETEX) --efmt=etex --ini \*\\input etex.src \\dump </dev/null
  
  elatex.efmt: etex
  	$(dumpenv) $(MAKE) progname=elatex files="latex.ltx" prereq-check
! 	$(dumpenv) $(ETEX) --efmt=elatex --ini \*\\input latex.ltx </dev/null
  
  tex.efmt: etex
  	$(dumpenv) $(MAKE) progname=tex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(ETEX) --efmt=tex --ini \\input plain \\dump </dev/null
  
  latex.efmt: etex
  	$(dumpenv) $(MAKE) progname=latex files="latex.ltx" prereq-check
! 	$(dumpenv) $(ETEX) --progname=latex --ini \\input latex.ltx </dev/null
  
  omega.fmt: omega
  	$(dumpenv) $(MAKE) progname=omega files="omega.tex" prereq-check
! 	$(dumpenv) $(OMEGA) --ini \\input omega.tex \\dump </dev/null
  
  lambda.fmt: omega
  	$(dumpenv) $(MAKE) progname=lambda files="lambda.tex" prereq-check
! 	$(dumpenv) $(OMEGA) --ini --progname=lambda \\input lambda.tex </dev/null
  
  pdftex.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdftex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(PDFTEX) --fmt=pdftex --ini \\pdfoutput=1 \\input plain \\dump </dev/null
  
  pdflatex.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdflatex files="latex.ltx" prereq-check
! 	$(dumpenv) $(PDFTEX) --fmt=pdflatex --ini \\pdfoutput=1 \\input latex.ltx </dev/null
  
  pdftexinfo.fmt: pdftex
  	$(dumpenv) $(MAKE) progname=pdftexinfo files="pdftexinfo.ini" prereq-check
! 	$(dumpenv) $(PDFTEX) --progname=pdftexinfo --ini pdftexinfo.ini </dev/null
  
  pdfetex.efmt: pdfetex
  	$(dumpenv) $(MAKE) progname=pdfetex files="etex.src plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(PDFETEX) --efmt=pdfetex --ini \*\\pdfoutput=1\\input etex.src \\dump </dev/null
  
  pdfelatex.efmt: pdfetex
  	$(dumpenv) $(MAKE) progname=pdfelatex files="latex.ltx" prereq-check
! 	$(dumpenv) $(PDFETEX) --efmt=pdfelatex --ini \*\\pdfoutput=1\\input latex.ltx </dev/null
  
  mltex.fmt: tex
  	$(dumpenv) $(MAKE) progname=mltex files="plain.tex cmr10.tfm" prereq-check
! 	$(dumpenv) $(TEX) --mltex --fmt=mltex --ini \\input plain \\dump </dev/null
  
  mllatex.fmt: tex
  	$(dumpenv) $(MAKE) progname=mllatex files="latex.ltx" prereq-check
! 	$(dumpenv) $(TEX) --mltex --fmt=mllatex --ini \\input latex.ltx </dev/null
  
  mf.base: mf
  	$(dumpenv) $(MAKE) progname=mf files="plain.mf cmr10.mf $(localmodes).mf" prereq-check
! 	$(dumpenv) $(MF) --base=mf --ini \\input plain input $(localmodes) dump </dev/null
  
  mpost.mem: mpost
  	$(dumpenv) $(MAKE) progname=mpost files=plain.mp prereq-check
! 	$(dumpenv) $(MPOST) --mem=mpost --ini \\input plain dump </dev/null
  
  # This is meant to be called recursively, with $(files) set.
  prereq-check: $(kpathsea_dir)/kpsewhich
! 	$(KPSEWHICH) --progname=$(progname) $(files) >/dev/null || $(MAKE) prereq-lose >/dev/null
  
  prereq-lose:
  	@echo "You seem to be missing input files necessary to make the" >&2
*************** prereq-lose:
*** 513,527 ****
  $(kpathsea_dir)/kpsewhich: $(kpathsea)
  
  amstex.fmt: tex
! 	$(dumpenv) ./tex --progname=amstex --ini amstex.ini </dev/null
  
  # Texinfo changes the escape character from `\' to `@'.
  texinfo.fmt: tex.fmt
! 	$(dumpenv) ./tex --progname=texinfo --ini texinfo @dump </dev/null
  
  eplain.fmt: tex.fmt
  	touch eplain.aux # Makes cross-reference warnings work right.
! 	$(dumpenv) ./tex --progname=eplain --ini \&./tex eplain \\dump </dev/null
  
  # 
  install: install-exec install-data
--- 532,546 ----
  $(kpathsea_dir)/kpsewhich: $(kpathsea)
  
  amstex.fmt: tex
! 	$(dumpenv) $(TEX) --progname=amstex --ini amstex.ini </dev/null
  
  # Texinfo changes the escape character from `\' to `@'.
  texinfo.fmt: tex.fmt
! 	$(dumpenv) $(TEX) --progname=texinfo --ini texinfo @dump </dev/null
  
  eplain.fmt: tex.fmt
  	touch eplain.aux # Makes cross-reference warnings work right.
! 	$(dumpenv) $(TEX) --progname=eplain --ini \&./tex eplain \\dump </dev/null
  
  # 
  install: install-exec install-data
*************** install-programs: $(programs)
*** 534,557 ****
  	  $(mfpooldir) $(mppooldir)
  	cd mpware && $(MAKE) $(install_makeargs) install-exec
  	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $(bindir) $$p; done
! @OMEGA@	cd omegafonts && $(MAKE) $(install_makeargs) install-programs install-links
! @OMEGA@	cd otps && $(MAKE) $(install_makeargs) install-programs
  
  # The links to {mf,mp,tex} for each format and for {ini,vir}{mf,mp,tex},
  # plus the equivalents for e-TeX, Omega, pdfTeX, and pdfeTeX.
  install-links: install-programs
! @TEX@	cd $(bindir) && (rm -f initex virtex; \
! @TEX@	  $(LN) tex initex; $(LN) tex virtex)
! @ETEX@	cd $(bindir) && (rm -f einitex evirtex; \
! @ETEX@	  $(LN) etex einitex; $(LN) etex evirtex)
! @CTEX@	cd $(bindir) && (rm -f tex initex virtex; \
! @CTEX@	  $(LN) etex tex; $(LN) etex initex; $(LN) etex virtex)
! @OMEGA@	cd $(bindir) && (rm -f iniomega viromega; \
! @OMEGA@	  $(LN) omega iniomega; $(LN) omega viromega)
! @PTEX@	cd $(bindir) && (rm -f pdfinitex pdfvirtex; \
! @PTEX@	  $(LN) pdftex pdfinitex; $(LN) pdftex pdfvirtex)
! @PETEX@	cd $(bindir) && (rm -f pdfeinitex pdfevirtex; \
! @PETEX@	  $(LN) pdfetex pdfeinitex; $(LN) pdfetex pdfevirtex)
  	cd $(bindir) && (rm -f inimf virmf; \
  	  $(LN) mf inimf; $(LN) mf virmf)
  	cd $(bindir) && (rm -f inimpost virmpost; \
--- 553,576 ----
  	  $(mfpooldir) $(mppooldir)
  	cd mpware && $(MAKE) $(install_makeargs) install-exec
  	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $(bindir) $$p; done
! @HASH_OMEGA@	cd omegafonts && $(MAKE) $(install_makeargs) install-programs install-links
! @HASH_OMEGA@	cd otps && $(MAKE) $(install_makeargs) install-programs
  
  # The links to {mf,mp,tex} for each format and for {ini,vir}{mf,mp,tex},
  # plus the equivalents for e-TeX, Omega, pdfTeX, and pdfeTeX.
  install-links: install-programs
! @HASH_TEX@	cd $(bindir) && (rm -f initex virtex; \
! @HASH_TEX@	  $(LN) tex initex; $(LN) tex virtex)
! @HASH_ETEX@	cd $(bindir) && (rm -f einitex evirtex; \
! @HASH_ETEX@	  $(LN) etex einitex; $(LN) etex evirtex)
! @HASH_CTEX@	cd $(bindir) && (rm -f tex initex virtex; \
! @HASH_CTEX@	  $(LN) etex tex; $(LN) etex initex; $(LN) etex virtex)
! @HASH_OMEGA@	cd $(bindir) && (rm -f iniomega viromega; \
! @HASH_OMEGA@	  $(LN) omega iniomega; $(LN) omega viromega)
! @HASH_PTEX@	cd $(bindir) && (rm -f pdfinitex pdfvirtex; \
! @HASH_PTEX@	  $(LN) pdftex pdfinitex; $(LN) pdftex pdfvirtex)
! @HASH_PETEX@	cd $(bindir) && (rm -f pdfeinitex pdfevirtex; \
! @HASH_PETEX@	  $(LN) pdfetex pdfeinitex; $(LN) pdfetex pdfevirtex)
  	cd $(bindir) && (rm -f inimf virmf; \
  	  $(LN) mf inimf; $(LN) mf virmf)
  	cd $(bindir) && (rm -f inimpost virmpost; \
*************** install-fmts: $(all_formats)
*** 587,594 ****
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(fmtdir)
  	all_formats="$(all_formats)"; \
  	  for f in $$all_formats; do $(INSTALL_DATA) $$f $(fmtdir)/$$f; done
! @TEX@	cd $(fmtdir) && (rm -f plain.fmt; $(LN) tex.fmt plain.fmt)
! @CTEX@	cd $(fmtdir) && (rm -f plain.efmt; $(LN) tex.efmt plain.efmt)
  
  install-bases: $(all_bases)
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(basedir)
--- 606,613 ----
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(fmtdir)
  	all_formats="$(all_formats)"; \
  	  for f in $$all_formats; do $(INSTALL_DATA) $$f $(fmtdir)/$$f; done
! @HASH_TEX@	cd $(fmtdir) && (rm -f plain.fmt; $(LN) tex.fmt plain.fmt)
! @HASH_CTEX@	cd $(fmtdir) && (rm -f plain.efmt; $(LN) tex.efmt plain.efmt)
  
  install-bases: $(all_bases)
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(basedir)
*************** install-mems: $(all_mems)
*** 605,615 ****
  # Auxiliary files.
  install-data::
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(texpooldir) $(mfpooldir) $(mppooldir) $(web2cdir) $(fontnamedir)
! @TEX@	$(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool
! @ETEX@	$(INSTALL_DATA) etex.pool $(texpooldir)/etex.pool
! @OMEGA@	$(INSTALL_DATA) omega.pool $(texpooldir)/omega.pool
! @PTEX@	$(INSTALL_DATA) pdftex.pool $(texpooldir)/pdftex.pool
! @PETEX@	$(INSTALL_DATA) pdfetex.pool $(texpooldir)/pdfetex.pool
  	$(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
  	$(INSTALL_DATA) mp.pool $(mppooldir)/mp.pool
  	cd $(srcdir)/share && for f in *.tcx; do \
--- 624,634 ----
  # Auxiliary files.
  install-data::
  	$(SHELL) $(top_srcdir)/../mkinstalldirs $(texpooldir) $(mfpooldir) $(mppooldir) $(web2cdir) $(fontnamedir)
! @HASH_TEX@	$(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool
! @HASH_ETEX@	$(INSTALL_DATA) etex.pool $(texpooldir)/etex.pool
! @HASH_OMEGA@	$(INSTALL_DATA) omega.pool $(texpooldir)/omega.pool
! @HASH_PTEX@	$(INSTALL_DATA) pdftex.pool $(texpooldir)/pdftex.pool
! @HASH_PETEX@	$(INSTALL_DATA) pdfetex.pool $(texpooldir)/pdfetex.pool
  	$(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
  	$(INSTALL_DATA) mp.pool $(mppooldir)/mp.pool
  	cd $(srcdir)/share && for f in *.tcx; do \
*************** ac_include ../make/config.mk
*** 799,814 ****
  
  # 
  # Testing, including triptrap. The `x' filenames are for output.
! @TEX@tex_check = tex-check
! @ETEX@etex_check = etex-check
  check: bibtex-check dvicopy-check dvitomp-check dvitype-check \
         $(etex_check) gftodvi-check gftopk-check gftype-check \
         mf-check mft-check mpost-check patgen-check pktogf-check \
         pktype-check pltotf-check pooltype-check $(tex_check) tftopl-check \
         vftovp-check vptovf-check weave-check
  
! @TEX@trip = trip
! @ETEX@etrip = etrip
  triptrap: $(trip) trap mptrap $(etrip)
  testdir = $(srcdir)/triptrap
  testenv = TEXMFCNF=$(testdir)
--- 818,833 ----
  
  # 
  # Testing, including triptrap. The `x' filenames are for output.
! @HASH_TEX@tex_check = tex-check
! @HASH_ETEX@etex_check = etex-check
  check: bibtex-check dvicopy-check dvitomp-check dvitype-check \
         $(etex_check) gftodvi-check gftopk-check gftype-check \
         mf-check mft-check mpost-check patgen-check pktogf-check \
         pktype-check pltotf-check pooltype-check $(tex_check) tftopl-check \
         vftovp-check vptovf-check weave-check
  
! @HASH_TEX@trip = trip
! @HASH_ETEX@etrip = etrip
  triptrap: $(trip) trap mptrap $(etrip)
  testdir = $(srcdir)/triptrap
  testenv = TEXMFCNF=$(testdir)
*************** pltotf-check: pltotf
*** 947,954 ****
  
  # When tex.pool has not been generated we pooltype etex.pool
  pooltype-check: pooltype
! @TEX@	./pooltype tex.pool >tests/xtexpool.typ
! @CTEX@	./pooltype etex.pool >tests/xtexpool.typ
  
  # No need for tangle-check, since we run it to make everything else.
  
--- 966,973 ----
  
  # When tex.pool has not been generated we pooltype etex.pool
  pooltype-check: pooltype
! @HASH_TEX@	./pooltype tex.pool >tests/xtexpool.typ
! @HASH_CTEX@	./pooltype etex.pool >tests/xtexpool.typ
  
  # No need for tangle-check, since we run it to make everything else.
  
*************** installcheck:
*** 994,1003 ****
  
  # 
  # Cleaning.
! @PTEX@pdftexdir = pdftexdir
! @PETEX@pdfetexdir = pdfetexdir
! @OMEGA@omegafonts = omegafonts
! @OMEGA@otps = otps
  all_subdirs = doc lib man mpware web2c window $(omegafonts) $(otps) $(pdftexdir) $(pdfetexdir)
  
  # Having a multiple-target rule with the subdir loop fails because of
--- 1013,1022 ----
  
  # 
  # Cleaning.
! @HASH_PTEX@pdftexdir = pdftexdir
! @HASH_PETEX@pdfetexdir = pdfetexdir
! @HASH_OMEGA@omegafonts = omegafonts
! @HASH_OMEGA@otps = otps
  all_subdirs = doc lib man mpware web2c window $(omegafonts) $(otps) $(pdftexdir) $(pdfetexdir)
  
  # Having a multiple-target rule with the subdir loop fails because of
*************** distclean::
*** 1047,1053 ****
  	rm -f odvicopy.ch  odvitype.ch  otangle.ch 
  # And some miscellaneous files
  	rm -f etrip.tex omega.c omegamem.h
! @PTEX@	rm -f macnames.c ttf2afm.c
  	rm -f fmtutil.cnf
  
  extraclean::
--- 1066,1072 ----
  	rm -f odvicopy.ch  odvitype.ch  otangle.ch 
  # And some miscellaneous files
  	rm -f etrip.tex omega.c omegamem.h
! @HASH_PTEX@	rm -f macnames.c ttf2afm.c
  	rm -f fmtutil.cnf
  
  extraclean::
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/web2c/configure.in ./texk/web2c/configure.in
*** ../xweb2c-7.3.7-cygwin/texk/web2c/configure.in	Sat Sep 28 12:44:05 2002
--- ./texk/web2c/configure.in	Sat Sep 28 13:08:27 2002
*************** test "x$with_x" = xno && with_x_toolkit=
*** 81,86 ****
--- 81,87 ----
  : ${with_x=no} # tell PATH_XTRA no X by default, if not specified.
  
  sinclude(withenable.ac)
+ sinclude(../cross.ac)
  sinclude(../kpathsea/withenable.ac)
  sinclude(../../libs/zlib/withenable.ac)
  sinclude(../../libs/libpng/withenable.ac)
*************** sinclude(../../libs/xpdf/libxpdf.ac)
*** 97,115 ****
  : ${with_mfw=mf} # Default.
  if test "x$with_mfw" = xyes; then
    # --with-mfw=yes, build separate mfw with window support.
!   MFW=
!   MFN=
  elif test "x$with_mfw" = xmf; then
    # --with-mfw=mf, build mf with selected window support.
!   MFW=
!   MFN='#N#'
  else
    # --with-mfw=no, do not include window support.
!   MFW='#W#'
!   MFN=
  fi
! AC_SUBST(MFN)
! AC_SUBST(MFW)
  
  # For Omega.
  if test -d $srcdir/omegadir; then
--- 98,116 ----
  : ${with_mfw=mf} # Default.
  if test "x$with_mfw" = xyes; then
    # --with-mfw=yes, build separate mfw with window support.
!   HASH_MFW=
!   HASH_MFN=
  elif test "x$with_mfw" = xmf; then
    # --with-mfw=mf, build mf with selected window support.
!   HASH_MFW=
!   HASH_MFN='#N#'
  else
    # --with-mfw=no, do not include window support.
!   HASH_MFW='#W#'
!   HASH_MFN=
  fi
! AC_SUBST(HASH_MFN)
! AC_SUBST(HASH_MFW)
  
  # For Omega.
  if test -d $srcdir/omegadir; then
*************** else
*** 121,133 ****
    with_omega=no
  fi
  if test "x$with_omega" = xyes; then
!   OMEGA=
    omegafontsmakefile=omegafonts/Makefile
    otpsmakefile=otps/Makefile
  else
!   OMEGA='#O#'
  fi
! AC_SUBST(OMEGA)
  
  
  # For pdfTeX.
--- 122,134 ----
    with_omega=no
  fi
  if test "x$with_omega" = xyes; then
!   HASH_OMEGA=
    omegafontsmakefile=omegafonts/Makefile
    otpsmakefile=otps/Makefile
  else
!   HASH_OMEGA='#O#'
  fi
! AC_SUBST(HASH_OMEGA)
  
  
  # For pdfTeX.
*************** if test "x$with_pdftex" = xyes || test "
*** 173,190 ****
  fi
  
  if test "x$with_pdftex" = xyes; then
!   PTEX=
  else
!   PTEX='#P#'
  fi
! AC_SUBST(PTEX)
  
  if test "x$with_pdfetex" = xyes; then
!   PETEX=
  else
!   PETEX='#P#'
  fi
! AC_SUBST(PETEX)
  
  # For e-TeX, three choices: no, yes, and tex.  In the latter case, we
  # have to comment out the normal TeX build (TEX), as well as enable the
--- 174,191 ----
  fi
  
  if test "x$with_pdftex" = xyes; then
!   HASH_PTEX=
  else
!   HASH_PTEX='#P#'
  fi
! AC_SUBST(HASH_PTEX)
  
  if test "x$with_pdfetex" = xyes; then
!   HASH_PETEX=
  else
!   HASH_PETEX='#P#'
  fi
! AC_SUBST(HASH_PETEX)
  
  # For e-TeX, three choices: no, yes, and tex.  In the latter case, we
  # have to comment out the normal TeX build (TEX), as well as enable the
*************** else
*** 200,223 ****
  fi
  if test "x$with_etex" = xtex; then
    TEXBIN=etex
!   CTEX=
!   ETEX=
!   TEX='#T#'
  elif test "x$with_etex" = xyes; then
    TEXBIN=tex
!   CTEX='#C#'
!   ETEX=
!   TEX=
  else
    TEXBIN=tex
!   CTEX='#C#'
!   ETEX='#E#'
!   TEX=
  fi
  AC_SUBST(TEXBIN)
! AC_SUBST(CTEX)
! AC_SUBST(ETEX)
! AC_SUBST(TEX)
  
  
  # --with-x* options: Distinguish no X at all, no toolkit, or toolkit.
--- 201,224 ----
  fi
  if test "x$with_etex" = xtex; then
    TEXBIN=etex
!   HASH_CTEX=
!   HASH_ETEX=
!   HASH_TEX='#T#'
  elif test "x$with_etex" = xyes; then
    TEXBIN=tex
!   HASH_CTEX='#C#'
!   HASH_ETEX=
!   HASH_TEX=
  else
    TEXBIN=tex
!   HASH_CTEX='#C#'
!   HASH_ETEX='#E#'
!   HASH_TEX=
  fi
  AC_SUBST(TEXBIN)
! AC_SUBST(HASH_CTEX)
! AC_SUBST(HASH_ETEX)
! AC_SUBST(HASH_TEX)
  
  
  # --with-x* options: Distinguish no X at all, no toolkit, or toolkit.
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/web2c/lib/Makefile.in ./texk/web2c/lib/Makefile.in
*** ../xweb2c-7.3.7-cygwin/texk/web2c/lib/Makefile.in	Tue Jan 12 20:11:41 1999
--- ./texk/web2c/lib/Makefile.in	Sat Sep 28 12:00:39 2002
*************** objects = alloca.o basechsuffix.o charto
*** 13,19 ****
    eofeoln.o fprintreal.o inputint.o input2int.o main.o \
    openclose.o printversion.o uexit.o usage.o version.o zround.o
  
! default all: $(library).a
  $(library).a: $(objects)
  	rm -f $@
  	$(AR) $(ARFLAGS) $@ $(objects)
--- 13,19 ----
    eofeoln.o fprintreal.o inputint.o input2int.o main.o \
    openclose.o printversion.o uexit.o usage.o version.o zround.o
  
! default all: $(library)$(for-build).a $(library).a
  $(library).a: $(objects)
  	rm -f $@
  	$(AR) $(ARFLAGS) $@ $(objects)
*************** $(library).a: $(objects)
*** 24,29 ****
--- 24,37 ----
  alloca.o: alloca.c 
  	$(CC) $(CFLAGS) -c $(srcdir)/alloca.c
  
+ alloca-for-build.o: alloca.c 
+ 	$(CC_FOR_BUILD $(CFLAGS) -c $(srcdir)/alloca.c
+ 	$(MAKE) for-build= CC="$(CC_FOR_BUILD)" lib.a
+ 	for i in $(objects); do mv $$i `basename $$i .o`-for-build.o; done
+ 	mv lib.a lib-for-build.a
+ 
+ lib-for-build.a: alloca-for-build.o
+ 
  Makefile: Makefile.in ../config.status
  	cd .. && $(SHELL) config.status
  
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/web2c/web2c/Makefile.in ./texk/web2c/web2c/Makefile.in
*** ../xweb2c-7.3.7-cygwin/texk/web2c/web2c/Makefile.in	Tue Jan 12 20:12:18 1999
--- ./texk/web2c/web2c/Makefile.in	Sat Sep 28 12:00:46 2002
*************** LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
*** 11,16 ****
--- 11,17 ----
  YACC = @YACC@
  
  proglib = ../lib/lib.a
+ proglib-for-build = ../lib/lib-for-build.a
  programs = web2c fixwrites splitup
  
  web2c_objects = main.o y_tab.o $(LEX_OUTPUT_ROOT).o
*************** web2c: $(web2c_objects)
*** 20,31 ****
--- 21,34 ----
  
  # We use y_tab.* for the sake of MS-DOS.
  main.o: main.c y_tab.h
+ main-for-build.o: main.c y_tab.h
  y_tab.c y_tab.h: web2c.y
  	@echo Expect one shift/reduce conflict.
  	$(YACC) -d -v $(srcdir)/web2c.y
  	-test -f y.tab.c && mv -f y.tab.c y_tab.c
  	-test -f y.tab.h && mv -f y.tab.h y_tab.h
  $(LEX_OUTPUT_ROOT).o: y_tab.h
+ $(LEX_OUTPUT_ROOT)-for-build.o: y_tab.h
  $(LEX_OUTPUT_ROOT).c: web2c.l
  	$(LEX) $(srcdir)/web2c.l
  
*************** fixwrites: fixwrites.o
*** 33,41 ****
  	$(kpathsea_link) fixwrites.o $(LOADLIBES)
  splitup: splitup.o
  	$(kpathsea_link) splitup.o $(LOADLIBES)
! regfix: regfix.o
  	$(kpathsea_link) regfix.o $(LOADLIBES)
  
  $(programs): $(proglib) $(kpathsea)
  
  @MAINT@# It's really not worth srcdir etc. here.
--- 36,49 ----
  	$(kpathsea_link) fixwrites.o $(LOADLIBES)
  splitup: splitup.o
  	$(kpathsea_link) splitup.o $(LOADLIBES)
! regfix: rexfix.o
  	$(kpathsea_link) regfix.o $(LOADLIBES)
  
+ fixwrites-for-build: fixwrites$(for-build).o
+ splitup-for-build: splitup$(for-build).o
+ regfix-for-build: regfix$(for-build).o
+ 
+ 
  $(programs): $(proglib) $(kpathsea)
  
  @MAINT@# It's really not worth srcdir etc. here.
*************** clean::
*** 57,59 ****
--- 65,79 ----
  
  ac_include ../make/rdepend.mk
  ac_include web2c/depend.mk
+ 
+ 
+ web2c_objects-for-build = main$(for-build).o y_tab$(for-build).o $(LEX_OUTPUT_ROOT)$(for-build).o
+ 
+ web2c-for-build: $(web2c_objects-for-build)
+ 	@rm -f $@
+ 	if [ "$(cross_compiling)" = "yes" ]; then \
+ 		$(CCLD_FOR_BUILD) -o $@ $(web2c_objects-for-build) $(LEXLIB) -lkpathsea; \
+ 	else \
+ 		$(kpathsea_link) $(web2c_objects) $(LEXLIB) $(LOADLIBES); \
+ 	fi
+ 
diff -p'crNx*~' -xcygwin -xCYGWIN-PATCHES -x.bash_mknetrel -xconfigure -xautom4te.cache -xstrip -xautogen.sh ../xweb2c-7.3.7-cygwin/texk/web2c/web2c/convert ./texk/web2c/web2c/convert
*** ../xweb2c-7.3.7-cygwin/texk/web2c/web2c/convert	Tue Feb  9 22:06:59 1999
--- ./texk/web2c/web2c/convert	Sat Sep 28 12:00:46 2002
*************** postcmd=
*** 44,49 ****
--- 44,57 ----
  output="> $cfile"
  output_files="$cfile $basefile.h"
  
+ fixwrites='./web2c/fixwrites'
+ splitup='./web2c/splitup'
+ web2c='./web2c/web2c'
+ 
+ f=./web2c/fixwrites-for-build && test -x $f && fixwrites=$f
+ f=./web2c/splitup-for-build && test -x $f && splitup=$f
+ f=./web2c/web2c-for-build && test -x $f && web2c=$f
+ 
  case $basefile in
    bibtex)
      midcmd="| sed -f $srcdir/web2c/cvtbib.sed";;
*************** case $basefile in
*** 53,59 ****
      web2c_options="-m -c${basefile}coerce"
      hfile=texmfmp.h
      midcmd="| sed -f $srcdir/web2c/cvtmf2.sed"
!     postcmd="| ./web2c/splitup $basefile"
      cfile=${basefile}2.c # last output file, or thereabouts
      output=
      output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
--- 61,67 ----
      web2c_options="-m -c${basefile}coerce"
      hfile=texmfmp.h
      midcmd="| sed -f $srcdir/web2c/cvtmf2.sed"
!     postcmd="| $splitup $basefile"
      cfile=${basefile}2.c # last output file, or thereabouts
      output=
      output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
*************** ${basefile}coerce.h"
*** 68,74 ****
      web2c_options="-t -c${basefile}coerce"
      hfile=texmfmp.h
      fixwrites_options=-t
!     postcmd="| ./web2c/splitup ${basefile}"
      cfile=${basefile}2.c # last output file, or thereabouts
      output=
      output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
--- 76,82 ----
      web2c_options="-t -c${basefile}coerce"
      hfile=texmfmp.h
      fixwrites_options=-t
!     postcmd="| $splitup ${basefile}"
      cfile=${basefile}2.c # last output file, or thereabouts
      output=
      output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
*************** esac
*** 79,87 ****
  # Do it.
  eval "cat $srcdir/web2c/common.defines $more_defines $pascalfile \
    $precmd \
!   | ./web2c/web2c -h$hfile $web2c_options \
    $midcmd \
!   | ./web2c/fixwrites $fixwrites_options $basefile \
    $postcmd \
    $output"
  
--- 87,95 ----
  # Do it.
  eval "cat $srcdir/web2c/common.defines $more_defines $pascalfile \
    $precmd \
!   | $web2c -h$hfile $web2c_options \
    $midcmd \
!   | $fixwrites $fixwrites_options $basefile \
    $postcmd \
    $output"
  

--=-=-=


    
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

--=-=-=--