*** ylwrap	1999/05/03 07:28:40
--- ylwrap	2000/02/23 19:20:37
***************
*** 1,7 ****
  #! /bin/sh
  # ylwrap - wrapper for lex/yacc invocations.
! # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
  # Written by Tom Tromey <tromey@cygnus.com>.
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,7 ----
  #! /bin/sh
  # ylwrap - wrapper for lex/yacc invocations.
! # Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
  # Written by Tom Tromey <tromey@cygnus.com>.
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
***************
*** 30,46 ****
  prog="$1"
  shift
  # Make any relative path in $prog absolute.
  case "$prog" in
!  /* | [A-Za-z]:\\*) ;;
   */*) prog="`pwd`/$prog" ;;
  esac
  
  # The input.
  input="$1"
  shift
  case "$input" in
!  /* | [A-Za-z]:\\*)
      # Absolute path; do nothing.
      ;;
   *)
      # Relative path.  Make it absolute.  Why?  Because otherwise any
--- 30,46 ----
  prog="$1"
  shift
  # Make any relative path in $prog absolute.
  case "$prog" in
!  /* | [A-Za-z]:*) ;;
   */*) prog="`pwd`/$prog" ;;
  esac
  
  # The input.
  input="$1"
  shift
  case "$input" in
!  /* | [A-Za-z]:*)
      # Absolute path; do nothing.
      ;;
   *)
      # Relative path.  Make it absolute.  Why?  Because otherwise any
*************** trap "cd `pwd`; rm -rf $dirname > /dev/n
*** 74,82 ****
  mkdir $dirname || exit 1
  
  cd $dirname
  case "$input" in
!  /* | [A-Za-z]:\\*)
      # Absolute path; do nothing.
      ;;
   *)
      # Make a symbolic link, hard link or hardcopy.
--- 74,82 ----
  mkdir $dirname || exit 1
  
  cd $dirname
  case "$input" in
!  /* | [A-Za-z]:*)
      # Absolute path; do nothing.
      ;;
   *)
      # Make a symbolic link, hard link or hardcopy.
*************** status=$?
*** 89,105 ****
  if test $status -eq 0; then
     set X $pairlist
     shift
     first=yes
     while test "$#" -ne 0; do
!       if test -f "$1"; then
           # If $2 is an absolute path name, then just use that,
           # otherwise prepend `../'.
           case "$2" in
! 	   /* | [A-Za-z]:\\*) target="$2";;
  	   *) target="../$2";;
  	 esac
! 	 mv "$1" "$target" || status=$?
        else
  	 # A missing file is only an error for the first file.  This
  	 # is a blatant hack to let us support using "yacc -d".  If -d
  	 # is not specified, we don't want an error when the header
--- 89,124 ----
  if test $status -eq 0; then
     set X $pairlist
     shift
     first=yes
+    # Since DOS filename conventions don't allow two dots,
+    # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+    # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+    y_tab_nodot="no"
+    if test -f y_tab.c || test -f y_tab.h; then
+       y_tab_nodot="yes"
+    fi
+ 
     while test "$#" -ne 0; do
!       from="$1"
!       # Handle y_tab.c and y_tab.h output by DOS
!       if test $y_tab_nodot = "yes"; then
! 	 if test $from = "y.tab.c"; then
! 	    from="y_tab.c"
! 	 else
! 	    if test $from = "y.tab.h"; then
! 	       from="y_tab.h"
! 	    fi
! 	 fi
!       fi
!       if test -f "$from"; then
           # If $2 is an absolute path name, then just use that,
           # otherwise prepend `../'.
           case "$2" in
! 	   /* | [A-Za-z]:*) target="$2";;
  	   *) target="../$2";;
  	 esac
! 	 mv "$from" "$target" || status=$?
        else
  	 # A missing file is only an error for the first file.  This
  	 # is a blatant hack to let us support using "yacc -d".  If -d
  	 # is not specified, we don't want an error when the header
*** ld/Makefile.in	1999/12/02 11:49:19	1.20
--- ld/Makefile.in	2000/02/23 19:20:58
*************** ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_
*** 518,529 ****
  	$(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
  .l.c:
  	$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
  .y.c:
! 	$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
  	if test -f y.tab.h; then \
  	if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
! 	else :; fi
  ldgram.h: ldgram.c
  
  
  ld.info: ld.texinfo
--- 518,537 ----
  	$(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
  .l.c:
  	$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
  .y.c:
! 	$(YACC) $(AM_YFLAGS) $(YFLAGS) $<
! 	if test -f y.tab.c; then \
! 	mv y.tab.c $*.c ; \
! 	fi ; \
! 	if test -f y_tab.c; then \
! 	mv y_tab.c $*.c ; \
! 	fi ; \
  	if test -f y.tab.h; then \
  	if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
! 	elif test -f y_tab.h; then \
! 	if cmp -s y_yab.h $*.h; then rm -f y_tab.h; else mv y_tab.h $*.h; fi; \
! 	fi
  ldgram.h: ldgram.c
  
  
  ld.info: ld.texinfo
*** ld/scripttempl/i386go32.sc.orig	Mon Aug  9 23:07:46 1999
--- ld/scripttempl/i386go32.sc	Sun Feb 20 17:47:40 2000
*************** SECTIONS
*** 20,28 ****
      ${RELOCATING+*(.gnu.linkonce.t*)}
      *(.const*)
      *(.ro*)
      ${RELOCATING+*(.gnu.linkonce.r*)}
!     ${RELOCATING+etext  =  . ; _etext = .};
      ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
    }
    .data ${RELOCATING+ ${DATA_ALIGNMENT}} : {
      ${RELOCATING+djgpp_first_ctor = . ;
--- 20,28 ----
      ${RELOCATING+*(.gnu.linkonce.t*)}
      *(.const*)
      *(.ro*)
      ${RELOCATING+*(.gnu.linkonce.r*)}
!     ${RELOCATING+etext  =  . ; _etext = . ;}
      ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
    }
    .data ${RELOCATING+ ${DATA_ALIGNMENT}} : {
      ${RELOCATING+djgpp_first_ctor = . ;
*************** SECTIONS
*** 39,56 ****
      ${RELOCATING+___EH_FRAME_END__ = . ;}
      ${RELOCATING+LONG(0);}
  
      ${RELOCATING+*(.gnu.linkonce.d*)}
!     ${RELOCATING+edata  =  . ; _edata = .};
      ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
    }
    ${CONSTRUCTING+${RELOCATING-$CTOR}}
    ${CONSTRUCTING+${RELOCATING-$DTOR}}
    .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
    { 					
      *(.bss)
      *(COMMON)
!     ${RELOCATING+ end = . ; _end = .};
      ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
    }
  }
  EOF
--- 39,56 ----
      ${RELOCATING+___EH_FRAME_END__ = . ;}
      ${RELOCATING+LONG(0);}
  
      ${RELOCATING+*(.gnu.linkonce.d*)}
!     ${RELOCATING+edata  =  . ; _edata = . ;}
      ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
    }
    ${CONSTRUCTING+${RELOCATING-$CTOR}}
    ${CONSTRUCTING+${RELOCATING-$DTOR}}
    .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
    { 					
      *(.bss)
      *(COMMON)
!     ${RELOCATING+ end = . ; _end = . ;}
      ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
    }
  }
  EOF
