*** 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
*** ./bfd/aoutx.h.orig	Mon Jul 12 06:28:24 1999
--- ./bfd/aoutx.h	Wed Feb 23 14:25:04 2000
*************** NAME(aout,find_nearest_line)
*** 2821,2829 ****
        directory_name = line_directory_name;
      }
  
    if (main_file_name == NULL
!       || main_file_name[0] == '/'
        || directory_name == NULL)
      filelen = 0;
    else
      filelen = strlen (directory_name) + strlen (main_file_name);
--- 2821,2829 ----
        directory_name = line_directory_name;
      }
  
    if (main_file_name == NULL
!       || IS_ABSOLUTE (main_file_name)
        || directory_name == NULL)
      filelen = 0;
    else
      filelen = strlen (directory_name) + strlen (main_file_name);
*************** NAME(aout,find_nearest_line)
*** 2845,2853 ****
      }
  
    if (main_file_name != NULL)
      {
!       if (main_file_name[0] == '/' || directory_name == NULL)
  	*filename_ptr = main_file_name;
        else
  	{
  	  sprintf (buf, "%s%s", directory_name, main_file_name);
--- 2845,2853 ----
      }
  
    if (main_file_name != NULL)
      {
!       if (IS_ABSOLUTE (main_file_name) || directory_name == NULL)
  	*filename_ptr = main_file_name;
        else
  	{
  	  sprintf (buf, "%s%s", directory_name, main_file_name);
*** ./bfd/archive.c.orig	Fri Dec 10 13:51:34 1999
--- ./bfd/archive.c	Wed Feb 23 14:25:00 2000
*************** normalize (abfd, file)
*** 1182,1189 ****
--- 1182,1199 ----
       const char *file;
  {
    const char *filename = strrchr (file, '/');
  
+ 
+ #ifdef DOSISH_FILENAMES
+   /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
+   if (filename == (char *) NULL || strchr (filename, '\\'))
+     {
+       filename = strrchr (filename != (char *) NULL ? filename : file, '\\');
+       if (filename == (char *) NULL && *file && file[1] == ':')
+ 	filename = file + 1;
+     }
+ #endif
    if (filename != (char *) NULL)
      filename++;
    else
      filename = file;
*************** bfd_bsd_truncate_arname (abfd, pathname,
*** 1514,1521 ****
--- 1524,1541 ----
    int length;
    CONST char *filename = strrchr (pathname, '/');
    int maxlen = ar_maxnamelen (abfd);
  
+ #ifdef DOSISH_FILENAMES
+   /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
+   if (!filename || strchr (filename, '\\'))
+     {
+       filename = strrchr (filename ? filename : pathname, '\\');
+       if (!filename && *pathname && pathname[1] == ':')
+ 	filename = pathname + 1;
+     }
+ #endif
+ 
    if (filename == NULL)
      filename = pathname;
    else
      ++filename;
*************** bfd_gnu_truncate_arname (abfd, pathname,
*** 1553,1560 ****
--- 1573,1590 ----
    struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
    int length;
    CONST char *filename = strrchr (pathname, '/');
    int maxlen = ar_maxnamelen (abfd);
+ 
+ #ifdef DOSISH_FILENAMES
+   /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
+   if (!filename || strchr (filename, '\\'))
+     {
+       filename = strrchr (filename ? filename : pathname, '\\');
+       if (!filename && *pathname && pathname[1] == ':')
+ 	filename = pathname + 1;
+     }
+ #endif
  
    if (filename == NULL)
      filename = pathname;
    else
*** ./bfd/cache.c.orig	Mon May  3 03:28:54 1999
--- ./bfd/cache.c	Wed Feb 23 14:25:02 2000
*************** bfd_open_file (abfd)
*** 287,295 ****
--- 287,302 ----
  	{
  	  /* Create the file.  Unlink it first, for the convenience of
               operating systems which worry about overwriting running
               binaries.  */
+ #ifndef __MSDOS__
+ 	  /* Don't do this for MSDOS: it doesn't care about overwriting
+ 	     a running binary, but if this file is already open by
+ 	     another BFD, we will be in deep trouble if we delete an
+ 	     open file.  In fact, objdump does just that if invoked with
+ 	     the --info option.  */
  	  unlink (abfd->filename);
+ #endif
  	  abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB);
  	  abfd->opened_once = true;
  	}
        break;
*** ./bfd/sysdep.h.orig	Mon May  3 03:28:58 1999
--- ./bfd/sysdep.h	Wed Feb 23 14:25:02 2000
*************** extern char *strrchr ();
*** 101,108 ****
--- 101,110 ----
  #ifndef SEEK_CUR
  #define SEEK_CUR 1
  #endif
  
+ #include "filenames.h"
+ 
  #ifdef NEED_DECLARATION_STRSTR
  extern char *strstr ();
  #endif
  
*** ./binutils/ar.c.orig	Fri Oct 15 12:50:46 1999
--- ./binutils/ar.c	Wed Feb 23 15:06:16 2000
*************** Foundation, Inc., 59 Temple Place - Suit
*** 31,38 ****
--- 31,39 ----
  #include "bucomm.h"
  #include "aout/ar.h"
  #include "libbfd.h"
  #include "arsup.h"
+ #include "filenames.h"
  #include <sys/stat.h>
  
  #ifdef __GO32___
  #define EXT_NAME_LEN 3		/* bufflen of addition to name if it's MS-DOS */
*************** map_over_members (arch, function, files,
*** 214,222 ****
  	      struct stat buf;
  	      bfd_stat_arch_elt (head, &buf);
  	    }
  	  if ((head->filename != NULL) &&
! 	      (!strcmp (normalize (*files, arch), head->filename)))
  	    {
  	      ++match_count;
  	      if (counted_name_mode
  		  && match_count != counted_name_counter) 
--- 215,223 ----
  	      struct stat buf;
  	      bfd_stat_arch_elt (head, &buf);
  	    }
  	  if ((head->filename != NULL) &&
! 	      (!FILENAME_CMP (normalize (*files, arch), head->filename)))
  	    {
  	      ++match_count;
  	      if (counted_name_mode
  		  && match_count != counted_name_counter) 
*************** normalize (file, abfd)
*** 301,308 ****
--- 302,318 ----
    if (full_pathname)
      return file;
  
    filename = strrchr (file, '/');
+ #ifdef DOSISH_FILENAMES
+   /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
+   if (!filename || strchr (filename, '\\'))
+     {
+       filename = strrchr (filename ? filename : file, '\\');
+       if (!filename && *file && file[1] == ':')
+ 	filename = file + 1;
+     }
+ #endif
    if (filename != (char *) NULL)
      filename++;
    else
      filename = file;
*************** main (argc, argv)
*** 376,389 ****
      {
        char *temp;
  
        temp = strrchr (program_name, '/');
        if (temp == NULL)
  	temp = program_name;
        else
  	++temp;
        if (strlen (temp) >= 6
! 	  && strcmp (temp + strlen (temp) - 6, "ranlib") == 0)
  	is_ranlib = 1;
        else
  	is_ranlib = 0;
      }
--- 386,411 ----
      {
        char *temp;
  
        temp = strrchr (program_name, '/');
+ #ifdef DOSISH_FILENAMES
+       /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
+       if (!temp || strchr (temp, '\\'))
+ 	{
+ 	  temp = strrchr (temp ? temp : program_name, '\\');
+ 	  if (!temp && *program_name && program_name[1] == ':')
+ 	    temp = program_name + 1;
+ 	}
+       /* Drop the .exe suffix, if any.  */
+       if (FILENAME_CMP (temp + strlen (temp) - 4, ".exe") == 0)
+ 	temp[strlen (temp) - 4] = '\0';
+ #endif
        if (temp == NULL)
  	temp = program_name;
        else
  	++temp;
        if (strlen (temp) >= 6
! 	  && FILENAME_CMP (temp + strlen (temp) - 6, "ranlib") == 0)
  	is_ranlib = 1;
        else
  	is_ranlib = 0;
      }
*************** open_inarch (archive_filename, file)
*** 698,711 ****
    target = NULL;
  
    if (stat (archive_filename, &sbuf) != 0)
      {
! #ifndef __GO32__
  
  /* KLUDGE ALERT! Temporary fix until I figger why
   * stat() is wrong ... think it's buried in GO32's IDT
!  * - Jax
!  */
        if (errno != ENOENT)
  	bfd_fatal (archive_filename);
  #endif
  
--- 720,737 ----
    target = NULL;
  
    if (stat (archive_filename, &sbuf) != 0)
      {
! #if !defined(__GO32__) || defined(__DJGPP__)
! 
!       /* FIXME: I don't understand why this fragment was ifndef'ed
! 	 away for __GO32__; perhaps it was in the days of DJGPP v1.x.
! 	 stat() works just fine in v2.x, so I think this should be
! 	 removed.  For now, I enable it for DJGPP v2. -- EZ.  */
  
  /* KLUDGE ALERT! Temporary fix until I figger why
   * stat() is wrong ... think it's buried in GO32's IDT
!  * - Jax */
        if (errno != ENOENT)
  	bfd_fatal (archive_filename);
  #endif
  
*************** do_quick_append (archive_filename, files
*** 933,941 ****
  
    if (stat (archive_filename, &sbuf) != 0)
      {
  
! #ifndef __GO32__
  
  /* KLUDGE ALERT! Temporary fix until I figger why
   * stat() is wrong ... think it's buried in GO32's IDT
   * - Jax
--- 959,975 ----
  
    if (stat (archive_filename, &sbuf) != 0)
      {
  
! #if !defined(__GO32__) || defined(__DJGPP__)
! 
!       /* FIXME: I don't understand why this fragment was ifndef'ed
! 	 away for __GO32__; perhaps it was in the days of DJGPP v1.x.
! 	 stat() works just fine in v2.x, so I think this should be
! 	 removed.  For now, I enable it for DJGPP v2.
! 
! 	 (And yes, I know this is all unused, but somebody, someday,
! 	 might wish to resurrect this again... -- EZ.  */
  
  /* KLUDGE ALERT! Temporary fix until I figger why
   * stat() is wrong ... think it's buried in GO32's IDT
   * - Jax
*************** get_pos_bfd (contents, default_pos, defa
*** 1109,1117 ****
      }
    else
      {
        for (; *after_bfd; after_bfd = &(*after_bfd)->next)
! 	if (strcmp ((*after_bfd)->filename, realposname) == 0)
  	  {
  	    if (realpos == pos_after)
  	      after_bfd = &(*after_bfd)->next;
  	    break;
--- 1143,1151 ----
      }
    else
      {
        for (; *after_bfd; after_bfd = &(*after_bfd)->next)
! 	if (FILENAME_CMP ((*after_bfd)->filename, realposname) == 0)
  	  {
  	    if (realpos == pos_after)
  	      after_bfd = &(*after_bfd)->next;
  	    break;
*************** delete_members (arch, files_to_delete)
*** 1149,1157 ****
        match_count = 0;
        current_ptr_ptr = &(arch->next);
        while (*current_ptr_ptr)
  	{
! 	  if (strcmp (normalize (*files_to_delete, arch),
  		      (*current_ptr_ptr)->filename) == 0)
  	    {
  	      ++match_count;
  	      if (counted_name_mode
--- 1183,1191 ----
        match_count = 0;
        current_ptr_ptr = &(arch->next);
        while (*current_ptr_ptr)
  	{
! 	  if (FILENAME_CMP (normalize (*files_to_delete, arch),
  		      (*current_ptr_ptr)->filename) == 0)
  	    {
  	      ++match_count;
  	      if (counted_name_mode
*************** move_members (arch, files_to_move)
*** 1206,1215 ****
        current_ptr_ptr = &(arch->next);
        while (*current_ptr_ptr)
  	{
  	  bfd *current_ptr = *current_ptr_ptr;
! 	  if (strcmp (normalize (*files_to_move, arch),
! 		      current_ptr->filename) == 0)
  	    {
  	      /* Move this file to the end of the list - first cut from
  		 where it is.  */
  	      bfd *link;
--- 1240,1249 ----
        current_ptr_ptr = &(arch->next);
        while (*current_ptr_ptr)
  	{
  	  bfd *current_ptr = *current_ptr_ptr;
! 	  if (FILENAME_CMP (normalize (*files_to_move, arch),
! 			    current_ptr->filename) == 0)
  	    {
  	      /* Move this file to the end of the list - first cut from
  		 where it is.  */
  	      bfd *link;
*************** replace_members (arch, files_to_move, qu
*** 1263,1272 ****
  	      current = *current_ptr;
  
  	      /* For compatibility with existing ar programs, we
  		 permit the same file to be added multiple times.  */
! 	      if (strcmp (normalize (*files_to_move, arch),
! 			  normalize (current->filename, arch)) == 0
  		  && current->arelt_data != NULL)
  		{
  		  if (newer_only)
  		    {
--- 1297,1306 ----
  	      current = *current_ptr;
  
  	      /* For compatibility with existing ar programs, we
  		 permit the same file to be added multiple times.  */
! 	      if (FILENAME_CMP (normalize (*files_to_move, arch),
! 				normalize (current->filename, arch)) == 0
  		  && current->arelt_data != NULL)
  		{
  		  if (newer_only)
  		    {
*** ./binutils/arsup.c.orig	Sun Jul 11 16:02:16 1999
--- ./binutils/arsup.c	Wed Feb 23 14:25:58 2000
*************** style librarian command syntax + 1 word 
*** 30,37 ****
--- 30,38 ----
  #include "bfd.h"
  #include "arsup.h"
  #include "libiberty.h"
  #include "bucomm.h"
+ #include "filenames.h"
  
  static void map_over_list
    PARAMS ((bfd *, void (*function) (bfd *, bfd *), struct list *));
  static void ar_directory_doer PARAMS ((bfd *, bfd *));
*************** map_over_list (arch, function, list)
*** 75,83 ****
  
  	  for (head = arch->next; head; head = head->next) 
  	    {
  	      if (head->filename != NULL
! 		  && strcmp (ptr->name, head->filename) == 0)
  		{
  		  found = true;
  		  function (head, prev);
  		}
--- 76,84 ----
  
  	  for (head = arch->next; head; head = head->next) 
  	    {
  	      if (head->filename != NULL
! 		  && FILENAME_CMP (ptr->name, head->filename) == 0)
  		{
  		  found = true;
  		  function (head, prev);
  		}
*************** DEFUN(ar_open,(name, t),
*** 159,167 ****
  
  {
    char *tname = (char *) xmalloc (strlen (name) + 10);
    real_name = name;
!   sprintf(tname, "%s-tmp", name);
    obfd = bfd_openw(tname, NULL);
  
    if (!obfd) {
      fprintf(stderr,_("%s: Can't open output archive %s\n"), program_name,
--- 160,170 ----
  
  {
    char *tname = (char *) xmalloc (strlen (name) + 10);
    real_name = name;
!   /* Prepend tmp- to the beginning, to avoid file-name clashes after
!      truncation on filesystems with limited namespaces (DOS).  */
!   sprintf(tname, "tmp-%s", name);
    obfd = bfd_openw(tname, NULL);
  
    if (!obfd) {
      fprintf(stderr,_("%s: Can't open output archive %s\n"), program_name,
*************** DEFUN(ar_delete, (list),
*** 288,296 ****
        bfd *member = obfd->archive_head;
        bfd **prev = &(obfd->archive_head);
        int found = 0;
        while (member) {
! 	if (strcmp(member->filename, list->name) == 0) {
  	  *prev = member->next;
  	  found = 1;
  	}
  	else {
--- 291,299 ----
        bfd *member = obfd->archive_head;
        bfd **prev = &(obfd->archive_head);
        int found = 0;
        while (member) {
! 	if (FILENAME_CMP(member->filename, list->name) == 0) {
  	  *prev = member->next;
  	  found = 1;
  	}
  	else {
*************** DEFUN(ar_replace, (list),
*** 345,353 ****
        bfd **prev = &(obfd->archive_head);
        int found = 0;
        while (member) 
        {
! 	if (strcmp(member->filename, list->name) == 0) 
  	{
  	  /* Found the one to replace */
  	  bfd *abfd = bfd_openr(list->name, 0);
  	  if (!abfd) 
--- 348,356 ----
        bfd **prev = &(obfd->archive_head);
        int found = 0;
        while (member) 
        {
! 	if (FILENAME_CMP(member->filename, list->name) == 0) 
  	{
  	  /* Found the one to replace */
  	  bfd *abfd = bfd_openr(list->name, 0);
  	  if (!abfd) 
*************** DEFUN(ar_extract,(list),
*** 436,444 ****
        bfd *member = obfd->archive_head;
        int found = 0;
        while (member && !found) 
        {
! 	if (strcmp(member->filename, list->name) == 0) 
  	{
  	  extract_file(member);
  	  found = 1;
  	  }
--- 439,447 ----
        bfd *member = obfd->archive_head;
        int found = 0;
        while (member && !found) 
        {
! 	if (FILENAME_CMP(member->filename, list->name) == 0) 
  	{
  	  extract_file(member);
  	  found = 1;
  	  }
*** ./binutils/bucomm.c.orig	Mon May  3 03:29:08 1999
--- ./binutils/bucomm.c	Wed Feb 23 14:25:54 2000
***************
*** 23,30 ****
--- 23,31 ----
  
  #include "bfd.h"
  #include "libiberty.h"
  #include "bucomm.h"
+ #include "filenames.h"
  
  #include <sys/stat.h>
  #include <time.h>		/* ctime, maybe time_t */
  
*************** make_tempname (filename)
*** 218,238 ****
    static char template[] = "stXXXXXX";
    char *tmpname;
    char *slash = strrchr (filename, '/');
  
! #if defined (__DJGPP__) || defined (__GO32__) || defined (_WIN32)
!   if (slash == NULL)
!     slash = strrchr (filename, '\\');
  #endif
  
    if (slash != (char *) NULL)
      {
        char c;
  
        c = *slash;
        *slash = 0;
!       tmpname = xmalloc (strlen (filename) + sizeof (template) + 1);
        strcpy (tmpname, filename);
        strcat (tmpname, "/");
        strcat (tmpname, template);
        mktemp (tmpname);
        *slash = c;
--- 219,251 ----
    static char template[] = "stXXXXXX";
    char *tmpname;
    char *slash = strrchr (filename, '/');
  
! #ifdef DOSISH_FILENAMES
!   /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
!   if (slash == (char *)NULL || strchr (slash, '\\') != (char *)NULL)
!     {
!       slash = strrchr (slash != (char *)NULL ? slash : filename, '\\');
!       if (slash == (char *)NULL && *filename && filename[1] == ':')
! 	slash = filename + 2;
!     }
  #endif
  
    if (slash != (char *) NULL)
      {
        char c;
  
        c = *slash;
        *slash = 0;
!       tmpname = xmalloc (strlen (filename) + sizeof (template) + 2);
        strcpy (tmpname, filename);
+ #ifdef DOSISH_FILENAMES
+       /* If tmpname is "X:", appending a slash will make it a root
+ 	 directory on drive X, which is NOT the same as the current
+ 	 directory on drive X.  */
+       if (tmpname[1] == ':' && tmpname[2] == '\0')
+ 	strcat (tmpname, ".");
+ #endif
        strcat (tmpname, "/");
        strcat (tmpname, template);
        mktemp (tmpname);
        *slash = c;
*** ./binutils/ieee.c.orig	Fri Jan 14 18:10:20 2000
--- ./binutils/ieee.c	Wed Feb 23 14:25:54 2000
***************
*** 29,36 ****
--- 29,37 ----
  #include "bucomm.h"
  #include "libiberty.h"
  #include "debug.h"
  #include "budbg.h"
+ #include "filenames.h"
  
  /* This structure holds an entry on the block stack.  */
  
  struct ieee_block
*************** ieee_start_compilation_unit (p, filename
*** 4937,4950 ****
  
    info->filename = filename;
    modname = strrchr (filename, '/');
    if (modname != NULL)
!     ++modname;
    else
      {
        modname = strrchr (filename, '\\');
        if (modname != NULL)
  	++modname;
        else
  	modname = filename;
      }
    c = xstrdup (modname);
--- 4938,4962 ----
  
    info->filename = filename;
    modname = strrchr (filename, '/');
    if (modname != NULL)
!     {
!       const char *backslash;
! 
!       ++modname;
!       /* We could have a mixed forward-/back-slash case.  */
!       if ((backslash = strrchr (modname, '\\')) != NULL)
! 	modname = backslash + 1;
!     }
    else
      {
        modname = strrchr (filename, '\\');
        if (modname != NULL)
  	++modname;
+ #ifdef DOSISH_FILENAMES
+       else if (filename[0] && filename[1] == ':')
+ 	modname = filename + 2;
+ #endif
        else
  	modname = filename;
      }
    c = xstrdup (modname);
*************** ieee_add_bb11 (info, sec, low, high)
*** 5200,5213 ****
        /* Start the enclosing BB10 block.  */
        filename = bfd_get_filename (info->abfd);
        modname = strrchr (filename, '/');
        if (modname != NULL)
! 	++modname;
        else
  	{
  	  modname = strrchr (filename, '\\');
  	  if (modname != NULL)
  	    ++modname;
  	  else
  	    modname = filename;
  	}
        c = xstrdup (modname);
--- 5212,5236 ----
        /* Start the enclosing BB10 block.  */
        filename = bfd_get_filename (info->abfd);
        modname = strrchr (filename, '/');
        if (modname != NULL)
! 	{
! 	  const char *backslash;
! 
! 	  ++modname;
! 	  /* We could have a mixed forward-/back-slash case.  */
! 	  if ((backslash = strrchr (modname, '\\')) != NULL)
! 	    modname = backslash + 1;
! 	}
        else
  	{
  	  modname = strrchr (filename, '\\');
  	  if (modname != NULL)
  	    ++modname;
+ #ifdef DOSISH_FILENAMES
+ 	  else if (filename[0] && filename[1] == ':')
+ 	    modname = filename + 2;
+ #endif
  	  else
  	    modname = filename;
  	}
        c = xstrdup (modname);
*** ./binutils/objcopy.c.orig	Mon Nov 22 04:42:42 1999
--- ./binutils/objcopy.c	Wed Feb 23 14:25:58 2000
***************
*** 24,31 ****
--- 24,32 ----
  #include "bucomm.h"
  #include "getopt.h"
  #include "libiberty.h"
  #include "budbg.h"
+ #include "filenames.h"
  #include <sys/stat.h>
  
  /* A list of symbols to explicitly strip out, or to keep.  A linked
     list is good enough for a small number from the command line, but
*************** main (argc, argv)
*** 2095,2103 ****
  
    if (is_strip < 0)
      {
        int i = strlen (program_name);
!       is_strip = (i >= 5 && strcmp (program_name + i - 5, "strip") == 0);
      }
  
    if (is_strip)
      strip_main (argc, argv);
--- 2096,2112 ----
  
    if (is_strip < 0)
      {
        int i = strlen (program_name);
! #ifdef DOSISH_FILENAMES
!       /* Drop the .exe suffix, if any.  */
!       if (FILENAME_CMP (program_name + i - 4, ".exe") == 0)
! 	{
! 	  program_name[i - 4] = '\0';
! 	  i -= 4;
! 	}
! #endif
!       is_strip = (i >= 5 && FILENAME_CMP (program_name + i - 5, "strip") == 0);
      }
  
    if (is_strip)
      strip_main (argc, argv);
*** ./binutils/objdump.c.orig	Thu Feb 10 13:13:00 2000
--- ./binutils/objdump.c	Wed Feb 23 14:25:56 2000
*************** display_target_list ()
*** 2662,2676 ****
--- 2662,2681 ----
        if (! bfd_set_format (abfd, bfd_object))
  	{
  	  if (bfd_get_error () != bfd_error_invalid_operation)
  	    nonfatal (p->name);
+ 	  bfd_close_all_done (abfd);
  	  continue;
  	}
  
        for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
  	if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0))
  	  printf ("  %s\n",
  		  bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
+       /* We are going to unlink the file below, so make sure it's not
+ 	 left open, for those systems that don't like it when an open
+ 	 file is unlinked.  */
+       bfd_close_all_done (abfd);
      }
    unlink (dummy_name);
    free (dummy_name);
  }
*************** display_info_table (first, last)
*** 2736,2743 ****
--- 2741,2753 ----
  		while (l--)
  		  putchar ('-');
  		putchar (' ');
  	      }
+ 	    /* We are going to unlink the file below, so make sure it's
+ 	       not left open, for those systems that don't like it when
+ 	       an open file is unlinked.  */
+ 	    if (abfd != NULL)
+ 	      bfd_close_all_done (abfd);
  	  }
  	putchar ('\n');
        }
    unlink (dummy_name);
*** ./binutils/strings.c.orig	Sun Dec 26 13:49:30 1999
--- ./binutils/strings.c	Wed Feb 23 14:25:56 2000
***************
*** 57,64 ****
--- 57,79 ----
  #include <errno.h>
  #include "bucomm.h"
  #include "libiberty.h"
  
+ /* Some platforms need to put stdin into binary mode, to read
+    binary files.  */
+ #ifndef O_BINARY
+ #ifdef _O_BINARY
+ #define O_BINARY _O_BINARY
+ #define setmode _setmode
+ #else
+ #define O_BINARY 0
+ #endif
+ #endif
+ #if O_BINARY
+ #include <io.h>
+ #define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0)
+ #endif
+ 
  #ifdef isascii
  #define isgraphic(c) (isascii (c) && isprint (c))
  #else
  #define isgraphic(c) (isprint (c))
*************** main (argc, argv)
*** 218,225 ****
--- 233,243 ----
  
    if (optind >= argc)
      {
        datasection_only = false;
+ #ifdef SET_BINARY
+       SET_BINARY (fileno (stdin));
+ #endif
        print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL);
        files_given = true;
      }
    else
*** ./gprof/gmon_io.c.orig	Fri Sep 24 05:03:48 1999
--- ./gprof/gmon_io.c	Thu Feb 24 14:00:32 2000
*************** DEFUN (gmon_out_read, (filename), const 
*** 71,78 ****
--- 71,81 ----
  
    if (strcmp (filename, "-") == 0)
      {
        ifp = stdin;
+ #ifdef SET_BINARY
+       SET_BINARY (fileno (stdin));
+ #endif
      }
    else
      {
        ifp = fopen (filename, FOPEN_RB);
*** ./gprof/gmon_io.h.orig	Mon May  3 03:29:10 1999
--- ./gprof/gmon_io.h	Thu Feb 24 14:00:32 2000
***************
*** 3,10 ****
--- 3,26 ----
  
  #include "bfd.h"
  #include "gmon.h"
  
+ /* Some platforms need to put stdin into binary mode, to read
+    binary files.  */
+ #include "sysdep.h"
+ #ifndef O_BINARY
+ #ifdef _O_BINARY
+ #define O_BINARY _O_BINARY
+ #define setmode _setmode
+ #else
+ #define O_BINARY 0
+ #endif
+ #endif
+ #if O_BINARY
+ #include <io.h>
+ #define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0)
+ #endif
+ 
  #define INPUT_HISTOGRAM		(1<<0)
  #define INPUT_CALL_GRAPH	(1<<1)
  #define INPUT_BB_COUNTS		(1<<2)
  
*** ./gprof/gprof.texi.orig	Sun Jun 13 21:36:30 1999
--- ./gprof/gprof.texi	Thu Feb 24 14:00:38 2000
*************** The order of these options does not matt
*** 302,310 ****
  @menu
  * Output Options::      Controlling @code{gprof}'s output style
  * Analysis Options::    Controlling how @code{gprof} analyses its data
  * Miscellaneous Options::
! * Depricated Options::  Options you no longer need to use, but which
                              have been retained for compatibility
  * Symspecs::            Specifying functions to include or exclude
  @end menu
  
--- 302,310 ----
  @menu
  * Output Options::      Controlling @code{gprof}'s output style
  * Analysis Options::    Controlling how @code{gprof} analyses its data
  * Miscellaneous Options::
! * Deprecated Options::  Options you no longer need to use, but which
                              have been retained for compatibility
  * Symspecs::            Specifying functions to include or exclude
  @end menu
  
*************** are tired of seeing the blurbs.
*** 343,351 ****
  The @samp{-C} option causes @code{gprof} to
  print a tally of functions and the number of times each was called.
  If @var{symspec} is specified, print tally only for matching symbols.
  
! If the profile data file contains basic-block count records, specifing
  the @samp{-l} option, along with @samp{-C}, will cause basic-block
  execution counts to be tallied and displayed.
  
  @item -i
--- 343,351 ----
  The @samp{-C} option causes @code{gprof} to
  print a tally of functions and the number of times each was called.
  If @var{symspec} is specified, print tally only for matching symbols.
  
! If the profile data file contains basic-block count records, specifying
  the @samp{-l} option, along with @samp{-C}, will cause basic-block
  execution counts to be tallied and displayed.
  
  @item -i
*************** call graph, and basic-block count record
*** 357,365 ****
  @item -I @var{dirs}
  @itemx --directory-path=@var{dirs}
  The @samp{-I} option specifies a list of search directories in
  which to find source files.  Environment variable @var{GPROF_PATH}
! can also be used to convery this information.
  Used mostly for annotated source output.
  
  @item -J[@var{symspec}]
  @itemx --no-annotated-source[=@var{symspec}]
--- 357,365 ----
  @item -I @var{dirs}
  @itemx --directory-path=@var{dirs}
  The @samp{-I} option specifies a list of search directories in
  which to find source files.  Environment variable @var{GPROF_PATH}
! can also be used to convey this information.
  Used mostly for annotated source output.
  
  @item -J[@var{symspec}]
  @itemx --no-annotated-source[=@var{symspec}]
*************** but excludes matching symbols.
*** 406,417 ****
  
  @item -y
  @itemx --separate-files
  This option affects annotated source output only.
! Normally, gprof prints annotated source files
  to standard-output.  If this option is specified,
! annotated source for a file named @file{path/filename}
! is generated in the file @file{filename-ann}.
  
  @item -Z[@var{symspec}]
  @itemx --no-exec-counts[=@var{symspec}]
  The @samp{-Z} option causes @code{gprof} not to
--- 406,422 ----
  
  @item -y
  @itemx --separate-files
  This option affects annotated source output only.
! Normally, @code{gprof} prints annotated source files
  to standard-output.  If this option is specified,
! annotated source for a file named @file{path/@var{filename}}
! is generated in the file @file{@var{filename}-ann}.  If the underlying
! filesystem would truncate @file{@var{filename}-ann} so that it
! overwrites the original @file{@var{filename}}, @code{gprof} generates
! annotated source in the file @file{@var{filename}.ann} instead (if the
! original file name has an extension, that extension is @emph{replaced}
! with @file{.ann}).
  
  @item -Z[@var{symspec}]
  @itemx --no-exec-counts[=@var{symspec}]
  The @samp{-Z} option causes @code{gprof} not to
*************** c-decl.o:00000000 T print_lang_type
*** 455,463 ****
  
  @end group
  @end smallexample
  
! GNU @code{nm} @samp{--extern-only} @samp{--defined-only} @samp{-v} @samp{--print-file-name} can be used to create @var{map_file}.
  
  @item -T
  @itemx --traditional
  The @samp{-T} option causes @code{gprof} to print its output in
--- 460,469 ----
  
  @end group
  @end smallexample
  
! To create a @var{map_file} with @sc{gnu} @code{nm}, type a command like
! @kbd{nm --extern-only --defined-only -v --print-file-name program-name}.
  
  @item -T
  @itemx --traditional
  The @samp{-T} option causes @code{gprof} to print its output in
*************** that had no time spent in them.  This is
*** 564,572 ****
  @samp{-c} option for discovering which routines were never called.
  
  @end table
  
! @node Miscellaneous Options,Depricated Options,Analysis Options,Invoking
  @section Miscellaneous Options
  
  @table @code
  
--- 570,578 ----
  @samp{-c} option for discovering which routines were never called.
  
  @end table
  
! @node Miscellaneous Options,Deprecated Options,Analysis Options,Invoking
  @section Miscellaneous Options
  
  @table @code
  
*************** The @samp{-v} flag causes @code{gprof} t
*** 600,609 ****
  number, and then exit.
  
  @end table
  
! @node Depricated Options,Symspecs,Miscellaneous Options,Invoking
! @section Depricated Options
  
  @table @code
  
  These options have been replaced with newer versions that use symspecs.
--- 606,615 ----
  number, and then exit.
  
  @end table
  
! @node Deprecated Options,Symspecs,Miscellaneous Options,Invoking
! @section Deprecated Options
  
  @table @code
  
  These options have been replaced with newer versions that use symspecs.
*************** gprof -e boring -f foo -f bar myprogram 
*** 652,660 ****
  @noindent
  lists in the call graph all functions that were reached from either
  @code{foo} or @code{bar} and were not reachable from @code{boring}.
  
! @node Symspecs,,Depricated Options,Invoking
  @section Symspecs
  
  Many of the output options allow functions to be included or excluded
  using @dfn{symspecs} (symbol specifications), which observe the
--- 658,666 ----
  @noindent
  lists in the call graph all functions that were reached from either
  @code{foo} or @code{bar} and were not reachable from @code{boring}.
  
! @node Symspecs,,Deprecated Options,Invoking
  @section Symspecs
  
  Many of the output options allow functions to be included or excluded
  using @dfn{symspecs} (symbol specifications), which observe the
*************** Here are some sample symspecs:
*** 671,679 ****
  
  @table @samp
  @item main.c
  Selects everything in file @file{main.c}---the
! dot in the string tells gprof to interpret
  the string as a filename, rather than as
  a function name.  To select a file whose
  name does not contain a dot, a trailing colon
  should be specified.  For example, @samp{odd:} is
--- 677,685 ----
  
  @table @samp
  @item main.c
  Selects everything in file @file{main.c}---the
! dot in the string tells @code{gprof} to interpret
  the string as a filename, rather than as
  a function name.  To select a file whose
  name does not contain a dot, a trailing colon
  should be specified.  For example, @samp{odd:} is
*************** explained below to specify a function fr
*** 690,702 ****
  Sometimes, function names contain dots.  In such cases, it is necessary
  to add a leading colon to the name.  For example, @samp{:.mul} selects
  function @samp{.mul}.
  
! In some object file formats, symbols have a leading underscore.  gprof
! will normally not print these underscores.  However, you must use the
! underscore when you name a symbol in a symspec.  You can use the
! @code{nm} program to see whether symbols have underscores for the object
! file format you are using.
  
  @item main.c:main
  Selects function @samp{main} in file @file{main.c}.
  
--- 696,710 ----
  Sometimes, function names contain dots.  In such cases, it is necessary
  to add a leading colon to the name.  For example, @samp{:.mul} selects
  function @samp{.mul}.
  
! In some object file formats, symbols have a leading underscore.
! @code{gprof} will normally not print these underscores.  When you name a
! symbol in a symspec, you should type it exactly as @code{gprof} prints
! it in its output.  For example, if the compiler produces a symbol
! @samp{_main} from your @code{main} function, @code{gprof} still prints
! it as @samp{main} in its output, so you should use @samp{main} in
! symspecs.
  
  @item main.c:main
  Selects function @samp{main} in file @file{main.c}.
  
*************** Each sample counts as 0.01 seconds.
*** 768,776 ****
  @noindent
  The functions are sorted by first by decreasing run-time spent in them,
  then by decreasing number of calls, then alphabetically by name.  The
  functions @samp{mcount} and @samp{profil} are part of the profiling
! aparatus and appear in every flat profile; their time gives a measure of
  the amount of overhead due to profiling.
  
  Just before the column headers, a statement appears indicating
  how much time each sample counted as.
--- 776,784 ----
  @noindent
  The functions are sorted by first by decreasing run-time spent in them,
  then by decreasing number of calls, then alphabetically by name.  The
  functions @samp{mcount} and @samp{profil} are part of the profiling
! apparatus and appear in every flat profile; their time gives a measure of
  the amount of overhead due to profiling.
  
  Just before the column headers, a statement appears indicating
  how much time each sample counted as.
*************** reliable.  In this example, each sample 
*** 780,791 ****
  suggesting a 100 Hz sampling rate.
  The program's total execution time was 0.06
  seconds, as indicated by the @samp{cumulative seconds} field.  Since
  each sample counted for 0.01 seconds, this means only six samples
! were taken during the run.  Two of the samples occured while the
  program was in the @samp{open} function, as indicated by the
  @samp{self seconds} field.  Each of the other four samples
! occured one each in @samp{offtime}, @samp{memccpy}, @samp{write},
  and @samp{mcount}.
  Since only six samples were taken, none of these values can
  be regarded as particularly reliable.
  In another run,
--- 788,799 ----
  suggesting a 100 Hz sampling rate.
  The program's total execution time was 0.06
  seconds, as indicated by the @samp{cumulative seconds} field.  Since
  each sample counted for 0.01 seconds, this means only six samples
! were taken during the run.  Two of the samples occurred while the
  program was in the @samp{open} function, as indicated by the
  @samp{self seconds} field.  Each of the other four samples
! occurred one each in @samp{offtime}, @samp{memccpy}, @samp{write},
  and @samp{mcount}.
  Since only six samples were taken, none of these values can
  be regarded as particularly reliable.
  In another run,
*************** The sum of the @code{self} and @code{chi
*** 1018,1026 ****
  of the amount of time spent within calls to @code{report} from @code{main}.
  
  @item called
  Two numbers: the number of times @code{report} was called from @code{main},
! followed by the total number of nonrecursive calls to @code{report} from
  all its callers.
  
  @item name and index number
  The name of the caller of @code{report} to which this line applies,
--- 1026,1034 ----
  of the amount of time spent within calls to @code{report} from @code{main}.
  
  @item called
  Two numbers: the number of times @code{report} was called from @code{main},
! followed by the total number of non-recursive calls to @code{report} from
  all its callers.
  
  @item name and index number
  The name of the caller of @code{report} to which this line applies,
*************** The sum of the @code{self} and @code{chi
*** 1077,1085 ****
  of the total time spent in calls to @code{report} from @code{main}.
  
  @item called
  Two numbers, the number of calls to @code{report} from @code{main}
! followed by the total number of nonrecursive calls to @code{report}.
  This ratio is used to determine how much of @code{report}'s @code{self}
  and @code{children} time gets credited to @code{main}.
  @xref{Assumptions}.
  
--- 1085,1093 ----
  of the total time spent in calls to @code{report} from @code{main}.
  
  @item called
  Two numbers, the number of calls to @code{report} from @code{main}
! followed by the total number of non-recursive calls to @code{report}.
  This ratio is used to determine how much of @code{report}'s @code{self}
  and @code{children} time gets credited to @code{main}.
  @xref{Assumptions}.
  
*************** subroutines, on the times when that call
*** 1210,1218 ****
  The @code{calls} field in the primary line for the cycle has two numbers:
  first, the number of times functions in the cycle were called by functions
  outside the cycle; second, the number of times they were called by
  functions in the cycle (including times when a function in the cycle calls
! itself).  This is a generalization of the usual split into nonrecursive and
  recursive calls.
  
  The @code{calls} field of a subroutine-line for a cycle member in the
  cycle's entry says how many time that function was called from functions in
--- 1218,1226 ----
  The @code{calls} field in the primary line for the cycle has two numbers:
  first, the number of times functions in the cycle were called by functions
  outside the cycle; second, the number of times they were called by
  functions in the cycle (including times when a function in the cycle calls
! itself).  This is a generalization of the usual split into non-recursive and
  recursive calls.
  
  The @code{calls} field of a subroutine-line for a cycle member in the
  cycle's entry says how many time that function was called from functions in
*************** index % time    self  children    called
*** 1274,1282 ****
  
  Now let's look at some of @code{gprof}'s output from the same program run,
  this time with line-by-line profiling enabled.  Note that @code{ct_init}'s
  four histogram hits are broken down into four lines of source code - one hit
! occured on each of lines 349, 351, 382 and 385.  In the call graph,
  note how
  @code{ct_init}'s 13327 calls to @code{init_block} are broken down
  into one call from line 396, 3071 calls from line 384, 3730 calls
  from line 385, and 6525 calls from 387.
--- 1282,1290 ----
  
  Now let's look at some of @code{gprof}'s output from the same program run,
  this time with line-by-line profiling enabled.  Note that @code{ct_init}'s
  four histogram hits are broken down into four lines of source code - one hit
! occurred on each of lines 349, 351, 382 and 385.  In the call graph,
  note how
  @code{ct_init}'s 13327 calls to @code{init_block} are broken down
  into one call from line 396, 3071 calls from line 384, 3730 calls
  from line 385, and 6525 calls from 387.
*************** number of times it was called.  You may 
*** 1327,1335 ****
  
  Compiling with @samp{gcc @dots{} -g -pg -a} augments your program
  with basic-block counting code, in addition to function counting code.
  This enables @code{gprof} to determine how many times each line
! of code was exeucted.
  For example, consider the following function, taken from gzip,
  with line numbers added:
  
  @smallexample
--- 1335,1343 ----
  
  Compiling with @samp{gcc @dots{} -g -pg -a} augments your program
  with basic-block counting code, in addition to function counting code.
  This enables @code{gprof} to determine how many times each line
! of code was executed.
  For example, consider the following function, taken from gzip,
  with line numbers added:
  
  @smallexample
*************** the @code{if} on line 13, and the conten
*** 1363,1371 ****
  the fifth basic-block.  The compiler may also generate additional
  basic-blocks to handle various special cases.
  
  A program augmented for basic-block counting can be analyzed with
! @code{gprof -l -A}.  I also suggest use of the @samp{-x} option,
  which ensures that each line of code is labeled at least once.
  Here is @code{updcrc}'s
  annotated source listing for a sample @code{gzip} run:
  
--- 1371,1379 ----
  the fifth basic-block.  The compiler may also generate additional
  basic-blocks to handle various special cases.
  
  A program augmented for basic-block counting can be analyzed with
! @samp{gprof -l -A}.  I also suggest use of the @samp{-x} option,
  which ensures that each line of code is labeled at least once.
  Here is @code{updcrc}'s
  annotated source listing for a sample @code{gzip} run:
  
*************** This listing will show you the lines in 
*** 1525,1533 ****
  but not necessarily those that consumed the most time.
  
  @item How do I find which lines in my program called a particular function?
  
! Use @code{gprof -l} and lookup the function in the call graph.
  The callers will be broken down by function and line number.
  
  @item How do I analyze a program that runs for less than a second?
  
--- 1533,1541 ----
  but not necessarily those that consumed the most time.
  
  @item How do I find which lines in my program called a particular function?
  
! Use @samp{gprof -l} and lookup the function in the call graph.
  The callers will be broken down by function and line number.
  
  @item How do I analyze a program that runs for less than a second?
  
*************** in the form @samp{from/to}, instead of @
*** 1581,1589 ****
  
  @item
  In the annotated source listing,
  if there are multiple basic blocks on the same line,
! @sc{gnu} @code{gprof} prints all of their counts, seperated by commas.
  
  @ignore - it does this now
  @item
  The function names printed in @sc{gnu} @code{gprof} output do not include
--- 1589,1597 ----
  
  @item
  In the annotated source listing,
  if there are multiple basic blocks on the same line,
! @sc{gnu} @code{gprof} prints all of their counts, separated by commas.
  
  @ignore - it does this now
  @item
  The function names printed in @sc{gnu} @code{gprof} output do not include
*************** tables without skipping the blurbs.
*** 1600,1608 ****
  @node Details
  @chapter Details of Profiling
  
  @menu
! * Implementation::      How a program collets profiling information
  * File Format::         Format of @samp{gmon.out} files
  * Internals::           @code{gprof}'s internal operation
  * Debugging::           Using @code{gprof}'s @samp{-d} option
  @end menu
--- 1608,1616 ----
  @node Details
  @chapter Details of Profiling
  
  @menu
! * Implementation::      How a program collects profiling information
  * File Format::         Format of @samp{gmon.out} files
  * Internals::           @code{gprof}'s internal operation
  * Debugging::           Using @code{gprof}'s @samp{-d} option
  @end menu
*************** The @code{mcount} routine, included in t
*** 1623,1638 ****
  is responsible for recording in an in-memory call graph table
  both its parent routine (the child) and its parent's parent.  This is
  typically done by examining the stack frame to find both
  the address of the child, and the return address in the original parent.
! Since this is a very machine-dependant operation, @code{mcount}
  itself is typically a short assembly-language stub routine
  that extracts the required
  information, and then calls @code{__mcount_internal}
  (a normal C function) with two arguments - @code{frompc} and @code{selfpc}.
  @code{__mcount_internal} is responsible for maintaining
  the in-memory call graph, which records @code{frompc}, @code{selfpc},
! and the number of times each of these call arcs was transversed.
  
  GCC Version 2 provides a magical function (@code{__builtin_return_address}),
  which allows a generic @code{mcount} function to extract the
  required information from the stack frame.  However, on some
--- 1631,1646 ----
  is responsible for recording in an in-memory call graph table
  both its parent routine (the child) and its parent's parent.  This is
  typically done by examining the stack frame to find both
  the address of the child, and the return address in the original parent.
! Since this is a very machine-dependent operation, @code{mcount}
  itself is typically a short assembly-language stub routine
  that extracts the required
  information, and then calls @code{__mcount_internal}
  (a normal C function) with two arguments - @code{frompc} and @code{selfpc}.
  @code{__mcount_internal} is responsible for maintaining
  the in-memory call graph, which records @code{frompc}, @code{selfpc},
! and the number of times each of these call arcs was traversed.
  
  GCC Version 2 provides a magical function (@code{__builtin_return_address}),
  which allows a generic @code{mcount} function to extract the
  required information from the stack frame.  However, on some
*************** load due to other users won't directly a
*** 1723,1731 ****
  @section Profiling Data File Format
  
  The old BSD-derived file format used for profile data does not contain a
  magic cookie that allows to check whether a data file really is a
! gprof file.  Furthermore, it does not provide a version number, thus
  rendering changes to the file format almost impossible.  @sc{gnu} @code{gprof}
  uses a new file format that provides these features.  For backward
  compatibility, @sc{gnu} @code{gprof} continues to support the old BSD-derived
  format, but not all features are supported with it.  For example,
--- 1731,1739 ----
  @section Profiling Data File Format
  
  The old BSD-derived file format used for profile data does not contain a
  magic cookie that allows to check whether a data file really is a
! @code{gprof} file.  Furthermore, it does not provide a version number, thus
  rendering changes to the file format almost impossible.  @sc{gnu} @code{gprof}
  uses a new file format that provides these features.  For backward
  compatibility, @sc{gnu} @code{gprof} continues to support the old BSD-derived
  format, but not all features are supported with it.  For example,
*************** These default excludes are not added to 
*** 1826,1834 ****
  Next, the BFD library is called to open the object file,
  verify that it is an object file,
  and read its symbol table (@code{core.c:core_init}),
  using @code{bfd_canonicalize_symtab} after mallocing
! an appropiate sized array of asymbols.  At this point,
  function mappings are read (if the @samp{--file-ordering} option
  has been specified), and the core text space is read into
  memory (if the @samp{-c} option was given).
  
--- 1834,1842 ----
  Next, the BFD library is called to open the object file,
  verify that it is an object file,
  and read its symbol table (@code{core.c:core_init}),
  using @code{bfd_canonicalize_symtab} after mallocing
! an appropriately sized array of symbols.  At this point,
  function mappings are read (if the @samp{--file-ordering} option
  has been specified), and the core text space is read into
  memory (if the @samp{-c} option was given).
  
*************** gets created every time the line number 
*** 1844,1852 ****
  In either case, two passes are made through the symbol
  table - one to count the size of the symbol table required,
  and the other to actually read the symbols.  In between the
  two passes, a single array of type @code{Sym} is created of
! the appropiate length.
  Finally, @code{symtab.c:symtab_finalize}
  is called to sort the symbol table and remove duplicate entries
  (entries with the same memory address).
  
--- 1852,1860 ----
  In either case, two passes are made through the symbol
  table - one to count the size of the symbol table required,
  and the other to actually read the symbols.  In between the
  two passes, a single array of type @code{Sym} is created of
! the appropriate length.
  Finally, @code{symtab.c:symtab_finalize}
  is called to sort the symbol table and remove duplicate entries
  (entries with the same memory address).
  
*************** are more common during line-by-line prof
*** 1930,1938 ****
  cause each of two adjacent lines to be credited with half
  a hit, for example.
  
  If call graph data is present, @code{cg_arcs.c:cg_assemble} is called.
! First, if @samp{-c} was specified, a machine-dependant
  routine (@code{find_call}) scans through each symbol's machine code,
  looking for subroutine call instructions, and adding them
  to the call graph with a zero call count.
  A topological sort is performed by depth-first numbering
--- 1938,1946 ----
  cause each of two adjacent lines to be credited with half
  a hit, for example.
  
  If call graph data is present, @code{cg_arcs.c:cg_assemble} is called.
! First, if @samp{-c} was specified, a machine-dependent
  routine (@code{find_call}) scans through each symbol's machine code,
  looking for subroutine call instructions, and adding them
  to the call graph with a zero call count.
  A topological sort is performed by depth-first numbering
*************** order (children appear before parents).
*** 1944,1959 ****
  Cycles are also detected at this point, all members
  of which are assigned the same topological number.
  Two passes are now made through this sorted array of symbol pointers.
  The first pass, from end to beginning (parents to children),
! computes the fraction of child time to propogate to each parent
  and a print flag.
  The print flag reflects symspec handling of INCL_GRAPH/EXCL_GRAPH,
  with a parent's include or exclude (print or no print) property
  being propagated to its children, unless they themselves explicitly appear
  in INCL_GRAPH or EXCL_GRAPH.
  A second pass, from beginning to end (children to parents) actually
! propogates the timings along the call graph, subject
  to a check against INCL_TIME/EXCL_TIME.
  With the print flag, fractions, and timings now stored in the symbol
  structures, the topological sort array is now discarded, and a
  new array of pointers is assembled, this time sorted by propagated time.
--- 1952,1967 ----
  Cycles are also detected at this point, all members
  of which are assigned the same topological number.
  Two passes are now made through this sorted array of symbol pointers.
  The first pass, from end to beginning (parents to children),
! computes the fraction of child time to propagate to each parent
  and a print flag.
  The print flag reflects symspec handling of INCL_GRAPH/EXCL_GRAPH,
  with a parent's include or exclude (print or no print) property
  being propagated to its children, unless they themselves explicitly appear
  in INCL_GRAPH or EXCL_GRAPH.
  A second pass, from beginning to end (children to parents) actually
! propagates the timings along the call graph, subject
  to a check against INCL_TIME/EXCL_TIME.
  With the print flag, fractions, and timings now stored in the symbol
  structures, the topological sort array is now discarded, and a
  new array of pointers is assembled, this time sorted by propagated time.
*** ./gprof/hertz.c.orig	Mon May  3 03:29:10 1999
--- ./gprof/hertz.c	Thu Feb 24 14:00:34 2000
***************
*** 18,29 ****
   */
  #include "hertz.h"
  
  
- #ifdef __MSDOS__
- #define HERTZ 18
- #endif
- 
  int
  hertz ()
  {
  #ifdef HERTZ
--- 18,25 ----
*************** hertz ()
*** 37,54 ****
    tim.it_value.tv_sec = 0;
    tim.it_value.tv_usec = 0;
    setitimer (ITIMER_REAL, &tim, 0);
    setitimer (ITIMER_REAL, 0, &tim);
!   if (tim.it_interval.tv_usec < 2)
      {
!       return HZ_WRONG;
      }
!   return 1000000 / tim.it_interval.tv_usec;
! #else /* ! defined (HAVE_SETITIMER) */
  #if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK)
    return sysconf (_SC_CLK_TCK);
  #else /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
    return HZ_WRONG;
  #endif /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
- #endif /* ! defined (HAVE_SETITIMER) */
  #endif /* ! defined (HERTZ) */
  }
--- 33,52 ----
    tim.it_value.tv_sec = 0;
    tim.it_value.tv_usec = 0;
    setitimer (ITIMER_REAL, &tim, 0);
    setitimer (ITIMER_REAL, 0, &tim);
!   if (tim.it_interval.tv_usec >= 2)
      {
!       return 1000000 / tim.it_interval.tv_usec;
      }
! #endif /* ! defined (HAVE_SETITIMER) */
  #if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK)
    return sysconf (_SC_CLK_TCK);
  #else /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
+ #ifdef __MSDOS__
+   return 18;
+ #else  /* ! defined (__MSDOS__) */
    return HZ_WRONG;
+ #endif /* ! defined (__MSDOS__) */
  #endif /* ! defined (HAVE_SYSCONF) || ! defined (_SC_CLK_TCK) */
  #endif /* ! defined (HERTZ) */
  }
*** ./gprof/search_list.c.orig	Mon May  3 03:29:10 1999
--- ./gprof/search_list.c	Thu Feb 24 14:00:34 2000
*************** DEFUN (search_list_append, (list, paths)
*** 14,22 ****
    colon = paths - 1;
    do
      {
        beg = colon + 1;
!       colon = strchr (beg, ':');
        if (colon)
  	{
  	  len = colon - beg;
  	}
--- 14,22 ----
    colon = paths - 1;
    do
      {
        beg = colon + 1;
!       colon = strchr (beg, PATH_SEP_CHAR);
        if (colon)
  	{
  	  len = colon - beg;
  	}
*** ./gprof/search_list.h.orig	Mon May  3 03:29:10 1999
--- ./gprof/search_list.h	Thu Feb 24 14:00:32 2000
***************
*** 1,7 ****
--- 1,15 ----
  #ifndef search_list_h
  #define search_list_h
  
+ /* Non-Posix systems use semi-colon as directory separator in lists,
+    since colon is part of drive letter spec.  */
+ #if defined (__MSDOS__) || defined (_WIN32)
+ #define PATH_SEP_CHAR ';'
+ #else
+ #define PATH_SEP_CHAR ':'
+ #endif
+ 
  typedef struct search_list_elem
    {
      struct search_list_elem *next;
      char path[1];
*** ./gprof/source.c.orig	Mon May  3 03:29:10 1999
--- ./gprof/source.c	Thu Feb 24 14:00:32 2000
***************
*** 1,9 ****
--- 1,12 ----
  /*
   * Keeps track of source files.
   */
+ #include <sys/stat.h>
+ 
  #include "gprof.h"
  #include "libiberty.h"
+ #include "filenames.h"
  #include "search_list.h"
  #include "source.h"
  
  #define EXT_ANNO "-ann"		/* postfix of annotated files */
*************** DEFUN (source_file_lookup_path, (path), 
*** 24,32 ****
    Source_File *sf;
  
    for (sf = first_src_file; sf; sf = sf->next)
      {
!       if (strcmp (path, sf->name) == 0)
  	{
  	  break;
  	}
      }
--- 27,35 ----
    Source_File *sf;
  
    for (sf = first_src_file; sf; sf = sf->next)
      {
!       if (FILENAME_CMP (path, sf->name) == 0)
  	{
  	  break;
  	}
      }
*************** DEFUN (source_file_lookup_name, (filenam
*** 65,73 ****
        else
  	{
  	  fname = sf->name;
  	}
!       if (strcmp (filename, fname) == 0)
  	{
  	  break;
  	}
      }
--- 68,76 ----
        else
  	{
  	  fname = sf->name;
  	}
!       if (FILENAME_CMP (filename, fname) == 0)
  	{
  	  break;
  	}
      }
*************** DEFUN (annotate_source, (sf, max_width, 
*** 94,102 ****
     * Open input file.  If open fails, walk along search-list until
     * open succeeds or reaching end of list:
     */
    strcpy (fname, sf->name);
!   if (sf->name[0] == '/')
      {
        sle = 0;			/* don't use search list for absolute paths */
      }
    name_only = 0;
--- 97,105 ----
     * Open input file.  If open fails, walk along search-list until
     * open succeeds or reaching end of list:
     */
    strcpy (fname, sf->name);
!   if (IS_ABSOLUTE (sf->name))
      {
        sle = 0;			/* don't use search list for absolute paths */
      }
    name_only = 0;
*************** DEFUN (annotate_source, (sf, max_width, 
*** 111,118 ****
--- 114,129 ----
  	}
        if (!sle && !name_only)
  	{
  	  name_only = strrchr (sf->name, '/');
+ #ifdef DOSISH_FILENAMES
+ 	  if (!name_only || strchr (name_only, '\\'))
+ 	    {
+ 	      name_only = strrchr (sf->name, '\\');
+ 	      if (!name_only && sf->name[0] && sf->name[1] == ':')
+ 		name_only = (char *)sf->name + 1;
+ 	    }
+ #endif
  	  if (name_only)
  	    {
  	      /* try search-list again, but this time with name only: */
  	      ++name_only;
*************** DEFUN (annotate_source, (sf, max_width, 
*** 121,128 ****
--- 132,144 ----
  	}
        if (sle)
  	{
  	  strcpy (fname, sle->path);
+ #ifdef DOSISH_FILENAMES
+ 	  /* d:foo is not the same thing as d:/foo!  */
+ 	  if (fname[strlen (fname) - 1] == ':')
+ 	    strcat (fname, ".");
+ #endif
  	  strcat (fname, "/");
  	  if (name_only)
  	    {
  	      strcat (fname, name_only);
*************** DEFUN (annotate_source, (sf, max_width, 
*** 155,162 ****
--- 171,186 ----
        const char *filename;
  
        /* create annotation files in the current working directory: */
        filename = strrchr (sf->name, '/');
+ #ifdef DOSISH_FILENAMES
+       if (!filename || strchr (filename, '\\'))
+ 	{
+ 	  filename = strrchr (sf->name, '\\');
+ 	  if (!filename && sf->name[0] && sf->name[1] == ':')
+ 	    filename = sf->name + 1;
+ 	}
+ #endif
        if (filename)
  	{
  	  ++filename;
  	}
*************** DEFUN (annotate_source, (sf, max_width, 
*** 166,173 ****
--- 190,214 ----
  	}
  
        strcpy (fname, filename);
        strcat (fname, EXT_ANNO);
+ #ifdef __MSDOS__
+       {
+ 	/* foo.cpp-ann can overwrite foo.cpp due to silent truncation of
+ 	   file names on 8+3 filesystems.  Their `stat' better be good...  */
+ 	struct stat buf1, buf2;
+ 
+ 	if (stat (filename, &buf1) == 0 && stat (fname, &buf2) == 0
+ 	    && buf1.st_ino == buf2.st_ino)
+ 	  {
+ 	    char *dot = strrchr (fname, '.');
+ 
+ 	    if (dot)
+ 	      *dot = '\0';
+ 	    strcat (fname, ".ann");
+ 	  }
+       }
+ #endif
        ofp = fopen (fname, "w");
        if (!ofp)
  	{
  	  perror (fname);
*** ./gprof/sym_ids.c.orig	Sun Jul 11 16:06:46 1999
--- ./gprof/sym_ids.c	Thu Feb 24 14:00:38 2000
*************** static bool
*** 200,208 ****
  DEFUN (match, (pattern, sym), Sym * pattern AND Sym * sym)
  {
    return (pattern->file ? pattern->file == sym->file : TRUE)
      && (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
!     && (pattern->name ? strcmp (pattern->name, sym->name) == 0 : TRUE);
  }
  
  
  static void
--- 200,211 ----
  DEFUN (match, (pattern, sym), Sym * pattern AND Sym * sym)
  {
    return (pattern->file ? pattern->file == sym->file : TRUE)
      && (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
!     && (pattern->name
! 	? strcmp (pattern->name,
! 		  sym->name+(discard_underscores && sym->name[0] == '_')) == 0
! 	: TRUE);
  }
  
  
  static void
*** ./ld/ldmain.c.orig	Sun Jul 11 16:09:02 1999
--- ./ld/ldmain.c	Wed Feb 23 14:25:30 2000
*************** Software Foundation, 59 Temple Place - S
*** 26,33 ****
--- 26,34 ----
  #include <ctype.h>
  #include "libiberty.h"
  #include "progress.h"
  #include "bfdlink.h"
+ #include "filenames.h"
  
  #include "ld.h"
  #include "ldmain.h"
  #include "ldmisc.h"
*************** set_scripts_dir ()
*** 566,573 ****
--- 567,579 ----
      return;			/* We've been installed normally.  */
  
    /* Look for "ldscripts" in the dir where our binary is.  */
    end = strrchr (program_name, '/');
+ #ifdef DOSISH_FILENAMES
+   /* We could have \foo\bar, or /foo\bar.  */
+   if (end == NULL || strchr (end, '\\'))
+     end = strrchr (program_name, '\\');
+ #endif
  
    if (end == NULL)
      {
        /* Don't look for ldscripts in the current directory.  There is
*** ./libiberty/argv.c.orig	Wed Jul 14 13:32:00 1999
--- ./libiberty/argv.c	Wed Feb 23 14:25:38 2000
*************** extern char *strdup ();		/* Duplicate a 
*** 50,57 ****
--- 50,61 ----
  #endif
  
  #endif	/* __STDC__ */
  
+ #if defined(__MSDOS__) || defined(_WIN32)
+ #define BACKSLASH_AS_SLASH
+ #endif
+ 
  #include "alloca-conf.h"
  
  #ifndef NULL
  #define NULL 0
*************** char *input;
*** 272,279 ****
--- 276,287 ----
  		      *arg++ = *input;
  		    }
  		  else if (*input == '\\')
  		    {
+ #ifdef BACKSLASH_AS_SLASH
+ 		      /* Don't break dosish file names.  */
+ 		      if (input[1] == '\'' || input[1] == '"')
+ #endif
  		      bsquote = 1;
  		    }
  		  else if (squote)
  		    {
*** ./libiberty/choose-temp.c.orig	Tue Feb 22 15:49:24 2000
--- ./libiberty/choose-temp.c	Wed Feb 23 15:01:30 2000
*************** Boston, MA 02111-1307, USA.  */
*** 46,63 ****
  
  #include "libiberty.h"
  extern int mkstemps ();
  
- #ifndef IN_GCC
- #if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN))
- #define DIR_SEPARATOR '\\'
- #endif
- #endif
- 
  #ifndef DIR_SEPARATOR
  #define DIR_SEPARATOR '/'
  #endif
  
  /* On MSDOS, write temp files in current dir
     because there's no place else we can expect to use.  */
  /* ??? Although the current directory is tried as a last resort,
     this is left in so that on MSDOS it is preferred to /tmp on the
--- 46,73 ----
  
  #include "libiberty.h"
  extern int mkstemps ();
  
  #ifndef DIR_SEPARATOR
  #define DIR_SEPARATOR '/'
  #endif
  
+ #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+   defined (__OS2__)
+ #define HAVE_DOS_BASED_FILE_SYSTEM
+ #ifndef DIR_SEPARATOR_2 
+ #define DIR_SEPARATOR_2 '\\'
+ #endif
+ #endif
+ 
+ /* Define IS_DIR_SEPARATOR.  */
+ #ifndef DIR_SEPARATOR_2
+ # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+ #else /* DIR_SEPARATOR_2 */
+ # define IS_DIR_SEPARATOR(ch) \
+ 	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+ #endif /* DIR_SEPARATOR_2 */
+ 
  /* On MSDOS, write temp files in current dir
     because there's no place else we can expect to use.  */
  /* ??? Although the current directory is tried as a last resort,
     this is left in so that on MSDOS it is preferred to /tmp on the
*************** choose_temp_base ()
*** 129,138 ****
  			   + strlen (TEMP_FILE) + 1);
    strcpy (temp_filename, base);
  
    if (len != 0
!       && temp_filename[len-1] != '/'
!       && temp_filename[len-1] != DIR_SEPARATOR)
      temp_filename[len++] = DIR_SEPARATOR;
    strcpy (temp_filename + len, TEMP_FILE);
  
    mktemp (temp_filename);
--- 139,147 ----
  			   + strlen (TEMP_FILE) + 1);
    strcpy (temp_filename, base);
  
    if (len != 0
!       && !IS_DIR_SEPARATOR (temp_filename[len-1]))
      temp_filename[len++] = DIR_SEPARATOR;
    strcpy (temp_filename + len, TEMP_FILE);
  
    mktemp (temp_filename);
*************** make_temp_file (suffix)
*** 182,191 ****
  			   + suffix_len + 1);
    strcpy (temp_filename, base);
  
    if (base_len != 0
!       && temp_filename[base_len-1] != '/'
!       && temp_filename[base_len-1] != DIR_SEPARATOR)
      temp_filename[base_len++] = DIR_SEPARATOR;
    strcpy (temp_filename + base_len, TEMP_FILE);
  
    if (suffix)
--- 191,199 ----
  			   + suffix_len + 1);
    strcpy (temp_filename, base);
  
    if (base_len != 0
!       && !IS_DIR_SEPARATOR(temp_filename[base_len-1]))
      temp_filename[base_len++] = DIR_SEPARATOR;
    strcpy (temp_filename + base_len, TEMP_FILE);
  
    if (suffix)
*** ./libiberty/pexecute.c.orig	Tue Feb 22 15:49:32 2000
--- ./libiberty/pexecute.c	Wed Feb 23 14:25:36 2000
*************** pexecute (program, argv, this_pname, tem
*** 152,160 ****
      abort ();
  
  #ifdef __GO32__
    /* ??? What are the possible return values from spawnv?  */
!   rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
  #else
    char *scmd, *rf;
    FILE *argfile;
    int i, el = flags & PEXECUTE_SEARCH ? 4 : 0;
--- 152,160 ----
      abort ();
  
  #ifdef __GO32__
    /* ??? What are the possible return values from spawnv?  */
!   rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv);
  #else
    char *scmd, *rf;
    FILE *argfile;
    int i, el = flags & PEXECUTE_SEARCH ? 4 : 0;
*************** pexecute (program, argv, this_pname, tem
*** 201,209 ****
  
    if (rc == -1)
      {
        *errmsg_fmt = install_error_msg;
!       *errmsg_arg = program;
        return -1;
      }
  
    /* Tuck the status away for pwait, and return a "pid".  */
--- 201,209 ----
  
    if (rc == -1)
      {
        *errmsg_fmt = install_error_msg;
!       *errmsg_arg = (char *)program;
        return -1;
      }
  
    /* Tuck the status away for pwait, and return a "pid".  */
*************** pwait (pid, status, flags)
*** 221,235 ****
    if (pid != last_pid
        /* Called twice for the same child?  */
        || pid == last_reaped)
      {
!       /* ??? ECHILD would be a better choice.  Can we use it here?  */
        errno = EINVAL;
        return -1;
      }
!   /* ??? Here's an opportunity to canonicalize the values in STATUS.
!      Needed?  */
    *status = last_status;
    last_reaped = last_pid;
    return last_pid;
  }
  
--- 221,243 ----
    if (pid != last_pid
        /* Called twice for the same child?  */
        || pid == last_reaped)
      {
!       /* ECHILD is a better choice, if we can use it.  */
! #ifdef __DJGPP__
!       errno = ECHILD;
! #else
        errno = EINVAL;
+ #endif
        return -1;
      }
!   /* Here's an opportunity to canonicalize the values in STATUS, if
!      needed.  */
! #ifdef __DJGPP__
!   *status = (last_status >> 8);
! #else
    *status = last_status;
+ #endif
    last_reaped = last_pid;
    return last_pid;
  }
  
*** intl/aclocal.m4.orig	Mon May  3 03:29:04 1999
--- intl/aclocal.m4	Sun Feb 27 17:58:18 2000
*************** __argz_count __argz_stringify __argz_nex
*** 264,270 ****
     dnl Determine which catalog format we have (if any is needed)
     dnl For now we know about two different formats:
     dnl   Linux libc-5 and the normal X/Open format
!    if test -f $srcdir/po2tbl.sed.in; then
        if test "$CATOBJEXT" = ".cat"; then
  	 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  
--- 264,270 ----
     dnl Determine which catalog format we have (if any is needed)
     dnl For now we know about two different formats:
     dnl   Linux libc-5 and the normal X/Open format
!    if test -f $srcdir/po2tblsed.in; then
        if test "$CATOBJEXT" = ".cat"; then
  	 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  
*************** __argz_count __argz_stringify __argz_nex
*** 274,280 ****
        fi
        dnl po2tbl.sed is always needed.
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
! 	 $srcdir/po2tbl.sed.in > po2tbl.sed
     fi
  
     dnl In the intl/Makefile.in we have a special dependency which makes
--- 274,280 ----
        fi
        dnl po2tbl.sed is always needed.
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
! 	 $srcdir/po2tblsed.in > po2tbl.sed
     fi
  
     dnl In the intl/Makefile.in we have a special dependency which makes
*** ./include/filenames.h.orig	Mon Feb 28 01:29:26 2000
--- ./include/filenames.h	Mon Feb 28 01:13:24 2000
***************
*** 0 ****
--- 1,23 ----
+ /* Macros for taking apart, interpreting and processing file names.
+ 
+    These are here because some non-Posix (a.k.a. DOSish) systems have
+    the drive letter brain-damage at the beginning of an absolute file
+    name, use forward- and back-slash in path names interchangeably, and
+    some of them have case-insensitive file names.  */
+ 
+ #if defined(__MSDOS__) || defined(_WIN32)
+ #define IS_SLASH(c)     (((c) == '/') || ((c) == '\\'))
+ #define IS_ABSOLUTE(f)  ((IS_SLASH((f)[0]) || ((f)[0] && (f)[1] == ':')))
+ #define DOSISH_FILENAMES 1
+ #define MONOCASE_FILENAMES 1
+ #else
+ #define IS_SLASH(c)	((c) == '/')
+ #define IS_ABSOLUTE(f)	(IS_SLASH((f)[0]))
+ #define MONOCASE_FILENAMES 0
+ #endif
+ 
+ #if MONOCASE_FILENAMES
+ #define FILENAME_CMP(s1, s2)  strcasecmp(s1, s2)
+ #else
+ #define FILENAME_CMP(s1, s2)  strcmp(s1, s2)
+ #endif
*** ./ld/Makefile.in	2000/02/27 16:54:31	1.24
--- ./ldMakefile.in	2000/02/28 06:51:00
*************** ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_
*** 517,528 ****
  	$(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
--- 517,536 ----
  	$(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
*** intl/configure.orig	Mon May  3 03:29:04 1999
--- intl/configure	Mon Feb 28 01:54:42 2000
*************** echo "configure:2425: checking for catal
*** 2445,2451 ****
     fi
     
  
!             if test -f $srcdir/po2tbl.sed.in; then
        if test "$CATOBJEXT" = ".cat"; then
  	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
--- 2445,2451 ----
     fi
     
  
!             if test -f $srcdir/po2tblsed.in; then
        if test "$CATOBJEXT" = ".cat"; then
  	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
*************** fi
*** 2485,2491 ****
  	          	 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
        fi
              sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
! 	 $srcdir/po2tbl.sed.in > po2tbl.sed
     fi
  
              if test "$PACKAGE" = "gettext"; then
--- 2485,2491 ----
  	          	 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
        fi
              sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
! 	 $srcdir/po2tblsed.in > po2tbl.sed
     fi
  
              if test "$PACKAGE" = "gettext"; then
*************** s%@GT_NO@%$GT_NO%g
*** 2682,2687 ****
--- 2682,2688 ----
  s%@GT_YES@%$GT_YES%g
  s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
  s%@l@%$l%g
+   s,po2tbl\.sed\.in,po2tblsed.in,g
  
  CEOF
  EOF
