--- binutils-2.9.1/bfd/amigaos.c	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/bfd/amigaos.c	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,3313 @@
+/* BFD back-end for Commodore-Amiga AmigaOS binaries.
+   Copyright (C) 1990-1994 Free Software Foundation, Inc.
+   Contributed by Leonard Norrgard.  Partially based on the bout
+   and ieee BFD backends and Markus Wild's tool hunk2gcc.
+   Revised and updated by Stephan Thesing 
+
+This file is part of BFD, the Binary File Descriptor library.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/*
+SECTION
+	amiga back end
+
+This section describes the overall structure of the Amiga BFD back end.
+The linker stuff can be found in @xref{amigalink}.
+@menu
+@* implementation::
+@* amigalink::
+@end menu
+
+INODE
+implementation, amigalink, amiga, amiga
+
+
+SECTION
+	implementation
+
+
+The need for a port of the bfd library for Amiga style object (hunk) files
+arose by the desire to port the GNU debugger gdb to the Amiga.
+Also, the linker ld should be updated to the current version (2.5.2).
+@@*
+This port bases on the work done by Leonard Norrgard, who started porting
+gdb. Raphael Luebbert, who supports the ixemul.library, has also worked on
+implementing the needed @code{ptrace()} system call and gas2.5.
+
+@menu
+@* not supported::
+@* Does it work ?::
+@* TODO::
+@end menu
+
+INODE
+not supported, Does it work ?,implementation,implementation
+SUBSECTION
+	not supported
+
+Currently, the implementation does not support Amiga link library files, like
+e.g. amiga.lib. This may be added in a later version, if anyone starts work
+on it, or I find some time for it.
+
+The handling of the symbols in hunk files is a little bit broken:
+	  o The symbols in a load file are totally ignored at the moment, so gdb and gprof
+            do not work.
+	  o The symbols of a object module (Hunk file, starting with HUNK_UNIT) are read in
+            correctly, but HUNK_SYMBOL hunks are also ignored.
+
+The reason for this is the following:
+Amiga symbol hunks do not allow for much information. Only a name and a value are allowed.
+On the other hand, a.out format carries along much more information (see, e.g. the
+entry on set symbols in the ld manual). The old linker copied this information into
+a HUNK_DEBUG hunk. Now there is the choice:
+	o ignoring the debug hunk, read in only HUNK_SYMBOL definitions => extra info is lost.
+	o read in the debug hunk and use the information therein => How can clashs between the
+          information in the debug hunk and HUNK_SYMBOL or HUNK_EXT hunks be avoided ?
+I haven't decided yet, what to do about this.
+
+
+Although bfd allows to link together object modules of different flavours, 
+producing a.out style executables does not work on Amiga :-)
+It should, however, be possible to create a.out files with the -r option of ld
+(incremental link).
+
+INODE 
+Does it work ?,TODO ,not supported , implementation
+SUBSECTION
+	Does it work ?
+
+Currently, the following utilities work:
+	o objdump
+	o objcopy
+	o strip
+	o nm
+	o ar
+	o gas
+
+	
+INODE
+TODO, , Does it work ?, implementation
+SUBSECTION
+	TODO
+
+	o fix fixme:s
+
+@*
+BFD:
+	o add flag to say if the format allows multiple sections with the
+          same name.  Fix bfd_get_section_by_name() and bfd_make_section()
+          accordingly.
+       
+	o dumpobj.c: the disassembler: use relocation record data to find symbolic
+           names of addresses, when available.  Needs new routine where one can
+          specify the source section of the symbol to be printed as well as some
+          rewrite of the disassemble functions.
+       
+*/
+
+#include "bfd.h"
+#include "bfdlink.h"
+#include "sysdep.h"
+#include "genlink.h"
+#include "libbfd.h"
+#include "libamiga.h"
+
+#ifndef alloca
+extern PTR alloca ();
+#endif
+
+typedef struct aout_symbol {
+  asymbol symbol;
+  short desc;
+  char other;
+  unsigned char type;
+} aout_symbol_type;
+
+#include "aout/aout64.h"
+
+typedef struct amiga_ardata_struct {
+  /* generic stuff */
+  struct artdata generic;
+  /* amiga-specific stuff */
+  unsigned long filesize;
+  struct arch_syms *defsyms;
+  unsigned long defsym_count;
+} amiga_ardata_type;
+
+#define amiga_ardata(abfd) ((abfd)->tdata.amiga_ardata)
+
+#define GL(x) bfd_get_32 (abfd, (bfd_byte *) (x))
+#define GW(x) bfd_get_16 (abfd, (bfd_byte *) (x))
+#define LONGSIZE(l) (((l)+3) >> 2)
+
+#define DEBUG_AMIGA 10000
+
+static long determine_datadata_relocs PARAMS ((bfd *, asection *));
+static boolean amiga_write_section_contents PARAMS ((bfd *, asection *,
+						     asection *, long, long*));
+static boolean amiga_write_symbols PARAMS ((bfd *, asection *));
+static boolean amiga_digest_file ();
+static boolean amiga_mkobject ();
+static boolean amiga_mkarchive ();
+static boolean amiga_read_unit PARAMS ((bfd *, unsigned long));
+static boolean amiga_read_load PARAMS ((bfd *));
+static boolean amiga_handle_cdb_hunk PARAMS ((bfd *, unsigned long,
+					     unsigned long, int,
+					     unsigned long));
+static boolean amiga_handle_rest PARAMS ((bfd *,asection *,boolean));
+static boolean write_name PARAMS ((bfd*, const char*, long));
+
+/* AmigaOS doesn't like symbols names longer than 124 characters */
+#define MAX_NAME_SIZE 124
+
+extern int amiga_pOS_flg;
+
+#if DEBUG_AMIGA
+#include <varargs.h>
+static void
+error_print(va_alist)
+va_dcl
+{
+  va_list args;
+  char *fmt;
+
+  va_start (args);
+  fmt = va_arg (args, char *);
+
+  vfprintf (stderr, fmt, args);
+  va_end (args);
+}
+
+#define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
+#else
+#define DPRINT(L,x) 
+#endif
+
+reloc_howto_type howto_hunk_reloc8 =
+{
+  HUNK_RELOC8, /* type */
+  0,           /* rightshift */
+  0,           /* size */
+  8,           /* bitsize */
+  true,        /* pc_relative */
+  0,           /* bitpos */
+  complain_overflow_bitfield,  /* complain_on_overflow */
+  0,           /* special_function */
+  "reloc8",    /* textual name */
+  false,       /* partial_inplace? */
+  0x000000ff,  /* src_mask */
+  0x000000ff,  /* dst_mask */
+  true         /* pcrel_offset */
+};
+
+reloc_howto_type howto_hunk_reloc16 =
+{HUNK_RELOC16,0,1,16,true,0,complain_overflow_bitfield,0,"reloc16",false,0x0000ffff,0x0000ffff,true};
+
+reloc_howto_type howto_hunk_reloc32 =
+{HUNK_RELOC32,0,2,32,true,0,complain_overflow_bitfield,0,"reloc32",false,0xffffffff,0xffffffff,true};
+
+reloc_howto_type howto_hunk_drel8 =
+{HUNK_DREL8,0,0,8,false,0,complain_overflow_bitfield,0,"drel8",false,0x000000ff,0x000000ff,false};
+
+reloc_howto_type howto_hunk_drel16 =
+{HUNK_DREL16,0,1,16,false,0,complain_overflow_bitfield,0,"drel16",false,0x0000ffff,0x0000ffff,false};
+
+reloc_howto_type howto_hunk_drel32 =
+{HUNK_DREL32,0,2,32,false,0,complain_overflow_bitfield,0,"drel32",false,0xffffffff,0xffffffff,false};
+
+reloc_howto_type *amiga_howto_array[2][3] =
+{
+  { &howto_hunk_reloc8, &howto_hunk_reloc16, &howto_hunk_reloc32 },
+  { &howto_hunk_drel8, &howto_hunk_drel16, &howto_hunk_drel32 }
+};
+
+/* The following are gross hacks that need to be fixed.  The problem is
+   that the linker unconditionally references these values without
+   going through any of bfd's standard interface.  Thus they need to
+   be defined in a bfd module that is included in *all* configurations,
+   and are currently in bfd.c, otherwise linking the linker will fail
+   on non-Amiga target configurations. */
+/* This one is used by the linker and tells us, if a debug hunk should be
+   written out*/
+extern int write_debug_hunk;
+/* This is also used by the linker to set the attribute of sections */
+extern int amiga_attribute;
+
+static boolean
+get_long (abfd, n)
+    bfd *abfd;
+    unsigned long *n;
+{
+  if (bfd_read ((PTR)n, 1, sizeof (*n), abfd) != sizeof (*n))
+    return false;
+  *n = GL (n);
+  return true;
+}
+
+static const struct bfd_target *
+amiga_object_p (abfd)
+     bfd *abfd;
+{
+  char buf[8];
+  unsigned int x;
+  struct stat stat_buffer;
+
+  /* An Amiga object file must be at least 8 bytes long.  */
+  if (bfd_read ((PTR) buf, 1, 8, abfd) != 8)
+    {
+      bfd_set_error(bfd_error_wrong_format);
+      return 0;
+    }
+
+  bfd_seek (abfd, 0, SEEK_SET);
+
+  /* Does it look like an Amiga object file?  */
+  x = GL(buf);
+  if ((x != HUNK_UNIT) && (x != HUNK_HEADER) && (x != HUNK_HEADER_POS))
+    {
+      /* Not an Amiga file.  */
+      bfd_set_error(bfd_error_wrong_format);
+      return 0;
+    }
+
+  /* Can't fail and return (but must be declared boolean to suit
+     other bfd requirements).  */
+  (void) amiga_mkobject (abfd);
+
+  AMIGA_DATA(abfd)->IsLoadFile = (x == HUNK_HEADER || x == HUNK_HEADER_POS);
+
+  if (!amiga_digest_file (abfd))
+    {
+      /* Something went wrong.  */
+      DPRINT (20,("bfd parser stopped at offset 0x%lx\n", bfd_tell (abfd)));
+      return (const struct bfd_target *) 0;
+    }
+
+  /* Set default architecture to m68k:68000.  */
+  /* So we can link on 68000 AMIGAs..... */
+  abfd->arch_info = bfd_scan_arch ("m68k:68000");
+
+  return (abfd->xvec);
+}
+
+/* Skip over the hunk length longword + the number of longwords given there.  */
+#define next_hunk(abfd) \
+  { AMIGA_DATA(abfd)->file_pointer += 1 + GL(AMIGA_DATA(abfd)->file_pointer); }
+
+static asection *
+amiga_get_section_by_hunk_number (abfd, hunk_number)
+     bfd *abfd;
+      long hunk_number;
+{
+  /* A cache, so we don't have to search the entire list every time.  */
+  static asection *last_reference;
+  static bfd *last_bfd;
+  asection *p;
+
+  switch(hunk_number)
+    {
+    case -1:
+      return bfd_abs_section_ptr;
+      break;
+    case -2:
+      return bfd_und_section_ptr;
+      break;
+    case -3: 
+      return bfd_com_section_ptr;
+      break;
+    default:
+      if (last_reference)
+	if (last_bfd == abfd && last_reference->target_index == hunk_number)
+	  return last_reference;
+      for (p = abfd->sections; p != NULL; p = p->next)
+	if (p->target_index == hunk_number)
+	  {
+	    last_reference = p;
+	    last_bfd = abfd;
+	    return p;
+	  }
+      BFD_FAIL();
+      break;
+    }
+  return (asection *) 0;
+}
+
+static boolean
+amiga_add_reloc (abfd, section, offset, symbol, howto, target_hunk)
+     bfd *abfd;
+     asection *section;
+     bfd_size_type offset;
+     amiga_symbol_type * symbol;
+     reloc_howto_type *howto;
+     long target_hunk;
+{
+  amiga_reloc_type *reloc;
+  static int count;
+  asection *target_sec;
+
+  reloc = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
+  reloc->next = 0;
+
+  if (!reloc)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return(false);
+    }
+
+  abfd -> flags |= HAS_RELOC;
+  section -> flags |= SEC_RELOC;
+
+  if (amiga_per_section(section)->reloc_tail)
+    amiga_per_section(section)->reloc_tail->next = reloc;
+  else
+    section->relocation = (struct reloc_cache_entry *) reloc;
+  amiga_per_section(section)->reloc_tail = reloc;
+  reloc->next = NULL;
+  reloc->relent.address = offset;
+  reloc->relent.addend = 0;
+  reloc->relent.howto = howto;
+
+  if (symbol==NULL) {		/* relative to section */
+    target_sec = amiga_get_section_by_hunk_number (abfd, target_hunk);
+     if (target_sec)
+       reloc->symbol = (amiga_symbol_type *)target_sec->symbol;
+     else
+       return false;
+  }
+  else
+    reloc->symbol = symbol;
+  reloc->relent.sym_ptr_ptr=(asymbol **)(&(reloc->symbol));
+  reloc->target_hunk = target_hunk;
+
+  return true;
+}
+
+/* BFD doesn't currently allow multiple sections with the same
+   name, so we try a little harder to get a unique name.  */
+asection *
+amiga_make_unique_section (abfd, name)
+     bfd *abfd;
+     CONST char *name;
+{
+  asection *section;
+
+  bfd_set_error (bfd_error_no_error);
+  section = bfd_make_section (abfd, name);
+  if (!section && (bfd_get_error() == bfd_error_no_error))
+    {
+#if 0
+      int i = 1;
+      char *new_name;
+
+      new_name = bfd_alloc (abfd, strlen(name) + 4);
+
+      /* We try to come up with an original name (since BFD
+	 currently requires all sections to have different names).  */
+      while (!section && (i<=99))
+	{
+	  sprintf (new_name, "%s_%u", name, i++);
+	  section = bfd_make_section (abfd, new_name);
+	}
+#else
+      section = bfd_make_section_anyway (abfd, name);
+#endif
+    }
+  return section;
+}
+
+
+
+#if DEBUG_AMIGA
+#define DPRINTHUNK(x)   fprintf (stderr,"Processing %s hunk (0x%x)...",\
+	  (x) == HUNK_UNIT ? "HUNK_UNIT" :\
+	  (x) == HUNK_NAME ? "HUNK_NAME" :\
+	  (x) == HUNK_DEBUG ? "HUNK_DEBUG" :\
+	  (x) == HUNK_OVERLAY ? "HUNK_OVERLAY" :\
+	  (x) == HUNK_BREAK ? "HUNK_BREAK" :\
+	  (x) == HUNK_HEADER ? "HUNK_HEADER" :\
+	  (x) == HUNK_HEADER_POS ? "HUNK_HEADER_POS" :\
+	  (x) == HUNK_CODE ? "HUNK_CODE" :\
+	  (x) == HUNK_DATA ? "HUNK_DATA" :\
+	  (x) == HUNK_BSS ? "HUNK_BSS" :\
+	  (x) == HUNK_RELOC8 ? "HUNK_RELOC8" :\
+	  (x) == HUNK_RELOC16 ? "HUNK_RELOC16" :\
+	  (x) == HUNK_RELOC32 ? "HUNK_RELOC32" :\
+	  (x) == HUNK_DREL8 ? "HUNK_DREL8" :\
+	  (x) == HUNK_DREL16 ? "HUNK_DREL16" :\
+	  (x) == HUNK_DREL32 ? "HUNK_DREL32" :\
+	  (x) == HUNK_SYMBOL ? "HUNK_SYMBOL" :\
+	  (x) == HUNK_EXT ? "HUNK_EXT" :\
+	  (x) == HUNK_END ? "HUNK_END" :\
+	  (x) == HUNK_LIB ? "HUNK_LIB" :\
+	  (x) == HUNK_INDEX ? "HUNK_INDEX" :\
+	  "*unknown*",(x))
+#define DPRINTHUNKEND fprintf(stderr,"...done\n")
+#else
+#define DPRINTHUNK(x) 
+#define DPRINTHUNKEND 
+#endif
+
+#define STRSZ_BLOCK 4096
+#define CARSYM_BLOCK 200
+
+static boolean
+parse_archive_units (abfd, n_units, filesize, one, syms, symcount)
+  bfd *abfd;
+  int *n_units;
+  unsigned long filesize;
+  boolean one;		       /* parse only the first unit ? */
+  struct arch_syms **syms;
+  symindex *symcount;
+{
+  unsigned long hunk_type,pos,no,hunk,len,n;
+  long section_idx=-1;
+  symindex defsymcount=0;
+  unsigned long str_size=0, str_tot_size=0;
+  char *strings = NULL;
+  unsigned long unit_offset, defsym_pos=0;
+  struct arch_syms *nsyms, *syms_tail=NULL;
+
+  *n_units = 0;
+  while (get_long (abfd, &hunk_type)) {
+    switch (hunk_type) {
+    case HUNK_UNIT:
+      unit_offset = bfd_tell (abfd)-4;
+      (*n_units)++;
+      if (one && *n_units>1) {
+	bfd_seek (abfd, -4, SEEK_CUR);
+	return true;
+      }
+      if (get_long (abfd, &len) && !bfd_seek (abfd, len<<2, SEEK_CUR)) {
+	section_idx = -1;
+      }
+      else
+	return false;
+      break;
+    case HUNK_DEBUG:
+    case HUNK_NAME:
+      if (!(get_long (abfd, &len) && !bfd_seek (abfd, len<<2, SEEK_CUR)))
+	return false;
+      break;
+    case HUNK_CODE:
+    case HUNK_DATA:
+      section_idx++;
+      if (!(get_long (abfd, &len) && !bfd_seek (abfd, (len&0x3fffffff)<<2,
+						SEEK_CUR)))
+	return false;
+      break;
+    case HUNK_BSS:
+      section_idx++;
+      if (!get_long (abfd, &len))
+	return false;
+      break;
+    case HUNK_RELOC8:
+    case HUNK_RELOC16:
+    case HUNK_RELOC32:
+      if (!get_long (abfd, &no))
+	return false;
+      while (no) {
+	/* destination hunk */
+	if (!get_long (abfd, &hunk))
+	  return false;
+	/* skip the offsets */
+	if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	  return false;
+	/* read the number of offsets to come */
+	if (!get_long (abfd, &no))
+	  return false;
+      }
+      break;
+    case HUNK_END:
+      break;
+    case HUNK_DREL8:
+    case HUNK_DREL16:
+    case HUNK_DREL32:
+      fprintf (stderr, "hunk_drelx not supported yet\n");
+      return false;
+    case HUNK_SYMBOL:
+      if (!get_long (abfd, &len))
+	return false;
+      while (len) {
+	if (bfd_seek (abfd, (len+1)<<2, SEEK_CUR))
+	  return false;
+	if (!get_long (abfd, &len))
+	  return false;
+      }
+      break;
+    case HUNK_EXT:
+      defsym_pos = 0;
+      if (!get_long (abfd, &n))
+	return false;
+      while (n != 0) {
+	unsigned long tmp, type;
+
+	len = n & 0xffffff;
+	type = (n>>24) & 0xff;
+	switch (type) {
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS:
+	  /* retain the positions of defined symbols for each object
+             in the archive. They'll be used later to build a
+             pseudo-armap, which _bfd_generic_link_add_archive_symbols
+             needs */
+	  if (defsym_pos==0)
+	    defsym_pos = bfd_tell (abfd)-4;
+	  /* skip name & value */
+	  if (bfd_seek (abfd, (len+1)<<2, SEEK_CUR))
+	    return false;
+	  defsymcount++;
+	  break;
+
+	case EXT_REF8:
+	case EXT_REF16:
+	case EXT_REF32:
+	case EXT_DEXT8:
+	case EXT_DEXT16:
+	case EXT_DEXT32:
+	  /* skip name */
+	  if (bfd_seek (abfd, len<<2, SEEK_CUR))
+	    return false;
+
+	  if (!get_long (abfd, &no))
+	    return false;
+	  if (no)
+	    if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	      return false;
+	  break;
+
+	case EXT_COMMON:
+	  /* skip name */
+	  if (bfd_seek (abfd, len<<2, SEEK_CUR))
+	    return false;
+	  /* size of common block */
+	  if (!get_long (abfd, &len))
+	    return false;
+	  /* number of references */
+	  if (!get_long (abfd, &no))
+	    return false;
+	  /* skip references */
+	  if (no)
+	    if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	      return false;
+	  break;
+
+	default: /* error */
+	  fprintf (stderr, "unexpected type in hunk_ext at offset 0x%lx\n",
+		   bfd_tell (abfd));
+	  return false;
+	}
+
+	if (!get_long (abfd, &n))
+	  return false;
+      }
+      if (defsym_pos != 0 && syms) {
+	/* there are some defined symbols, keep enough information on
+           them to simulate an armap later on */
+	nsyms = (struct arch_syms*) bfd_alloc (abfd, sizeof (struct arch_syms));
+	nsyms->next = NULL;
+	if (syms_tail)
+	  syms_tail->next = nsyms;
+	else
+	  *syms = nsyms;
+	syms_tail = nsyms;
+	nsyms->offset = defsym_pos;
+	nsyms->size = bfd_tell (abfd) - defsym_pos;
+	nsyms->unit_offset = unit_offset;
+      }
+      break; /* of HUNK_EXT */
+
+    default:
+#if 0
+      fprintf (stderr, "unexpected hunk 0x%lx at offset 0x%lx\n",
+	       hunk_type, bfd_tell (abfd));
+#endif
+      return false;
+    }
+  }
+  if (syms && symcount)
+    *symcount = defsymcount;
+  return (bfd_tell (abfd) == filesize);
+}
+
+static boolean
+amiga_digest_file (abfd)
+     bfd *abfd;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type,pos;
+  struct stat stat_buffer;
+
+  if (bfd_read ((PTR) &hunk_type, 1, 4, abfd) != 4)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  if (bfd_stat (abfd, &stat_buffer) < 0)
+    return false;
+
+  hunk_type = HUNK_VALUE(GL(&hunk_type));
+
+  switch (hunk_type)
+    {
+    case HUNK_UNIT:
+      /* Read the unit(s) */
+/*
+      while ((pos=bfd_tell (abfd)) < stat_buffer.st_size)
+	{
+*/
+      if (!amiga_read_unit (abfd, stat_buffer.st_size - abfd->origin))
+	return false;
+      if (abfd->arelt_data)
+	arelt_size (abfd) = bfd_tell (abfd);
+/*	}*/
+      break;
+
+    case HUNK_HEADER:
+    case HUNK_HEADER_POS:
+      /* This is a load file */
+      if (!amiga_read_load (abfd))
+	return(false);
+      break;
+    }
+
+  return true;
+}/* of amiga_digest_file */
+
+
+/* Read in Unit file */
+/* file pointer is located after the HUNK_UNIT LW */
+static boolean
+amiga_read_unit (abfd, size)
+    bfd *abfd;
+    unsigned long size;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type, hunk_number=0;
+  unsigned long sz;
+  unsigned long buf[2];
+
+  /* read LW length of unit's name */
+  if (bfd_read (buf, sizeof (buf[0]), 1, abfd) != sizeof (buf[0]))
+    return false;
+
+  /* and skip it (FIXME maybe) */
+  if (bfd_seek (abfd, GL(buf)<<2, SEEK_CUR))
+    return false;
+
+  while (bfd_tell (abfd) < size)
+    {
+      if (!get_long (abfd, &hunk_type))
+	return false;
+
+      /* Now there may be CODE, DATA, BSS, SYMBOL, DEBUG, RELOC Hunks */
+      hunk_type = HUNK_VALUE (hunk_type);
+
+      switch(hunk_type)
+	{
+	case HUNK_UNIT:
+	  /* next unit, seek back and return */
+	  return (bfd_seek (abfd, -4, SEEK_CUR) == 0);
+
+	case HUNK_DEBUG:
+	  /* we don't parse hunk_debug at the moment */
+	  if (!get_long (abfd, &sz) || bfd_seek (abfd, sz<<2, SEEK_CUR))
+	    return false;
+	  break;
+
+	case HUNK_NAME:
+	case HUNK_CODE:
+	case HUNK_DATA:
+	case HUNK_BSS:
+	  /* Handle this hunk, including relocs, etc.
+	     The finishing HUNK_END is consumed by the routine
+	     */
+	  if (!amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number++,
+				      0, -1))
+	    return false;
+
+	  break;
+
+	default:
+	  /* Something very nasty happened:
+	     Illegal Hunk occured....
+	     */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch hunk_type */
+
+      /* Next hunk */
+    }
+  return true;
+}
+
+
+/* Read a load file */
+static boolean
+amiga_read_load (abfd)
+    bfd *abfd;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd); 
+  unsigned long *hunk_attributes, *hunk_sizes;
+  int hunk_number=0;
+  int hunk_type;
+  unsigned long max_hunk_number;
+  int i,n;
+  unsigned long buf[4];
+
+  /* Read hunk lengths (and memory attributes...) */
+  /* Read in each hunk */
+
+  if (bfd_read (buf, sizeof(*buf), 4, abfd) != 4 * sizeof (*buf))
+    return false;
+
+  /* If there are resident libs: abort (obsolete feature) */
+  if (GL(buf) != 0)
+    return false;
+
+  max_hunk_number = GL(buf+1);
+
+  /* Sanity */
+  if (max_hunk_number<1)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  amiga_data->nb_hunks = max_hunk_number;
+
+  /* Num of root hunk must be 0 */
+  if (GL(buf+2)!=0)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  /* Num of last hunk must be mhn-1 */
+  if (GL(buf+3) != max_hunk_number-1)
+    {
+      fprintf (stderr, "Overlay loadfiles are not supported\n");
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  hunk_sizes = alloca (max_hunk_number * sizeof (unsigned long));
+  hunk_attributes = alloca (max_hunk_number * sizeof (unsigned long));
+
+  if (hunk_sizes == NULL || hunk_attributes == NULL)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return false;
+    }
+
+  if (bfd_read (hunk_sizes, sizeof (unsigned long), max_hunk_number, abfd) !=
+      max_hunk_number * sizeof (unsigned long))
+    return false;
+
+  /* Now, read in sizes and memory attributes */
+  for (i=0; i<max_hunk_number; i++)
+    {
+      /* convert to host format */
+      hunk_sizes[i] = GL(hunk_sizes+i);
+      switch (HUNK_ATTRIBUTE (hunk_sizes[i]))
+	{
+	case HUNK_ATTR_CHIP:
+	  hunk_attributes[i] = MEMF_CHIP;
+	  break;
+	case HUNK_ATTR_FAST:
+	  hunk_attributes[i] = MEMF_FAST;
+	  break;
+	case HUNK_ATTR_FOLLOWS:
+	  if (!get_long (abfd, &hunk_attributes[i]))
+	    return false;
+	  break;
+	default:
+	  hunk_attributes[i] = 0;
+	  break;
+	}
+      hunk_sizes[i] = (HUNK_VALUE (hunk_sizes[i]))<<2;
+    }
+
+  for (hunk_number=0; hunk_number < max_hunk_number; hunk_number++)
+    {
+      if (bfd_read (buf, sizeof(*buf), 1, abfd) != sizeof(*buf))
+	return false;
+      hunk_type = HUNK_VALUE (GL(buf));
+
+      /* This may be HUNK_NAME, CODE, BSS, DEBUG, DATA */
+      switch(hunk_type)
+	{
+	case HUNK_NAME:
+	case HUNK_CODE:
+	case HUNK_DATA:
+	case HUNK_BSS:
+	case HUNK_DEBUG:
+	  if (!amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number,
+				      hunk_attributes[hunk_number],
+				      hunk_sizes[hunk_number]))
+	    {
+	      bfd_set_error (bfd_error_wrong_format);
+	      return false;
+	    }
+	  break;
+
+	default:
+	  /* illegal hunk */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch */
+    }
+
+  return true;
+}/* Of amiga_read_load */
+
+
+/* Handle NAME, CODE, DATA, BSS, DEBUG Hunks */
+static boolean 
+amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number, hunk_attribute,
+		       hunk_size)
+     bfd *abfd;
+     unsigned long hunk_type;
+     unsigned long hunk_number;
+     int hunk_attribute;
+     unsigned long hunk_size;
+/* If hunk_size==-1, then we are digesting a HUNK_UNIT */
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  char *current_name=NULL;
+  unsigned long len;
+  asection *current_section=NULL;
+  int is_load = (hunk_size!=-1);
+  unsigned long buf[6];
+  int secflags;
+
+  if (hunk_type==HUNK_NAME) /* get name */
+    {
+      if (!get_long (abfd, &len))
+	return false;
+      len = (HUNK_VALUE (len)) << 2;
+      current_name = bfd_alloc (abfd, len+1);
+      if (!current_name)
+	return false;
+
+      if (bfd_read (current_name, 1, len, abfd) != len)
+	return false;
+
+      current_name [len] = '\0';
+
+      if (!get_long (abfd, &hunk_type))
+	return false;
+
+    }
+  else /* Set curent name to something appropriate */
+    current_name=(hunk_type==HUNK_CODE)?".text":
+                 (hunk_type==HUNK_BSS)?".bss":".data";
+
+  /* file_pointer is now after hunk_type */
+  secflags = 0;
+  switch (hunk_type)
+    {
+    case HUNK_CODE:
+      secflags = SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS;
+      goto do_section;
+
+    case HUNK_DATA:
+      secflags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS;
+      goto do_section;
+
+    case HUNK_BSS:
+      secflags = SEC_ALLOC;
+
+    do_section:
+      if (!get_long (abfd, &len))
+	return false;
+      len = HUNK_VALUE (len)<<2; /* Length of section */
+      if (!is_load)
+	{
+	  hunk_attribute = HUNK_ATTRIBUTE (len);
+	  hunk_attribute=(hunk_attribute==HUNK_ATTR_CHIP)?MEMF_CHIP:
+	             (hunk_attribute==HUNK_ATTR_FAST)?MEMF_FAST:0;
+	}
+
+      /* Make new section */
+      current_section = amiga_make_unique_section (abfd, current_name);
+      if (!current_section)
+	return false;
+
+      current_section->filepos = bfd_tell (abfd);
+      /* For a loadfile, the section size in memory comes from the
+         hunk header. The size on disk may be smaller. */
+      current_section->_cooked_size = current_section->_raw_size =
+	((hunk_size==-1) ? len : hunk_size);
+      current_section->target_index = hunk_number;
+      bfd_set_section_flags (abfd, current_section, secflags);
+
+      amiga_per_section(current_section)->disk_size = len; /* size on disk */
+      amiga_per_section(current_section)->attribute = hunk_attribute;
+
+      /* skip the contents */
+      if ((secflags & SEC_HAS_CONTENTS) && bfd_seek (abfd, len, SEEK_CUR))
+	return false;
+
+      if (!amiga_handle_rest (abfd, current_section, is_load))
+	return false;
+      break;
+
+      /* Currently, there is one debug hunk per executable, instead of
+         one per unit as it would with a "standard" amigaos
+         implementation. So the debug hunk is at the same level as
+         code/data/bss. This will change in the future */
+    case HUNK_DEBUG:
+      /* format of gnu debug hunk is:
+          HUNK_DEBUG
+              N
+            0413.L    Magic number
+	  symtabsize
+	  strtabsize
+	  symtabdata  [length=symtabsize]
+	  strtabdata  [length=strtabsize]
+          [pad bytes]
+	  */
+
+      /* read LW length */
+      if (bfd_read (buf, sizeof(*buf), 1, abfd) != sizeof (*buf))
+	return false;
+
+      len = GL (buf) << 2;
+      if (len > 5*sizeof(long))
+	{
+	  if (bfd_read (buf, sizeof(*buf), 6, abfd) != 6*sizeof(*buf))
+	    return false;
+
+	  if (GL(buf) == 0413) /* GNU DEBUG HUNK */
+	    {
+	      /*FIXME: we should add the symbols in the debug hunk to symtab... */
+	      amiga_data->symtab_size = GL(buf+1);
+	      amiga_data->stringtab_size = GL(buf+2);
+	      adata(abfd).sym_filepos = bfd_tell (abfd);
+	      adata(abfd).str_filepos = adata(abfd).sym_filepos +
+		amiga_data->symtab_size;
+	      len -= 5*sizeof(long);
+	    }
+	}
+      if (bfd_seek (abfd, len, SEEK_CUR))
+	return false;
+      break;
+
+    default:
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+      break;
+    } /* switch (hunk_type) */
+
+  return true;
+
+} /* Of amiga_handle_cdb_hunk */
+
+
+/* Handle rest of a hunk 
+   I.e.: Relocs, EXT, SYMBOLS... */
+static boolean
+amiga_handle_rest (abfd, current_section, isload)
+     bfd *abfd;
+     asection *current_section;
+     boolean isload;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type, type, len, n;
+  long tmp;
+  unsigned long **p, no, *countptr;
+  struct amiga_raw_symbol *sp=NULL;
+  unsigned long buf[5];
+  file_ptr filepos;
+  amiga_per_section_type *asect = amiga_per_section (current_section);
+
+  while (1)
+    {
+      if (!get_long (abfd, &hunk_type))
+	return false;
+      switch (hunk_type)
+	{
+	case HUNK_END:
+	  return true;
+	  break;
+
+	case HUNK_RELOC8:
+	  asect->raw_relocs8 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs8;
+	  goto rel;
+	case HUNK_RELOC16:
+	  asect->raw_relocs16 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs16;
+	  goto rel;
+	case HUNK_RELOC32:
+	  asect->raw_relocs32 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs32;
+	  goto rel;
+	case HUNK_DREL8:
+	  fprintf (stderr, "hunk_drel8 not supported yet\n");
+	  return false;
+	case HUNK_DREL16:
+	  fprintf (stderr, "hunk_drel16 not supported yet\n");
+	  return false;
+	case HUNK_DREL32:
+	  fprintf (stderr, "hunk_drel32 not supported yet\n");
+	  return false;
+	rel:
+	  current_section->flags |= SEC_RELOC;
+	  abfd->flags |= HAS_RELOC;
+
+	  /* read the first number of relocs */
+	  if (!get_long (abfd, &no))
+	    return false;
+
+	  /* count and skip them */
+	  while (no != 0)
+	    {
+	      current_section->reloc_count += no;
+	      (*countptr) += no;
+	      if (bfd_seek (abfd, (no+1)<<2, SEEK_CUR))
+		return false;
+	      if (!get_long (abfd, &no))
+		return false;
+	    }
+	  break;
+
+	case HUNK_SYMBOL:
+	  /* In a unit, we ignore these, since all symbol information
+	     comes with HUNK_EXT, in a load file, these are added */
+	  if (!isload)
+	    {
+	      amiga_per_section(current_section)->hunk_symbol_pos =
+		bfd_tell (abfd);
+	      /* size of first symbol */
+	      if (bfd_read (buf, sizeof(*buf), 1, abfd) != 1*sizeof (*buf))
+		return false;
+	      while (GL(buf) != 0) /* until size is 0 */
+		{
+		  /* skip the name */
+		  if (bfd_seek (abfd, (GL(buf)+1)<<2, SEEK_CUR))
+		    return false;
+		  /* read the size */
+		  if (bfd_read (buf, sizeof(*buf), 1, abfd) != 1*sizeof (*buf))
+		    return false;
+		}
+	      break;
+	    }
+	  /* We add these, by falling through... */
+
+	case HUNK_EXT:
+	  /* We leave these alone, until they are requested by the user */
+	  amiga_per_section(current_section)->hunk_ext_pos = bfd_tell (abfd);
+
+	  if (!get_long (abfd, &n))
+	    return false;
+	  while (n != 0)
+	    {
+	      /* read the symbol type and length */
+	      type = (n>>24) & 0xff;
+	      len = n & 0xffffff;
+
+	      /* skip the symbol name */
+	      if (bfd_seek (abfd, len<<2, SEEK_CUR))
+		return false;
+
+	      switch(type)
+		{
+		case EXT_SYMB: /* Symbol hunks are relative to hunk start... */
+		case EXT_DEF: /* def relative to hunk */
+		case EXT_ABS: /* def absolute */
+		  abfd->flags |= HAS_SYMS; /* We have symbols */
+		  abfd->symcount++;
+		  /* skip the value */
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  break;
+
+		case EXT_REF8: /* 8 bit ref */
+		case EXT_REF16: /* 16 bit ref */
+		case EXT_REF32: /* 32 bit ref */
+		case EXT_DEXT8: /* 8 bit base relative ref */
+		case EXT_DEXT16: /* 16 bit " "*/
+		case EXT_DEXT32: /* 32 bit " " */
+		  abfd->flags |= HAS_SYMS;
+		  abfd->symcount++;
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (tmp)
+		    {
+		      abfd->flags|=HAS_RELOC;
+		      current_section->flags|=SEC_RELOC;
+		      current_section->reloc_count += tmp;
+		      /* skip references */
+		      if (bfd_seek (abfd, tmp<<2, SEEK_CUR))
+			return false;
+		    }
+		  break;
+
+		case EXT_COMMON: /* Common ref/def */
+		  abfd->flags |= HAS_SYMS;
+		  abfd->symcount++;
+		  /* skip the size of common block: FIXME */
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (tmp)
+		    {
+		      abfd->flags |= HAS_RELOC;
+		      current_section->flags |= SEC_RELOC;
+		      current_section->reloc_count += tmp;
+		      if (bfd_seek (abfd, tmp<<2, SEEK_CUR))
+			return false;
+		    }
+		  break;
+
+		default: /* error */
+		  bfd_set_error (bfd_error_wrong_format);
+		  return false;
+		  break;
+		}/* of switch type */
+
+	      if (!get_long (abfd, &n))
+		return false;
+	    }
+	  break;
+
+	  /* If a debug hunk is found at this position, the file has
+             been generated by a third party tool and the debug info
+             here are useless to us. Just skip the hunk, then. */
+	case HUNK_DEBUG:
+	  if (!get_long (abfd, &n) || bfd_seek (abfd, n<<2, SEEK_CUR))
+	    return false;
+	  break;
+	default: /* error */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch */
+    }/* of while */
+  return true;
+}/* of amiga_handle_rest*/
+
+static boolean
+amiga_mkobject (abfd)
+     bfd *abfd;
+{
+  struct amiga_data_struct *rawptr;
+
+  rawptr = (struct amiga_data_struct *)
+    bfd_zalloc (abfd, sizeof (struct amiga_data_struct));
+  abfd->tdata.amiga_data = rawptr;
+  return rawptr != NULL;
+}
+
+static boolean
+amiga_mkarchive (abfd)
+     bfd *abfd;
+{
+  amiga_ardata_type *ar;
+  ar = (amiga_ardata_type*) bfd_zalloc (abfd, sizeof (amiga_ardata_type));
+  amiga_ardata (abfd) = ar;
+  return (ar!=NULL);
+}
+
+/* used with base relative linking */
+extern int amiga_base_relative;
+
+/* used with -resident linking */
+extern int amiga_resident;
+
+/* write nb long words (possibly swapped out) to the output file */
+static boolean
+write_longs (in, nb, abfd)
+     unsigned long *in;
+     long nb;
+     bfd *abfd;
+{
+  unsigned long out [10];
+  int i;
+  
+  while (nb > 0)
+    {
+      for (i=0; i<nb && i<10; i++)
+	out[i] = GL (in++);
+      if (bfd_write ((PTR)out, sizeof (long), i, abfd) != sizeof(long)*i)
+	return false;
+      nb -= 10;
+    }
+  return true;
+}
+
+static long
+determine_datadata_relocs (abfd, section)
+     bfd *abfd;
+     asection *section;
+{
+  long relocs = 1, i;
+  struct reloc_cache_entry *r;
+  asection *insection;
+  asymbol *sym_p;
+  
+  for (i=0;i<section->reloc_count;i++)
+    {
+      r=section->orelocation[i];
+      if (r == NULL)
+        continue;
+      sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
+      insection=sym_p->section;
+
+      /* Is reloc relative to a special section ? */
+      if ((insection==bfd_abs_section_ptr)||(insection==bfd_com_section_ptr)||
+	  (insection==bfd_und_section_ptr)||(insection==bfd_ind_section_ptr))
+	continue; /* Nothing to do, since this translates to HUNK_EXT */
+      if (insection->output_section == section)
+        relocs++;
+    }
+  return relocs;
+}
+
+/* Adjust the indices map when we decide not to output the section <sec> */
+static void
+remove_section_index (sec, index_map)
+    asection *sec;
+    long *index_map;
+{
+  int i = sec->index;
+  sec = sec->next;
+  index_map[i++] = -1;
+  while (sec!=NULL) {
+    (index_map[i++])--;
+    sec=sec->next;
+  }
+}
+
+/* Write out the contents of a bfd */
+static boolean
+amiga_write_object_contents (abfd)
+     bfd *abfd;
+{
+  struct amiga_data_struct *amiga_data=AMIGA_DATA(abfd);
+  sec_ptr p;
+  unsigned long n[5];
+  long i;
+  static const char zero[3]={0,0,0};
+  long datadata_relocs, bss_size = 0;
+  long *index_map;
+  asection *data_sec;
+
+  /* Distinguish UNITS, LOAD Files
+    Write out hunks+relocs+HUNK_EXT+HUNK_DEBUG (GNU format)*/
+  DPRINT(5,("Entering write_object_conts\n"));
+
+  abfd->output_has_begun=true; /* Output has begun */
+
+  index_map = bfd_alloc (abfd, abfd->section_count * sizeof (long));
+  if (!index_map)
+    return false;
+
+  for (i=0, p=abfd->sections; p!=NULL; p=p->next)
+    index_map[i++] = p->index;
+
+  /* Distinguish Load files and Unit files */
+  if (amiga_data->IsLoadFile)
+    {
+      DPRINT(5,("Writing Load file\n"));
+
+      /* Write out load file header */
+      if (amiga_pOS_flg)
+	n[0] = HUNK_HEADER_POS;
+      else
+	n[0] = HUNK_HEADER;
+      n[1] = n[2] = 0;
+      for (p=abfd->sections; p!=NULL; p=p->next) {
+	/* For baserel linking, don't remove the empty sections, since
+           they may get some contents later on */
+	if ((amiga_base_relative || p->_raw_size!=0 || p->_cooked_size!=0) &&
+	    !(amiga_base_relative && !strcmp (p->name, ".bss")))
+	  n[2]++;
+	else
+	  remove_section_index (p, index_map);
+      }
+
+      if (amiga_base_relative)
+	BFD_ASSERT(abfd->section_count==3);
+
+      n[3]=0;
+      n[4]=n[2]-1;
+      if (!write_longs (n, 5, abfd))
+	return false;
+
+      /* Write out sizes and memory specifiers... */
+      /* We have to traverse the section list again, bad but no other way... */
+      if (amiga_base_relative) {
+        for (p=abfd->sections; p!=NULL; p=p->next)
+	  {
+	    if (amiga_resident && strcmp(p->name,".data")==0)
+	      {
+	        datadata_relocs = determine_datadata_relocs (abfd, p);
+	        data_sec = p;
+	      }
+	    else if (strcmp(p->name,".bss")==0)
+	      {
+	        /* Get size for header*/
+	          bss_size = p->_raw_size;
+	      }
+	  }
+      }
+
+      for (p=abfd->sections; p!=NULL; p=p->next)
+	{
+          long extra = 0;
+
+	  if (index_map[p->index] < 0)
+	    continue;
+	  if (amiga_resident && (strcmp(p->name,".text")==0))
+	    extra = datadata_relocs*4;
+	  else {
+	    if (amiga_base_relative && !strcmp (p->name, ".data"))
+	      extra = bss_size;
+	  }
+
+	  if (amiga_per_section(p)->disk_size == 0)
+	    amiga_per_section(p)->disk_size = p->_raw_size;
+
+	  /* convert to a size in long words */
+	  n[0] = LONGSIZE (p->_raw_size+extra);
+
+	  i=amiga_per_section(p)->attribute;
+	  switch (i)
+	    {
+	    case MEMF_CHIP:
+	      n[0]|=0x40000000;
+	      i=1;
+	      break;
+	    case MEMF_FAST:
+	      n[0]|=0x80000000;
+	      i=1;
+	      break;
+	    case 0: /* nothing*/
+	      i=1;
+	      break;
+	    default: /* Special one */
+	      n[0]|=0xc0000000;
+	      n[1]=i;
+	      i=2;
+	      break;
+	    }/* Of switch */
+
+	  if (!write_longs (n, i, abfd))
+            return false;
+	}/* Of for */
+    }
+  else
+    {/* Unit , no base-relative linking here.... */
+      int len = strlen (abfd->filename);
+      /* Write out unit header */
+      DPRINT(5,("Writing Unit\n"));
+
+      n[0]=HUNK_UNIT;
+      if (!write_longs (n, 1, abfd))
+	return false;
+
+      i = LONGSIZE (len);
+      if (!write_name (abfd, abfd->filename, 0))
+	return false;
+    }
+
+  /* Write out every section */
+  for (p=abfd->sections; p!=NULL; p=p->next)
+    {
+      if (index_map[p->index] < 0)
+	continue;
+      if (amiga_per_section(p)->disk_size == 0)
+	amiga_per_section(p)->disk_size = p->_raw_size;
+
+      if (amiga_resident && (strcmp(p->name,".text")==0))
+        {
+          if (!amiga_write_section_contents (abfd,p,data_sec,datadata_relocs,
+					    index_map))
+	    return false;
+        }
+      else if (amiga_base_relative && (strcmp(p->name,".data")==0))
+        {
+          if (!amiga_write_section_contents (abfd,p,0,0,index_map))
+	    return false;
+        }
+      else
+        { 
+          if (!amiga_write_section_contents (abfd,p,0,0,index_map))
+	    return false;
+        }
+
+      if (!amiga_write_symbols(abfd,p)) /* Write out symbols, incl HUNK_END */
+	return false;
+
+    }/* of for sections */
+
+  /* Write out debug hunk, if requested */
+  if (amiga_data->IsLoadFile /*&& write_debug_hunk*/)
+    {
+      extern boolean
+	translate_to_native_sym_flags (bfd*, asymbol*, struct external_nlist*);
+
+      /* We have to convert all the symbols in abfd to a.out style.... */
+      struct external_nlist data;
+      int str_size, offset = 4;
+      int symbols = 0;
+      asymbol *sym;
+      asection *s;
+
+      if (abfd->symcount)
+	{
+	  /* Now, set the .text, .data and .bss fields in the tdata
+	     struct (because translate_to_native_sym_flags needs
+	     them... */
+	  for (i=0,s=abfd->sections;s!=NULL;s=s->next)
+	    if (strcmp(s->name,".text")==0)
+	      {
+		i|=1;
+		adata(abfd).textsec=s;
+	      }
+	    else if (strcmp(s->name,".data")==0)
+	      {
+	        i|=2;
+	        adata(abfd).datasec=s;
+	      }
+	    else if (strcmp(s->name,".bss")==0)
+	      {
+	        i|=4;
+	        adata(abfd).bsssec=s;
+	      }
+
+	  if (i!=7) /* One section missing... */
+	    {
+	      fprintf(stderr,"Missing section, hunk not written\n");
+	      return true;
+	    }
+
+	  str_size=4; /* the first 4 bytes will be replaced with the length */
+
+#define CAN_WRITE_OUTSYM(sym) (sym!=NULL && sym->section && \
+				((sym->section->owner && \
+				 bfd_get_flavour (sym->section->owner) == \
+				 bfd_target_aout_flavour) || \
+				 bfd_asymbol_flavour(sym) == \
+				 bfd_target_aout_flavour))
+
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+	        {
+		  str_size += strlen(sym->name) + 1;
+		  symbols++;
+		}
+	    }
+
+	  /* Write out HUNK_DEBUG, size, 0413.... */
+	  n[0] = HUNK_DEBUG;
+	  n[1] = 3 + ((symbols * sizeof(struct internal_nlist) + str_size + 3) >> 2);
+	  n[2] = 0413L; /* Magic number */
+	  n[3] = symbols * sizeof(struct internal_nlist);
+	  n[4] = str_size;
+	  if (!write_longs ((PTR)(n), 5, abfd))
+	    return false;
+
+	  /* Write out symbols */
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+		{
+	            {
+                      aout_symbol_type *t = (aout_symbol_type *)
+			&(sym)->the_bfd;
+
+	              bfd_h_put_16(abfd, t->desc, data.e_desc);
+	              bfd_h_put_8(abfd, t->other, data.e_other);
+	              bfd_h_put_8(abfd, t->type, data.e_type);
+		    }
+		    if (!translate_to_native_sym_flags(abfd,sym,&data))
+		      {
+			fprintf (stderr, "Cannot translate flags for %s\n",
+				 sym->name);
+		      }
+		  PUT_WORD(abfd, offset, &(data.e_strx[0])); /* Store index */
+		  offset += strlen(sym->name) + 1;
+	          if (bfd_write ((unsigned long *)&data,sizeof(long),3,abfd)
+		      != sizeof(long)*3)
+	            return false;
+	      }
+	    }
+
+	  /* Write out strings */
+	  if (!write_longs ((unsigned long *)&str_size, 1, abfd))
+	    return false;
+	  
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+		{
+		  int len = strlen(sym->name) + 1;
+
+	          /* Write string tab */
+	          if (bfd_write((PTR)(sym->name),sizeof(char),len,abfd)!=len)
+	            return false;
+		}
+	    }
+
+          i = ((str_size + 3) & (~3)) - str_size;
+          str_size = 0;
+	  /* Write padding */
+	  if (i && bfd_write((PTR)(&str_size),sizeof(char),i,abfd)!=i)
+	    return false;
+
+	  /* write a HUNK_END here to finish the loadfile, or amigaos
+	     will refuse to load it */
+	  n[0]=HUNK_END;
+	  if (!write_longs (n, 1, abfd))
+	    return false;
+	}/* Of if abfd->symcount */
+    }/* Of write out debug hunk */
+
+  bfd_release (abfd, index_map);
+  return true;
+}
+
+/* Write a string padded to 4 bytes and preceded by it's length in
+   long words ORed with <value> */
+static boolean
+write_name (abfd, name, value)
+     bfd *abfd;
+     const char *name;
+     long value;
+{
+  long i,j;
+  struct name {
+    long len;
+    char buf[MAX_NAME_SIZE+3];
+  } n;
+
+  j = strlen (name);
+  if (j > MAX_NAME_SIZE)
+    j = MAX_NAME_SIZE;
+  strncpy (n.buf, name, j);
+  i = LONGSIZE (j) | value;
+  n.len = GL (&i);
+  if (j&3) {
+    n.buf[j] = n.buf[j+1] = n.buf[j+2] = '\0';
+    j += (4-(j&3))&3;
+  }
+  return (bfd_write ((PTR)&n, 1, sizeof(long)+j, abfd) == sizeof(long)+j);
+}
+
+static boolean
+amiga_write_archive_contents (arch)
+     bfd *arch;
+{
+  bfd *object;
+  char buffer[DEFAULT_BUFFERSIZE];
+  int i;
+  unsigned long n[2];
+  long size;
+  struct stat status;
+
+  for (object = arch->archive_head; object; object = object->next)
+    {
+      unsigned int remaining;
+
+      if (bfd_write_p (object))
+	{
+	  bfd_set_error (bfd_error_invalid_operation);
+	  return false;
+	}
+
+      if (stat (object->filename, &status) != 0)
+	{
+	  bfd_set_error (bfd_error_system_call);
+	  return false;
+	}
+
+      if (bfd_seek (object, (file_ptr) 0, SEEK_SET) != 0)
+	return false;
+
+      remaining = status.st_size;
+
+      while (remaining)
+	{
+	  unsigned int amt = DEFAULT_BUFFERSIZE;
+	  if (amt > remaining)
+	    amt = remaining;
+	  errno = 0;
+	  if (bfd_read (buffer, amt, 1, object) != amt)
+	    {
+	      if (bfd_get_error () != bfd_error_system_call)
+		bfd_set_error (bfd_error_malformed_archive);
+	      return false;
+	    }
+	  if (bfd_write (buffer, amt, 1, arch) != amt)
+	    return false;
+	  remaining -= amt;
+	}
+    }
+    return true;
+}
+
+static boolean
+amiga_write_armap (abfd)
+     bfd *abfd;
+{
+  return true;
+}
+
+#define determine_size(type) (2 - ((type)>=3 ? (type)-3 : (type)))
+
+static int
+determine_type (r)
+     struct reloc_cache_entry *r;
+{
+  switch (r->howto->type) /* FIXME: Is this sufficient to distinguish them ?*/
+    {
+      /* AMIGA specific */
+      case HUNK_RELOC8:
+      case HUNK_RELOC16:
+      case HUNK_RELOC32:
+      case HUNK_DREL8:
+      case HUNK_DREL16:
+      case HUNK_DREL32:
+        if (r->howto->type >= HUNK_DREL32)
+          return 3 + r->howto->type - HUNK_DREL32;
+        return r->howto->type - HUNK_RELOC32;
+
+      /* Now, these may occur, if a.out was used as input */
+      case 0: /* 8 bit ref */
+        return 2;
+
+      case 1: /* 16 bit relative */
+        return 1;
+
+      case 2: /* 32 bit relative */
+        return 0;
+
+      case 9: /* 16 bit base rel */
+        return 4;
+
+      case 10: /* 32 bit baserel */
+        return 3;
+
+      /* FIXME: There are other (pc relative) displacements left */
+      default: /* Error, can't represent this */
+        bfd_set_error(bfd_error_nonrepresentable_section);
+        return -1;
+    }/* Of switch */
+}
+
+#define MAX_RELOC_OUT 3
+
+static unsigned long reloc_types[]= {
+  HUNK_RELOC32, HUNK_RELOC16, HUNK_RELOC8
+/* these reloc types are not supported at the moment */
+#if 0
+  HUNK_DREL32,  HUNK_DREL16,  HUNK_DREL8
+#endif
+};
+
+#define NB_RELOC_TYPES (sizeof(reloc_types) / sizeof(reloc_types[0]))
+
+/* Write out section contents, including relocs */
+static boolean
+amiga_write_section_contents (abfd, section, data_sec, datadata_relocs,
+			      index_map)
+     bfd *abfd;
+     asection *section;
+     asection *data_sec;
+     long datadata_relocs;
+     long *index_map;
+{
+  static const char zero[3]={0,0,0};
+  unsigned long n[2];
+  int i, j, type, size;
+  unsigned int k;
+  struct reloc_cache_entry *r;
+  asection *osection, *sec, *insection;
+  asymbol *sym_p;
+  int pad, reloc_count = 0;
+  unsigned long disksize;
+  int max_hunk = -1;
+  char *c_p;
+  unsigned char *values;
+  long *reloc_counts;
+
+  DPRINT(5, ("Entered Write-section-conts\n"));
+
+  /* Compute the maximum hunk number of the ouput file */
+  sec = abfd->sections;
+  while (sec) {
+    max_hunk++;
+    sec = sec->next;
+  }
+
+  /* If we are base-relative linking and the section is .bss and abfd
+     is a load file, then return */
+  if (AMIGA_DATA(abfd)->IsLoadFile)
+    {
+      if (amiga_base_relative && (strcmp(section->name, ".bss") == 0))
+	return true; /* Nothing to do */
+    }
+  else
+    {
+      /* WRITE out HUNK_NAME + section name */
+      n[0] = HUNK_NAME;
+      if (!write_longs (n, 1, abfd) || !write_name (abfd, section->name, 0))
+	return false;
+    }
+
+  /* Depending on the type of the section, write out HUNK_{CODE|DATA|BSS} */
+  if (section->flags & SEC_CODE) /* Code section */
+    n[0] = HUNK_CODE;
+  else if (section->flags & (SEC_DATA | SEC_LOAD)) /* data section */
+    n[0] = HUNK_DATA;
+  else if (section->flags & SEC_ALLOC) /* BSS */
+    n[0] = HUNK_BSS;
+  else if (section->flags & SEC_DEBUGGING) /* debug section */
+    n[0] = HUNK_DEBUG;
+  else /* Error */
+    {
+#if 0
+      bfd_set_error(bfd_error_nonrepresentable_section);
+      return(false);
+#else
+      /* FIXME: Just dump everything we don't currently recognize into
+	 a DEBUG hunk. */
+      n[0] = HUNK_DEBUG;
+#endif
+    }
+
+  DPRINT(10,("Section type is %lx\n",n[0]));
+
+  /* Get real size in n[1], this may be shorter than the size in the header */
+  disksize = LONGSIZE (amiga_per_section(section)->disk_size) + datadata_relocs;
+  pad = (4-(amiga_per_section(section)->disk_size & 3)) & 3;
+  n[1] = disksize;
+
+  /* in a load file, we put section attributes only in the header */
+  if (!(AMIGA_DATA(abfd)->IsLoadFile))
+    {
+      /* Get attribute for section */
+      switch (amiga_per_section(section)->attribute)
+	{
+	case MEMF_CHIP:
+	  n[1] |= HUNKF_CHIP;
+	  break;
+	case MEMF_FAST:
+	  n[1] |= HUNKF_FAST;
+	  break;
+	case 0:
+	  break;
+	default: /* error , can't represent this */
+	  bfd_set_error(bfd_error_nonrepresentable_section);
+	  return(false);
+	  break;
+	}
+    }/* Of switch */
+
+  if (!write_longs (n, 2, abfd))
+      return false;
+
+  DPRINT(5,("Wrote code and size=%lx\n",n[1]));
+
+  /* If a BSS hunk, we're done, else write out section contents */
+  if (HUNK_VALUE(n[0]) == HUNK_BSS)
+    return true;
+
+  DPRINT(5,("Non bss hunk...\n"));
+
+  /* Traverse through the relocs, sample them in reloc_data, adjust section
+     data to get 0 addend
+     Then compactify reloc_data
+     Set the entry in the section for the reloc to NULL */
+
+  if (disksize != 0)
+    BFD_ASSERT((section->flags & SEC_IN_MEMORY) != 0);
+
+  reloc_counts  = (long*) bfd_alloc (abfd, NB_RELOC_TYPES * (max_hunk+1)
+				     * sizeof (long));
+  if (!reloc_counts)
+    return false;
+  bzero (reloc_counts, NB_RELOC_TYPES*(max_hunk+1)*sizeof (long));
+
+  DPRINT(5,("Section has %d relocs\n", section->reloc_count));
+
+  for (i = 0; i < section->reloc_count; i++)
+    {
+      r = section->orelocation[i];
+      if (r == NULL)
+        continue;
+      sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+      insection = sym_p->section;
+      DPRINT(5,("Sec for reloc is %lx(%s)\n",insection,insection->name));
+      DPRINT(5,("Symbol for this reloc is %lx(%s)\n",sym_p, sym_p->name));
+
+      /* Is reloc relative to a special section ? */
+      if ((insection == bfd_abs_section_ptr) ||
+	  (insection == bfd_com_section_ptr) ||
+	  (insection == bfd_und_section_ptr) ||
+	  (insection == bfd_ind_section_ptr))
+	continue; /* Nothing to do, since this translates to HUNK_EXT */
+
+      r->addend += sym_p->value; /* Add offset of symbol from section start */
+
+      /* Address of reloc has been unchanged since original reloc, or has been
+	 adjusted by get_relocated_section_contents. */
+      /* For relocs, the vma of the target section is in the data, the
+	 addend is -vma of that section =>No need to add vma*/
+      /* Add in offset */
+      r->addend += insection->output_offset;
+      osection = insection->output_section; /* target section */
+
+      /* Determine which hunk to write, and index of target */
+      j = index_map[osection->index];
+
+      if (j<0 || j>max_hunk) {
+	fprintf (stderr, "erroneous relocation to hunk %d\n", j);
+	BFD_FAIL ();
+      }
+
+      type = determine_type(r);
+      if (type == -1)
+	return false;
+      size = determine_size(type);
+
+      if (type < NB_RELOC_TYPES)
+	reloc_counts[type+(j*NB_RELOC_TYPES)]++;
+      else {
+	bfd_set_error (bfd_error_nonrepresentable_section);
+	return false;
+      }
+
+      c_p = ((char *)(section->contents)) + r->address;
+      DPRINT(5,("reloc address=%lx,addend=%lx\n",r->address,r->addend));
+
+      /* There is no error checking with these.. */
+      values = (unsigned char *)c_p;
+      switch (size)
+	{
+	case 0: /* adjust byte */
+	  j = (int)(*c_p) + r->addend;
+	  *c_p = (signed char)j;
+	  break;
+	case 1: /* Adjust word */
+	  k = values[1] | (values[0] << 8);
+	  j = (int)k + r->addend;
+	  values[0] = (j & 0xff00) >> 8;
+	  values[1] = j & 0xff;
+	  break;
+	case 2: /* adjust long */
+	  k = values[3] | (values[2] << 8) | (values[1] << 16) |
+	    (values[0] << 24);
+	  j = (int)k + r->addend;
+	  values[3] = j & 0xff;
+	  values[2] = (j & 0xff00) >> 8;
+	  values[1] = (j & 0xff0000) >> 16;
+	  values[0] = ((unsigned int)j & 0xff000000) >> 24;
+	  break;
+	} /* of switch */
+
+      r->addend = 0;
+      DPRINT(5,("Did adjusting\n"));
+
+      if (type < MAX_RELOC_OUT)
+        reloc_count++;
+      else
+        section->orelocation[i] = NULL;
+    } /* of for i */
+
+  DPRINT(5,("Did all relocs\n"));
+
+  /* We applied all the relocs, as far as possible to obtain 0 addend fields */
+  /* Write the section contents */
+  if (amiga_per_section(section)->disk_size != 0)
+    {
+      if (bfd_write((PTR)(section->contents), sizeof(char),
+		    amiga_per_section(section)->disk_size, abfd) !=
+	  amiga_per_section(section)->disk_size)
+	return false;
+    }
+
+  /* pad the section on disk if necessary (to a long boundary) */
+  if (pad!=0 && (bfd_write (zero, 1, pad, abfd) != pad))
+    return false;
+
+#if 0
+  /* write bss data in the data hunk if needed */
+  i = 0;
+  while (bss_size--)
+    if (!write_longs((PTR)&i, 1, abfd))
+      return false;
+#endif
+
+  if (datadata_relocs)
+    {
+      datadata_relocs--;
+      if (!write_longs (&datadata_relocs, 1, abfd))
+        return false;
+      for (i = 0; i < data_sec->reloc_count; i++)
+        {
+          r = data_sec->orelocation[i];
+          if (r == NULL)
+            continue;
+          sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+          insection = sym_p->section;
+
+          /* Is reloc relative to a special section ? */
+          if ((insection == bfd_abs_section_ptr) ||
+	      (insection == bfd_com_section_ptr) ||
+              (insection == bfd_und_section_ptr) ||
+	      (insection == bfd_ind_section_ptr))
+            continue; /* Nothing to do, since this translates to HUNK_EXT */
+
+	  if (insection->output_section == data_sec)
+	    {
+	      if (determine_type(r) == 0)
+		if (!write_longs ((PTR)&r->address, 1, abfd))
+		  return false;
+	    }
+	}
+    }
+  DPRINT(10,("Wrote contents, writing relocs now\n"));
+
+
+  if (reloc_count) {
+    while (reloc_count) {
+      /* Sample every reloc type */
+      for (i = 0; i < NB_RELOC_TYPES; i++) {
+	int written = false;
+	for (j = 0; j <= max_hunk; j++) {
+	  long relocs;
+	  while ((relocs = reloc_counts [i+(j*NB_RELOC_TYPES)]) > 0) {
+	    if (!written)
+	      if (!write_longs(&reloc_types[i], 1, abfd))
+		return false;
+	      else
+		written = true;
+
+	    if (relocs > 0xffff)
+	      relocs = 0xffff;
+
+	    reloc_counts [i+(j*NB_RELOC_TYPES)] -= relocs;
+	    n[0] = relocs;
+	    n[1] = j;
+	    if (!write_longs(n, 2, abfd))
+	      return false;
+	    reloc_count -= relocs;
+
+	    for (k = 0; k < section->reloc_count; k++) {
+	      int jj;
+
+	      r = section->orelocation[k];
+	      if (r == NULL)	/* already written */
+		continue;
+	      sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+	      insection = sym_p->section;
+	      /* Is reloc relative to a special section ? */
+	      if ((insection == bfd_abs_section_ptr) ||
+		  (insection == bfd_com_section_ptr) ||
+		  (insection == bfd_und_section_ptr) ||
+		  (insection == bfd_ind_section_ptr))
+		/* Nothing to do, since this translates to HUNK_EXT */
+		continue;
+
+	      osection = insection->output_section; /* target section */
+
+#if 0
+	      /* Determine which hunk to write, and index of target */
+	      for (jj = 0, sec = abfd->sections; sec != NULL;
+		   sec = sec->next, jj++) {
+		if (sec == osection)
+		  break;
+	      }
+
+	      BFD_ASSERT (jj==index_map[insection->output_section->index]);
+#else
+	      jj=index_map[insection->output_section->index];
+#endif
+	      if (jj == j && i == determine_type(r)) {
+		section->orelocation[k] = NULL;
+		if (!write_longs((PTR)&r->address, 1, abfd))
+		  return false;
+		if (--relocs == 0)
+		  break;
+	      }
+	    }
+	  }
+	}
+      }
+    }
+    /* write a zero to finish the relocs */
+    if (!write_longs((PTR)&reloc_count, 1, abfd))
+      return false;
+  }
+  bfd_release (abfd, reloc_counts);
+  DPRINT(5,("Leaving write_section...\n"));
+  return true;
+}
+
+
+/* Write out symbol information, including HUNK_EXT, DEFS, ABS. 
+   In the case, we were linking base relative, the symbols of the .bss
+   hunk have been converted already to belong to the .data hunk */
+
+static boolean
+amiga_write_symbols (abfd, section)
+     bfd *abfd;
+     asection *section;
+{
+
+  int i,j;
+  struct reloc_cache_entry *r;
+  asection *osection;
+  asymbol *sym_p;
+  char b[3]="\0\0\0";
+  unsigned long n[3];
+  int symbol_count;
+  unsigned long symbol_header;
+  unsigned long type, tmp;
+  int len;
+
+  /* If base rel linking and section is .bss ==> exit */
+  if (amiga_base_relative && (strcmp(section->name,".bss")==0))
+    return true;
+
+  if (section->reloc_count==0 && abfd->symcount==0)
+    {/* Write HUNK_END */
+    alldone:
+      DPRINT(5,("Leaving write_symbols\n"));
+      n[0]=HUNK_END;
+      return write_longs ((PTR)n, 1, abfd);
+    }
+
+  symbol_count=0;
+  symbol_header=HUNK_EXT;
+
+  /* If this is Loadfile, then do not write HUNK_EXT, but rather HUNK_SYMB*/
+
+ /* Write out all the symbol definitions, then HUNK_END 
+
+     Now, first traverse the relocs, all entries that are non NULL
+     have to be taken into account */
+  /* Determine the type of HUNK_EXT to issue and build a single
+     HUNK_EXT subtype */
+
+
+  /*FIXME: We write out many HUNK_EXT's entries for references to the
+    same symbol.. */
+  for (i=0;i<section->reloc_count;i++)
+    {
+      r=section->orelocation[i];
+
+      if (r==NULL) /* Empty entry */
+	continue;
+
+      sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
+      osection=sym_p->section; /* The section the symbol belongs to */
+      /* this section MUST be a special section */
+
+      DPRINT(5,("Symbol is %s, section is %lx(%s)\n",sym_p->name,osection,osection->name));
+
+      if (osection!=bfd_com_section_ptr) /* Not common symbol */
+	{
+	  DPRINT(5,("Non common ref\n"));
+	  /* Add a reference to this HUNK */
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      tmp=HUNK_EXT;
+	      if (!write_longs(&tmp, 1, abfd))
+		return false;
+	    }
+
+	  /* Determine type of ref */
+	  switch(r->howto->type)
+	    {
+	      /* AMIGA specific */
+	    case 0:
+	    case HUNK_RELOC8:
+	      type=EXT_REF8;
+	      break;
+
+	    case 1:
+	    case HUNK_RELOC16:
+	      type=EXT_REF16;
+	      break;
+
+	    case 2:
+	    case HUNK_RELOC32:
+	      type=EXT_REF32;
+	      break;
+	    case HUNK_DREL8:
+	      type=EXT_DEXT8;
+	      break;
+
+	    case 9:
+	    case HUNK_DREL16:
+	      type=EXT_DEXT16;
+	      break;
+
+	    case 10:
+	    case HUNK_DREL32:
+	        type=EXT_DEXT32;
+	      break;
+	      
+	      /* FIXME: There are other (pc relative) displacements left */
+	    default: /* Error, can't represent this */
+	      bfd_set_error(bfd_error_nonrepresentable_section);
+	      return false;
+	      break;
+	    }/* Of switch */
+	  DPRINT(5,("Type is %x\n",type));
+
+	  if (!write_name (abfd, sym_p->name, type << 24))
+	    return false;
+	  n[0]=1; /* 1 ref at address... */
+	  n[1]=r->address;
+	  if (!write_longs (n, 2, abfd))
+	    return false;
+
+	  continue; /* Next relocation */
+	}/* Of is ref to undefined or abs symbol */
+
+      else /* ref to common symbol */
+	{
+	  DPRINT(5,("Common ref\n"));
+
+	  /* If the reference is NOT 32 bit wide absolute , then issue warning */
+	  if ((r->howto->type!=2)&&(r->howto->type!=HUNK_RELOC32))
+	    fprintf(stderr,"Warning: Non 32 bit wide reference to common symbol %s\n",
+		    sym_p->name);
+
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      tmp=HUNK_EXT;
+	      if (!write_longs (&tmp, 1, abfd))
+		return false;
+	    }
+
+	  if (!write_name (abfd, sym_p->name, EXT_COMMON<<24))
+	    return false;
+	  n[0]=sym_p->value; /* Size of common block */
+	  n[1]=1;
+	  n[2]=r->address;
+	  if (!write_longs (n, 3, abfd))
+	    return false;
+
+	  continue;
+	}/* Of is common section */
+
+      DPRINT(10,("Failing...\n"));
+      BFD_FAIL();
+    }/* Of traverse relocs */
+      
+	  
+  /* Now traverse the symbol table and write out all definitions, that are relative
+     to this hunk */
+  /* Absolute defs are always only written out with the first hunk */
+  /* Don't write out local symbols
+                     undefined symbols
+		     indirect symbols
+		     warning symbols
+		     debugging symbols
+		     warning symbols
+		     constructor symbols, since they are unrepresentable in HUNK format..*/
+
+  DPRINT(10,("Traversing symbol table\n"));
+  symbol_header=(AMIGA_DATA(abfd)->IsLoadFile)?HUNK_SYMBOL:HUNK_EXT;
+  for (i=0;i<abfd->symcount;i++)
+    {
+      sym_p=abfd->outsymbols[i];
+      osection=sym_p->section;
+
+      DPRINT(5,("%d. symbol(%s), osec=%x(%s)\n",i,sym_p->name,osection,osection->name));
+
+      if ((osection==bfd_und_section_ptr)/*||(osection==bfd_com_section_ptr)*/||
+	  (osection==bfd_ind_section_ptr))
+	continue; /* Don't write these */
+
+      /* Only write abs defs, if not writing A Loadfile */
+      if ((osection==bfd_abs_section_ptr)&&(section->index==0)&&
+	  !AMIGA_DATA(abfd)->IsLoadFile) /* Write out abs defs */
+	{
+	  DPRINT(5,("Abs symbol\n"));
+	  /* don't write debug symbols, they will be written in a
+             HUNK_DEBUG later on */
+	  if (sym_p->flags & BSF_DEBUGGING)
+	    continue;
+
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      if (!write_longs (&symbol_header, 1, abfd))
+		return false;
+	    }
+
+	  if (!write_name (abfd, sym_p->name, EXT_ABS << 24))
+	    return false;
+	  n[0]=sym_p->value;
+	  if (!write_longs (n, 1,abfd))
+	    return false;
+	  continue;
+	}/* Of abs def */
+      if (osection == NULL) /* Happens with constructor functions. FIXME */
+        continue;
+      if (osection==bfd_abs_section_ptr) /* Not first hunk. Already written */
+	continue;
+
+      /* If it is a warning symbol, or a constructor symbol or a
+	 debugging or a local symbol, don't write it */
+      if (sym_p->flags & (BSF_WARNING|BSF_CONSTRUCTOR|BSF_DEBUGGING|BSF_LOCAL))
+	continue;
+
+      if (!(sym_p->flags & BSF_GLOBAL))
+	continue;
+
+      /* Now, if osection==section, write it out */
+      if (osection->output_section==section)
+	{
+	  DPRINT(5,("Writing it out\n"));
+
+	  if ((symbol_count++)==0) /* First write out the header */
+	    {
+	      if (!write_longs (&symbol_header, 1, abfd))
+		return false;
+	    }
+	  type=((symbol_header==HUNK_EXT?EXT_DEF:0)<<24)&0xff000000;
+
+	  if (!write_name (abfd, sym_p->name, type))
+	    return false;
+	  n[0] = sym_p->value + sym_p->section->output_offset;
+	  if (!write_longs (n, 1, abfd))
+	    return false;
+	}
+      else
+	{
+	  /* write common definitions as bss common references */
+	  if (osection->output_section == bfd_com_section_ptr &&
+	      section->index == 2)
+	    {
+	      if ((symbol_count++)==0) /* First write out the header */
+		{
+		  if (!write_longs (&symbol_header, 1, abfd))
+		    return false;
+		}
+	      if (!write_name (abfd, sym_p->name, EXT_COMMON<<24))
+		return false;
+
+	      n[0]=sym_p->value;
+	      n[1]=0;
+	      if (!write_longs (n, 2, abfd))
+		return false;
+	    }
+	}
+    }/* Of for */
+
+  DPRINT(10,("Did traversing\n"));
+  if (symbol_count) /* terminate HUNK_EXT, HUNK_SYMBOL */
+    {
+      n[0]=0;
+      if (!write_longs (n, 1, abfd))
+	return false;
+    }
+  DPRINT(5,("Leaving\n"));
+  goto alldone; /* Write HUNK_END, return */
+}
+
+static boolean
+amiga_get_section_contents (abfd, section, location, offset, count)
+     bfd *abfd;
+     sec_ptr section;
+     PTR location;
+     file_ptr offset;
+     bfd_size_type count;
+{
+  long disk_size = amiga_per_section (section)->disk_size;
+
+  if (bfd_seek (abfd, section->filepos + offset, SEEK_SET))
+    return false;
+
+  if (offset+count > disk_size) {
+    /* the section's size on disk may be smaller than in memory
+       in this case, pad the contents */
+    if (bfd_read (location, 1, disk_size-offset, abfd) != disk_size-offset)
+      return false;
+    memset ((char *) location + disk_size - offset, 0, count-(disk_size-offset));
+  }
+  else {
+    if (bfd_read (location, 1, count, abfd) != disk_size-offset)
+      return false;
+  }
+  return true;
+}
+
+
+boolean
+amiga_new_section_hook (abfd, newsect)
+     bfd *abfd;
+     asection *newsect;
+{
+  newsect->used_by_bfd = (PTR) bfd_zalloc (abfd,
+					   sizeof (amiga_per_section_type));
+  newsect->alignment_power = 2;
+  amiga_per_section(newsect)->reloc_tail = NULL;
+  if (!strcmp (newsect->name, ".data_chip") || !strcmp (newsect->name,
+						       ".bss_chip"))
+      amiga_per_section(newsect)->attribute |= MEMF_CHIP;
+  return true;
+}
+
+static boolean
+amiga_slurp_symbol_table (abfd)
+     bfd *abfd;
+{
+  amiga_data_type *amiga_data=AMIGA_DATA(abfd);
+  asection *section;
+  struct amiga_raw_symbol *sp;
+  amiga_symbol_type *asp=NULL;
+  unsigned long *lp, l, buf[4];
+  unsigned long len, type;
+
+  if (amiga_data->symbols)
+    return true; /* already read */
+
+  if (abfd->symcount)
+    asp = (amiga_symbol_type*) bfd_alloc (abfd, sizeof (amiga_symbol_type) *
+					     abfd->symcount);
+  else
+    return true;
+
+  if (abfd->symcount!=0 && !asp) {
+    bfd_set_error (bfd_error_no_memory);
+    return false;
+  }
+
+  amiga_data->symbols = asp;
+
+  /* Symbols are associated with every section */
+  for (section=abfd->sections; section!=NULL; section=section->next)
+    {
+      if (amiga_per_section(section)->hunk_ext_pos == 0)
+	continue;
+
+      if (bfd_seek (abfd, amiga_per_section(section)->hunk_ext_pos, SEEK_SET))
+	return false;
+
+      amiga_per_section(section)->amiga_symbols = asp;
+
+      while (get_long (abfd, &l) && (l!=0))
+	{
+	  type = l>>24;	/* type of entry */
+	  len = (l & 0xffffff) << 2; /* namelength */
+
+	  /* read the name */
+	  if ((asp->symbol.name = bfd_alloc (abfd ,len+1))==NULL)
+	    {
+	      bfd_set_error (bfd_error_no_memory);
+	      return false;
+	    }
+	  if (bfd_read ((PTR)asp->symbol.name, 1, len, abfd) != len)
+	    return false;
+	  ((char*)asp->symbol.name)[len] = '\0';
+
+	  asp->symbol.the_bfd = abfd;
+	  asp->type = type;
+	  asp->symbol.flags = BSF_GLOBAL;
+	  asp->index = asp - amiga_data->symbols;
+
+	  switch(type) {
+	  case EXT_COMMON: /* Common reference/definition*/
+	    asp->symbol.section = bfd_com_section_ptr;
+	    asp->hunk_number = -3;
+	    /* size of common block -> symbol's value */
+	    if (!get_long (abfd, &l))
+	      return false;
+	    asp->symbol.value = l;
+	    /* skip refs */
+	    if (!(get_long (abfd, &l) && bfd_seek (abfd, l<<2, SEEK_CUR)==0))
+	      return false;
+	    break;
+	  case EXT_ABS: /* Absolute */
+	    asp->symbol.section = bfd_abs_section_ptr;
+	    asp->hunk_number = -1;
+	    goto rval;
+	    break;
+	  case EXT_DEF: /* Relative Definition */
+	  case EXT_SYMB: /* Same as EXT_DEF for load files */
+	    asp->symbol.section = section;
+	    asp->hunk_number = section->target_index;
+	  rval:
+	    /* read the value */
+	    if (get_long (abfd, &l))
+	      asp->symbol.value = l;
+	    else
+	      return false;
+	    break;
+
+	  default: /* References to an undefined symbol */
+	    asp->symbol.section = bfd_und_section_ptr;
+	    asp->hunk_number = -2; /* undefined */
+	    asp->symbol.flags = 0;
+	    /* skip refs */
+	    if (!(get_long (abfd, &l) && bfd_seek (abfd, l<<2, SEEK_CUR)==0))
+	      return false;
+	    break;
+	  }
+	  asp++;
+	}
+    }
+  return true;
+}
+
+
+/* Get size of symtab */
+long
+amiga_get_symtab_upper_bound (abfd)
+     bfd *abfd;
+{
+  if (!amiga_slurp_symbol_table (abfd))
+    return -1;
+   return (abfd->symcount+1) * (sizeof (amiga_symbol_type *));
+}
+
+long
+amiga_get_symtab (abfd, location)
+     bfd *abfd;
+     asymbol **location;
+{
+  amiga_symbol_type *symp;
+  int i=0;
+
+  if(!amiga_slurp_symbol_table(abfd))
+    return -1;
+
+  if (abfd->symcount)
+    {
+      for (symp = AMIGA_DATA(abfd)->symbols; i < bfd_get_symcount (abfd);
+	   i++, symp++)
+	*location++ = &symp->symbol;
+    }
+  return abfd->symcount;
+}
+
+asymbol *
+amiga_make_empty_symbol (abfd)
+     bfd *abfd;
+{
+  amiga_symbol_type *new =
+    (amiga_symbol_type *) bfd_zalloc (abfd, sizeof (amiga_symbol_type));
+  new->symbol.the_bfd = abfd;
+  return &new->symbol;
+}
+
+
+
+void
+amiga_get_symbol_info (ignore_abfd, symbol, ret)
+      bfd *ignore_abfd;
+      asymbol *symbol;
+      symbol_info *ret;
+{
+  bfd_symbol_info (symbol, ret);
+  if (symbol->name[0] == ' ')
+    ret->name = "* empty table entry ";
+  if (symbol->section==bfd_abs_section_ptr)
+    ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
+}
+
+
+
+void
+amiga_print_symbol (ignore_abfd, afile,  symbol, how)
+      bfd *ignore_abfd;
+      PTR afile;
+      asymbol *symbol;
+      bfd_print_symbol_type how;
+{
+  FILE *file = (FILE *)afile;
+  
+  switch (how) {
+  case bfd_print_symbol_name:
+    fprintf(file, "%s", symbol->name);
+    break;
+  case bfd_print_symbol_more:
+    fprintf(stderr,"%4x %2x %2x",
+	    (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff),0,
+	    amiga_symbol(symbol)->type);
+    break;
+  case bfd_print_symbol_all:
+      {
+	CONST char *section_name = symbol->section->name;
+	if (symbol->name[0] == ' ')
+	  {
+	    fprintf(file, "* empty table entry ");
+	  }
+	else
+	  {
+	    bfd_print_symbol_vandf ((PTR)file, symbol);
+
+	    fprintf(file," %-5s %04x %02x %s",
+		    section_name,
+		    (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff),
+		    (unsigned) 0,                       /* ->other */
+		    symbol->name);                      /* ->name */
+	}
+      }
+    break;
+  }
+}
+
+ long
+amiga_get_reloc_upper_bound (abfd, asect)
+     bfd *abfd;
+     sec_ptr asect;
+{
+  if (bfd_get_format (abfd) != bfd_object)
+    {
+      bfd_set_error(bfd_error_invalid_operation);
+      return 0;
+    }
+  return sizeof (arelent *) * (asect->reloc_count + 1);
+}
+
+
+static boolean
+read_raw_relocs (abfd, section, d_offset, count)
+    bfd *abfd;
+    sec_ptr section;
+    unsigned long d_offset;	/* offset in the bfd */
+    unsigned long count;	/* number of relocs */
+{
+  unsigned long type, no ,offset, hunk_number, j;
+  int index,br;
+
+  if (bfd_seek (abfd, d_offset, SEEK_SET))
+    return false;
+  while (count > 0) 
+    {
+      /* first determine type of reloc */
+      if (!get_long (abfd, &type))
+	return false;
+
+      switch (type)
+	{
+	case HUNK_RELOC32: /* 32 bit ref */
+	case HUNK_RELOC16: /* 16 bit ref */
+	case HUNK_RELOC8: /* 8 bit ref */
+	case HUNK_DREL32: /* 32 bit ref baserel */
+	case HUNK_DREL16: /* 16 bit baserel */
+	case HUNK_DREL8: /* 8 bit baserel */
+	  if (type < HUNK_DREL32)
+	    { /*0:8bit, 1: 16bit, 2:32bit */
+	      index=2-(type-HUNK_RELOC32);
+	      br=0; /* not base relative */
+	    }
+	  else
+	    {
+	      index=2-(type-HUNK_DREL32);
+	      br=1; /* base relative */
+	    }
+
+	  if (!get_long (abfd, &no))
+	    return false;
+	  while (no) /* read offsets and hunk number */
+	    {
+	      if (!get_long (abfd, &hunk_number))
+		return false;
+	      for (j=0; j<no; j++)
+		{ /* add relocs */
+		  if (!get_long (abfd, &offset) ||
+		      !amiga_add_reloc (abfd, section, offset, NULL,
+				       amiga_howto_array[br][index],hunk_number))
+		    return false;
+		}
+	      count -= no;
+	      if (!get_long (abfd, &no))
+		return false;
+	    }
+	  break;
+
+	default: /* error */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}
+    }
+
+}
+
+
+/* slurp in relocs , amiga_digest_file left various pointers for us*/
+static boolean 
+amiga_slurp_relocs (abfd, section, symbols)
+     bfd *abfd;
+     sec_ptr section;
+     asymbol **symbols;
+{
+  amiga_data_type *amiga_data=AMIGA_DATA(abfd);
+  struct amiga_raw_symbol *sp;
+  amiga_symbol_type *asp;
+  long *lp;
+  unsigned long type, offset, hunk_number, no;
+  int i,n,br,j;
+  int index;
+  long count;
+  amiga_per_section_type *asect = amiga_per_section(section);
+
+  if (section->relocation)
+    return true;
+
+  if (asect->raw_relocs8)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs8,
+			  asect->num_raw_relocs8))
+      return false;
+
+  if (asect->raw_relocs16)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs16,
+			  asect->num_raw_relocs16))
+      return false;
+
+  if (asect->raw_relocs32)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs32,
+			  asect->num_raw_relocs32))
+      return false;
+
+  /* Now step through the raw_symbols and add all relocs in them */
+  if (!amiga_data->symbols && !amiga_slurp_symbol_table (abfd))
+    return false;
+
+  if (amiga_per_section(section)->hunk_ext_pos == 0)
+    return true;
+
+  if (bfd_seek (abfd, amiga_per_section(section)->hunk_ext_pos, SEEK_SET))
+    return false;
+
+  asp = amiga_per_section(section)->amiga_symbols;
+  while (get_long (abfd, &n) && n!=0)
+    {
+      type = (n>>24) & 0xff;
+      n &= 0xffffff;
+
+      /* skip the name */
+      if (bfd_seek (abfd, n<<2, SEEK_CUR))
+	return false;
+
+      switch (type)
+	{
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS: /* no relocs here */
+	  if (bfd_seek (abfd, sizeof (long), SEEK_CUR))
+	    return false;
+	  break;
+	  /* same as below, but advance lp by one to skip common size */
+	case EXT_COMMON:
+	  if (bfd_seek (abfd, sizeof (long), SEEK_CUR))
+	    return false;
+	  /* Fall through */
+	default: /* reference to something */
+	  /* points to num of refs to hunk */
+	  if (!get_long (abfd, &n))
+	    return false;
+
+	  /* Add relocs to this section, relative to asp */
+	  /* determine howto first */
+	  if (type==EXT_COMMON) /* 32 bit ref */
+	    {
+	      index=2;
+	      br=0;
+	    }
+	  else
+	    {
+	      if (type>EXT_REF32)
+		type--; /* skip EXT_COMMON gap */
+		     
+	      type-=EXT_REF32;
+	      br=0;
+
+	      if (type>2) /* base relative */
+		{
+		  type-=3;
+		  br=1;
+		}
+	      index=2-type;
+	    }/* of else */
+
+	  for (i=0;i<n;i++) /* refs follow */
+	    {
+	      if (!get_long (abfd, &offset))
+		return false;
+	      if (!amiga_add_reloc (abfd, section, offset, abfd->outsymbols ?
+				    (amiga_symbol_type*)abfd->outsymbols[asp->index]: asp,
+				    amiga_howto_array[br][index],-4))
+		return false;
+	    }
+	      
+	  break;
+	}/* of switch */
+      asp++;
+    }
+
+  return true;
+
+}/* Of slurp_relocs */
+
+
+long
+amiga_canonicalize_reloc (abfd, section, relptr, symbols)
+     bfd *abfd;
+     sec_ptr section;
+     arelent **relptr;
+     asymbol **symbols;
+{
+  amiga_reloc_type *src;
+  int i=0;
+
+  if (!section->relocation && !amiga_slurp_relocs (abfd, section, symbols))
+    return -1;
+
+  src = (amiga_reloc_type *)section->relocation;
+  while (src != (amiga_reloc_type *) 0)
+    {
+      *relptr++ = &src->relent;
+      src = src->next;
+    }
+  *relptr = (arelent *) 0;
+
+  return section->reloc_count;
+}
+
+
+/* Set section contents */
+/* We do it the following way: 
+   if this is a bss section ==> error
+   otherwise, we try to allocate space for this section,
+   if  this has not already been done
+   Then we set the memory area to the contents */
+static boolean
+amiga_set_section_contents (abfd, section, location, offset, count)
+     bfd *abfd;
+     sec_ptr section;
+     unsigned char *location;
+     file_ptr offset;
+     int count;
+{
+  unsigned char *contents;
+
+  if ((section->flags&SEC_HAS_CONTENTS)==0) /* BSS */
+    {
+      bfd_set_error(bfd_error_invalid_operation);
+      return false;
+    }
+  
+  if ((section->flags&SEC_IN_MEMORY)==0) /* Not in memory, so alloc space */
+    {
+      contents=bfd_zalloc(abfd,section->_raw_size);
+      if (!contents)
+	{
+	  bfd_set_error(bfd_error_no_memory);
+	  return false;
+	}
+      
+      DPRINT(5,("Allocated %lx bytes at %lx\n",section->_raw_size,contents));
+
+      section->contents=contents;
+      section->flags|=SEC_IN_MEMORY;
+    }
+  else /* In memory */
+    contents=section->contents;
+
+  /* Copy mem */
+  memmove(contents+offset,location,count);
+
+  return(true);
+
+}/* Of section_set_contents */
+
+
+/* FIXME: Is this everything ? */
+static boolean
+amiga_set_arch_mach (abfd, arch, machine)
+     bfd *abfd;
+     enum bfd_architecture arch;
+     unsigned long machine;
+{
+  bfd_default_set_arch_mach(abfd, arch, machine);
+
+  if (arch == bfd_arch_m68k)
+    {
+      switch (machine)
+	{
+	case 68000:
+	case 68008:
+	case 68010:
+	case 68020:
+	case 68030:
+	case 68040:
+	case 68070:
+	case 0:
+	  return true;
+	default:
+	  return false;
+	}
+    }
+  else if (arch == bfd_arch_powerpc)
+    {
+      return true;
+    }
+  return false;
+}
+
+static int
+DEFUN(amiga_sizeof_headers,(ignore_abfd, ignore),
+      bfd *ignore_abfd AND
+      boolean ignore)
+{
+  /* The amiga hunk format doesn't have headers.*/
+  return 0;
+}
+
+/* Provided a BFD, a section and an offset into the section, calculate
+   and return the name of the source file and the line nearest to the
+   wanted location.  */
+boolean
+amiga_find_nearest_line(abfd, section, symbols, offset, filename_ptr,
+			functionname_ptr, line_ptr)
+     bfd *abfd;
+     asection *section;
+     asymbol **symbols;
+     bfd_vma offset;
+     char **filename_ptr;
+     char **functionname_ptr;
+     int *line_ptr;
+{
+  /* FIXME (see aoutx.h, for example) */
+  return false;
+}
+
+static const struct reloc_howto_struct *
+amiga_bfd_reloc_type_lookup (abfd, code)
+       bfd *abfd;
+       bfd_reloc_code_real_type code;
+{
+  switch (code)
+    {
+    case BFD_RELOC_8_PCREL:  return &howto_hunk_reloc8;
+    case BFD_RELOC_16_PCREL: return &howto_hunk_reloc16;
+    case BFD_RELOC_CTOR:
+    case BFD_RELOC_32_PCREL: return &howto_hunk_reloc32;
+    case BFD_RELOC_8:        return &howto_hunk_reloc8;
+    case BFD_RELOC_16:       return &howto_hunk_reloc16;
+    case BFD_RELOC_32:       return &howto_hunk_reloc32;
+      /* FIXME: Add more cases here for base relative relocs*/
+    default:                 return 0;
+    }
+}
+
+static boolean
+amiga_bfd_copy_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  AMIGA_DATA(obfd)->IsLoadFile = AMIGA_DATA(ibfd)->IsLoadFile;
+  return true;
+}
+
+static boolean
+amiga_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
+     bfd *ibfd;
+     asection *isec;
+     bfd *obfd;
+     asection *osec;
+{
+  if (bfd_get_flavour (osec->owner) == bfd_target_amiga_flavour) {
+    amiga_per_section (osec)->disk_size = amiga_per_section (isec)->disk_size;
+    amiga_per_section (osec)->attribute = amiga_per_section (isec)->attribute;
+  }
+  return true;
+}
+
+/* There is no armap in the amiga libraries, so we fill carsym entries
+   one by one after having parsed the whole archive. */
+static boolean
+amiga_slurp_armap (abfd)
+     bfd *abfd;
+{
+  unsigned long type, n, slen;
+  struct arch_syms *syms;
+  unsigned long symcount=0;
+  carsym *defsyms, *csym;
+  unsigned long *symblock,len;
+
+  /* allocate the carsyms */
+  syms = amiga_ardata(abfd)->defsyms;
+  symcount = amiga_ardata(abfd)->defsym_count;
+
+  defsyms = (carsym*) bfd_alloc (abfd, sizeof (carsym) * symcount);
+  if (!defsyms)
+    return false;
+
+  bfd_ardata(abfd)->symdefs = defsyms;
+  bfd_ardata(abfd)->symdef_count = symcount;
+
+  csym = defsyms;
+  while (syms) {
+    if (bfd_seek (abfd, syms->offset, SEEK_SET))
+      return false;
+    symblock = (unsigned long*) bfd_alloc (abfd, syms->size);
+    if (!symblock)
+      return false;
+    if (bfd_read (symblock, 1, syms->size, abfd) != syms->size)
+      return false;
+    while ((n=GL(symblock)) != 0)
+      {
+	symblock++;
+	len = n & 0xffffff;
+	type = (n>>24) & 0xff;
+	switch (type) {
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS:
+	  slen = len<<2;
+	  csym->name = (char*)symblock;
+	  if (*((char*)symblock+slen-1) != '\0')
+	    *((char*)symblock+slen) = '\0';
+	  csym->file_offset = syms->unit_offset;
+	  csym++;
+	  symblock += len+1;	/* name+value */
+	  break;
+	case EXT_REF8:
+	case EXT_REF16:
+	case EXT_REF32:
+	case EXT_DEXT8:
+	case EXT_DEXT16:
+	case EXT_DEXT32:
+	  symblock += len;
+	  symblock += 1+GL(symblock);
+	  break;
+	case EXT_COMMON:
+	  symblock += len+1;
+	  symblock += 1+GL(symblock);
+	  break;
+	default: /* error */
+	  fprintf (stderr, "unexpected type in hunk_ext\n");
+	  return false;
+	}
+      }
+    syms = syms->next;
+  }
+  bfd_has_map (abfd) = true;
+  return true;
+}
+
+static void amiga_truncate_arname ()
+{
+}
+
+static const struct bfd_target *
+amiga_archive_p (abfd)
+     bfd *abfd;
+{
+  long header;
+  struct stat stat_buffer;
+  int units;
+  symindex symcount = 0;
+  struct arch_syms *symbols = NULL;
+
+  bfd_set_error (bfd_error_wrong_format);
+
+  if (bfd_stat (abfd, &stat_buffer) < 0)
+    return false;
+
+  if (stat_buffer.st_size != 0)
+    {
+      /* scan the units */
+      if (!parse_archive_units (abfd, &units, stat_buffer.st_size, false,
+				&symbols, &symcount))
+	return NULL;
+
+      /* if there is only one unit, we consider it's an object, not an
+	 archive. Obviously it's not always true but taking objects
+	 for archives makes ld fail, so we don't have much of a choice */
+      if (units == 1)
+	return NULL;
+
+    }
+
+  if (abfd->arelt_data)
+    arelt_size (abfd) = bfd_tell (abfd);
+
+  bfd_seek (abfd, 0, SEEK_SET);
+  abfd->arch_info = bfd_scan_arch ("m68k:68000");
+
+  if (amiga_mkarchive (abfd))
+    {
+      amiga_ardata(abfd)->filesize = stat_buffer.st_size;
+      bfd_ardata(abfd)->first_file_filepos = 0;
+      amiga_ardata(abfd)->defsym_count = symcount;
+      amiga_ardata(abfd)->defsyms = symbols;
+      if (amiga_slurp_armap (abfd))
+	return abfd->xvec;
+      else
+	return NULL;
+    }
+    else
+      return NULL;
+}
+
+static bfd *
+amiga_openr_next_archived_file (archive, last_file)
+     bfd *archive;
+     bfd *last_file;
+{
+  file_ptr filestart;
+
+  if (!last_file)
+    filestart = bfd_ardata(archive)->first_file_filepos;
+  else
+    {
+      unsigned int size = arelt_size (last_file);
+      /* Pad to an even boundary... */
+      filestart = last_file->origin + size;
+      filestart += filestart % 2;
+    }
+
+  return _bfd_get_elt_at_filepos (archive, filestart);
+}
+
+static PTR
+amiga_read_ar_hdr (abfd)
+   bfd *abfd;
+{
+  struct areltdata *ared;
+  char *filename = NULL;
+  unsigned long header, read, len, start_pos;
+
+  start_pos = bfd_tell (abfd);
+
+  if (start_pos >= amiga_ardata(abfd)->filesize) {
+    bfd_set_error (bfd_error_no_more_archived_files);
+    return NULL;
+  }
+
+  if (bfd_read ((PTR) &header, 1, sizeof (header), abfd) != sizeof (header))
+      return NULL;
+
+  if (GL(&header) != HUNK_UNIT)
+    {
+      bfd_set_error (bfd_error_malformed_archive);
+      return NULL;
+    }
+
+  /* get the unit name length in long words */
+  if (!get_long (abfd, &len))
+    return NULL;
+  len = len << 2;
+
+  ared = bfd_zalloc (abfd, sizeof (struct areltdata));
+  if (ared == NULL) {
+    bfd_set_error (bfd_error_no_memory);
+    return NULL;
+  }
+
+  if (len)
+    {
+      if (!(ared->filename =  bfd_alloc (abfd, len+1)))
+	{
+	  bfd_set_error (bfd_error_no_memory);
+	  return NULL;
+	}
+      else
+	{
+	  if (bfd_read (ared->filename, 1, len, abfd) != len)
+	    return NULL;
+	  ared->filename[len] = '\0';
+	}
+    }
+  else
+    ared->filename = "(no name)";
+
+  if (bfd_seek (abfd, start_pos+4, SEEK_SET))
+    return false;
+
+  if (!amiga_read_unit (abfd, amiga_ardata(abfd)->filesize))
+    return NULL;
+
+  ared->parsed_size = bfd_tell(abfd)-start_pos;
+  if (bfd_seek (abfd, start_pos, SEEK_SET))
+    return false;
+  return (PTR) ared;
+}
+
+int
+amiga_generic_stat_arch_elt (abfd, buf)
+   bfd *abfd;
+   struct stat *buf;
+{
+  if (abfd->arelt_data == NULL)
+    {
+      bfd_set_error (bfd_error_invalid_operation);
+      return -1;
+    }
+
+  /* No header in amiga archives. Let's set reasonable default values */
+  buf->st_mtime = 0;
+  buf->st_uid = 0;
+  buf->st_gid = 0;
+  buf->st_mode = 0666;
+
+  buf->st_size = ((struct areltdata*)(abfd->arelt_data))->parsed_size;
+
+  return 0;
+}
+
+/* We don't have core files.  */
+#define	amiga_core_file_failing_command _bfd_dummy_core_file_failing_command
+#define	amiga_core_file_failing_signal _bfd_dummy_core_file_failing_signal
+#define	amiga_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
+
+/* Entry points through BFD_JUMP_TABLE_ARCHIVE */
+/*#define	amiga_slurp_armap		bfd_slurp_amiga_armap*/
+#define	amiga_slurp_extended_name_table	_bfd_slurp_extended_name_table
+#define amiga_construct_extended_name_table _bfd_archive_bsd_construct_extended_name_table
+/*#define	amiga_truncate_arname		bfd_gnu_truncate_arname*/
+/*#define	amiga_write_armap		amiga_write_armap*/
+/*#define	amiga_read_ar_hdr		_bfd_generic_read_ar_hdr*/
+/*#define	amiga_openr_next_archived_file	bfd_generic_openr_next_archived_file*/
+
+#define amiga_get_elt_at_index		_bfd_generic_get_elt_at_index
+/* #define amiga_generic_stat_arch_elt	bfd_generic_stat_arch_elt */
+#define amiga_update_armap_timestamp	_bfd_archive_bsd_update_armap_timestamp
+
+/* Entry points through BFD_JUMP_TABLE_SYMBOLS */
+#undef amiga_get_symtab_upper_bound	/* defined above */
+#undef amiga_get_symtab			/* defined above */
+#undef amiga_make_empty_symbol		/* defined above */
+#undef amiga_print_symbol		/* defined above */
+#undef amiga_get_symbol_info		/* defined above */
+#define amiga_bfd_is_local_label	bfd_generic_is_local_label
+#define amiga_get_lineno		(struct lineno_cache_entry *(*)())bfd_nullvoidptr
+#undef amiga_find_nearest_line		/* defined above */
+#define amiga_bfd_make_debug_symbol	(asymbol * (*)(bfd *, void *, unsigned long)) bfd_nullvoidptr
+#define amiga_read_minisymbols		_bfd_generic_read_minisymbols
+#define amiga_minisymbol_to_symbol	_bfd_generic_minisymbol_to_symbol
+
+#define amiga_bfd_debug_info_start		bfd_void
+#define amiga_bfd_debug_info_end		bfd_void
+#define amiga_bfd_debug_info_accumulate	(PROTO(void,(*),(bfd*, struct sec *))) bfd_void
+#define amiga_bfd_is_local_label_name bfd_generic_is_local_label_name
+
+/* NOTE: We use a special get_relocated_section_contents both in amiga AND in a.out files.
+   In addition, we use an own final_link routine, which is nearly identical to _bfd_generic_final_link */
+extern bfd_byte *get_relocated_section_contents(bfd*, struct bfd_link_info *,
+						struct bfd_link_order *, bfd_byte *,
+						boolean, asymbol **);
+#define amiga_bfd_get_relocated_section_contents get_relocated_section_contents
+#define amiga_bfd_relax_section                   bfd_generic_relax_section
+
+#define amiga_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define amiga_bfd_link_add_symbols _bfd_generic_link_add_symbols
+extern boolean amiga_final_link(bfd *, struct bfd_link_info *);
+#define amiga_bfd_final_link amiga_final_link
+
+/* Entry points through BFD_JUMP_TABLE_GENERIC */
+#define amiga_close_and_cleanup         _bfd_generic_close_and_cleanup
+#define amiga_bfd_free_cached_info	_bfd_generic_bfd_free_cached_info
+/* amiga_new_section_hook defined above */
+/* amiga_get_section_hook defined above */
+#define amiga_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+
+/* Entry points through BFD_JUMP_TABLE_COPY */
+#define amiga_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+/*#define amiga_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data*/
+#define amiga_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define amiga_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define amiga_bfd_print_private_flags _bfd_generic_bfd_print_private_flags
+#define amiga_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
+
+#define amiga_bfd_link_split_section  _bfd_generic_link_split_section
+
+#if defined (amiga)
+/* So that the JUMP_TABLE() macro below can work.  */
+#undef amiga
+#endif
+
+const bfd_target amiga_vec =
+{
+  "amiga",		/* name */
+  bfd_target_amiga_flavour,
+  true,			/* data byte order is big */
+  true,			/* header byte order is big */
+  HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT, /* object flags */
+ /* section flags */
+  SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA,
+  '_',				/* symbol leading char */
+  ' ',				/* ar_pad_char */
+  15,				/* ar_max_namelen */	/* (15 for UNIX compatibility) */
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
+  bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
+  bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+  {
+    /* bfd_check_format */
+    _bfd_dummy_target,
+    amiga_object_p,
+    amiga_archive_p,
+    _bfd_dummy_target
+  },
+  {
+    /* bfd_set_format */
+    bfd_false,
+    amiga_mkobject,
+    amiga_mkarchive,
+    bfd_false
+  },
+  {
+    /* bfd_write_contents */
+    bfd_false,
+    amiga_write_object_contents,
+    amiga_write_archive_contents,
+    bfd_false
+  },
+  BFD_JUMP_TABLE_GENERIC (amiga),
+  BFD_JUMP_TABLE_COPY (amiga),
+  BFD_JUMP_TABLE_CORE (_bfd_nocore),
+  BFD_JUMP_TABLE_ARCHIVE (amiga),
+  BFD_JUMP_TABLE_SYMBOLS (amiga),
+  BFD_JUMP_TABLE_RELOCS (amiga),
+  BFD_JUMP_TABLE_WRITE (amiga),
+  BFD_JUMP_TABLE_LINK (amiga),
+  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+  (PTR) 0
+#if 0
+/* fixme: no longer in use?  */
+  /* How applications can find out about amiga relocation types (see
+     documentation on reloc types).  */
+  amiga_reloc_type_lookup
+#endif
+};
--- binutils-2.9.1/bfd/amigaoslink.c	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/bfd/amigaoslink.c	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,1193 @@
+/* BFD back-end for Commodore-Amiga AmigaOS binaries. Linker routines.
+   Copyright (C) 1990-1994 Free Software Foundation, Inc.
+   Contributed by Stephan Thesing
+
+This file is part of BFD, the Binary File Descriptor library.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/*
+INODE
+amigalink, , implementation, amiga
+SECTION
+	amigalink
+
+This is the description of the linker routines for the amiga.
+In fact, this includes a description of the changes made to the
+a.out code, in order to build a working linker for the Amiga.
+@menu
+@* alterations::
+@end menu
+
+INODE 
+alterations, , , amigalink
+SUBSECTION
+	alterations
+
+The file @file{aout-amiga.c} defines the amiga a.out backend. It differs from
+the sun3 backend only in these details:
+	o The @code{final_link} routine is @code{amiga_final_link}.
+	o The routine to get the relocated section contents is
+           @code{aout_bfd_get_relocated_section_contents}.
+
+This ensures that the link is performed properly, but has the side effect of loosing
+performance.
+
+
+The amiga bfd code uses the same @code{amiga_final_link} routine, but with a 
+different <<get_relocated_section_contents>> entry: <<amiga_bfd_get_relocated_section_contents>>.
+The latter  differs from the routine of the a.out backend only in the application of relocs
+ to the section contents.
+@@*
+
+The usage of a special linker code has one reason:
+The bfd library assumes that a program is always loaded at a known memory
+address. This is not a case on an Amiga. So the Amiga format has to take over
+some relocs to an executable output file. 
+This is not the case with a.out formats, so there relocations can be applied at link time,
+not at run time, like on the Amiga.
+The special routines compensate this: instead of applying the relocations, they are
+copied to the output file, if neccessary.
+As as consequence, the @code{final_link} and @code{get_relocated_section_contents} are nearly identical to
+the original routines from @file{linker.c} and @file{reloc.c}.
+*/
+
+#include "bfd.h"
+#include "bfdlink.h"
+#include "sysdep.h"
+#include "genlink.h"
+#include "libbfd.h"
+
+#include "libamiga.h"
+#undef GET_SWORD
+#define aadata ((bfd)->tdata.amiga_data->a)
+#undef adata
+#include "libaout.h"
+
+
+#define max(x,y) (((x)<=(y))?(y):(x))
+
+#define DEBUG_AMIGA 10000
+
+#if DEBUG_AMIGA
+#include <varargs.h>
+static void error_print(va_alist)
+va_dcl
+{
+va_list args;
+char *fmt;
+
+va_start(args);
+fmt=va_arg(args,char *);
+
+(void)vfprintf(stderr,fmt,args);
+va_end(args);
+}
+
+#define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
+#else
+#define DPRINT(L,x) 
+#endif
+
+/* This one is used by the linker and tells us, if a debug hunk should be
+   written out*/
+int write_debug_hunk = 0;
+
+/* This is also used by the linker to set the attribute of sections */
+int amiga_attribute = 0;
+
+/* This one is used to indicate base-relative linking */
+int amiga_base_relative=0;
+
+/* This one is used to indicate -resident linking */
+int amiga_resident=0;
+
+/* generate a pOS executable */
+int amiga_pOS_flg;
+
+extern boolean default_indirect_link_order
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+	   struct bfd_link_order *, boolean));
+
+
+
+bfd_byte *
+get_relocated_section_contents PARAMS((bfd *, struct bfd_link_info *,
+				       struct bfd_link_order *, bfd_byte *,
+				       boolean , asymbol **));
+static bfd_reloc_status_type
+amiga_perform_reloc PARAMS((bfd *, arelent *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type 
+aout_perform_reloc PARAMS ((bfd *, arelent *, PTR, asection *, bfd *, char **));
+static boolean
+amiga_reloc_link_order PARAMS ((bfd *, struct bfd_link_info *,asection *,
+				struct bfd_link_order *));
+
+
+/* This one is nearly identical to bfd_generic_get_relocated_section_contents
+   from reloc.c */
+bfd_byte *
+get_relocated_section_contents (abfd, link_info, link_order, data,
+					    relocateable, symbols)
+     bfd *abfd;
+     struct bfd_link_info *link_info;
+     struct bfd_link_order *link_order;
+     bfd_byte *data;
+     boolean relocateable;
+     asymbol **symbols;
+{
+  bfd *input_bfd = link_order->u.indirect.section->owner;
+  asection *input_section = link_order->u.indirect.section;
+
+  long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
+  arelent **reloc_vector = NULL;
+  long reloc_count;
+  bfd_reloc_status_type (*reloc_func)(bfd *, arelent *, PTR, asection *,
+				      bfd *, char **);
+
+  DPRINT(5,("Entering get_rel_sec_cont\n"));
+
+  if (reloc_size < 0)
+    goto error_return;
+
+  if (input_bfd->xvec->flavour==bfd_target_amiga_flavour)
+    reloc_func=amiga_perform_reloc;
+  else if (input_bfd->xvec->flavour==bfd_target_aout_flavour)
+    reloc_func=aout_perform_reloc;
+  else
+    {
+      bfd_set_error(bfd_error_bad_value);
+      goto error_return;
+    }
+
+  reloc_vector = (arelent **) malloc (reloc_size);
+
+  if (reloc_vector == NULL && reloc_size != 0)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      goto error_return;
+    }
+
+  DPRINT(5,("GRSC: GetSecCont()\n"));
+  /* read in the section */
+  if (!bfd_get_section_contents (input_bfd,
+				 input_section,
+				 (PTR) data,
+				 0,
+				 input_section->_raw_size))
+    goto error_return;
+
+  /* We're not relaxing the section, so just copy the size info */
+  input_section->_cooked_size = input_section->_raw_size;
+  input_section->reloc_done = true;
+
+  DPRINT(5,("GRSC: CanReloc\n"));
+  reloc_count = bfd_canonicalize_reloc (input_bfd,
+					input_section,
+					reloc_vector,
+					symbols);
+  if (reloc_count < 0)
+    goto error_return;
+
+  if (reloc_count > 0)
+    {
+      arelent **parent;
+
+      DPRINT(5,("reloc_count=%d\n",reloc_count));
+
+      for (parent = reloc_vector; *parent != (arelent *) NULL;
+	   parent++)
+	{
+	  char *error_message = (char *) NULL;
+	  bfd_reloc_status_type r ;
+
+	  DPRINT(5,("Applying a reloc\nparent=%lx, reloc_vector=%lx,"
+		    "*parent=%lx\n",parent,reloc_vector,*parent));
+	  r=(*reloc_func) (input_bfd,
+			   *parent,
+			   (PTR) data,
+			   input_section,
+			   relocateable ? abfd : (bfd *) NULL,
+			   &error_message);
+	  if (relocateable)
+	    {
+	      asection *os = input_section->output_section;
+
+	      DPRINT(5,("Keeping reloc\n"));
+	      /* A partial link, so keep the relocs */
+	      os->orelocation[os->reloc_count] = *parent;
+	      os->reloc_count++;
+	    }
+
+	  if (r != bfd_reloc_ok)
+	    {
+	      switch (r)
+		{
+		case bfd_reloc_undefined:
+		  if (!((*link_info->callbacks->undefined_symbol)
+			(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+			 input_bfd, input_section, (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_dangerous:
+		  BFD_ASSERT (error_message != (char *) NULL);
+		  if (!((*link_info->callbacks->reloc_dangerous)
+			(link_info, error_message, input_bfd, input_section,
+			 (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_overflow:
+		  if (!((*link_info->callbacks->reloc_overflow)
+			(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+			 (*parent)->howto->name, (*parent)->addend,
+			 input_bfd, input_section, (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_outofrange:
+		default:
+		  DPRINT(10,("get_rel_sec_cont fails, perform reloc "
+			     "returned $%x\n",r));
+		  abort ();
+		  break;
+		}
+
+	    }
+	}
+    }
+  if (reloc_vector != NULL)
+    free (reloc_vector);
+  DPRINT(5,("GRSC: Returning ok\n"));
+  return data;
+
+error_return:
+  DPRINT(5,("GRSC: Error_return\n"));
+  if (reloc_vector != NULL)
+    free (reloc_vector);
+  return NULL;
+}
+
+
+/* Add a value to a location */
+static bfd_reloc_status_type
+my_add_to (data, offset, size, add, sign)
+  PTR data;
+  int offset, size, add, sign;
+{
+  signed char *p;
+  int val;
+  bfd_reloc_status_type ret;
+
+  DPRINT(5,("Entering add_value\n"));
+
+  ret=bfd_reloc_ok;
+  p=((signed char*)data)+offset;
+
+  switch (size)
+    {
+    case 0: /* byte size */
+      val = (int)(p[0]) + add;
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x80 || val>0x7f)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffffff00)!=0 && (val&0xffffff00)!=0xffffff00)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[0]=val&0xff;
+      break;
+
+    case 1: /* word size */
+      val = (int)((p[1]&0xff)|(p[0]<<8)) + add;
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x8000 || val>0x7fff)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffff0000)!=0 && (val&0xffff0000)!=0xffff0000)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[1]=val&0xff;
+      p[0]=((val&0xff00)>>8)&0xff;
+      break;
+
+    case 2: /* long word */
+      val = bfd_getb_signed_32 (p) + add;
+      /* If we are linking a resident program, then we limit the reloc size
+         to about +/- 1 GB.
+         
+         When linking a shared library all variables defined in other
+         libraries are placed in memory >0x80000000, so if the library
+         tries to use one of those variables an error is output.
+         
+         Without this it would be much more difficult to check for
+         incorrect references.
+       */
+      if (amiga_resident &&
+          (val & 0xc0000000)!=0 && (val&0xc0000000)!=0xc0000000) /* Overflow */
+	{
+	  ret=bfd_reloc_overflow;
+	}
+      bfd_putb32 (val, p);
+      break;
+      
+    default: /* Error */
+      ret=bfd_reloc_notsupported;
+      break;
+    }/* Of switch */
+
+  DPRINT(5,("Leaving add_value\n"));
+  return (ret);
+}
+
+/* Set a value to a location */
+static bfd_reloc_status_type
+my_set_to (data, offset, size, val, sign)
+  PTR data;
+  int offset, size, val, sign;
+{
+  signed char *p;
+  bfd_reloc_status_type ret;
+
+  DPRINT(5,("Entering add_value\n"));
+
+  ret=bfd_reloc_ok;
+  p=((signed char*)data)+offset;
+
+  switch (size)
+    {
+    case 0: /* byte size */
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x80 || val>0x7f)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffffff00)!=0 && (val&0xffffff00)!=0xffffff00)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[0]=val&0xff;
+      break;
+
+    case 1: /* word size */
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x8000 || val>0x7fff)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffff0000)!=0 && (val&0xffff0000)!=0xffff0000)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[1]=val&0xff;
+      p[0]=((val&0xff00)>>8)&0xff;
+      break;
+
+    case 2: /* long word */
+      /* If we are linking a resident program, then we limit the reloc size
+         to about +/- 1 GB.
+         
+         When linking a shared library all variables defined in other
+         libraries are placed in memory >0x80000000, so if the library
+         tries to use one of those variables an error is output.
+         
+         Without this it would be much more difficult to check for
+         incorrect references.
+       */
+      if (amiga_resident &&
+          (val & 0xc0000000)!=0 && (val&0xc0000000)!=0xc0000000) /* Overflow */
+	{
+	  ret=bfd_reloc_overflow;
+	}
+      p[3] = val & 0xff;
+      p[2] = (val >> 8) & 0xff;
+      p[1] = (val >> 16) & 0xff;
+      p[0] = (val >> 24) & 0xff;
+      break;
+      
+    default: /* Error */
+      ret=bfd_reloc_notsupported;
+      break;
+    }/* Of switch */
+
+  DPRINT(5,("Leaving set_value\n"));
+  return (ret);
+}
+
+/* Perform an Amiga relocation */
+static bfd_reloc_status_type 
+amiga_perform_reloc (abfd, r, data, sec, obfd, error_message)
+   bfd *abfd;
+   arelent *r;
+   PTR data;
+   asection *sec;
+   bfd *obfd;
+   char **error_message;
+{
+  asymbol *sym; /* Reloc is relative to sym */
+  asection *target_section; /* reloc is relative to this section */
+  int relocation;
+  boolean copy;
+  bfd_reloc_status_type ret;
+  int size = 2;
+  int sign = false;
+
+  DPRINT(5,("Entering APR\nflavour is %d (aflavour=%d, aout_flavour=%d)\n",
+	    sec->owner->xvec->flavour, bfd_target_amiga_flavour,
+	    bfd_target_aout_flavour));
+
+  /* If obfd==NULL: Apply the reloc, if possible. */
+  /* Else: Modify it and return */
+
+  if (obfd!=NULL) /* Only modify the reloc */
+    {
+      r->address+=sec->output_offset;
+      sec->output_section->flags|=SEC_RELOC;
+      DPRINT(5,("Leaving APR, modified case \n"));
+      return bfd_reloc_ok;
+    }
+
+  /* Try to apply the reloc */
+
+  sym=*(r->sym_ptr_ptr);
+
+#if 0
+  /* FIXME */
+   if (sym->udata.p)
+     sym = ((struct generic_link_hash_entry*)sym->udata.p)->sym;
+#endif
+
+  target_section=sym->section;
+
+  if (target_section==bfd_und_section_ptr) /* Error */
+    {
+      DPRINT(10,("perform_reloc: Target is undefined section\n"));
+      return bfd_reloc_undefined;
+    }
+  
+  relocation=0; copy=false; ret=bfd_reloc_ok;
+
+  switch(r->howto->type)
+    {
+    case HUNK_RELOC32: /* 32 bit reloc */
+      DPRINT(5,("RELOC32\n"));
+      size=2;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* ref to common */
+	{
+	  relocation=0;
+	  copy=true;
+	}
+      else
+	{
+	  /* If we access a symbol in the .bss section, we have to convert
+	     this to an access to .data section */
+	  /* This is done through a change to the symbol... */
+	  if (amiga_base_relative && (strcmp(sym->section->output_section->name,
+					     ".bss")==0))
+	    {
+	      /* get value for .data section */
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_offset=s->_raw_size;
+		    sym->section->output_section=s;
+		  }
+	    }
+
+	  relocation=0;
+	  copy=true;
+	}
+      break;
+
+    case HUNK_RELOC8:
+    case HUNK_RELOC16:
+      DPRINT(5,("RELOC16/8\n"));
+      size=(r->howto->type==HUNK_RELOC8)?0:1;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else {
+	if (target_section==bfd_com_section_ptr) /* Error.. */
+	  {
+	    relocation=0;
+	    copy=false;
+	    ret=bfd_reloc_undefined;
+	  }
+	else
+	  {
+	    DPRINT(5,("PC relative\n"));
+	    /* This is a pc relative hunk... */
+	    if (sec->output_section!=target_section->output_section) /* Error */
+	      {
+		DPRINT(10,("pc relative, but out of range I\n"));
+		relocation=0;
+		copy =false;
+		ret=bfd_reloc_outofrange;
+	      }
+	    else
+	      { /* Same section */
+		relocation=-(r->address+sec->output_offset);
+		copy=false;
+	      }
+	  }
+      }
+      break;
+      
+    case HUNK_DREL32: /* baserel relocs */
+    case HUNK_DREL16:
+    case HUNK_DREL8:
+      DPRINT(5,("HUNK_BASEREL relocs\n"));
+
+      /* Relocs are always relative to the symbol ___a4_init */
+      /* Relocs to .bss section are converted to a reloc to .data section, since
+	 .bss section contains only COMMON sections...... and should be
+	 following .data section.. */
+
+      size=(r->howto->type==HUNK_DREL32)?2:((r->howto->type==HUNK_DREL16)?1:0);
+      
+      if (target_section==bfd_abs_section_ptr)
+	{
+	  relocation=sym->value;
+	}
+      else 
+	{
+	  if (! (AMIGA_DATA (target_section->output_section->owner)->baserel))
+	    {
+	      fprintf(stderr,"Base symbol for base relative reloc not defined,"
+		      "section %s, reloc to symbol %s\n", sec->name, sym->name);
+	      copy=false;
+	      ret=bfd_reloc_notsupported;
+	      break;
+	    }
+
+	  /* If target->out is .bss, add the value of the .data section to sym->value and
+	     set output_section new to .data section.... */
+	  if (strcmp(target_section->output_section->name,".bss")==0)
+	    {
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_section=s;
+		    sym->section->output_offset=s->_raw_size;
+		  }
+	    }
+
+	  relocation = sym->value + sym->section->output_offset
+	    - (AMIGA_DATA (target_section->output_section->owner))->a4init
+	    + r->addend;
+	  copy=false; 
+	  sign = true;
+	}
+      break;
+      
+    default:
+      fprintf(stderr,"Error:Not supported reloc type:%d\n",r->howto->type);
+      copy=false;
+      relocation=0;
+      ret=bfd_reloc_notsupported;
+      break;
+    } /* Of switch */
+  
+  /* Add in relocation */
+  if (relocation!=0)
+    ret = my_add_to (data, r->address, size, relocation, sign);
+  
+  if (copy)/* Copy reloc to output section */
+    {
+      DPRINT(5,("Copying reloc\n"));
+      target_section=sec->output_section;
+      r->address+=sec->output_offset;
+      target_section->orelocation[target_section->reloc_count++]=r;
+      sec->output_section->flags|=SEC_RELOC;
+    }
+  DPRINT(5,("Leaving a_perform_reloc\n"));
+  return ret;
+}
+
+
+/* Perform an a.out reloc */
+static bfd_reloc_status_type 
+aout_perform_reloc (abfd, r, data, sec, obfd, error_message)
+   bfd *abfd;
+   arelent *r;
+   PTR data;
+   asection *sec;
+   bfd *obfd;
+   char **error_message;
+{
+  asymbol *sym; /* Reloc is relative to this */
+  asection *target_section; /* reloc is relative to this section */
+  int relocation;
+  boolean copy, addval = true;
+  bfd_reloc_status_type ret;
+  int size = 2;
+  int sign = false;
+
+  /* If obfd==NULL: Apply the reloc, if possible. */
+  /* Else: Modify it and return */
+  DPRINT(5,("Entering aout_perf_reloc\n"));
+  if (obfd!=NULL) /* Only modify the reloc */
+    {
+      r->address+=sec->output_offset;
+      DPRINT(5,("Leaving aout_perf_reloc, modified\n"));
+      return bfd_reloc_ok;
+    }
+
+  sym=*(r->sym_ptr_ptr);
+  target_section=sym->section;
+
+  if (target_section==bfd_und_section_ptr) /* Error */
+    {
+      DPRINT(10,("target_sec=UND, aout_perf_rel\n"));
+      return bfd_reloc_undefined;
+    }
+  relocation=0; copy=false; ret=bfd_reloc_ok;
+
+  switch (r->howto->type)
+    {
+    case 0: /* 8 bit reloc, pc relative or absolute */
+    case 1: /* 16 bit reloc */
+      DPRINT(10,("16/8 bit relative\n"));
+      size=r->howto->type;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* Error.. */
+	{
+	  relocation=0;
+	  copy=false;
+	  ret=bfd_reloc_undefined;
+	  fprintf(stderr,"Pc relative relocation to  common symbol \"%s\" "
+		  "in section %s\n", sym->name,sec->name);
+	  DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
+	}
+      else 
+	{
+	  /* This is a pc relative hunk... or a baserel... */
+	  if (sec->output_section!=target_section->output_section)
+	    /* Error or baserel */
+	    {
+	      if (target_section->output_section->flags&SEC_DATA!=0)
+		/* Baserel reloc */
+		{
+		  goto baserel; /* Dirty, but no code doubling.. */
+		}/* Of is baserel */
+
+	      relocation=0;
+	      copy =false;
+	      ret=bfd_reloc_outofrange;
+	      fprintf(stderr,"pc relative relocation out of range in section"
+		      "%s. Relocation was to symbol %s\n",sec->name,sym->name);
+
+	      DPRINT(10,("Section%s, target %s: Reloc out of range..."
+			 "not same section, aout_perf\nsec->out=%s, target->out"
+			 "=%s, offset=%lx\n",sec->name, target_section->name,
+			 sec->output_section->name,
+			 target_section->output_section->name,r->address));
+	    }
+	  else
+	    { /* Same section */
+	      relocation=-(r->address+sec->output_offset);
+	      copy=false;
+	      DPRINT(5,("Reloc to same section...\n"));
+	    }
+	}
+      break;
+
+    case 4: /* 8 bit displacement */
+    case 5: /* 16 bit displacement */
+    case 6: /* 32 bit displacement */
+      size=r->howto->type - 4;
+      sign = true;
+      if (target_section == bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation = sym->value;
+      else
+         {
+           relocation = (sym->value + target_section->output_offset) -
+ 			(r->address + sec->output_offset);
+           if (size == 0)
+             relocation--;
+	   addval = false;
+	   copy = 0;
+         }
+      break;
+
+    case 2: /* 32 bit reloc, abs. or relative */
+      DPRINT(10,("32 bit\n"));
+      size=2;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* ref to common */
+	{
+	  relocation=0;
+	  copy=true;
+	}
+      else
+	{
+	  /* If we access a symbol in the .bss section, we have to convert
+	     this to an access to .data section*/
+	  /* This is done through a change to the output section of
+	     the symbol... */
+	  if (amiga_base_relative && (strcmp(sym->section->output_section->name,
+					     ".bss")==0))
+	    {
+	      /* get value for .data section */
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_section=s;
+		    sym->section->output_offset+=s->_raw_size;
+		  }
+	    }
+	  relocation=0;
+	  copy=true;
+	}
+      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+		 target_section->output_section->name,
+		 target_section->output_section,sec->output_section->name,
+		 sec->output_section,sym->name));
+      break;
+
+    case 9: /* 16 bit base relative */
+    case 10: /* 32 bit base relative */
+      DPRINT(10,("32/16 bit baserel\n"));
+      /* We use the symbol ___a4_init as base */
+      size=r->howto->type-8;
+      
+    baserel: 
+      if (target_section==bfd_abs_section_ptr)
+	{
+	  relocation=sym->value;
+	}
+      else if (target_section==bfd_com_section_ptr) /* Error.. */
+	{
+	  relocation=0;
+	  copy=false;
+	  ret=bfd_reloc_undefined;
+	  fprintf(stderr,"Baserelative relocation to common \"%s\"\n",
+		  sym->name);
+
+	  DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
+	}
+      else /* Target section and sec need not be the same... */
+	{
+	  if (! (AMIGA_DATA (target_section->output_section->owner)->baserel))
+
+	    {
+	      fprintf(stderr,"Base symbol for base relative reloc not defined,"
+		      "section %s, reloc to symbol %s\n", sec->name, sym->name);
+	      copy=false;
+	      ret=bfd_reloc_notsupported;
+	      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+			 target_section->output_section->name,
+			 target_section->output_section,
+			 sec->output_section->name,
+			 sec->output_section,sym->name));
+	      
+	      break;
+	    }
+	  
+	  /* If target->out is .bss, add the value of the .data section....
+	     to sym, set new output_section */
+	  if (strcmp(target_section->output_section->name,".bss")==0)
+	    {
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_offset+=s->_raw_size;
+		    sym->section->output_section=s;
+		  }
+	    }
+
+	  relocation = sym->value+target_section->output_offset - 0x7ffe;
+
+	  /* if the symbol is in bss, subtract the offset that gas has put
+	     into the opcode */
+	  if (target_section->index == 2)
+	    relocation -= abfd->tdata.aout_data->a.datasec->_raw_size;
+
+	  addval = true;
+	  copy = false;
+	  sign = true;
+
+	  DPRINT (20, ("symbol=%s (0x%lx)\nsection %s (0x%lx; %s; output=0x%lx)"
+		       "\nrelocation @0x%lx\n\n", sym->name, sym->value,
+		       sym->section->name, (unsigned long)sym->section,
+		       sym->section->owner->filename, sym->section->output_offset,
+		       r->address));
+	}
+      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+		 target_section->output_section->name,
+		 target_section->output_section,sec->output_section->name,
+		 sec->output_section,sym->name));
+      break;
+      
+    default:
+      copy=false;
+      relocation=0;
+      ret=bfd_reloc_notsupported;
+      fprintf(stderr,"Unsupported reloc: %d\n",r->howto->type);
+      break;
+
+    }/* Of switch */
+
+  /* Add in relocation */
+  if (relocation!=0)
+    if (addval)
+      ret = my_add_to (data, r->address,size, relocation, sign);
+    else
+      ret = my_set_to (data, r->address, size, relocation, sign);
+
+  if (copy)/* Copy reloc to output section */
+    {
+      DPRINT(5,("Copying reloc\n"));
+      target_section=sec->output_section;
+      r->address+=sec->output_offset;
+      target_section->orelocation[target_section->reloc_count++]=r;
+    }
+  DPRINT(5,("Leaving aout_perf_reloc with %d (OK=%d)\n",ret,bfd_reloc_ok));
+  return ret;
+}
+
+
+/* The final link routine, used both by Amiga and a.out backend*/
+/* This is nearly a copy of _bfd_generic_final_link */
+boolean
+amiga_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  bfd *sub;
+  asection *o,*act_sec;
+  struct bfd_link_order *p;
+  size_t outsymalloc;
+  struct generic_write_global_symbol_info wginfo;
+  struct bfd_link_hash_entry *h =
+    bfd_link_hash_lookup (info->hash, "___a4_init", false, false, true);
+
+  if (h && h->type == bfd_link_hash_defined) {
+    AMIGA_DATA (abfd)->baserel = true;
+    AMIGA_DATA (abfd)->a4init = h->u.def.value;
+  }
+  else
+    AMIGA_DATA (abfd)->baserel = false;
+
+  DPRINT(5,("Entering final_link\n"));
+
+  if (abfd->xvec->flavour == bfd_target_aout_flavour)
+    return amiga_aout_bfd_final_link(abfd, info);
+
+  abfd->outsymbols = (asymbol **) NULL;
+  abfd->symcount = 0;
+  outsymalloc = 0;
+
+  /* Mark all sections which will be included in the output file.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    for (p = o->link_order_head; p != NULL; p = p->next)
+      if (p->type == bfd_indirect_link_order)
+	p->u.indirect.section->linker_mark = true;
+
+  /* Build the output symbol table.  */
+  for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
+    if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc))
+      return false;
+
+  DPRINT(10,("Did build output symbol table\n"));
+
+  /* Accumulate the global symbols.  */
+  wginfo.info = info;
+  wginfo.output_bfd = abfd;
+  wginfo.psymalloc = &outsymalloc;
+  _bfd_generic_link_hash_traverse (_bfd_generic_hash_table (info),
+                                   _bfd_generic_link_write_global_symbol,
+                                   (PTR) &wginfo);
+
+  DPRINT(10,("Accumulated global symbols\n"));
+
+  DPRINT(10,("Output bfd is %s(%lx)\n",abfd->filename,abfd));
+
+  /* Allocate space for the output relocs for each section.  */
+  /* We also handle base-relative linking special, by setting the .data
+     sections real length to it's length + .bss length */
+  /* This is different to bfd_generic_final_link: We ALWAYS alloc space for
+     the relocs, because we may need it anyway */
+  for (o = abfd->sections;
+       o != (asection *) NULL;
+       o = o->next)
+    {
+      /* If section is .data, find .bss and add that length */
+      if (!info->relocateable && amiga_base_relative &&
+	  (strcmp(o->name,".data")==0))
+	{
+	  if (abfd->xvec->flavour!=bfd_target_amiga_flavour) /* oops */
+	    {
+	      fprintf(stderr,"You can't use base relative linking with"
+		      " partial links.\n");
+	    }
+	  else
+	    {
+#if 0
+	      for (act_sec=abfd->sections; act_sec!=NULL;act_sec=act_sec->next)
+		if (strcmp(act_sec->name,".bss")==0)
+		  amiga_per_section(o)->disk_size = o->_raw_size +
+		    act_sec->_raw_size;
+#endif
+	    }
+	}/* Of base-relative linking */
+
+      DPRINT(10,("Section in output bfd is %s (%lx)\n",o->name,o));
+
+      o->reloc_count = 0;
+      for (p = o->link_order_head;
+	   p != (struct bfd_link_order *) NULL;
+	   p = p->next)
+	{
+	  if (p->type == bfd_section_reloc_link_order
+	      || p->type == bfd_symbol_reloc_link_order)
+	    ++o->reloc_count;
+	  else if (p->type == bfd_indirect_link_order)
+	    {
+	      asection *input_section;
+	      bfd *input_bfd;
+	      long relsize;
+	      arelent **relocs;
+	      asymbol **symbols;
+	      long reloc_count;
+	      
+	      input_section = p->u.indirect.section;
+	      input_bfd = input_section->owner;
+
+	      DPRINT(10,("\tIndirect section from bfd %s, section is %s(%lx)"
+			 " (COM=%lx)\n",
+			 input_bfd->filename,input_section->name,input_section,
+			 bfd_com_section_ptr));
+
+	      relsize = bfd_get_reloc_upper_bound (input_bfd,
+						   input_section);
+	      if (relsize < 0)
+		{
+		  DPRINT(10,("Relsize<0.I..in bfd %s, sec %s\n",
+			     input_bfd->filename, input_section->name));
+		  return false;
+		}
+
+	      relocs = (arelent **) malloc ((size_t) relsize);
+
+	      if (!relocs && relsize != 0)
+		{
+		  bfd_set_error (bfd_error_no_memory);
+		  return false;
+		}
+	      symbols = _bfd_generic_link_get_symbols (input_bfd);
+	      reloc_count = bfd_canonicalize_reloc (input_bfd,
+						    input_section,
+						    relocs,
+						    symbols);
+	      if (reloc_count < 0)
+		{
+		  DPRINT(10,("Relsize<0.II..in bfd %s, sec %s\n",
+			     input_bfd->filename, input_section->name));
+		  return false;
+		}
+
+	      BFD_ASSERT (reloc_count == input_section->reloc_count);
+	      o->reloc_count += reloc_count;
+	      free (relocs);
+	    }
+	}
+      if (o->reloc_count > 0)
+	{
+	  o->orelocation = ((arelent **)
+			    bfd_alloc (abfd,
+				       (o->reloc_count
+					* sizeof (arelent *))));
+
+	  if (!o->orelocation)
+	    {
+	      bfd_set_error (bfd_error_no_memory);
+	      return false;
+	    }
+	  /* o->flags |= SEC_RELOC; There may be no relocs. This can be
+	     determined only later */
+	  /* Reset the count so that it can be used as an index
+	     when putting in the output relocs.  */
+	  o->reloc_count = 0;
+	}
+    }
+
+  DPRINT(10,("Got all relocs\n"));
+
+  /* Handle all the link order information for the sections.  */
+  for (o = abfd->sections;
+       o != (asection *) NULL;
+       o = o->next)
+    {
+      for (p = o->link_order_head;
+           p != (struct bfd_link_order *) NULL;
+           p = p->next)
+        {
+          switch (p->type)
+            {
+            case bfd_section_reloc_link_order:
+            case bfd_symbol_reloc_link_order:
+              if (! amiga_reloc_link_order (abfd, info, o, p)) /* We use an own routine */
+                return false;
+              break;
+            case bfd_indirect_link_order:
+              if (! default_indirect_link_order (abfd, info, o, p, false)) 
+		/* Calls our get_relocated_section_contents*/
+                return false;
+              break;
+            default:
+              if (! _bfd_default_link_order (abfd, info, o, p))
+                return false;
+              break;
+            }
+        }
+    }
+  if (abfd->xvec->flavour==bfd_target_amiga_flavour&&!info->relocateable)
+    AMIGA_DATA(abfd)->IsLoadFile=true;
+
+  DPRINT(10,("Leaving final_link\n"));
+  return true;
+}
+
+
+/* Handle reloc link order . This is nearly a copy from generic_reloc_link_order
+   in linker.c*/
+static boolean 
+amiga_reloc_link_order(abfd, info, sec, link_order)
+  bfd *abfd;
+  struct bfd_link_info *info;
+  asection *sec;
+  struct bfd_link_order *link_order;
+{
+   amiga_reloc_type *r;
+
+   DPRINT(5,("Entering amiga_reloc_link_order\n"));
+
+   /* We generate a new AMIGA style reloc */
+   BFD_ASSERT(sec->orelocation!=NULL);
+
+   if (sec->orelocation == (arelent **) NULL)
+     {
+       DPRINT(10,("aborting, since orelocation==NULL\n"));
+       abort ();
+     }
+
+   r = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
+   if (r ==  NULL)
+     {
+       bfd_set_error (bfd_error_no_memory);
+       DPRINT(5,("Leaving amiga_reloc_link, no mem\n"));
+       return false;
+     }
+   
+   r->relent.address = link_order->offset;
+   r->relent.howto = bfd_reloc_type_lookup (abfd, link_order->u.reloc.p->reloc);
+   if (r->relent.howto ==  NULL)
+     {
+       bfd_set_error (bfd_error_bad_value);
+       DPRINT(5,("Leaving amiga_reloc_link, bad value\n"));
+       return false;
+     }
+   
+   /* Get the symbol to use for the relocation.  */
+   if (link_order->type == bfd_section_reloc_link_order)
+     r->relent.sym_ptr_ptr = link_order->u.reloc.p->u.section->symbol_ptr_ptr;
+   else
+     {
+       struct generic_link_hash_entry *h;
+       
+       h = _bfd_generic_link_hash_lookup (_bfd_generic_hash_table (info),
+					  link_order->u.reloc.p->u.name,
+					  false, false, true);
+       if (h == (struct generic_link_hash_entry *) NULL
+	   || ! h->written)
+	 {
+	   if (! ((*info->callbacks->unattached_reloc)
+		  (info, link_order->u.reloc.p->u.name,
+		   (bfd *) NULL, (asection *) NULL, (bfd_vma) 0)))
+	     return false;
+	   bfd_set_error (bfd_error_bad_value);
+	   DPRINT(5,("Leaving amiga_reloc_link, bad value in hash lookup\n"));
+	   return false;
+	 }
+       r->relent.sym_ptr_ptr = &h->sym;
+     }
+   DPRINT(5,("Got symbol for relocation\n"));
+   /* Store the addend */
+   r->relent.addend = link_order->u.reloc.p->addend;
+
+
+   /* If we are generating relocateable output, just add the reloc */
+   if (info->relocateable)
+     {
+       DPRINT(5,("Adding reloc\n"));
+       sec->orelocation[sec->reloc_count] = (arelent *)r;
+       ++sec->reloc_count; 
+       sec->flags|=SEC_RELOC;
+     }
+   else
+     { /* Try to apply the reloc */
+       char *em="";
+       PTR data;
+       bfd_reloc_status_type ret;
+
+       DPRINT(5,("Apply link_order_reloc\n"));
+       /*FIXME: Maybe, we have to get the section contents, before we use them,
+	 if they have not been
+	 set by now.. */
+
+       BFD_ASSERT(sec->contents!=NULL);
+       data=(PTR)(sec->contents);
+
+       if (bfd_get_flavour(abfd)==bfd_target_amiga_flavour)
+	 ret=amiga_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
+       else
+	 ret=aout_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
+
+       if (ret!=bfd_reloc_ok)
+	 {
+	   DPRINT(5,("Leaving amiga_reloc_link, value false\n"));
+	   return false;
+	 }
+     }
+   DPRINT(5,("Leaving amiga_reloc_link\n"));
+   return true;
+}
--- binutils-2.9.1/bfd/aout-amiga.c	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/bfd/aout-amiga.c	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,50 @@
+/* BFD backend for Amiga style a.out with flags set to 0
+   Copyright (C) 1990, 91, 92, 93, 1994 Free Software Foundation, Inc.
+   Written by Stephan Thesing.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#define TARGETNAME "a.out-amiga"
+#define MY(OP) CAT(aout_amiga_,OP)
+
+#include "bfd.h"
+
+#define MY_exec_hdr_flags 0
+
+extern boolean
+amiga_final_link(bfd *,struct bfd_link_info *);
+#define MY_bfd_final_link amiga_final_link
+
+extern bfd_byte *
+get_relocated_section_contents(bfd *, struct bfd_link_info *,
+			       struct bfd_link_order *, bfd_byte *,
+			       boolean , asymbol **);
+#define MY_bfd_get_relocated_section_contents get_relocated_section_contents
+
+/* Include the usual a.out support.  */
+#include "aoutf1.h"
+
+/* Final link routine.  We need to use a call back to get the correct
+   offsets in the output file.  */
+
+boolean
+amiga_aout_bfd_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
+}
--- binutils-2.9.1/bfd/aoutx.h	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/aoutx.h	Sun Aug 23 00:00:00 1998
@@ -135,7 +135,8 @@ DESCRIPTION
 static boolean aout_get_external_symbols PARAMS ((bfd *));
 static boolean translate_from_native_sym_flags
   PARAMS ((bfd *, aout_symbol_type *));
-static boolean translate_to_native_sym_flags
+/*Amiga hack - used in amigaos.c, must be global */
+/*static*/ boolean translate_to_native_sym_flags
   PARAMS ((bfd *, asymbol *, struct external_nlist *));
 static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *));
 static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *));
@@ -1576,7 +1577,7 @@ translate_from_native_sym_flags (abfd, c
 
 /* Set the fields of SYM_POINTER according to CACHE_PTR.  */
 
-static boolean
+/*static*/ boolean
 translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
      bfd *abfd;
      asymbol *cache_ptr;
@@ -1977,10 +1978,29 @@ NAME(aout,swap_std_reloc_out) (abfd, g, 
 
   r_length = g->howto->size ;	/* Size as a power of two */
   r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC? */
+#if 1
+  /* FIXME! "#if 1" is the wrong way to select this Amiga specific code.
+   We can't just test for __amigaos__ defined either, since we may be
+   building a cross compiler and __amigaos__ is only defined if the
+   compiler we are using is targeted for the Amiga. */
+  /* Changed for cooperation with AMIGA backend */
+  /* This only applies, if aout flavour    191194 ST*/
   /* XXX This relies on relocs coming from a.out files.  */
+  if (bfd_asymbol_bfd(sym)->xvec->flavour==bfd_target_aout_flavour)
+    {
+      r_baserel = (g->howto->type & 8) != 0;
+      r_jmptable = (g->howto->type & 16) != 0;
+      r_relative = (g->howto->type & 32) != 0;
+    }
+  else
+    {
+      r_baserel=r_jmptable=r_relative=0;
+    }
+#else
   r_baserel = (g->howto->type & 8) != 0;
   r_jmptable = (g->howto->type & 16) != 0;
   r_relative = (g->howto->type & 32) != 0;
+#endif
 
 #if 0
   /* For a standard reloc, the addend is in the object file.  */
@@ -2273,8 +2293,12 @@ NAME(aout,swap_std_reloc_in) (abfd, byte
   /* Base relative relocs are always against the symbol table,
      regardless of the setting of r_extern.  r_extern just reflects
      whether the symbol the reloc is against is local or global.  */
+#if 0
+  /* FIXME! "#if 0" is the wrong way to disable this code.  See comment
+     earlier in file. */
   if (r_baserel)
     r_extern = 1;
+#endif
 
   if (r_extern && r_index > symcount)
     {
--- binutils-2.9.1/bfd/archive.c	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/archive.c	Sun Aug 23 00:00:00 1998
@@ -870,6 +870,22 @@ do_slurp_coff_armap (abfd)
     {
       rawptr = raw_armap + i;
       carsyms->file_offset = swap ((PTR) rawptr);
+      /* This is a hack to work around a bug in x86 BeOS linkers that did not
+	 follow the PE spec and saved the file offsets in little endian mode. */
+      {
+	file_ptr le_val;
+	le_val = bfd_getl32 ((PTR) rawptr);
+	if (carsyms->file_offset < 0)
+	  {
+	    /* Must have been little endian */
+	    carsyms->file_offset = le_val;
+	  }
+	else if ((le_val > 0) && (le_val < carsyms->file_offset))
+	  {
+	    /* Both values positive and le_val smaller, so use le_val. */
+	    carsyms->file_offset = le_val;
+	  }
+      }
       carsyms->name = stringbase;
       stringbase += strlen (stringbase) + 1;
       carsyms++;
--- binutils-2.9.1/bfd/archures.c	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/archures.c	Sun Aug 23 00:00:00 1998
@@ -869,3 +869,7 @@ bfd_printable_arch_mach (arch, machine)
       return ap->printable_name;
     return "UNKNOWN!";
 }
+
+#ifndef HAVE_i386pei_vec
+void pei_get_comdat_info(struct sec *pei_comdat_section){}
+#endif
--- binutils-2.9.1/bfd/bfd.c	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/bfd.c	Sun Aug 23 00:00:00 1998
@@ -177,6 +177,7 @@ CODE_FRAGMENT
 .      struct cisco_core_struct *cisco_core_data;
 .      struct versados_data_struct *versados_data;
 .      struct netbsd_core_struct *netbsd_core_data;
+.      struct amiga_data_struct *amiga_data;
 .      PTR any;
 .      } tdata;
 .  
@@ -1153,3 +1154,4 @@ bfd_record_phdr (abfd, type, flags_valid
 
   return true;
 }
+
--- binutils-2.9.1/bfd/bfd-in2.h	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/bfd-in2.h	Sun Aug 23 00:00:00 1998
@@ -694,6 +694,11 @@ extern boolean bfd_coff_get_syment
 extern boolean bfd_coff_get_auxent
   PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
 
+/* Externally visible PEI routines */
+
+extern void pei_get_comdat_info 
+  PARAMS ((struct sec *));
+
 /* And more from the source.  */
 void 
 bfd_init PARAMS ((void));
@@ -797,6 +802,13 @@ bfd_create PARAMS ((CONST char *filename
 #define bfd_h_get_signed_64(abfd, ptr) \
                 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
 
+typedef struct _comdat_info
+{
+  int asoc_sec;
+  char name_buf[9];
+  const char * comdat_sym;
+} comdat_info;
+
 typedef struct sec
 {
          /* The name of the section; the name isn't a copy, the pointer is
@@ -1078,6 +1090,8 @@ typedef struct sec
    struct symbol_cache_entry *symbol;
    struct symbol_cache_entry **symbol_ptr_ptr;
 
+   comdat_info *pe_comdat_info;
+
    struct bfd_link_order *link_order_head;
    struct bfd_link_order *link_order_tail;
 } asection ;
@@ -2290,6 +2304,8 @@ struct _bfd 
       struct cisco_core_struct *cisco_core_data;
       struct versados_data_struct *versados_data;
       struct netbsd_core_struct *netbsd_core_data;
+      struct amiga_data_struct *amiga_data;
+      struct amiga_ardata_struct *amiga_ardata;
       PTR any;
       } tdata;
   
@@ -2505,6 +2521,7 @@ core_file_matches_executable_p
 #endif
 enum bfd_flavour {
   bfd_target_unknown_flavour,
+  bfd_target_amiga_flavour,
   bfd_target_aout_flavour,
   bfd_target_coff_flavour,
   bfd_target_ecoff_flavour,
--- binutils-2.9.1/bfd/bfd-in.h	Fri May  1 08:48:01 1998
+++ binutils-2.9.1/bfd/bfd-in.h	Sun Aug 23 00:00:00 1998
@@ -694,4 +694,9 @@ extern boolean bfd_coff_get_syment
 extern boolean bfd_coff_get_auxent
   PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
 
+/* Externally visible PEI routines */
+
+extern void pei_get_comdat_info 
+  PARAMS ((struct sec *));
+
 /* And more from the source.  */
--- binutils-2.9.1/bfd/coffcode.h	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/coffcode.h	Sun Aug 23 00:00:00 1998
@@ -577,7 +577,7 @@ styp_to_sec_flags (abfd, hdr, name)
   if (styp_flags & IMAGE_SCN_LNK_REMOVE)
     sec_flags |= SEC_EXCLUDE;
 
-  if (styp_flags & IMAGE_SCN_LNK_COMDAT)
+  if (styp_flags & IMAGE_SCN_LNK_COMDAT & 0 /* fnf hack for mwcc hijacking this bit */)
     {
       sec_flags |= SEC_LINK_ONCE;
 
--- binutils-2.9.1/bfd/coffgen.c	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/coffgen.c	Sun Aug 23 00:00:00 1998
@@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #include "libbfd.h"
 #include "coff/internal.h"
 #include "libcoff.h"
+#include <ctype.h>
 
 static void coff_fix_symbol_name
   PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
@@ -654,6 +655,7 @@ coff_renumber_symbols (bfd_ptr, first_un
     if (!newsyms)
       return false;
     bfd_ptr->outsymbols = newsyms;
+#ifndef HAVE_i386pei_vec
     for (i = 0; i < symbol_count; i++)
       if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0
 	  || (!bfd_is_und_section (symbol_ptr_ptr[i]->section)
@@ -670,6 +672,35 @@ coff_renumber_symbols (bfd_ptr, first_un
 		  == BSF_GLOBAL)))
 	*newsyms++ = symbol_ptr_ptr[i];
 
+#else
+	 /* link.exe depends on the symbols being sorted in
+		their natural order in each section. this is 
+		as close as I could come without using backend data
+		otherwise it finds local labels and thinks they are comdats */
+    for (i = 0; i < symbol_count; i++)
+      if ( (symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0 
+	   || ( !bfd_is_und_section (symbol_ptr_ptr[i]->section) 
+              && !bfd_is_com_section (symbol_ptr_ptr[i]->section)
+              && !isalpha(symbol_ptr_ptr[i]->name[0])
+              && ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION)) != BSF_GLOBAL )
+              )
+         )
+	*newsyms++ = symbol_ptr_ptr[i];
+
+    for (i = 0; i < symbol_count; i++)
+      if ( (symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) == 0 
+           && !bfd_is_und_section (symbol_ptr_ptr[i]->section)
+           && !isalpha(symbol_ptr_ptr[i]->name[0])
+           && (bfd_is_com_section (symbol_ptr_ptr[i]->section) 
+              || ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION)) == BSF_GLOBAL)
+              ) 
+         )
+	*newsyms++ = symbol_ptr_ptr[i];
+	/* for Scope etc.. */
+    for (i = 0;i < symbol_count;i++)
+	if (isalpha(symbol_ptr_ptr[i]->name[0]))
+	  *newsyms++ = symbol_ptr_ptr[i];
+#endif
     *first_undef = newsyms - bfd_ptr->outsymbols;
 
     for (i = 0; i < symbol_count; i++)
--- binutils-2.9.1/bfd/cofflink.c	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/cofflink.c	Sun Aug 23 00:00:00 1998
@@ -34,6 +34,8 @@ static boolean coff_link_check_archive_e
 static boolean coff_link_check_ar_symbols
   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
 static boolean coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));
+static asection *coff_get_first_section_of_archive
+ PARAMS ((struct bfd_link_info *, bfd *, CONST char *));
 static char *dores_com PARAMS ((char *, bfd *, int));
 static char *get_name PARAMS ((char *, char **));
 static int process_embedded_commands
@@ -2654,8 +2656,33 @@ _bfd_coff_generic_relocate_section (outp
 		     + sec->output_offset);
 	      }
 
+      else if (coff_data(input_bfd)->pe
+	       && h->class == C_SECTION
+	       && h->root.type == bfd_link_hash_undefined)
+        {
+           /* Reference to an idata sub-section label, 
+              currently undefined */
+	      asection *sec;
+           if (!strncmp(sym->n_name, "i4", (size_t)2 ))
+                  sprintf(sym->n_name, ".idata$4");
+           else 
+             { 
+               if (!strncmp(sym->n_name, "i5", (size_t)2 ))
+                  sprintf(sym->n_name, ".idata$5"); 
+             }
+           sec = coff_get_first_section_of_archive(info,
+	         h->root.u.undef.abfd,
+	         sym->n_name);
+           if (sec == NULL)
+                 goto undef_sym;
+           val = (sec->output_section->vma
+	   + sec->output_offset
+	   - sec->vma);
+        }
+
 	  else if (! info->relocateable)
 	    {
+undef_sym:
 	      if (! ((*info->callbacks->undefined_symbol)
 		     (info, h->root.root.string, input_bfd, input_section,
 		      rel->r_vaddr - input_section->vma)))
@@ -2732,4 +2759,39 @@ _bfd_coff_generic_relocate_section (outp
     }
   return true;
 }
-
+static asection *
+coff_get_first_section_of_archive(info, abfd, name)
+     struct bfd_link_info *info;
+     bfd *abfd;
+     CONST char *name;
+{
+bfd *sub;
+asection *sect;
+asection *rtn = NULL;
+bfd_vma offset;
+
+/* move abfd to containing archive */
+if (abfd->my_archive == NULL)
+   return NULL;
+
+abfd = abfd->my_archive;
+
+for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) 
+  {
+   /* make sure that the bfd comes from the same archive */
+   if (sub->my_archive == NULL || strcmp(abfd->filename, sub->my_archive->filename) )
+     continue;
+
+   for (sect = sub->sections; sect != NULL; sect = sect->next) 
+     {
+     if (strcmp (sect->name, name))
+       continue;
+     if (rtn == NULL || offset > sect->output_offset)
+       {
+       offset = sect->output_offset;
+       rtn = sect;
+       }
+     }
+  }
+ return rtn;
+}
--- binutils-2.9.1/bfd/config.bfd	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/config.bfd	Sun Aug 23 00:00:00 1998
@@ -236,7 +236,7 @@ case "${targ}" in
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs="i386msdos_vec i386aout_vec"
     ;;
-  i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe)
+  i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe | i[3456]86-*-beos* )
     targ_defvec=i386pe_vec
     targ_selvecs="i386pe_vec i386pei_vec"
     ;;
@@ -284,6 +284,10 @@ case "${targ}" in
   m68*-motorola-sysv*)
     targ_defvec=m68ksysvcoff_vec
     ;;
+  m68*-*-amigaos*)
+    targ_defvec=amiga_vec
+    targ_selvecs="aout_amiga_vec amiga_vec"
+    ;;
   m68*-hp-bsd*)
     targ_defvec=hp300bsd_vec
     targ_underscore=yes
@@ -341,7 +345,7 @@ case "${targ}" in
     targ_selvecs="m68kcoff_vec versados_vec tekhex_vec"
     targ_underscore=yes
     ;;
-  m68*-cbm-*)
+  m68*-cbm-amix)
     targ_defvec=bfd_elf32_m68k_vec
     targ_selvecs=m68kcoff_vec
     ;;
@@ -463,6 +467,14 @@ case "${targ}" in
 
   powerpc-*-aix* | powerpc-*-beos*)
     targ_defvec=rs6000coff_vec
+    ;;
+  powerpc-*-amigaoshunk*)
+    targ_defvec=amiga_vec
+    targ_selvecs="bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec aout_amiga_vec"
+    ;;
+  powerpc-*-amigaos*)
+    targ_defvec=bfd_elf32_powerpc_vec
+    targ_selvecs="bfd_elf32_powerpcle_vec"
     ;;
   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
   powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems*)
--- binutils-2.9.1/bfd/configure	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/configure	Thu Jan 21 19:39:34 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -65,6 +65,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -182,6 +186,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -224,6 +232,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -354,7 +378,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -524,9 +548,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -588,7 +614,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:592: checking host system type" >&5
+echo "configure:618: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -609,7 +635,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:613: checking target system type" >&5
+echo "configure:639: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -627,7 +653,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:631: checking build system type" >&5
+echo "configure:657: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -652,15 +678,16 @@ test "$host_alias" != "$target_alias" &&
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:656: checking for $ac_word" >&5
+echo "configure:682: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -678,19 +705,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:712: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:745: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:774: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:685: checking for $ac_word" >&5
+echo "configure:807: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -725,25 +848,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:859: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:890: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 743 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 901 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -757,18 +916,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:932: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:772: checking whether we are using GNU C" >&5
+echo "configure:937: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -777,7 +942,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -788,11 +953,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:965: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -807,20 +976,47 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:824: checking for POSIXized ISC" >&5
+echo "configure:1020: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -848,21 +1044,22 @@ fi
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:857: checking for a BSD compatible install" >&5
+echo "configure:1054: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -901,13 +1098,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:911: checking whether build environment is sane" >&5
+echo "configure:1110: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -964,7 +1163,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:968: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1167: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1010,7 +1209,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1014: checking for working aclocal" >&5
+echo "configure:1213: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1023,7 +1222,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1027: checking for working autoconf" >&5
+echo "configure:1226: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1036,7 +1235,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1040: checking for working automake" >&5
+echo "configure:1239: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1049,7 +1248,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1053: checking for working autoheader" >&5
+echo "configure:1252: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1062,7 +1261,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1066: checking for working makeinfo" >&5
+echo "configure:1265: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1085,15 +1284,16 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1089: checking for $ac_word" >&5
+echo "configure:1288: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_AR="${ac_tool_prefix}ar"
@@ -1113,18 +1313,68 @@ fi
 
 
 
+ if test -z "$AR"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1321: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+fi
+echo $ac_n "checking what flags $AR needs to create archives""... $ac_c" 1>&6
+echo "configure:1352: checking what flags $AR needs to create archives" >&5
+if eval "test \"`echo '$''{'gg_cv_arflags'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$CC" in
+  mwcc* | bcc*) ARFLAGS=${ARFLAGS-"-xml -o"} ;;
+  *)		ARFLAGS=${ARFLAGS-"cr"} ;;
+esac
+gg_cv_arflags=$ARFLAGS
+
+fi
+ARFLAGS="$gg_cv_arflags"
+echo "$ac_t""$ARFLAGS" 1>&6
+
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1369: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
@@ -1147,15 +1397,16 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1151: checking for $ac_word" >&5
+echo "configure:1401: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1229,15 +1480,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1233: checking for $ac_word" >&5
+echo "configure:1484: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1268,7 +1520,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1272: checking for ld used by GCC" >&5
+echo "configure:1524: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1286,10 +1538,10 @@ echo "configure:1272: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1290: checking for GNU ld" >&5
+echo "configure:1542: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1293: checking for non-GNU ld" >&5
+echo "configure:1545: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1325,7 +1577,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1329: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1581: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1341,7 +1593,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1345: checking for BSD-compatible nm" >&5
+echo "configure:1597: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1378,7 +1630,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1382: checking whether ln -s works" >&5
+echo "configure:1634: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1388,14 +1640,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1414,8 +1676,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1418 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1680 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1515,7 +1777,7 @@ test "$program_transform_name" = "" && p
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1519: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1781: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1533,19 +1795,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1537: checking for Cygwin32 environment" >&5
+echo "configure:1799: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1804 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1562,19 +1824,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1566: checking for Mingw32 environment" >&5
+echo "configure:1828: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1571 "configure"
+#line 1833 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1593,7 +1855,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1597: checking for executable suffix" >&5
+echo "configure:1859: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1625,15 +1887,16 @@ target64=false
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1629: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1651,19 +1914,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1921: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1954: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1983: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1658: checking for $ac_word" >&5
+echo "configure:2016: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1698,25 +2057,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2068: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2099: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2110 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1730,18 +2125,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2141: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1745: checking whether we are using GNU C" >&5
+echo "configure:2146: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1750,7 +2151,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1761,11 +2162,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1769: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2174: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1780,18 +2185,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 # Permit host specific settings.
 . ${srcdir}/configure.host
@@ -1831,7 +2263,7 @@ if test "x$cross_compiling" = "xno"; the
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:1835: checking for build system executable suffix" >&5
+echo "configure:2267: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1853,7 +2285,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1857: checking how to run the C preprocessor" >&5
+echo "configure:2289: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1868,14 +2300,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
+#line 2304 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1885,14 +2317,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 2321 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2338 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1905,6 +2354,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1917,18 +2368,18 @@ for ac_hdr in stddef.h string.h strings.
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1921: checking for $ac_hdr" >&5
+echo "configure:2372: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1926 "configure"
+#line 2377 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1957,18 +2408,18 @@ for ac_hdr in fcntl.h sys/file.h sys/tim
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1961: checking for $ac_hdr" >&5
+echo "configure:2412: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 2417 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1994,12 +2445,12 @@ fi
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1998: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2449: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2003 "configure"
+#line 2454 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2008,7 +2459,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2031,12 +2482,12 @@ fi
 for ac_func in fcntl getpagesize setitimer sysconf fdopen
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2035: checking for $ac_func" >&5
+echo "configure:2486: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2491 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2059,7 +2510,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2094,12 +2545,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2098: checking whether strstr must be declared" >&5
+echo "configure:2549: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2103 "configure"
+#line 2554 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2120,7 +2571,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2142,12 +2593,12 @@ EOF
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:2146: checking whether malloc must be declared" >&5
+echo "configure:2597: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 2602 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2168,7 +2619,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:2172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -2190,12 +2641,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:2194: checking whether realloc must be declared" >&5
+echo "configure:2645: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2199 "configure"
+#line 2650 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2216,7 +2667,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:2220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -2238,12 +2689,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2242: checking whether free must be declared" >&5
+echo "configure:2693: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2247 "configure"
+#line 2698 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2264,7 +2715,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -2286,12 +2737,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2290: checking whether getenv must be declared" >&5
+echo "configure:2741: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2746 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2312,7 +2763,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2587,19 +3038,19 @@ EOF
   # Define HAVE_SYS_PROCFS_H if the file exists and defines
   # prstatus_t.
   echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
-echo "configure:2591: checking for sys/procfs.h" >&5
+echo "configure:3042: checking for sys/procfs.h" >&5
   if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2596 "configure"
+#line 3047 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 prstatus_t t;
 ; return 0; }
 EOF
-if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_header_sys_procfs_h=yes
 else
@@ -2700,6 +3151,7 @@ do
     # with the two vector lists in targets.c.
     a29kcoff_big_vec)		tb="$tb coff-a29k.lo cofflink.lo" ;;
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
+    amiga_vec)			tb="$tb amigaos.lo amigaoslink.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
@@ -2707,6 +3159,7 @@ do
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
+    aout_amiga_vec)		tb="$tb aout-amiga.lo aout32.lo stab-syms.lo";;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
     aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
@@ -2910,18 +3363,18 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2914: checking for $ac_hdr" >&5
+echo "configure:3367: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 3372 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2949,12 +3402,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2953: checking for $ac_func" >&5
+echo "configure:3406: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2958 "configure"
+#line 3411 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2977,7 +3430,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3002,7 +3455,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3006: checking for working mmap" >&5
+echo "configure:3459: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3010,7 +3463,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3014 "configure"
+#line 3467 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3150,7 +3603,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3175,12 +3628,12 @@ fi
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3179: checking for $ac_func" >&5
+echo "configure:3632: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3184 "configure"
+#line 3637 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3203,7 +3656,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3258,7 +3711,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -3304,7 +3757,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -3325,7 +3780,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -3349,6 +3804,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -3366,6 +3822,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -3383,9 +3843,11 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -3394,8 +3856,7 @@ s%@AUTOMAKE@%$AUTOMAKE%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
+s%@ARFLAGS@%$ARFLAGS%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -3560,6 +4021,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -3605,6 +4067,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -3636,6 +4099,7 @@ test -z "$CONFIG_HEADERS" || echo timest
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/bfd/configure.host	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/configure.host	Sun Aug 23 00:00:00 1998
@@ -44,6 +44,7 @@ mips*-*-sysv*)		HDEFINES="-G 4" ;;
 mips*-*-riscos*)	HDEFINES="-G 4" ;;
 
 m68*-hp-hpux*)		HDEFINES=-DHOST_HP300HPUX ;;
+m68*-*-amigaos*)	HDEFINES=-mstackextend ;;
 
 *-*-solaris*)		HOST_64BIT_TYPE="long long"
 			HOST_U_64BIT_TYPE="unsigned long long"
--- binutils-2.9.1/bfd/configure.in	Fri May  1 08:48:05 1998
+++ binutils-2.9.1/bfd/configure.in	Sun Aug 23 00:00:00 1998
@@ -12,6 +12,7 @@ AM_INIT_AUTOMAKE(bfd, 2.9.1)
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
+AC_ARFLAGS
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
 dnl Default to a non shared library.  This may be overridden by the
@@ -385,6 +386,7 @@ do
     # with the two vector lists in targets.c.
     a29kcoff_big_vec)		tb="$tb coff-a29k.lo cofflink.lo" ;;
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
+    amiga_vec)			tb="$tb amigaos.lo amigaoslink.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
@@ -392,6 +394,7 @@ do
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
+    aout_amiga_vec)		tb="$tb aout-amiga.lo aout32.lo stab-syms.lo";;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
     aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
--- binutils-2.9.1/bfd/doc/bfd.texinfo	Fri May  1 08:48:02 1998
+++ binutils-2.9.1/bfd/doc/bfd.texinfo	Sun Aug 23 00:00:00 1998
@@ -302,9 +302,10 @@ structures.
 @chapter BFD back ends
 @menu
 * What to Put Where::
-* aout ::	a.out backends
-* coff ::	coff backends
-* elf  ::	elf backends
+* aout  ::	a.out backends
+* coff  ::	coff backends
+* elf   ::	elf backends
+* amiga ::      amigaos backend
 @ignore
 * oasys ::	oasys backends
 * ieee ::	ieee backend
@@ -320,10 +321,14 @@ All of BFD lives in one directory.
 @node coff, elf, aout, BFD back ends
 @include  coffcode.texi
 
-@node elf,  , coff, BFD back ends
+@node elf, amiga  , coff, BFD back ends
 @include  elf.texi
 @c Leave this out until the file has some actual contents...
 @c @include  elfcode.texi
+
+@node amiga,  , elf, BFD back ends
+@include amiga.texi
+@include amigalink.texi
 
 @node Index,  , BFD back ends , Top
 @unnumbered Index
--- binutils-2.9.1/bfd/doc/Makefile.am	Fri May  1 08:48:02 1998
+++ binutils-2.9.1/bfd/doc/Makefile.am	Sun Aug 23 00:00:00 1998
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = cygnus
 
-DOCFILES = aoutx.texi  archive.texi archures.texi \
+DOCFILES = amiga.texi amigalink.texi aoutx.texi  archive.texi archures.texi \
 	bfdt.texi  cache.texi coffcode.texi \
 	core.texi elf.texi elfcode.texi  format.texi  libbfd.texi  \
 	opncls.texi  reloc.texi  section.texi  \
@@ -24,6 +24,7 @@ SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)
 	$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
 	$(srcdir)/../corefile.c $(srcdir)/../elf.c \
 	$(srcdir)/../elfcode.h  $(srcdir)/../format.c \
+	$(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
 	$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
 	$(srcdir)/../reloc.c  $(srcdir)/../section.c \
 	$(srcdir)/../syms.c  $(srcdir)/../targets.c \
@@ -48,14 +49,14 @@ info_TEXINFOS = bfd.texinfo
 MKDOC = chew$(EXEEXT_FOR_BUILD)
 
 $(MKDOC): chew.o
-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
+	$(CC_FOR_BUILD) $(H_CFLAGS) $(CFLAGS) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
 
 chew.o: chew.c
 	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi bfd.guide: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
@@ -182,6 +183,18 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c
 	$(srcdir)/../../move-if-change linker.tmp linker.texi
 	touch s-linker
 linker.texi: s-linker
+
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
+	$(srcdir)/../../move-if-change amiga.tmp amiga.texi
+	touch s-amiga
+amiga.texi: s-amiga
+
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
+	$(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
+	touch s-amigalink
+amigalink.texi: s-amigalink
 
 libbfd.h: $(srcdir)/../libbfd-in.h	\
 	$(srcdir)/../init.c		\
--- binutils-2.9.1/bfd/doc/Makefile.in	Fri May  1 08:48:02 1998
+++ binutils-2.9.1/bfd/doc/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -91,7 +97,7 @@ wordsize = @wordsize@
 
 AUTOMAKE_OPTIONS = cygnus
 
-DOCFILES = aoutx.texi  archive.texi archures.texi \
+DOCFILES = amiga.texi amigalink.texi aoutx.texi  archive.texi archures.texi \
 	bfdt.texi  cache.texi coffcode.texi \
 	core.texi elf.texi elfcode.texi  format.texi  libbfd.texi  \
 	opncls.texi  reloc.texi  section.texi  \
@@ -113,6 +119,7 @@ SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)
 	$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
 	$(srcdir)/../corefile.c $(srcdir)/../elf.c \
 	$(srcdir)/../elfcode.h  $(srcdir)/../format.c \
+	$(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
 	$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
 	$(srcdir)/../reloc.c  $(srcdir)/../section.c \
 	$(srcdir)/../syms.c  $(srcdir)/../targets.c \
@@ -151,26 +158,35 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/t
 INFO_DEPS = bfd.info
 DVIS = bfd.dvi
 TEXINFOS = bfd.texinfo
+GUIDES = bfd.guide
+GUIDE_DEPS = bfd.guide
+HTMLS = bfd.html
+HTML_DEPS = bfd.html
+PS_S = bfd.ps
+PS_DEPS = bfd.ps
 DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
-default: all
+all: Makefile
 
 .SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+.SUFFIXES: .dvi .guide .html .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps doc/Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 
 bfd.info: bfd.texinfo
+bfd.guide: bfd.texinfo
+bfd.html: bfd.texinfo
+bfd.ps: bfd.dvi
 bfd.dvi: bfd.texinfo
 
 
@@ -178,7 +194,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -186,39 +202,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -229,11 +257,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -246,10 +274,140 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
 	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
-	  bfd.op bfd.tr bfd.cv bfd.cn
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
 
 clean-aminfo:
 
@@ -280,6 +438,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -296,8 +457,6 @@ install: install-exec install-data all
 
 uninstall: 
 
-all: Makefile
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
@@ -317,36 +476,45 @@ distclean-generic:
 maintainer-clean-generic:
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-aminfo mostlyclean-generic
+mostlyclean:  mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-generic
 
-clean:  clean-aminfo clean-generic mostlyclean
+clean:  clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-generic mostlyclean
 
-distclean:  distclean-aminfo distclean-generic clean
+distclean:  distclean-aminfo distclean-guide distclean-html \
+		distclean-dvi distclean-ps distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
-maintainer-clean:  maintainer-clean-aminfo maintainer-clean-generic \
-		distclean
+maintainer-clean:  maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
-dvi installcheck install-info install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+.PHONY: install-info-am uninstall-info install-guide uninstall-guide \
+install-ps uninstall-ps install-html uninstall-html install-dvi \
+uninstall-dvi mostlyclean-guide distclean-guide clean-guide \
+maintainer-clean-guide mostlyclean-html distclean-html clean-html \
+maintainer-clean-html mostlyclean-ps distclean-ps clean-ps \
+maintainer-clean-ps mostlyclean-dvi distclean-dvi clean-dvi \
+maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo tags distdir info guide html ps dvi \
+installcheck install-info install-exec install-data install uninstall \
+all installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 $(MKDOC): chew.o
-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
+	$(CC_FOR_BUILD) $(H_CFLAGS) $(CFLAGS) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
 
 chew.o: chew.c
 	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi bfd.guide: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
@@ -473,6 +641,18 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c
 	$(srcdir)/../../move-if-change linker.tmp linker.texi
 	touch s-linker
 linker.texi: s-linker
+
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
+	$(srcdir)/../../move-if-change amiga.tmp amiga.texi
+	touch s-amiga
+amiga.texi: s-amiga
+
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
+	$(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
+	touch s-amigalink
+amigalink.texi: s-amigalink
 
 libbfd.h: $(srcdir)/../libbfd-in.h	\
 	$(srcdir)/../init.c		\
--- binutils-2.9.1/bfd/elf32-ppc.c	Fri May  1 08:48:09 1998
+++ binutils-2.9.1/bfd/elf32-ppc.c	Sun Aug 23 00:00:00 1998
@@ -3358,7 +3358,11 @@ ppc_elf_relocate_section (output_bfd, in
 #define TARGET_BIG_NAME		"elf32-powerpc"
 #define ELF_ARCH		bfd_arch_powerpc
 #define ELF_MACHINE_CODE	EM_PPC
+#if 0	/* HACK - fnf */
 #define ELF_MAXPAGESIZE		0x10000
+#else
+#define ELF_MAXPAGESIZE		0x1000
+#endif
 #define elf_info_to_howto	ppc_elf_info_to_howto
 
 #ifdef  EM_CYGNUS_POWERPC
--- binutils-2.9.1/bfd/hash.c	Fri May  1 08:48:10 1998
+++ binutils-2.9.1/bfd/hash.c	Sun Aug 23 00:00:00 1998
@@ -73,7 +73,7 @@ SUBSECTION
 	The function <<bfd_hash_table_init>> take as an argument a
 	function to use to create new entries.  For a basic hash
 	table, use the function <<bfd_hash_newfunc>>.  @xref{Deriving
-	a New Hash Table Type} for why you would want to use a
+	a New Hash Table Type}, for why you would want to use a
 	different value for this argument.
 
 @findex bfd_hash_allocate
--- binutils-2.9.1/bfd/hosts/amigaos.h	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/bfd/hosts/amigaos.h	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,5 @@
+/* Host configuration for AmigaOS */
+#ifndef hosts_amigaos_h
+#define hosts_amigaos_h
+#include "hosts/std-host.h"
+#endif /* hosts_amigaos_h */
--- binutils-2.9.1/bfd/libamiga.h	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/bfd/libamiga.h	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,224 @@
+/* BFD back-end data structures for AmigaOS.
+   Copyright (C) 1992-1994 Free Software Foundation, Inc.
+   Contributed by Leonard Norrgard.
+   Extended by Stephan Thesing Nov 94
+
+This file is part of BFD, the Binary File Descriptor library.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#ifdef __STDC__
+#define CAT3(a,b,c) a##b##c
+#else
+#define CAT3(a,b,c) a/**/b/**/c
+#endif
+
+#define GET_WORD bfd_h_get_32
+#define GET_SWORD (int32_type)GET_WORD
+#define PUT_WORD bfd_h_put_32
+#define NAME(x,y) CAT3(x,_32_,y)
+#define JNAME(x) CAT(x,_32)
+#define BYTES_IN_WORD 4
+
+/* Hunk ID numbers.*/  
+#define HUNK_UNIT		999
+#define HUNK_NAME		1000
+#define HUNK_CODE		1001
+#define HUNK_DATA		1002
+#define HUNK_BSS		1003
+#define HUNK_RELOC32		1004
+#define HUNK_ABSRELOC32		HUNK_RELOC32
+#define HUNK_RELOC16		1005
+#define HUNK_RELRELOC16		HUNK_RELOC16
+#define HUNK_RELOC8		1006
+#define HUNK_RELRELOC8		HUNK_RELOC8
+#define HUNK_EXT		1007
+#define HUNK_SYMBOL		1008
+#define HUNK_DEBUG		1009
+#define HUNK_END		1010
+#define HUNK_HEADER		1011
+#define HUNK_HEADER_POS		(0x00001000 | 1011)
+#define HUNK_OVERLAY		1013
+#define HUNK_BREAK		1014
+#define HUNK_DREL32		1015
+#define HUNK_DREL16		1016
+#define HUNK_DREL8		1017
+#define HUNK_LIB		1018
+#define HUNK_INDEX		1019
+#define HUNK_RELOC32SHORT	1020
+#define HUNK_RELRELOC32		1021
+#define HUNK_ABSRELOC16		1022
+
+/* The hunk ID part.  */
+
+#define HUNK_VALUE(hunk_id)	((hunk_id) & 0x3fffffff)
+
+/* Attributes of a hunk.  */
+
+#define HUNK_ATTRIBUTE(hunk_id)	((hunk_id) >> 30)
+#define HUNK_ATTR_CHIP 		0x01	/* Hunk contents must go into chip ram.  */
+#define HUNK_ATTR_FAST		0x02	/* fast */
+#define HUNK_ATTR_FOLLOWS	0x03	/* Mem id follows */
+
+#define EXT_SYMB		0
+#define EXT_DEF			1
+#define EXT_ABS			2
+#define EXT_RES			3
+#define EXT_REF32		129
+#define EXT_ABSREF32		EXT_REF32
+#define EXT_COMMON		130
+#define EXT_ABSCOMMON		EXT_COMMON
+#define EXT_REF16		131
+#define EXT_RELREF16		EXT_REF16
+#define EXT_REF8		132
+#define EXT_RELREF8		EXT_REF8
+#define EXT_DEXT32		133
+#define EXT_DREF32		EXT_DEXT32
+#define EXT_DEXT16		134
+#define EXT_DREF16		EXT_DEXT16
+#define EXT_DEXT8		135
+#define EXT_DREF8		EXT_DEXT8
+#define EXT_RELREF32		136
+#define EXT_RELCOMMON		137
+#define EXT_ABSREF16		138
+#define EXT_ABSREF8		139
+
+
+typedef struct amiga_reloc {
+  arelent relent;
+  struct amiga_reloc *next;
+  struct amiga_symbol *symbol;
+  long target_hunk;
+} amiga_reloc_type;
+
+typedef struct amiga_symbol {
+  asymbol symbol;
+/*  struct amiga_symbol *next;*/
+  unsigned short hunk_number;
+  long index;
+  /* these come from a.out. Not used yet, but needed to compile */
+  short desc;
+  char other;
+  unsigned char type;
+} amiga_symbol_type;
+
+struct amiga_raw_symbol {
+  struct amiga_raw_symbol *next;
+  unsigned long data[1];
+};
+
+typedef struct amiga_per_section
+{
+  amiga_reloc_type *reloc_tail; /* last reloc */ /* first is in section->relocation */
+  int attribute; /* Memory type required by this section */
+  unsigned long disk_size;	/* Section size on disk. _raw_size may be larger than this */
+  int max_raw_relocs; /* Size of array */
+  unsigned long int num_raw_relocs8, num_raw_relocs16, num_raw_relocs32;
+  unsigned long  raw_relocs8, raw_relocs16, raw_relocs32;
+  struct amiga_raw_symbol *first;
+  struct amiga_raw_symbol *last; /* tail */
+
+  /* the symbols for this section */
+  amiga_symbol_type *amiga_symbols;
+
+  unsigned long hunk_ext_pos;	/* offset of hunk_ext in the bfd file */
+  unsigned long hunk_symbol_pos; /* offset of hunk_symbol in the bfd file */
+} amiga_per_section_type;
+#define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
+
+/* The `tdata' struct for all a.out-like object file formats.
+   Various things depend on this struct being around any time an a.out
+   file is being handled.  An example is dbxread.c in GDB.  */
+
+struct amiga_data {
+  struct internal_exec *hdr;		/* exec file header */
+  amiga_symbol_type *symbols;		/* symtab for input bfd */
+
+  /* Filler, so we can pretend to be an a.out to GDB.  */
+  asection *textsec;
+  asection *datasec;
+  asection *bsssec;
+  int nb_hunks;			/* number of hunks in the file */
+  /* The positions of the string table and symbol table.  */
+  file_ptr sym_filepos;
+  file_ptr str_filepos;
+
+  unsigned int n_symbols;               /* number of symbols */
+
+  /* Size of a relocation entry in external form */
+  unsigned dummy_reloc_entry_size;
+
+  /* Size of a symbol table entry in external form */
+  unsigned symbol_entry_size;
+
+  unsigned exec_bytes_size;
+  unsigned vma_adjusted : 1;
+};
+
+typedef struct  amiga_data_struct {
+  struct amiga_data a;
+
+  unsigned long symtab_size;
+  unsigned long stringtab_size;
+
+  unsigned long *first_byte;
+  unsigned long *file_end;
+  unsigned long *file_pointer;
+  amiga_symbol_type *symbols;
+  amiga_symbol_type *symbol_tail;
+  boolean IsLoadFile; /* If true, this is a load file (for output bfd only) */
+  int maxsymbols;     /* Used by final_link routine to add symbols to output bfd.
+                         This is the # of entries, allocated in abdfd->osymbols */
+  int nb_hunks;
+  /* The next two fields are set at final_link time
+     for the output bfd only */
+  boolean baserel;    /* true if there is ___init_a4 in the global hash table */
+  bfd_vma a4init;     /* cache the value for efficiency */
+} amiga_data_type;
+
+struct arch_syms {
+  unsigned long offset;		/* disk offset in the archive */
+  unsigned long size;		/* size of the block of symbols */
+  unsigned long unit_offset;	/* start of unit on disk */
+  struct arch_syms *next;	/* linked list */
+};
+
+#define	adata(bfd)		((bfd)->tdata.amiga_data->a)
+
+/* We take the address of the first element of an asymbol to ensure that the
+   macro is only ever applied to an asymbol */
+#define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
+
+#define AMIGA_DATA(abfd) ((abfd)->tdata.amiga_data)
+
+#define HUNKB_ADVISORY		29
+#define HUNKB_CHIP		30
+#define HUNKB_FAST		31
+#define HUNKF_ADVISORY		(1L << HUNKB_ADVISORY)
+#define HUNKF_CHIP		(1L << HUNKB_CHIP)
+#define HUNKF_FAST		(1L << HUNKB_FAST)
+
+#define MEMF_ANY		(0L)
+#define MEMF_PUBLIC		(1L << 0)
+#define MEMF_CHIP		(1L << 1)
+#define MEMF_FAST		(1L << 2)
+#define MEMF_LOCAL		(1L << 8)
+#define MEMF_24BITDMA		(1L << 9)
+#define	MEMF_KICK		(1L << 10)
+#define MEMF_CLEAR		(1L << 16)
+#define MEMF_LARGEST		(1L << 17)
+#define MEMF_REVERSE		(1L << 18)
+#define MEMF_TOTAL		(1L << 19)
+#define	MEMF_NO_EXPUNGE		(1L << 31)
--- binutils-2.9.1/bfd/linker.c	Fri May  1 08:48:12 1998
+++ binutils-2.9.1/bfd/linker.c	Sun Aug 23 00:00:00 1998
@@ -74,7 +74,7 @@ SUBSECTION
 @cindex target vector (_bfd_link_hash_table_create)
 	The linker routines must create a hash table, which must be
 	derived from <<struct bfd_link_hash_table>> described in
-	<<bfdlink.c>>.  @xref{Hash Tables} for information on how to
+	<<bfdlink.c>>.  @xref{Hash Tables}, for information on how to
 	create a derived hash table.  This entry point is called using
 	the target vector of the linker output file.
 
@@ -428,7 +428,8 @@ static boolean generic_add_output_symbol
 static boolean default_fill_link_order
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
 	   struct bfd_link_order *));
-static boolean default_indirect_link_order
+/*Amiga hack - used in amigaoslink.c so must be global */
+/*static*/ boolean default_indirect_link_order
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
 	   struct bfd_link_order *, boolean));
 
@@ -1196,8 +1197,17 @@ generic_link_check_archive_element (abfd
 	  h->u.c.size = size;
 
 	  power = bfd_log2 (size);
-	  if (power > 4)
-	    power = 4;
+	  /* For the amiga, we don't want an alignment bigger than
+	     2**2. Doing this here is a horribly kludgy, but IMHO the
+	     max power alignment really should be target-dependant so
+	     that we wouldn't have to do this -- daniel */
+	  if (bfd_get_flavour(abfd) == bfd_target_amiga_flavour) {
+	    if (power > 2)
+	      power = 2;
+	  }
+	  else
+	    if (power > 4)
+	      power = 4;
 	  h->u.c.p->alignment_power = power;
 
 	  if (p->section == bfd_com_section_ptr)
@@ -1658,8 +1668,18 @@ _bfd_generic_link_add_one_symbol (info, 
 	    unsigned int power;
 
 	    power = bfd_log2 (value);
-	    if (power > 4)
-	      power = 4;
+	    /* For the amiga, we don't want an alignment bigger than
+               2**2. Doing this here is a horribly kludgy, but IMHO
+               the max power alignment really should be
+               target-dependant so that we wouldn't have to do this --
+               daniel */
+	    if (bfd_get_flavour(abfd) == bfd_target_amiga_flavour) {
+	      if (power > 2)
+		power = 2;
+	    }
+	    else
+	      if (power > 4)
+		power = 4;
 	    h->u.c.p->alignment_power = power;
 	  }
 
@@ -2626,7 +2646,7 @@ default_fill_link_order (abfd, info, sec
 
 /* Default routine to handle a bfd_indirect_link_order.  */
 
-static boolean
+/*static*/ boolean
 default_indirect_link_order (output_bfd, info, output_section, link_order,
 			     generic_linker)
      bfd *output_bfd;
--- binutils-2.9.1/bfd/Makefile.am	Fri May  1 08:47:58 1998
+++ binutils-2.9.1/bfd/Makefile.am	Sun Aug 23 00:00:00 1998
@@ -98,7 +98,10 @@ ALL_MACHINES_CFILES = \
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
 BFD32_BACKENDS = \
+	amigaos.lo \
+	amigaoslink.lo \
 	aout-adobe.lo \
+	aout-amiga.lo \
 	aout-arm.lo \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
@@ -203,7 +206,10 @@ BFD32_BACKENDS = \
 	xcofflink.lo
 
 BFD32_BACKENDS_CFILES = \
+	amigaos.c \
+	amigaoslink.c \
 	aout-adobe.c \
+	aout-amiga.c \
 	aout-arm.c \
 	aout-ns32k.c \
 	aout-sparcle.c \
@@ -382,7 +388,7 @@ CFILES = \
 HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
 	ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
-	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libamiga.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
 	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
 	targmatch.h
@@ -637,6 +643,9 @@ cpu-vax.lo: cpu-vax.c
 cpu-we32k.lo: cpu-we32k.c
 cpu-w65.lo: cpu-w65.c
 cpu-z8k.lo: cpu-z8k.c
+amigaos.lo: amigaos.c libamiga.h bfd.h
+amigaoslink.lo: bfd.h libamiga.h amigaoslink.c
+aout-amiga.lo: aout-amiga.c aoutf1.h bfd.h
 aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
   $(INCDIR)/bfdlink.h
--- binutils-2.9.1/bfd/Makefile.in	Fri May  1 08:47:59 1998
+++ binutils-2.9.1/bfd/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -187,7 +193,10 @@ ALL_MACHINES_CFILES = \
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
 BFD32_BACKENDS = \
+	amigaos.lo \
+	amigaoslink.lo \
 	aout-adobe.lo \
+	aout-amiga.lo \
 	aout-arm.lo \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
@@ -292,7 +301,10 @@ BFD32_BACKENDS = \
 	xcofflink.lo
 
 BFD32_BACKENDS_CFILES = \
+	amigaos.c \
+	amigaoslink.c \
 	aout-adobe.c \
+	aout-amiga.c \
 	aout-arm.c \
 	aout-ns32k.c \
 	aout-sparcle.c \
@@ -471,7 +483,7 @@ CFILES = \
 HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
 	ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
-	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libamiga.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
 	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
 	targmatch.h
@@ -521,6 +533,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 libbfd_a_LIBADD = 
 libbfd_a_OBJECTS = 
+ARFLAGS = @ARFLAGS@
 LTLIBRARIES =  $(lib_LTLIBRARIES)
 
 libbfd_la_OBJECTS =  archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
@@ -536,21 +549,21 @@ acconfig.h acinclude.m4 aclocal.m4 bfd-i
 configure.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
 OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
 
-default: all
+all: all-recursive-am all-am
 
 .SUFFIXES:
 .SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -643,18 +656,18 @@ maintainer-clean-libLTLIBRARIES:
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
 
 uninstall-libLTLIBRARIES:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  $(LIBTOOL)  --mode=uninstall rm -f $(libdir)/$$p; \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
 	done
 
 libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
@@ -671,7 +684,8 @@ libbfd.la: $(libbfd_la_OBJECTS) $(libbfd
 
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+check-recursive installcheck-recursive info-recursive dvi-recursive \
+guide-recursive ps-recursive html-recursive:
 	@set fnord $(MAKEFLAGS); amf=$$2; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  target=`echo $@ | sed s/-recursive//`; \
@@ -776,6 +790,9 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	done
 info: info-recursive
+guide: guide-recursive
+html: html-recursive
+ps: ps-recursive
 dvi: dvi-recursive
 check:
 	$(MAKE) check-recursive
@@ -803,12 +820,10 @@ install: install-recursive install-exec-
 
 uninstall: uninstall-recursive uninstall-am
 
-all: all-recursive-am all-am
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs: installdirs-recursive
-	$(mkinstalldirs)  $(libdir)
+	$(mkinstalldirs)  $(DATADIR)$(libdir)
 
 
 mostlyclean-generic:
@@ -857,26 +872,26 @@ maintainer-clean:  maintainer-clean-recu
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
-distclean-noinstLIBRARIES clean-noinstLIBRARIES \
-maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck install-info all-recursive-am all-am install-exec-am \
-install-data-am uninstall-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-libLTLIBRARIES \
+distclean-libLTLIBRARIES clean-libLTLIBRARIES \
+maintainer-clean-libLTLIBRARIES uninstall-libLTLIBRARIES \
+install-libLTLIBRARIES install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive guide-recursive html-recursive \
+ps-recursive dvi-recursive mostlyclean-recursive distclean-recursive \
+clean-recursive maintainer-clean-recursive tags tags-recursive \
+mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
+distdir info guide html ps dvi installcheck install-info \
+all-recursive-am all-am install-exec-am install-data-am uninstall-am \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 diststuff: info
@@ -922,6 +937,9 @@ targets.lo: targets.c config.status
 archures.lo: archures.c config.status
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
 
+coffgen.lo: coffgen.c config.status
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/coffgen.c
+
 elf32-target.h : elfxx-target.h
 	rm -f elf32-target.h
 	sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
@@ -1094,6 +1112,9 @@ cpu-vax.lo: cpu-vax.c
 cpu-we32k.lo: cpu-we32k.c
 cpu-w65.lo: cpu-w65.c
 cpu-z8k.lo: cpu-z8k.c
+amigaos.lo: amigaos.c libamiga.h bfd.h
+amigaoslink.lo: bfd.h libamiga.h amigaoslink.c
+aout-amiga.lo: aout-amiga.c aoutf1.h bfd.h
 aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
   $(INCDIR)/bfdlink.h
--- binutils-2.9.1/bfd/peicode.h	Fri May  1 08:48:14 1998
+++ binutils-2.9.1/bfd/peicode.h	Sun Aug 23 00:00:00 1998
@@ -494,11 +494,17 @@ coff_swap_sym_in (abfd, ext1, in1)
      documentation indicates is a section symbol.  The problem is that the
      value field in the symbol is simply a copy of the .idata section's flags
      rather than something useful.  When these symbols are encountered, change
-     the value to 0 and the section number to 1 so that they will be handled
-     somewhat correctly in the bfd code. */
-  if (in->n_sclass == 0x68) {
+     the value to 0 so that they will be handled somewhat correctly in the 
+     bfd code. */
+  if (in->n_sclass == C_SECTION) {
     in->n_value = 0x0;
-    in->n_scnum = 1;
+    if(strcmp (in->_n._n_name, ".idata$2") == 0)
+      in->n_sclass = 1; /* not used for anything that I know of. */
+/* can't hash more than 1 sub-section symbol with the same name. */
+    if(strcmp (in->_n._n_name, ".idata$4") == 0)
+      sprintf(in->_n._n_name, "i4%x",((int)abfd & ~0xff000000));
+    if(strcmp (in->_n._n_name, ".idata$5") == 0)
+      sprintf(in->_n._n_name, "i5%x",((int)abfd & ~0xff000000));
     /* I have tried setting the class to 3 and using the following to set
        the section number.  This will put the address of the pointer to the
        string kernel32.dll at addresses 0 and 0x10 off start of idata section
@@ -1394,14 +1400,14 @@ pe_print_idata(abfd, vfile)
 	  fprintf (file, "\tvma:  Hint/Ord Member-Name\n");
 
 	  idx = hint_addr + adj;
-
+#define IMPORTED_BY_ORDINAL 0x80000000 /* FIXME should be in a REAL header */
 	  for (j = 0; j < stop; j += 4)
 	    {
 	      unsigned long member = bfd_get_32 (abfd, data + idx + j);
 
 	      if (member == 0)
 		break;
-	      if (member & 0x80000000)
+	      if (member & IMPORTED_BY_ORDINAL)
 		fprintf (file, "\t%04lx\t %4lu", member,
 			 member & 0x7fffffff);
 	      else
@@ -1464,10 +1470,19 @@ pe_print_idata(abfd, vfile)
 		    }
 		  else 
 		    {
+		      if (!(iat_member & IMPORTED_BY_ORDINAL))
+                        {
 		      ordinal = bfd_get_16(abfd,
 					   data + iat_member + adj);
 		      member_name = (char *) data + iat_member + adj + 2;
-		      fprintf(file, "\t%04lx\t %4d  %s\n",
+                        }
+                      else
+			{              
+			  ordinal = (iat_member & 0x0000ffff);
+			  iat_member = first_thunk + j;
+              		  member_name = (char *)"Imported By Ordinal";
+			}
+		      fprintf(file, "\t%04lx\t %4x  %s\n",
 			      iat_member, ordinal, member_name);
 		    }
 		}
--- binutils-2.9.1/bfd/pei-i386.c	Fri May  1 08:48:14 1998
+++ binutils-2.9.1/bfd/pei-i386.c	Sun Aug 23 00:00:00 1998
@@ -30,6 +30,56 @@ Foundation, Inc., 59 Temple Place - Suit
 #define COFF_LONG_SECTION_NAMES
 
 #include "coff-i386.c"
+#include <ctype.h>
 
+/* Routine to get the comdat symbol or associated section
+     for a section, used by the linker to determine if sections are
+     duplicates. needs the asection passed to it */
 
+void pei_get_comdat_info PARAMS ((asection *));
 
+void pei_get_comdat_info(sec)
+asection *sec;
+{
+const char *nosym = "none";
+bfd_size_type symesz;
+bfd_byte *esym;
+bfd_byte *esym_end;
+
+comdat_info *comdat;
+
+comdat = (comdat_info *) bfd_alloc (sec->owner, sizeof(comdat_info));
+
+memcpy (comdat->name_buf, nosym, 5);
+comdat->asoc_sec = (int)NULL;
+symesz = bfd_coff_symesz (sec->owner);
+esym = (bfd_byte *) obj_coff_external_syms (sec->owner);
+esym_end = esym + obj_raw_syment_count (sec->owner) * symesz;
+
+
+/* walk the native table looking for the section symbol */
+  while (esym < esym_end)
+    {
+      struct internal_syment sym;
+      bfd_coff_swap_sym_in (sec->owner, (PTR) esym, (PTR) &sym);
+	/* FIXME add ISSYM() ISWEAK()? to function symbols ISFCN( sym.n_type )) would make things MUCH easier*/
+	/* every comdat has either another comdat that it is addociated with
+	   or a comdat symbol of it's own. if a symbol it isn't associated */
+      if ((sym.n_scnum == sec->index + 1) && !isalpha(sym.n_name[0]) && !sym.n_numaux )
+         {
+	  comdat->comdat_sym = _bfd_coff_internal_syment_name(sec->owner, &sym, comdat->name_buf);
+		break;
+	 }
+      if (!isalpha(sym.n_name[0]) && (sym.n_scnum == sec->index + 1) && sym.n_numaux)
+         {
+          union internal_auxent aux;
+          bfd_coff_swap_aux_in(sec->owner, (PTR) (esym + symesz)
+		,sym.n_type, sym.n_sclass, 0, sym.n_numaux, (PTR) &aux);
+          comdat->asoc_sec = aux.x_scn.x_associated;
+	  if (comdat->asoc_sec)
+            break;
+         }
+      esym += (sym.n_numaux + 1) * symesz;
+    }
+sec->pe_comdat_info = comdat;
+}
--- binutils-2.9.1/bfd/section.c	Fri May  1 08:48:15 1998
+++ binutils-2.9.1/bfd/section.c	Sun Aug 23 00:00:00 1998
@@ -150,6 +150,13 @@ SUBSECTION
 
 CODE_FRAGMENT
 .
+.typedef struct _comdat_info
+.{
+.  int asoc_sec;
+.  char name_buf[9];
+.  const char * comdat_sym;
+.} comdat_info;
+.
 .typedef struct sec
 .{
 .        {* The name of the section; the name isn't a copy, the pointer is
@@ -431,6 +438,8 @@ CODE_FRAGMENT
 .   struct symbol_cache_entry *symbol;
 .   struct symbol_cache_entry **symbol_ptr_ptr;
 .
+.   comdat_info *pe_comdat_info;
+.
 .   struct bfd_link_order *link_order_head;
 .   struct bfd_link_order *link_order_tail;
 .} asection ;
@@ -487,7 +496,7 @@ static const asymbol global_syms[] =
   const asection SEC = \
     { NAME, 0, 0, FLAGS, 0, 0, 0, 0, 0, 0, 0, 0, (asection *) &SEC, \
       0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, \
-      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0 }
+      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0, 0 }
 
 STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol,
 	     BFD_COM_SECTION_NAME, 0);
--- binutils-2.9.1/bfd/syms.c	Fri May  1 08:48:15 1998
+++ binutils-2.9.1/bfd/syms.c	Sun Aug 23 00:00:00 1998
@@ -1062,7 +1062,7 @@ _bfd_stab_section_find_nearest_line (abf
     {
       stab = info->cached_stab;
       indexentry = info->cached_indexentry;
-      file_name = info->cached_file_name;
+      file_name = (char *) info->cached_file_name;
     }
   else
 #endif
@@ -1097,10 +1097,10 @@ _bfd_stab_section_find_nearest_line (abf
 	return true;
 
       stab = indexentry->stab + STABSIZE;
-      file_name = indexentry->file_name;
+      file_name = (char *) indexentry->file_name;
     }
 
-  directory_name = indexentry->directory_name;
+  directory_name = (char *) indexentry->directory_name;
   str = indexentry->str;
 
   for (; stab < (indexentry+1)->stab; stab += STABSIZE)
@@ -1188,11 +1188,11 @@ _bfd_stab_section_find_nearest_line (abf
          to clobber the colon.  It's OK to change the name, since the
          string is in our own local storage anyhow.  */
 
-      s = strchr (indexentry->function_name, ':');
+      s = strchr ((const char *) indexentry->function_name, ':');
       if (s != NULL)
 	*s = '\0';
 
-      *pfnname = indexentry->function_name;
+      *pfnname = (const char *) indexentry->function_name;
     }
 
   return true;
--- binutils-2.9.1/bfd/targets.c	Fri May  1 08:48:16 1998
+++ binutils-2.9.1/bfd/targets.c	Sun Aug 23 00:00:00 1998
@@ -138,6 +138,7 @@ DESCRIPTION
 
 .enum bfd_flavour {
 .  bfd_target_unknown_flavour,
+.  bfd_target_amiga_flavour,
 .  bfd_target_aout_flavour,
 .  bfd_target_coff_flavour,
 .  bfd_target_ecoff_flavour,
@@ -469,6 +470,8 @@ in this structure.
    we can't intermix extern's and initializers.  */
 extern const bfd_target a29kcoff_big_vec;
 extern const bfd_target a_out_adobe_vec;
+extern const bfd_target amiga_vec;
+extern const bfd_target aout_amiga_vec;
 extern const bfd_target aout_arm_big_vec;
 extern const bfd_target aout_arm_little_vec;
 extern const bfd_target aout_mips_big_vec;
@@ -630,6 +633,8 @@ const bfd_target * const bfd_target_vect
 	   it wasn't omitted by mistake.  */
 	&a29kcoff_big_vec,
 	&a_out_adobe_vec,
+	&amiga_vec,
+	&aout_amiga_vec,
 #if 0				/* No one seems to use this.  */
 	&aout_mips_big_vec,
 #endif
--- binutils-2.9.1/bfd/xcofflink.c	Fri May  1 08:48:17 1998
+++ binutils-2.9.1/bfd/xcofflink.c	Sun Aug 23 00:00:00 1998
@@ -721,7 +721,7 @@ _bfd_xcoff_canonicalize_dynamic_symtab (
 	    if (ldsym._l._l_name[i] == '\0')
 	      break;
 	  if (i < SYMNMLEN)
-	    symbuf->symbol.name = (char *) elsym->_l._l_name;
+	    symbuf->symbol.name = (const char *) elsym->_l._l_name;
 	  else
 	    {
 	      char *c;
@@ -3824,7 +3824,7 @@ xcoff_build_ldsyms (h, p)
 
       bfd_put_16 (ldinfo->output_bfd, len + 1,
 		  ldinfo->strings + ldinfo->string_size);
-      strcpy (ldinfo->strings + ldinfo->string_size + 2, h->root.root.string);
+      strcpy ((char *) ldinfo->strings + ldinfo->string_size + 2, h->root.root.string);
       h->ldsym->_l._l_l._l_zeroes = 0;
       h->ldsym->_l._l_l._l_offset = ldinfo->string_size + 2;
       ldinfo->string_size += len + 3;
@@ -3953,7 +3953,7 @@ _bfd_xcoff_bfd_final_link (abfd, info)
       if (file_align != 0)
 	{
 	  boolean saw_contents;
-	  int indx;
+	  int indx = 0;
 	  asection **op;
 	  file_ptr sofar;
 
--- binutils-2.9.1/binutils/bucomm.h	Fri May  1 08:49:31 1998
+++ binutils-2.9.1/binutils/bucomm.h	Sun Aug 23 00:00:00 1998
@@ -96,11 +96,11 @@ extern char *getenv ();
 #define SEEK_END 2
 #endif
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 # undef alloca
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
+# if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #  include <alloca.h>
 # else
 #  ifndef alloca /* predefined by HP cc +Olibcalls */
--- binutils-2.9.1/binutils/configure	Fri May  1 08:49:31 1998
+++ binutils-2.9.1/binutils/configure	Thu Jan 21 19:39:41 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -653,21 +679,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:662: checking for a BSD compatible install" >&5
+echo "configure:689: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -706,13 +733,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:716: checking whether build environment is sane" >&5
+echo "configure:745: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -769,7 +798,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:802: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -815,7 +844,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:819: checking for working aclocal" >&5
+echo "configure:848: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -828,7 +857,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:832: checking for working autoconf" >&5
+echo "configure:861: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -841,7 +870,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:845: checking for working automake" >&5
+echo "configure:874: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -854,7 +883,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:858: checking for working autoheader" >&5
+echo "configure:887: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -867,7 +896,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:871: checking for working makeinfo" >&5
+echo "configure:900: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -930,15 +959,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:934: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -959,15 +989,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:963: checking for $ac_word" >&5
+echo "configure:993: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -985,19 +1016,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1056: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1085: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1118: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1032,25 +1159,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1170: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1050 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1212 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1064,18 +1227,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1243: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1079: checking whether we are using GNU C" >&5
+echo "configure:1248: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1084,7 +1253,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1095,11 +1264,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1276: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,18 +1287,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1139,7 +1339,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1143: checking for ld used by GCC" >&5
+echo "configure:1343: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1157,10 +1357,10 @@ echo "configure:1143: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1161: checking for GNU ld" >&5
+echo "configure:1361: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1164: checking for non-GNU ld" >&5
+echo "configure:1364: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1196,7 +1396,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1400: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1212,7 +1412,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1216: checking for BSD-compatible nm" >&5
+echo "configure:1416: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1249,7 +1449,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1253: checking whether ln -s works" >&5
+echo "configure:1453: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1259,14 +1459,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1285,8 +1495,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1289 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1499 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1350,15 +1560,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1354: checking for $ac_word" >&5
+echo "configure:1564: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1376,19 +1587,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1594: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1627: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1656: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1383: checking for $ac_word" >&5
+echo "configure:1689: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1423,25 +1730,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1741: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1431: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1441 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1783 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1455,18 +1798,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1465: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1470: checking whether we are using GNU C" >&5
+echo "configure:1819: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1475,7 +1824,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1486,11 +1835,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1494: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1847: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1505,33 +1858,61 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 for ac_prog in 'bison -y' byacc
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1527: checking for $ac_word" >&5
+echo "configure:1907: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -1555,15 +1936,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1559: checking for $ac_word" >&5
+echo "configure:1940: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -1588,7 +1970,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1592: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1974: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1596,7 +1978,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
+#line 1982 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1607,7 +1989,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1630,7 +2012,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1634: checking how to run the C preprocessor" >&5
+echo "configure:2016: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1645,14 +2027,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1649 "configure"
+#line 2031 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1662,14 +2044,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1666 "configure"
+#line 2048 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2065 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1682,6 +2081,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1691,7 +2092,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1695: checking lex output file root" >&5
+echo "configure:2096: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1712,7 +2113,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:1716: checking whether yytext is a pointer" >&5
+echo "configure:2117: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1724,14 +2125,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 1728 "configure"
+#line 2129 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -1754,7 +2155,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1758: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2159: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1772,19 +2173,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1776: checking for Cygwin32 environment" >&5
+echo "configure:2177: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1781 "configure"
+#line 2182 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1801,19 +2202,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1805: checking for Mingw32 environment" >&5
+echo "configure:2206: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 2211 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1832,7 +2233,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1836: checking for executable suffix" >&5
+echo "configure:2237: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1868,15 +2269,16 @@ AR=${AR-ar}
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1872: checking for $ac_word" >&5
+echo "configure:2273: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1912,7 +2314,7 @@ if test "x$cross_compiling" = "xno"; the
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:1916: checking for build system executable suffix" >&5
+echo "configure:2318: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1937,18 +2339,18 @@ for ac_hdr in string.h strings.h stdlib.
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1941: checking for $ac_hdr" >&5
+echo "configure:2343: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
+#line 2348 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1974,12 +2376,12 @@ fi
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1978: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2380: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1983 "configure"
+#line 2385 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1995,7 +2397,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2018,19 +2420,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2022: checking for working alloca.h" >&5
+echo "configure:2424: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2027 "configure"
+#line 2429 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2050,26 +2452,44 @@ EOF
 
 fi
 
+# Temporary ugly hack for BeOS.  Don't try to run the test for alloca
+# since it will succeed due to finding the version of alloca in the
+# runtime library.  We don't want to use that version, so let's pretend
+# we loaded it from the cache (default to 'no') and thus the package will configure
+# itself to use it's private copy of the C alloca replacement.  When the
+# horribly small default stack size problem is fixed (exists up through
+# at least DR8.2) then we can build gcc to start using it's builtin
+# alloca, we can allow mwcc to use it's builtin alloca, and this hack
+# can go away.
+if test "`uname`" = "BeOS"; then
+  test -z "$ac_cv_func_alloca_works" && ac_cv_func_alloca_works=no
+fi
+
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2055: checking for alloca" >&5
+echo "configure:2470: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2060 "configure"
+#line 2475 "configure"
 #include "confdefs.h"
 
-#ifdef __GNUC__
+#if 0	/* Never do this, it's unnecessary. -fnf */
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
 # else
-#  ifdef _AIX
- #pragma alloca
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
 #  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#    endif
 #   endif
 #  endif
 # endif
@@ -2079,7 +2499,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2104,19 +2524,19 @@ if test $ac_cv_func_alloca_works = no; t
   # that cause trouble.  Some versions do not even contain alloca or
   # contain a buggy version.  If you still want to use their alloca,
   # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.o
+  ALLOCA=alloca.${ac_objext}
   cat >> confdefs.h <<\EOF
 #define C_ALLOCA 1
 EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2115: checking whether alloca needs Cray hooks" >&5
+echo "configure:2535: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2120 "configure"
+#line 2540 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2141,12 +2561,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2145: checking for $ac_func" >&5
+echo "configure:2565: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2150 "configure"
+#line 2570 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2169,7 +2589,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2196,7 +2616,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2200: checking stack direction for C alloca" >&5
+echo "configure:2620: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2204,7 +2624,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2208 "configure"
+#line 2628 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2223,7 +2643,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2247,12 +2667,12 @@ fi
 for ac_func in sbrk utimes
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2251: checking for $ac_func" >&5
+echo "configure:2671: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2256 "configure"
+#line 2676 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2275,7 +2695,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2301,19 +2721,19 @@ done
 
 
 echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
-echo "configure:2305: checking for time_t in time.h" >&5
+echo "configure:2725: checking for time_t in time.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2310 "configure"
+#line 2730 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:2317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_time_h=yes
 else
@@ -2334,19 +2754,19 @@ EOF
 fi
 
 echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2338: checking for time_t in sys/types.h" >&5
+echo "configure:2758: checking for time_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2343 "configure"
+#line 2763 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:2350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_types_h=yes
 else
@@ -2369,12 +2789,12 @@ fi
 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
 # by default.
 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
-echo "configure:2373: checking for utime.h" >&5
+echo "configure:2793: checking for utime.h" >&5
 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2378 "configure"
+#line 2798 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_TIME_H
@@ -2385,7 +2805,7 @@ int main() {
 struct utimbuf s;
 ; return 0; }
 EOF
-if { (eval echo configure:2389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_header_utime_h=yes
 else
@@ -2406,12 +2826,12 @@ EOF
 fi
 
 echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
-echo "configure:2410: checking whether fprintf must be declared" >&5
+echo "configure:2830: checking whether fprintf must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2415 "configure"
+#line 2835 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2432,7 +2852,7 @@ int main() {
 char *(*pfn) = (char *(*)) fprintf
 ; return 0; }
 EOF
-if { (eval echo configure:2436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_fprintf=no
 else
@@ -2454,12 +2874,12 @@ EOF
 fi
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2458: checking whether strstr must be declared" >&5
+echo "configure:2878: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2463 "configure"
+#line 2883 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2480,7 +2900,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2502,12 +2922,12 @@ EOF
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2506: checking whether sbrk must be declared" >&5
+echo "configure:2926: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2511 "configure"
+#line 2931 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2528,7 +2948,7 @@ int main() {
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:2532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -2550,12 +2970,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2554: checking whether getenv must be declared" >&5
+echo "configure:2974: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2559 "configure"
+#line 2979 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2576,7 +2996,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2666,7 +3086,7 @@ do
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
-	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
+	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32* | i[3-6]86-*-beos* )
   	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
@@ -2724,7 +3144,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2770,7 +3190,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2791,7 +3213,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2815,6 +3237,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2832,6 +3255,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2849,8 +3276,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2861,6 +3288,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -2873,7 +3301,6 @@ s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
 s%@MAINT@%$MAINT%g
 s%@EXEEXT@%$EXEEXT%g
 s%@HDEFINES@%$HDEFINES%g
-s%@AR@%$AR%g
 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
 s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
 s%@ALLOCA@%$ALLOCA%g
@@ -3026,6 +3453,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -3071,6 +3499,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -3102,6 +3531,7 @@ test -z "$CONFIG_HEADERS" || echo timest
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/binutils/configure.in	Fri May  1 08:49:32 1998
+++ binutils-2.9.1/binutils/configure.in	Sun Aug 23 00:00:00 1998
@@ -166,7 +166,7 @@ changequote([,])dnl
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
 changequote(,)dnl
-	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
+	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32* | i[3-6]86-*-beos* )
 changequote([,])dnl
   	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
--- binutils-2.9.1/binutils/dlltool.c	Fri May  1 08:49:32 1998
+++ binutils-2.9.1/binutils/dlltool.c	Sun Aug 23 00:00:00 1998
@@ -314,7 +314,7 @@ static const unsigned char arm_jtab[] =
 static const unsigned char ppc_jtab[] = 
 { 
   0x00, 0x00, 0x62, 0x81, /* lwz r11,0(r2)               */
-                          /*   Reloc TOCREL16 __imp_xxx  */
+                          /*   Reloc TOCREL16 _imp__xxx  */
   0x00, 0x00, 0x8B, 0x81, /* lwz r12,0(r11)              */
   0x04, 0x00, 0x41, 0x90, /* stw r2,4(r1)                */
   0xA6, 0x03, 0x89, 0x7D, /* mtctr r12                   */
@@ -1292,14 +1292,14 @@ both single and double underscores, for 
 
 	.text
 	.global	_GetFileVersionInfoSizeW@8
-	.global	__imp_GetFileVersionInfoSizeW@8
+	.global	_imp__GetFileVersionInfoSizeW@8
 _GetFileVersionInfoSizeW@8:
-	jmp *	__imp_GetFileVersionInfoSizeW@8
+	jmp *	_imp__GetFileVersionInfoSizeW@8
 	.section	.idata$7	# To force loading of head
 	.long	__version_a_head
 # Import Address Table
 	.section	.idata$5
-__imp_GetFileVersionInfoSizeW@8:
+_imp__GetFileVersionInfoSizeW@8:
 	.rva	ID2
 
 # Import Lookup Table
@@ -1316,8 +1316,8 @@ For the PowerPC, here's the variation on
 # Rather than a simple "jmp *", the code to get to the dll function 
 # looks like:
          .text
-         lwz	r11,[tocv]__imp_function_name(r2)
-#		   RELOC: 00000000 TOCREL16,TOCDEFN __imp_function_name
+         lwz	r11,[tocv]_imp__function_name(r2)
+#		   RELOC: 00000000 TOCREL16,TOCDEFN _imp__function_name
          lwz	r12,0(r11)
 	 stw	r2,4(r1)
 	 mtctr	r12
@@ -1353,7 +1353,7 @@ make_one_lib_file (exp, i)
       fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
       fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
       fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
-      fprintf (f, "%s%s:\n\t%s\t__imp_%s\n", ASM_PREFIX,
+      fprintf (f, "%s%s:\n\t%s\t_imp__%s\n", ASM_PREFIX,
 	       exp->name, ASM_JUMP, exp->name);
 
       fprintf (f, "\t.section\t.idata$7\t%s To force loading of head\n", ASM_C);
--- binutils-2.9.1/binutils/Makefile.in	Fri May  1 08:49:30 1998
+++ binutils-2.9.1/binutils/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -70,17 +76,10 @@ CC = @CC@
 DLLTOOL_DEFS = @DLLTOOL_DEFS@
 EXEEXT = @EXEEXT@
 HDEFINES = @HDEFINES@
-LD = @LD@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
 NLMCONV_DEFS = @NLMCONV_DEFS@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 UNDERSCORE = @UNDERSCORE@
-VERSION = @VERSION@
 
 AUTOMAKE_OPTIONS = cygnus dejagnu
 
@@ -335,13 +334,20 @@ CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then echo $(top_builddir)/../texinfo/makeinfo/makeinfo; else echo makeinfo; fi`
 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
 TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = binutils.info
 DVIS = binutils.dvi
 TEXINFOS = binutils.texi
-MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 	addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
-
+GUIDES = binutils.guide
+GUIDE_DEPS = binutils.guide
+HTMLS = binutils.html
+HTML_DEPS = binutils.html
+PS_S = binutils.ps
+PS_DEPS = binutils.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  README ChangeLog Makefile.am Makefile.in NEWS acconfig.h \
@@ -350,21 +356,24 @@ configure.in deflex.c defparse.c nlmhead
 stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(c__filt_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES)
 OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(c__filt_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) config.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .l .lo .o .ps .s .texi .texinfo .txi .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -408,18 +417,18 @@ maintainer-clean-binPROGRAMS:
 
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(bindir)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
 uninstall-binPROGRAMS:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	done
 
 mostlyclean-noinstPROGRAMS:
@@ -543,6 +552,9 @@ nlmheader.h: nlmheader.c
 	$(SHELL) $(YLWRAP) "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS)
 
 binutils.info: binutils.texi
+binutils.guide: binutils.texi
+binutils.html: binutils.texi
+binutils.ps: binutils.dvi
 binutils.dvi: binutils.texi
 
 
@@ -550,7 +562,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -558,39 +570,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -601,11 +625,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -618,12 +642,155 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
 	  binutils.fns binutils.ky binutils.kys binutils.ps \
 	  binutils.log binutils.pg binutils.toc binutils.tp \
 	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
-	  binutils.cv binutils.cn
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
 
 clean-aminfo:
 
@@ -637,101 +804,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "ar" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ar.1; then file=$(srcdir)/ar.1; \
-	else file=ar.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "nlmconv" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/nlmconv.1; then file=$(srcdir)/nlmconv.1; \
-	else file=nlmconv.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/$(DEMANGLER_PROG).1; then file=$(srcdir)/$(DEMANGLER_PROG).1; \
-	else file=$(DEMANGLER_PROG).1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "nm" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/nm.1; then file=$(srcdir)/nm.1; \
-	else file=nm.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "objdump" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/objdump.1; then file=$(srcdir)/objdump.1; \
-	else file=objdump.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "ranlib" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ranlib.1; then file=$(srcdir)/ranlib.1; \
-	else file=ranlib.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "size" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/size.1; then file=$(srcdir)/size.1; \
-	else file=size.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "strings" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/strings.1; then file=$(srcdir)/strings.1; \
-	else file=strings.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "strip" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/strip.1; then file=$(srcdir)/strip.1; \
-	else file=strip.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "objcopy" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/objcopy.1; then file=$(srcdir)/objcopy.1; \
-	else file=objcopy.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "addr2line" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/addr2line.1; then file=$(srcdir)/addr2line.1; \
-	else file=addr2line.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "ar" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "nlmconv" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "nm" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "objdump" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "ranlib" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "size" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "strings" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "strip" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "objcopy" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "addr2line" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -827,6 +938,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE) check-DEJAGNU
@@ -843,12 +957,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-binPROGRAMS uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(bindir) $(mandir)/man1
+	$(mkinstalldirs)  $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -867,40 +979,51 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-binPROGRAMS \
 		mostlyclean-noinstPROGRAMS mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-aminfo mostlyclean-tags \
-		mostlyclean-generic mostlyclean-local
+		mostlyclean-libtool mostlyclean-aminfo \
+		mostlyclean-guide mostlyclean-html mostlyclean-dvi \
+		mostlyclean-ps mostlyclean-tags mostlyclean-generic \
+		mostlyclean-local
 
 clean:  clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
-		clean-libtool clean-aminfo clean-tags clean-generic \
-		mostlyclean
+		clean-libtool clean-aminfo clean-guide clean-html \
+		clean-dvi clean-ps clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-binPROGRAMS distclean-noinstPROGRAMS \
 		distclean-compile distclean-libtool distclean-aminfo \
-		distclean-tags distclean-generic clean
+		distclean-guide distclean-html distclean-dvi \
+		distclean-ps distclean-tags distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
 		maintainer-clean-noinstPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
 clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
 mostlyclean-compile distclean-compile clean-compile \
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
-info dvi installcheck install-info install-exec install-data install \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir check-DEJAGNU info guide html \
+ps dvi installcheck install-info install-exec install-data install \
 uninstall all installdirs mostlyclean-generic distclean-generic \
 clean-generic maintainer-clean-generic clean mostlyclean distclean \
 maintainer-clean
--- binutils-2.9.1/binutils/objcopy.c	Fri May  1 08:49:34 1998
+++ binutils-2.9.1/binutils/objcopy.c	Sun Aug 23 00:00:00 1998
@@ -1242,7 +1242,8 @@ copy_section (ibfd, isection, obfdarg)
   if (size == 0 || osection == 0)
     return;
 
-  if (strip_symbols == strip_all)
+  /* Never, ever, strip reloc data on the Amiga! */
+  if (strip_symbols == strip_all && bfd_get_flavour(obfd) != bfd_target_amiga_flavour)
     bfd_set_reloc (obfd, osection, (arelent **) NULL, 0);
   else
     {
--- binutils-2.9.1/binutils/objdump.c	Fri May  1 08:49:34 1998
+++ binutils-2.9.1/binutils/objdump.c	Sun Aug 23 00:00:00 1998
@@ -328,6 +328,7 @@ dump_section_header (abfd, section, igno
   if ((section->flags & SEC_LINK_ONCE) != 0)
     {
       const char *ls;
+      pei_get_comdat_info(section);
 
       switch (section->flags & SEC_LINK_DUPLICATES)
 	{
@@ -348,6 +349,10 @@ dump_section_header (abfd, section, igno
 	}
       printf ("%s%s", comma, ls);
       comma = ", ";
+      if (section->pe_comdat_info->asoc_sec != (int)NULL)
+        printf ("\n		    Associated with section %d", section->pe_comdat_info->asoc_sec -1);
+      else
+        printf ("\n		    Communal; sym=%s", section->pe_comdat_info->comdat_sym);
     }
 
   printf ("\n");
--- binutils-2.9.1/config.guess	Fri May  1 08:48:46 1998
+++ binutils-2.9.1/config.guess	Sun Aug 23 00:00:00 1998
@@ -112,6 +112,9 @@ EOF
     amiga:OpenBSD:*:*)
 	echo m68k-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
     arc64:OpenBSD:*:*)
 	echo mips64el-unknown-openbsd${UNAME_RELEASE}
 	exit 0 ;;
@@ -795,6 +798,9 @@ EOF
 	exit 0 ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
 	exit 0 ;;
 esac
 
--- binutils-2.9.1/config/mh-amigaos	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/config/mh-amigaos	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,13 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+CFLAGS = -g -O2 -mstackextend
+
+# We have both types of links under AmigaOS with GNU
+# utils, however the links need to be made in canonical
+# AmigaOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
--- binutils-2.9.1/config/mh-cxux	Fri May  1 08:48:42 1998
+++ binutils-2.9.1/config/mh-cxux	Sun Aug 23 00:00:00 1998
@@ -8,7 +8,7 @@ RANLIB = true
 CXXFLAGS=-O
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
+ARFLAGS = cq
 
 # Under CX/UX, we want to tell the compiler to use ANSI mode.
 CC=cc -Xa
--- binutils-2.9.1/config/mh-ncr3000	Fri May  1 08:48:43 1998
+++ binutils-2.9.1/config/mh-ncr3000	Sun Aug 23 00:00:00 1998
@@ -14,4 +14,4 @@ SYSV = -DSYSV -DSVR4
 RANLIB = true
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
+ARFLAGS = cq
--- binutils-2.9.1/config/mh-sysv4	Fri May  1 08:48:44 1998
+++ binutils-2.9.1/config/mh-sysv4	Sun Aug 23 00:00:00 1998
@@ -6,6 +6,6 @@ RANLIB = true
 CXXFLAGS=-O
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cr
+ARFLAGS = cr
 
 X11_EXTRA_LIBS = -lnsl
--- binutils-2.9.1/config/mpw/g-mpw-make.sed	Fri May  1 08:48:45 1998
+++ binutils-2.9.1/config/mpw/g-mpw-make.sed	Sun Aug 23 00:00:00 1998
@@ -52,7 +52,7 @@
 /CC/s/^CC *=/#CC =/
 /CFLAGS/s/^CFLAGS *=/#CFLAGS =/
 /AR/s/^AR *=/#AR =/
-/AR_FLAGS/s/^AR_FLAGS *=/#AR_FLAGS =/
+/ARFLAGS/s/^ARFLAGS *=/#ARFLAGS =/
 /RANLIB/s/^RANLIB *=/#RANLIB =/
 /CC_LD/s/^CC_LD *=/#CC_LD =/
 /LDFLAGS/s/^LDFLAGS *=/#LDFLAGS =/
--- binutils-2.9.1/config/mpw-mh-mpw	Fri May  1 08:48:44 1998
+++ binutils-2.9.1/config/mpw-mh-mpw	Sun Aug 23 00:00:00 1998
@@ -55,7 +55,7 @@ AR_MWLINKPPC = MWLinkPPC -xm library
 
 AR_AR = ar
 
-AR_FLAGS = -o
+ARFLAGS = -o
 
 RANLIB_NULL = null-command
 
--- binutils-2.9.1/config.sub	Fri May  1 08:48:46 1998
+++ binutils-2.9.1/config.sub	Sun Aug 23 00:00:00 1998
@@ -287,11 +287,11 @@ case $basic_machine in
 		os=-sysv
 		;;
 	amiga | amiga-*)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		;;
-	amigados)
-		basic_machine=m68k-cbm
-		os=-amigados
+	amigaos)
+		basic_machine=m68k-unknown
+		os=-amigaos
 		;;
 	amigaunix | amix)
 		basic_machine=m68k-cbm
@@ -925,7 +925,7 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-	      | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
+	      | -amigaos* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
@@ -1098,7 +1098,7 @@ case $basic_machine in
 		os=-sysv
 		;;
 	*-cbm)
-		os=-amigados
+		os=-amigaos
 		;;
 	*-dg)
 		os=-dgux
@@ -1180,9 +1180,6 @@ case $basic_machine in
 				;;
 			-aix*)
 				vendor=ibm
-				;;
-			-beos*)						# CYGNUS LOCAL
-				vendor=be
 				;;
 			-hpux*)
 				vendor=hp
--- binutils-2.9.1/configure	Fri May  1 08:48:46 1998
+++ binutils-2.9.1/configure	Sun Aug 23 00:00:00 1998
@@ -34,8 +34,8 @@
 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0 $argv; kill $$)
 
 remove=rm
-hard_link=ln
-symbolic_link='ln -s'
+hard_link=cp
+symbolic_link=cp
 
 #for Test
 #remove="echo rm"
@@ -64,7 +64,10 @@ norecursion=
 other_options=
 package_makefile_frag=
 package_makefile_rules_frag=
-prefix=/usr/local
+# This is a hack so we don't have to remember to always configure using
+# the "--prefix=/gg" option.  Personally I feel this should be settable
+# in a config file.  -fnf
+prefix=/gg
 progname=
 program_prefix=
 program_prefixoption=
@@ -144,9 +147,12 @@ NO_EDIT="This file was generated automat
 ## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
 ##
 
-progname=$0
+# For some reason, the value of $0 in AmigaOS pdksh ends up with a
+# trailing '/' that needs to be stripped.
+progname=`echo $0 | sed 's:/$::'`
 # if PWD already has a value, it is probably wrong.
-if [ -n "$PWD" ]; then PWD=`pwd`; fi
+# The AmigaOS pksh can't change the value of PWD, it's readonly.
+#if [ -n "$PWD" ]; then PWD=`pwd`; fi
 
 case "${progname}" in
 /*) ;;
@@ -964,18 +970,76 @@ else
       fi
     done
     IFS="$save_ifs"
-    CC=${CC-cc}
+  fi
+  # If CC is still not set, try to get bcc.
+  if [ -z "${CC}" ]; then
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH; do
+      test -z "$dir" && dir=.
+      if test -f $dir/bcc; then
+	CC="bcc"
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CFLAGS-"-g -O2"}
+	else
+	  CFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CFLAGS-"-O2"}
+	fi
+	rm -f conftest*
+	break
+      fi
+    done
+    IFS="$save_ifs"
+  fi
+  # If CC is still not set, try to get mwcc.
+  if [ -z "${CC}" ]; then
+    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
+    for dir in $PATH; do
+      test -z "$dir" && dir=.
+      if test -f $dir/mwcc; then
+	CC="mwcc -I- -I. -I${prefix}/include -L${prefix}/lib -opt global -nodup"
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CFLAGS-"-g -O2"}
+	else
+	  CFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CFLAGS-"-O2"}
+	fi
+	rm -f conftest*
+	break
+      fi
+    done
+    IFS="$save_ifs"
   fi
 
+  CC=${CC-gcc}
   CXX=${CXX-"c++"}
   CFLAGS=${CFLAGS-"-g"}
   CXXFLAGS=${CXXFLAGS-"-g -O2"}
 fi
 
+case "$CC" in
+	*mwcc* | *bcc* )
+		AR="mwld"
+		ARFLAGS="-xml -o"
+		RANLIB="true"
+		;;
+	*)
+		AR=${AR-"ar"}
+		ARFLAGS=${ARFLAGS-"cr"}
+		RANLIB=${RANLIB-"ranlib"}
+		;;
+esac
+
 export CC
 export CXX
 export CFLAGS
 export CXXFLAGS
+export AR
+export ARFLAGS
+export RANLIB
 
 # FIXME: This should be in configure.in, not configure
 case "$host" in
@@ -983,6 +1047,8 @@ case "$host" in
 	    enable_gdbtk=no ;;
 	*msdosdjgpp*)
 	    enable_gdbtk=no ;;
+	*beos*)
+	    enable_gdbtk=no ;;
 esac
 
 # FIXME: This should be in configure.in, not configure
@@ -1305,6 +1371,9 @@ EOF
 			s%^CXXFLAGS[ 	]*=.*$%CXXFLAGS = ${CXXFLAGS}%
 			}" \
 		    -e "s|^SHELL[	 ]*=.*$|SHELL = ${config_shell}|" \
+		    -e "s:^AR[	 ]*=.*$:AR = ${AR}:" \
+		    -e "s:^ARFLAGS[	 ]*=.*$:ARFLAGS = ${ARFLAGS}:" \
+		    -e "s:^RANLIB[	 ]*=.*$:RANLIB = ${RANLIB}:" \
                     -e "s|^srcdir[ 	]*=.*$|srcdir = ${makesrcdir}|" \
                     -e "s///" \
                     -e "s:^program_prefix[ 	]*=.*$:program_prefix = ${program_prefix}:" \
@@ -1468,7 +1537,9 @@ if [ -z "${norecursion}" -a -n "${config
 
 ### The recursion line is here.
 			if [ ! -z "${recprog}" ] ; then
-	                        if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
+	                        	echo ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} ${prefixoption} ${tmpdiroption} ${exec_prefixoption} ${srcdiroption} ${program_prefixoption} ${program_suffixoption} \
+					${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect}
+					if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
         	                        ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
                 	                ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
 	                                true
--- binutils-2.9.1/configure.in	Fri May  1 09:00:42 1998
+++ binutils-2.9.1/configure.in	Sun Aug 23 00:00:00 1998
@@ -179,6 +179,9 @@ case "${host}" in
   i[3456]86-*-msdosdjgpp*)
     host_makefile_frag="${host_makefile_frag} config/mh-go32"
     ;;
+  *-*-amigaos*)
+    host_makefile_frag="${host_makefile_frag} config/mh-amigaos"
+    ;;
   *-cygwin32*)
     host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
     ;;
--- binutils-2.9.1/etc/configure	Fri May  1 08:48:45 1998
+++ binutils-2.9.1/etc/configure	Thu Jan 21 19:39:43 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -44,6 +44,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -161,6 +165,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -203,6 +211,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -333,7 +357,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -503,9 +527,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -546,21 +572,22 @@ ac_configure=$ac_aux_dir/configure # Thi
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:555: checking for a BSD compatible install" >&5
+echo "configure:582: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -599,6 +626,8 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
@@ -625,7 +654,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -665,6 +694,7 @@ fi
 
 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
+
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
@@ -683,7 +713,9 @@ rm -f conftest.defs
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -704,7 +736,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -728,6 +760,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -745,8 +778,13 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 
 CEOF
@@ -857,6 +895,7 @@ cat >> $CONFIG_STATUS <<\EOF
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/etc/Makefile.in	Fri May  1 08:48:45 1998
+++ binutils-2.9.1/etc/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -24,6 +24,7 @@ man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
 infodir = @infodir@
+guidedir = $(prefix)/guide
 
 SHELL = /bin/sh
 
@@ -41,11 +42,12 @@ TEXIDIR = $(srcdir)/../texinfo
 ###
 
 INFOFILES = standards.info
+GUIDEFILES = standards.guide
 DVIFILES = standards.dvi
 
-all:
+all: info guide
 
-install:
+install: install-info install-guide
 
 uninstall:
 
@@ -57,6 +59,14 @@ install-info: info
 	  $(INSTALL_DATA) $$i $(infodir)/$$i; \
 	done
 
+guide: $(GUIDEFILES)
+
+install-guide: guide
+	if test ! -f standards.guide; then cd $(srcdir); fi; \
+	for i in standards.guide; do \
+	  $(INSTALL_DATA) $$i $(guidedir)/$$i; \
+	done
+
 dvi: $(DVIFILES)
 
 standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
@@ -65,10 +75,14 @@ standards.info: $(srcdir)/standards.texi
 standards.dvi: $(srcdir)/standards.texi
 	TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi
 
+standards.guide: $(srcdir)/standards.texi
+	$(MAKEINFO) -I$(srcdir) --amiga --no-split -o standards.guide $(srcdir)/standards.texi
+
 
 clean:
 	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
 	rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
+	rm -f *.guide
 
 mostlyclean: clean
 
--- binutils-2.9.1/gas/as.c	Fri May  1 08:45:05 1998
+++ binutils-2.9.1/gas/as.c	Sun Aug 23 00:00:00 1998
@@ -76,6 +76,9 @@ char *myname;			/* argv[0] */
 #ifdef BFD_ASSEMBLER
 segT reg_section, expr_section;
 segT text_section, data_section, bss_section;
+#ifdef TE_AMIGA
+segT data_chip_section, bss_chip_section;
+#endif
 #endif
 
 /* The default obstack chunk size.  If we set this to zero, the
@@ -924,6 +927,10 @@ perform_an_assembly_pass (argc, argv)
   text_section = subseg_new (TEXT_SECTION_NAME, 0);
   data_section = subseg_new (DATA_SECTION_NAME, 0);
   bss_section = subseg_new (BSS_SECTION_NAME, 0);
+#ifdef TE_AMIGA
+  data_chip_section = subseg_new (".data_chip", 0);
+  bss_chip_section = subseg_new (".bss_chip", 0);
+#endif
   /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
      to have relocs, otherwise we don't find out in time. */
   applicable = bfd_applicable_section_flags (stdoutput);
@@ -934,6 +941,12 @@ perform_an_assembly_pass (argc, argv)
   bfd_set_section_flags (stdoutput, data_section,
 			 applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
   bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC);
+#ifdef TE_AMIGA
+  bfd_set_section_flags (stdoutput, data_chip_section,
+			 applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
+  bfd_set_section_flags (stdoutput, bss_chip_section, applicable & SEC_ALLOC);
+#endif
+
   seg_info (bss_section)->bss = 1;
   subseg_new (BFD_ABS_SECTION_NAME, 0);
   subseg_new (BFD_UND_SECTION_NAME, 0);
--- binutils-2.9.1/gas/as.h	Fri May  1 08:45:05 1998
+++ binutils-2.9.1/gas/as.h	Sun Aug 23 00:00:00 1998
@@ -51,7 +51,7 @@
 /* Force void* decl for hpux.  This is what Bison uses.  --KR 1995.08.16 */
 
 /* AIX requires this to be the first thing in the file.  */
-#ifdef __GNUC__
+#if defined __GNUC__ && !defined (C_ALLOCA)
 # ifndef alloca
 #  ifdef __STDC__
 extern void *alloca ();
@@ -60,7 +60,7 @@ extern char *alloca ();
 #  endif
 # endif
 #else
-# if HAVE_ALLOCA_H
+# if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #  include <alloca.h>
 # else
 #  ifdef _AIX
--- binutils-2.9.1/gas/config/amigaos.mh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/gas/config/amigaos.mh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,13 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# There is no standard system compiler.  Assume use GNU C.
+CC = gcc
+# There is no support for -g yet.  But use -O instead.
+CFLAGS = -O
+# We have both types of links under AmigaOS with GNU
+# utils, however the links need to be made in canonical
+# AmigaOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
--- binutils-2.9.1/gas/config/m68k-parse.h	Fri May  1 08:44:34 1998
+++ binutils-2.9.1/gas/config/m68k-parse.h	Sun Aug 23 00:00:00 1998
@@ -225,6 +225,9 @@ struct m68k_exp
 
   /* The expression itself.  */
   expressionS exp;
+  
+  /* base-relative? */
+  short baserel;
 };
 
 /* The operand modes.  */
--- binutils-2.9.1/gas/config/m68k-parse.y	Fri May  1 08:44:35 1998
+++ binutils-2.9.1/gas/config/m68k-parse.y	Sun Aug 23 00:00:00 1998
@@ -945,6 +945,7 @@ yylex ()
     }
 
   yylval.exp.size = SIZE_UNSPEC;
+  yylval.exp.baserel = 0;
   if (s <= str + 2
       || (s[-2] != '.' && s[-2] != ':'))
     tail = 0;
@@ -952,18 +953,21 @@ yylex ()
     {
       switch (s[-1])
 	{
+	case 'B':
+          yylval.exp.baserel = 1;
 	case 's':
 	case 'S':
 	case 'b':
-	case 'B':
 	  yylval.exp.size = SIZE_BYTE;
 	  break;
-	case 'w':
 	case 'W':
+          yylval.exp.baserel = 1;
+	case 'w':
 	  yylval.exp.size = SIZE_WORD;
 	  break;
-	case 'l':
 	case 'L':
+          yylval.exp.baserel = 1;
+	case 'l':
 	  yylval.exp.size = SIZE_LONG;
 	  break;
 	default:
--- binutils-2.9.1/gas/config/obj-amigahunk.c	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/gas/config/obj-amigahunk.c	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,560 @@
+/* AmigaOS object file format
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of GAS, the GNU Assembler.
+
+GAS is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2,
+or (at your option) any later version.
+
+GAS is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with GAS; see the file COPYING.  If not, write
+to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "as.h"
+
+#ifdef BFD_ASSEMBLER
+#undef NO_RELOC
+#endif
+#include "obstack.h"
+
+#ifndef BFD_ASSEMBLER
+/* in: segT   out: N_TYPE bits */
+const short seg_N_TYPE[] =
+{
+  N_ABS,
+  N_TEXT,
+  N_DATA,
+  N_BSS,
+  N_UNDF,			/* unknown */
+  N_UNDF,			/* error */
+  N_UNDF,			/* expression */
+  N_UNDF,			/* debug */
+  N_UNDF,			/* ntv */
+  N_UNDF,			/* ptv */
+  N_REGISTER,			/* register */
+};
+
+const segT N_TYPE_seg[N_TYPE + 2] =
+{				/* N_TYPE == 0x1E = 32-2 */
+  SEG_UNKNOWN,			/* N_UNDF == 0 */
+  SEG_GOOF,
+  SEG_ABSOLUTE,			/* N_ABS == 2 */
+  SEG_GOOF,
+  SEG_TEXT,			/* N_TEXT == 4 */
+  SEG_GOOF,
+  SEG_DATA,			/* N_DATA == 6 */
+  SEG_GOOF,
+  SEG_BSS,			/* N_BSS == 8 */
+  SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_REGISTER,			/* dummy N_REGISTER for regs = 30 */
+  SEG_GOOF,
+};
+#endif
+
+static void obj_amiga_line PARAMS ((int));
+static void obj_amiga_weak PARAMS ((int));
+
+const pseudo_typeS obj_pseudo_table[] =
+{
+  {"line", obj_amiga_line, 0},	/* source code line number */
+  {"ln", obj_amiga_line, 0},	/* coff line number that we use anyway */
+
+  {"weak", obj_amiga_weak, 0},	/* mark symbol as weak.  */
+
+  /* coff debug pseudos (ignored) */
+  {"def", s_ignore, 0},
+  {"dim", s_ignore, 0},
+  {"endef", s_ignore, 0},
+  {"ident", s_ignore, 0},
+  {"line", s_ignore, 0},
+  {"ln", s_ignore, 0},
+  {"scl", s_ignore, 0},
+  {"size", s_ignore, 0},
+  {"tag", s_ignore, 0},
+  {"type", s_ignore, 0},
+  {"val", s_ignore, 0},
+  {"version", s_ignore, 0},
+
+  {"optim", s_ignore, 0},	/* For sun386i cc (?) */
+
+  /* other stuff */
+  {"ABORT", s_abort, 0},
+
+  {NULL}			/* end sentinel */
+};				/* obj_pseudo_table */
+
+
+#ifdef BFD_ASSEMBLER
+
+void
+obj_amiga_frob_symbol (sym, punt)
+     symbolS *sym;
+     int *punt;
+{
+  flagword flags;
+  asection *sec;
+  int desc, type, other;
+
+  flags = sym->bsym->flags;
+  type = S_GET_TYPE (sym);
+  desc = S_GET_DESC (sym);
+  other = S_GET_OTHER (sym);
+  sec = sym->bsym->section;
+
+  /* Only frob simple symbols this way right now.  */
+  if (! (type & ~ (N_TYPE | N_EXT)))
+    {
+      if (type == (N_UNDF | N_EXT)
+	  && sec == &bfd_abs_section)
+	sym->bsym->section = sec = bfd_und_section_ptr;
+
+      if ((type & N_TYPE) != N_INDR
+	  && (type & N_TYPE) != N_SETA
+	  && (type & N_TYPE) != N_SETT
+	  && (type & N_TYPE) != N_SETD
+	  && (type & N_TYPE) != N_SETB
+	  && type != N_WARNING
+	  && (sec == &bfd_abs_section
+	      || sec == &bfd_und_section))
+	return;
+      if (flags & BSF_EXPORT)
+	type |= N_EXT;
+
+      switch (type & N_TYPE)
+	{
+	case N_SETA:
+	case N_SETT:
+	case N_SETD:
+	case N_SETB:
+	  /* Set the debugging flag for constructor symbols so that
+	     BFD leaves them alone.  */
+	  sym->bsym->flags |= BSF_DEBUGGING;
+
+	  /* You can't put a common symbol in a set.  The way a set
+	     element works is that the symbol has a definition and a
+	     name, and the linker adds the definition to the set of
+	     that name.  That does not work for a common symbol,
+	     because the linker can't tell which common symbol the
+	     user means.  FIXME: Using as_bad here may be
+	     inappropriate, since the user may want to force a
+	     particular type without regard to the semantics of sets;
+	     on the other hand, we certainly don't want anybody to be
+	     mislead into thinking that their code will work.  */
+	  if (S_IS_COMMON (sym))
+	    as_bad ("Attempt to put a common symbol into set %s",
+		    S_GET_NAME (sym));
+	  /* Similarly, you can't put an undefined symbol in a set.  */
+	  else if (! S_IS_DEFINED (sym))
+	    as_bad ("Attempt to put an undefined symbol into set %s",
+		    S_GET_NAME (sym));
+
+	  break;
+	case N_INDR:
+	  /* Put indirect symbols in the indirect section.  */
+	  sym->bsym->section = bfd_ind_section_ptr;
+	  sym->bsym->flags |= BSF_INDIRECT;
+	  if (type & N_EXT)
+	    {
+	      sym->bsym->flags |= BSF_EXPORT;
+	      sym->bsym->flags &=~ BSF_LOCAL;
+	    }
+	  break;
+	case N_WARNING:
+	  /* Mark warning symbols.  */
+	  sym->bsym->flags |= BSF_WARNING;
+	  break;
+	}
+    }
+  else
+    {
+      sym->bsym->flags |= BSF_DEBUGGING;
+    }
+
+  S_SET_TYPE (sym, type);
+
+  /* Double check weak symbols.  */
+  if (sym->bsym->flags & BSF_WEAK)
+    {
+      if (S_IS_COMMON (sym))
+	as_bad ("Symbol `%s' can not be both weak and common",
+		S_GET_NAME (sym));
+    }
+}
+
+void
+obj_amiga_frob_file ()
+{
+  /* Relocation processing may require knowing the VMAs of the sections.
+     Since writing to a section will cause the BFD back end to compute the
+     VMAs, fake it out here....  */
+  bfd_byte b = 0;
+  boolean x = true;
+  if (bfd_section_size (stdoutput, text_section) != 0)
+    {
+      x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0,
+				    (bfd_size_type) 1);
+    }
+  else if (bfd_section_size (stdoutput, data_section) != 0)
+    {
+      x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
+				    (bfd_size_type) 1);
+    }
+  assert (x == true);
+}
+
+#else
+
+/* Relocation. */
+
+/*
+ *		emit_relocations()
+ *
+ * Crawl along a fixS chain. Emit the segment's relocations.
+ */
+void
+obj_emit_relocations (where, fixP, segment_address_in_file)
+     char **where;
+     fixS *fixP;		/* Fixup chain for this segment. */
+     relax_addressT segment_address_in_file;
+{
+  for (; fixP; fixP = fixP->fx_next)
+    if (fixP->fx_done == 0)
+      {
+	tc_aout_fix_to_chars (*where, fixP, segment_address_in_file);
+	*where += md_reloc_size;
+      }
+}
+
+#ifndef obj_header_append
+/* Aout file generation & utilities */
+void
+obj_header_append (where, headers)
+     char **where;
+     object_headers *headers;
+{
+  tc_headers_hook (headers);
+
+#ifdef CROSS_COMPILE
+  md_number_to_chars (*where, headers->header.a_info, sizeof (headers->header.a_info));
+  *where += sizeof (headers->header.a_info);
+  md_number_to_chars (*where, headers->header.a_text, sizeof (headers->header.a_text));
+  *where += sizeof (headers->header.a_text);
+  md_number_to_chars (*where, headers->header.a_data, sizeof (headers->header.a_data));
+  *where += sizeof (headers->header.a_data);
+  md_number_to_chars (*where, headers->header.a_bss, sizeof (headers->header.a_bss));
+  *where += sizeof (headers->header.a_bss);
+  md_number_to_chars (*where, headers->header.a_syms, sizeof (headers->header.a_syms));
+  *where += sizeof (headers->header.a_syms);
+  md_number_to_chars (*where, headers->header.a_entry, sizeof (headers->header.a_entry));
+  *where += sizeof (headers->header.a_entry);
+  md_number_to_chars (*where, headers->header.a_trsize, sizeof (headers->header.a_trsize));
+  *where += sizeof (headers->header.a_trsize);
+  md_number_to_chars (*where, headers->header.a_drsize, sizeof (headers->header.a_drsize));
+  *where += sizeof (headers->header.a_drsize);
+
+#else /* CROSS_COMPILE */
+
+  append (where, (char *) &headers->header, sizeof (headers->header));
+#endif /* CROSS_COMPILE */
+
+}
+#endif
+
+void
+obj_symbol_to_chars (where, symbolP)
+     char **where;
+     symbolS *symbolP;
+{
+  md_number_to_chars ((char *) &(S_GET_OFFSET (symbolP)),
+		      S_GET_OFFSET (symbolP),
+		      sizeof (S_GET_OFFSET (symbolP)));
+
+  md_number_to_chars ((char *) &(S_GET_DESC (symbolP)),
+		      S_GET_DESC (symbolP),
+		      sizeof (S_GET_DESC (symbolP)));
+
+  md_number_to_chars ((char *) &(symbolP->sy_symbol.n_value),
+		      S_GET_VALUE (symbolP),
+		      sizeof (symbolP->sy_symbol.n_value));
+
+  append (where, (char *) &symbolP->sy_symbol, sizeof (obj_symbol_type));
+}
+
+void
+obj_emit_symbols (where, symbol_rootP)
+     char **where;
+     symbolS *symbol_rootP;
+{
+  symbolS *symbolP;
+
+  /* Emit all symbols left in the symbol chain.  */
+  for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
+    {
+      /* Used to save the offset of the name. It is used to point
+	 to the string in memory but must be a file offset. */
+      register char *temp;
+
+      temp = S_GET_NAME (symbolP);
+      S_SET_OFFSET (symbolP, symbolP->sy_name_offset);
+
+      /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
+      if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP))
+	S_SET_EXTERNAL (symbolP);
+
+      /* Adjust the type of a weak symbol.  */
+      if (S_GET_WEAK (symbolP))
+	{
+	  switch (S_GET_TYPE (symbolP))
+	    {
+	    case N_UNDF: S_SET_TYPE (symbolP, N_WEAKU); break;
+	    case N_ABS:	 S_SET_TYPE (symbolP, N_WEAKA); break;
+	    case N_TEXT: S_SET_TYPE (symbolP, N_WEAKT); break;
+	    case N_DATA: S_SET_TYPE (symbolP, N_WEAKD); break;
+	    case N_BSS:  S_SET_TYPE (symbolP, N_WEAKB); break;
+	    default: as_bad ("%s: bad type for weak symbol", temp); break;
+	    }
+	}
+
+      obj_symbol_to_chars (where, symbolP);
+      S_SET_NAME (symbolP, temp);
+    }
+}
+
+#endif /* ! BFD_ASSEMBLER */
+
+static void
+obj_amiga_line (ignore)
+     int ignore;
+{
+  /* Assume delimiter is part of expression.
+     BSD4.2 as fails with delightful bug, so we
+     are not being incompatible here. */
+  new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
+  demand_empty_rest_of_line ();
+}				/* obj_aout_line() */
+
+/* Handle .weak.  This is a GNU extension.  */
+
+static void
+obj_amiga_weak (ignore)
+     int ignore;
+{
+  char *name;
+  int c;
+  symbolS *symbolP;
+
+  do
+    {
+      name = input_line_pointer;
+      c = get_symbol_end ();
+      symbolP = symbol_find_or_make (name);
+      *input_line_pointer = c;
+      SKIP_WHITESPACE ();
+      S_SET_WEAK (symbolP);
+      if (c == ',')
+	{
+	  input_line_pointer++;
+	  SKIP_WHITESPACE ();
+	  if (*input_line_pointer == '\n')
+	    c = '\n';
+	}
+    }
+  while (c == ',');
+  demand_empty_rest_of_line ();
+}
+
+void
+obj_read_begin_hook ()
+{
+}
+
+#ifndef BFD_ASSEMBLER
+
+void
+obj_crawl_symbol_chain (headers)
+     object_headers *headers;
+{
+  symbolS *symbolP;
+  symbolS **symbolPP;
+  int symbol_number = 0;
+
+  tc_crawl_symbol_chain (headers);
+
+  symbolPP = &symbol_rootP;	/*->last symbol chain link. */
+  while ((symbolP = *symbolPP) != NULL)
+    {
+      if (symbolP->sy_mri_common)
+	{
+	  if (S_IS_EXTERNAL (symbolP))
+	    as_bad ("%s: global symbols not supported in common sections",
+		    S_GET_NAME (symbolP));
+	  *symbolPP = symbol_next (symbolP);
+	  continue;
+	}
+
+      if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA))
+	{
+	  S_SET_SEGMENT (symbolP, SEG_TEXT);
+	}			/* if pusing data into text */
+
+      resolve_symbol_value (symbolP);
+
+      /* OK, here is how we decide which symbols go out into the brave
+	 new symtab.  Symbols that do are:
+
+	 * symbols with no name (stabd's?)
+	 * symbols with debug info in their N_TYPE
+
+	 Symbols that don't are:
+	 * symbols that are registers
+	 * symbols with \1 as their 3rd character (numeric labels)
+	 * "local labels" as defined by S_LOCAL_NAME(name) if the -L
+	 switch was passed to gas.
+
+	 All other symbols are output.  We complain if a deleted
+	 symbol was marked external. */
+
+
+      if (!S_IS_REGISTER (symbolP)
+	  && (!S_GET_NAME (symbolP)
+	      || S_IS_DEBUG (symbolP)
+	      || !S_IS_DEFINED (symbolP)
+	      || S_IS_EXTERNAL (symbolP)
+	      || (S_GET_NAME (symbolP)[0] != '\001'
+		  && (flag_keep_locals || !S_LOCAL_NAME (symbolP)))))
+	{
+	  symbolP->sy_number = symbol_number++;
+
+	  /* The + 1 after strlen account for the \0 at the
+			   end of each string */
+	  if (!S_IS_STABD (symbolP))
+	    {
+	      /* Ordinary case. */
+	      symbolP->sy_name_offset = string_byte_count;
+	      string_byte_count += strlen (S_GET_NAME (symbolP)) + 1;
+	    }
+	  else			/* .Stabd case. */
+	    symbolP->sy_name_offset = 0;
+	  symbolPP = &(symbol_next (symbolP));
+	}
+      else
+	{
+	  if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP))
+	    /* This warning should never get triggered any more.
+	       Well, maybe if you're doing twisted things with
+	       register names...  */
+	    {
+	      as_bad ("Local symbol %s never defined.", decode_local_label_name (S_GET_NAME (symbolP)));
+	    }			/* oops. */
+
+	  /* Unhook it from the chain */
+	  *symbolPP = symbol_next (symbolP);
+	}			/* if this symbol should be in the output */
+    }				/* for each symbol */
+
+  H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number);
+}
+
+/*
+ * Find strings by crawling along symbol table chain.
+ */
+
+void
+obj_emit_strings (where)
+     char **where;
+{
+  symbolS *symbolP;
+
+#ifdef CROSS_COMPILE
+  /* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
+  md_number_to_chars (*where, string_byte_count, sizeof (string_byte_count));
+  *where += sizeof (string_byte_count);
+#else /* CROSS_COMPILE */
+  append (where, (char *) &string_byte_count, (unsigned long) sizeof (string_byte_count));
+#endif /* CROSS_COMPILE */
+
+  for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
+    {
+      if (S_GET_NAME (symbolP))
+	append (&next_object_file_charP, S_GET_NAME (symbolP),
+		(unsigned long) (strlen (S_GET_NAME (symbolP)) + 1));
+    }				/* walk symbol chain */
+}
+
+void
+obj_pre_write_hook (headers)
+     object_headers *headers;
+{
+  H_SET_DYNAMIC (headers, 0);
+  H_SET_VERSION (headers, AOUT_VERSION);
+  H_SET_MACHTYPE (headers, AOUT_MACHTYPE);
+  tc_aout_pre_write_hook (headers);
+}
+
+void
+DEFUN_VOID (s_sect)
+{
+  /* Strip out the section name */
+  char *section_name;
+  char *section_name_end;
+  char c;
+
+  unsigned int len;
+  unsigned int exp;
+  char *save;
+
+  section_name = input_line_pointer;
+  c = get_symbol_end ();
+  section_name_end = input_line_pointer;
+
+  len = section_name_end - section_name;
+  input_line_pointer++;
+  save = input_line_pointer;
+
+  SKIP_WHITESPACE ();
+  if (c == ',')
+    {
+      exp = get_absolute_expression ();
+    }
+  else if (*input_line_pointer == ',')
+    {
+      input_line_pointer++;
+      exp = get_absolute_expression ();
+    }
+  else
+    {
+      input_line_pointer = save;
+      exp = 0;
+    }
+  if (exp >= 1000)
+    {
+      as_bad ("subsegment index too high");
+    }
+
+  if (strcmp (section_name, ".text") == 0)
+    {
+      subseg_set (SEG_TEXT, (subsegT) exp);
+    }
+
+  if (strcmp (section_name, ".data") == 0)
+    {
+      if (flag_readonly_data_in_text)
+	subseg_set (SEG_TEXT, (subsegT) exp + 1000);
+      else
+	subseg_set (SEG_DATA, (subsegT) exp);
+    }
+
+  *section_name_end = c;
+}
+
+#endif /* ! BFD_ASSEMBLER */
--- binutils-2.9.1/gas/config/obj-amigahunk.h	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/gas/config/obj-amigahunk.h	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,219 @@
+/* obj-amigahunk.h, AmigaOS object file format for gas, the assembler.
+   Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2,
+   or (at your option) any later version.
+
+   GAS is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with GAS; see the file COPYING.  If not, write
+   to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tag to validate an amiga object file format processing */
+#define OBJ_AMIGAHUNK 1
+
+#include "targ-cpu.h"
+#include "aout_gnu.h"
+
+#ifdef BFD_ASSEMBLER
+
+#include "bfd/libamiga.h"
+
+#define OUTPUT_FLAVOR bfd_target_amiga_flavour
+
+#else /* ! BFD_ASSEMBLER */
+
+extern const short seg_N_TYPE[];
+extern const segT N_TYPE_seg[];
+
+#ifndef DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE
+#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE	(HUNK_UNIT)
+#endif
+
+#endif /* ! BFD_ASSEMBLER */
+
+/* SYMBOL TABLE */
+/* Symbol table macros and constants */
+
+#ifdef BFD_ASSEMBLER
+
+
+#define S_SET_OTHER(S,V)		(amiga_symbol((S)->bsym)->other = (V))
+#define S_SET_TYPE(S,T)			(amiga_symbol((S)->bsym)->type = (T))
+#define S_SET_DESC(S,D)			(amiga_symbol((S)->bsym)->desc = (D))
+#define S_GET_OTHER(S)			(amiga_symbol((S)->bsym)->other)
+#define S_GET_TYPE(S)			(amiga_symbol((S)->bsym)->type)
+#define S_GET_DESC(S)			(amiga_symbol((S)->bsym)->desc)
+
+asection *text_section, *data_section, *bss_section;
+
+#define obj_frob_symbol(S,PUNT)	obj_amiga_frob_symbol (S, &PUNT)
+#define obj_frob_file()		obj_amiga_frob_file ()
+extern void obj_amiga_frob_symbol PARAMS ((struct symbol *, int *));
+extern void obj_amiga_frob_file PARAMS ((void));
+
+#define obj_sec_sym_ok_for_reloc(SEC)	(1)
+
+#else
+
+/* We use the sy_obj field to record whether a symbol is weak.  */
+#define OBJ_SYMFIELD_TYPE char
+
+/*
+ *  Macros to extract information from a symbol table entry.
+ *  This syntaxic indirection allows independence regarding a.out or coff.
+ *  The argument (s) of all these macros is a pointer to a symbol table entry.
+ */
+
+/* True if the symbol is external */
+#define S_IS_EXTERNAL(s)	((s)->sy_symbol.n_type & N_EXT)
+
+/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
+#define S_IS_DEFINED(s)		((S_GET_TYPE(s) != N_UNDF) || (S_GET_OTHER(s) != 0) || (S_GET_DESC(s) != 0))
+
+#define S_IS_REGISTER(s)	((s)->sy_symbol.n_type == N_REGISTER)
+
+/* True if a debug special symbol entry */
+#define S_IS_DEBUG(s)		((s)->sy_symbol.n_type & N_STAB)
+/* True if a symbol is local symbol name */
+/* A symbol name whose name begin with ^A is a gas internal pseudo symbol
+   nameless symbols come from .stab directives. */
+#define S_IS_LOCAL(s)		(S_GET_NAME(s) && \
+				 !S_IS_DEBUG(s) && \
+				 (S_GET_NAME(s)[0] == '\001' || \
+				  (S_LOCAL_NAME(s) && !flag_keep_locals)))
+/* True if a symbol is not defined in this file */
+#define S_IS_EXTERN(s)		((s)->sy_symbol.n_type & N_EXT)
+/* True if the symbol has been generated because of a .stabd directive */
+#define S_IS_STABD(s)		(S_GET_NAME(s) == (char *)0)
+
+/* Accessors */
+/* The name of the symbol */
+#define S_GET_NAME(s)		((s)->sy_symbol.n_un.n_name)
+/* The pointer to the string table */
+#define S_GET_OFFSET(s)		((s)->sy_symbol.n_un.n_strx)
+/* The type of the symbol */
+#define S_GET_TYPE(s)		((s)->sy_symbol.n_type & N_TYPE)
+/* The numeric value of the segment */
+#define S_GET_SEGMENT(s)	(N_TYPE_seg[S_GET_TYPE(s)])
+/* The n_other expression value */
+#define S_GET_OTHER(s)		((s)->sy_symbol.n_other)
+/* The n_desc expression value */
+#define S_GET_DESC(s)		((s)->sy_symbol.n_desc)
+/* Whether the symbol is weak.  */
+#define S_GET_WEAK(s)		((s)->sy_obj)
+
+/* Modifiers */
+/* Assume that a symbol cannot be simultaneously in more than on segment */
+/* set segment */
+#define S_SET_SEGMENT(s,seg)	((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type|=SEGMENT_TO_SYMBOL_TYPE(seg))
+/* The symbol is external */
+#define S_SET_EXTERNAL(s)	((s)->sy_symbol.n_type |= N_EXT)
+/* The symbol is not external */
+#define S_CLEAR_EXTERNAL(s)	((s)->sy_symbol.n_type &= ~N_EXT)
+/* Set the name of the symbol */
+#define S_SET_NAME(s,v)		((s)->sy_symbol.n_un.n_name = (v))
+/* Set the offset in the string table */
+#define S_SET_OFFSET(s,v)	((s)->sy_symbol.n_un.n_strx = (v))
+/* Set the n_type field */
+#define S_SET_TYPE(s,t)		((s)->sy_symbol.n_type = (t))
+/* Set the n_other expression value */
+#define S_SET_OTHER(s,v)	((s)->sy_symbol.n_other = (v))
+/* Set the n_desc expression value */
+#define S_SET_DESC(s,v)		((s)->sy_symbol.n_desc = (v))
+/* Mark the symbol as weak.  This causes n_type to be adjusted when
+   the symbol is written out.  */
+#define S_SET_WEAK(s)		((s)->sy_obj = 1)
+
+/* File header macro and type definition */
+
+#define H_GET_FILE_SIZE(h)	(H_GET_HEADER_SIZE(h) \
+				 + H_GET_TEXT_SIZE(h) \
+				 + H_GET_DATA_SIZE(h) \
+				 + H_GET_SYMBOL_TABLE_SIZE(h) \
+				 + H_GET_TEXT_RELOCATION_SIZE(h) \
+				 + H_GET_DATA_RELOCATION_SIZE(h) \
+				 + H_GET_STRING_SIZE(h))
+
+#define H_GET_HEADER_SIZE(h)		(EXEC_BYTES_SIZE)
+#define H_GET_TEXT_SIZE(h)		((h)->header.a_text)
+#define H_GET_DATA_SIZE(h)		((h)->header.a_data)
+#define H_GET_BSS_SIZE(h)		((h)->header.a_bss)
+#define H_GET_TEXT_RELOCATION_SIZE(h)	((h)->header.a_trsize)
+#define H_GET_DATA_RELOCATION_SIZE(h)	((h)->header.a_drsize)
+#define H_GET_SYMBOL_TABLE_SIZE(h)	((h)->header.a_syms)
+#define H_GET_ENTRY_POINT(h)		((h)->header.a_entry)
+#define H_GET_STRING_SIZE(h)		((h)->string_table_size)
+#define H_GET_LINENO_SIZE(h)		(0)
+
+#define H_GET_DYNAMIC(h)		((h)->header.a_info >> 31)
+#define H_GET_VERSION(h)		(((h)->header.a_info >> 24) & 0x7f)
+#define H_GET_MACHTYPE(h)		(((h)->header.a_info >> 16) & 0xff)
+#define H_GET_MAGIC_NUMBER(h)		((h)->header.a_info & 0xffff)
+
+#define H_SET_DYNAMIC(h,v)		((h)->header.a_info = (((v) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_VERSION(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | ((v) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_MACHTYPE(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | ((v) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_MAGIC_NUMBER(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | ((v))))
+
+#define H_SET_TEXT_SIZE(h,v)		((h)->header.a_text = md_section_align(SEG_TEXT, (v)))
+#define H_SET_DATA_SIZE(h,v)		((h)->header.a_data = md_section_align(SEG_DATA, (v)))
+#define H_SET_BSS_SIZE(h,v)		((h)->header.a_bss = md_section_align(SEG_BSS, (v)))
+
+#define H_SET_RELOCATION_SIZE(h,t,d)	(H_SET_TEXT_RELOCATION_SIZE((h),(t)),\
+					 H_SET_DATA_RELOCATION_SIZE((h),(d)))
+
+#define H_SET_TEXT_RELOCATION_SIZE(h,v)	((h)->header.a_trsize = (v))
+#define H_SET_DATA_RELOCATION_SIZE(h,v)	((h)->header.a_drsize = (v))
+#define H_SET_SYMBOL_TABLE_SIZE(h,v)	((h)->header.a_syms = (v) * 12)
+
+#define H_SET_ENTRY_POINT(h,v)		((h)->header.a_entry = (v))
+#define H_SET_STRING_SIZE(h,v)		((h)->string_table_size = (v))
+
+typedef struct
+  {
+    struct exec header;		/* a.out header */
+    long string_table_size;	/* names + '\0' + sizeof(int) */
+  }
+
+object_headers;
+
+/* line numbering stuff. */
+#define OBJ_EMIT_LINENO(a, b, c)	{;}
+
+struct fix;
+void tc_aout_fix_to_chars PARAMS ((char *where, struct fix *fixP, relax_addressT segment_address));
+
+#endif
+
+#define obj_symbol_new_hook(s)	{;}
+
+#define EMIT_SECTION_SYMBOLS		0
+
+#define AOUT_STABS
+
+
+/* end of obj-aout.h */
--- binutils-2.9.1/gas/config/tc-i386.c	Fri May  1 08:44:41 1998
+++ binutils-2.9.1/gas/config/tc-i386.c	Sun Aug 23 00:00:00 1998
@@ -1807,7 +1807,7 @@ md_assemble (line)
 	else
 	  {
 	    fix_new_exp (frag_now, p - frag_now->fr_literal, size,
-			 i.disps[0], 1, reloc (size, 1, i.disp_reloc[0]));
+			 i.disps[0], 1, reloc (size, 1, i.disp_reloc[0]), 0);
 
 	  }
       }
@@ -1826,7 +1826,7 @@ md_assemble (line)
 	  md_number_to_chars (p + 1, (valueT) i.imms[1]->X_add_number, 4);
 	else
 	  fix_new_exp (frag_now, p + 1 - frag_now->fr_literal, 4,
-		       i.imms[1], 0, BFD_RELOC_32);
+		       i.imms[1], 0, BFD_RELOC_32, 0);
 	if (i.imms[0]->X_op != O_constant)
 	  as_bad ("can't handle non absolute segment in long call/jmp");
 	md_number_to_chars (p + 5, (valueT) i.imms[0]->X_add_number, 2);
@@ -1952,7 +1952,7 @@ md_assemble (line)
 			insn_size += 4;
 			fix_new_exp (frag_now, p - frag_now->fr_literal, 4,
 					    i.disps[n], 0, 
-					    TC_RELOC(i.disp_reloc[n], BFD_RELOC_32));
+					    TC_RELOC(i.disp_reloc[n], BFD_RELOC_32), 0);
 		      }
 		  }
 	      }
@@ -2026,7 +2026,7 @@ md_assemble (line)
 			  }
 #endif
 			fix_new_exp (frag_now, p - frag_now->fr_literal, size,
-				     i.imms[n], pcrel, r_type);
+				     i.imms[n], pcrel, r_type, 0);
 		      }
 		  }
 	      }
@@ -2577,7 +2577,7 @@ md_estimate_size_before_relax (fragP, se
 				     think it does not matter that much, as
 				     this will be right most of the time. ERY*/
 		    S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)?
-		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL);
+		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL, 0);
 	  break;
 
 	default:
@@ -2593,7 +2593,7 @@ md_estimate_size_before_relax (fragP, se
 				     presence of @PLT, but I cannot see how
 				     to get to that from here.  ERY */
 		    S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)?
-		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL);
+		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL, 0);
 	  break;
 	}
       frag_wane (fragP);
@@ -2729,7 +2729,7 @@ md_create_long_jump (ptr, from_addr, to_
       md_number_to_chars (ptr, (valueT) 0xe9, 1);/* opcode for long jmp */
       md_number_to_chars (ptr + 1, (valueT) offset, 4);
       fix_new (frag, (ptr + 1) - frag->fr_literal, 4,
-	       to_symbol, (offsetT) 0, 0, BFD_RELOC_32);
+	       to_symbol, (offsetT) 0, 0, BFD_RELOC_32, 0);
     }
   else
     {
@@ -3064,7 +3064,11 @@ md_section_align (segment, size)
      segT segment;
      valueT size;
 {
-#ifdef OBJ_AOUT
+/* fnf hack - check to see if BFD really should handle this or not.  It is currently
+   not, at least for the BeOS port, and since stdio does not guarantee that holes
+   in files are zero filled, the holes are ending up with random contents.  This
+   really screws things like gcc's bootstrap success/fail testing. */
+#if 1
 #ifdef BFD_ASSEMBLER
   /* For a.out, force the section size to be aligned.  If we don't do
      this, BFD will align it for us, but it will not write out the
--- binutils-2.9.1/gas/config/tc-m68k.c	Fri May  1 08:44:43 1998
+++ binutils-2.9.1/gas/config/tc-m68k.c	Sun Aug 23 00:00:00 1998
@@ -27,6 +27,12 @@
 #include "opcode/m68k.h"
 #include "m68k-parse.h"
 
+/* FIXME: delete this #define as soon as the code that references
+   N_TEXT is changed */
+#ifdef BFD_ASSEMBLER
+#define N_TEXT 4
+#endif
+
 /* This string holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  The macro
    tc_comment_chars points to this.  We use this, rather than the
@@ -70,6 +76,7 @@ int flag_want_pic;
 
 static int flag_short_refs;	/* -l option */
 static int flag_long_jumps;	/* -S option */
+static int flag_small_code;	/* -sc option */
 
 #ifdef REGISTER_PREFIX_OPTIONAL
 int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
@@ -156,6 +163,9 @@ static struct obstack robyn;
 /* Mode AINDX (apc-relative) using PC, with variable target, might fit
    in 16 or 8 bits.  */
 #define PCINDEX		7
+/* AmigaOS relocations */
+#define ABSREL		8
+#define IMMREL		9
 
 struct m68k_incant
   {
@@ -243,6 +253,7 @@ struct m68k_it
 	 so, which.  */
       enum pic_relocation pic_reloc;
 #endif
+      char baserel;
     }
   reloc[5];			/* Five is enough??? */
 };
@@ -268,7 +279,7 @@ static struct m68k_it the_ins;	/* the in
 /* Static functions.  */
 
 static void insop PARAMS ((int, const struct m68k_incant *));
-static void add_fix PARAMS ((int, struct m68k_exp *, int, int));
+static void add_fix PARAMS ((int, struct m68k_exp *, int, int, int));
 static void add_frag PARAMS ((symbolS *, offsetT, int));
 
 /* Like addword, but goes BEFORE general operands */
@@ -291,11 +302,12 @@ insop (w, opcode)
 /* The numo+1 kludge is so we can hit the low order byte of the prev word.
    Blecch.  */
 static void
-add_fix (width, exp, pc_rel, pc_fix)
+add_fix (width, exp, pc_rel, pc_fix, base_rel)
      int width;
      struct m68k_exp *exp;
      int pc_rel;
      int pc_fix;
+     int base_rel;
 {
   the_ins.reloc[the_ins.nrel].n = ((width == 'B' || width == '3')
 				   ? (the_ins.numo*2-1)
@@ -308,7 +320,8 @@ add_fix (width, exp, pc_rel, pc_fix)
 #ifdef OBJ_ELF
   the_ins.reloc[the_ins.nrel].pic_reloc = exp->pic_reloc;
 #endif
-  the_ins.reloc[the_ins.nrel++].pcrel = pc_rel;
+  the_ins.reloc[the_ins.nrel].pcrel = pc_rel;
+  the_ins.reloc[the_ins.nrel++].baserel = base_rel;
 }
 
 /* Cause an extra frag to be generated here, inserting up to 10 bytes
@@ -425,6 +438,15 @@ static const int n_archs = sizeof (archs
 /* BCC68000 is for patching in an extra jmp instruction for long offsets
    on the 68000.  The 68000 doesn't support long branches with branchs */
 
+/* ABSREL (nice name;-)) is used in small-code, it might be 
+ * implemented base-relative (a4), pc-relative, or base-rel with an extra
+ * add instruction to add the base-register
+ *
+ * IMMREL is the analogous mode for immediate addressing of variables. This
+ * one can lead into situations, where a replacement is not possible:
+ * addl #foo,a0
+ * can't be made pc-relative, if foo is in the text segment */
+
 /* This table desribes how you change sizes for the various types of variable
    size expressions.  This version only supports two kinds. */
 
@@ -479,6 +501,17 @@ relax_typeS md_relax_table[] =
   {32765, -32770, 2, TAB (PCINDEX, LONG)},
   {0, 0, 4, 0},
   {1, 1, 0, 0},
+
+  {127, -128, 0, 0},
+  {32767, -32768, 2, TAB(ABSREL,LONG)},
+  {0, 0, 6, 0},
+  {1, 1, 0, 0},
+
+  {127, -128, 0, 0},
+  {32767, -32768, 2, TAB(IMMREL,LONG)},
+  {0, 0, 6, 0},
+  {1, 1, 0, 0},
+
 };
 
 /* These are the machine dependent pseudo-ops.  These are included so
@@ -500,12 +533,14 @@ const pseudo_typeS md_pseudo_table[] =
   {"even", s_even, 0},
   {"skip", s_space, 0},
   {"proc", s_proc, 0},
+#ifndef __amigaos__
 #if defined (TE_SUN3) || defined (OBJ_ELF)
   {"align", s_align_bytes, 0},
 #endif
 #ifdef OBJ_ELF
   {"swbeg", s_ignore, 0},
 #endif
+#endif
   {"extend", float_cons, 'x'},
   {"ldouble", float_cons, 'x'},
 
@@ -1820,7 +1855,20 @@ m68k_ip (instring)
 	      else
 		nextword = get_num (&opP->disp, 0);
 	      if (isvar (&opP->disp))
-		add_fix (s[1], &opP->disp, 0, 0);
+	        {
+/* This doesn't work when the symbol is N_UNDF! So we ignore this for the moment.
+
+	          if (flag_small_code)
+	            {
+	              add_frag (adds(&opP->disp),
+	      		        offs(&opP->disp),
+	      		        TAB(IMMREL, SZ_UNDEF));
+	      	      break;
+	            }
+	          else
+*/
+		    add_fix(s[1], &opP->disp, 0, 0, opP->disp.baserel);
+	        }
 	      switch (s[1])
 		{
 		case 'b':
@@ -1980,7 +2028,7 @@ m68k_ip (instring)
 			      )
 			    {
 			      addword (0x0170);
-			      add_fix ('l', &opP->disp, 1, 2);
+			      add_fix ('l', &opP->disp, 1, 2, opP->disp.baserel);
 			    }
 			  else
 			    {
@@ -1993,7 +2041,7 @@ m68k_ip (instring)
 		      else
 			{
 			  addword (0x0170);
-			  add_fix ('l', &opP->disp, 0, 0);
+			  add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 			}
 		    }
 		  else
@@ -2011,10 +2059,10 @@ m68k_ip (instring)
 		    {
 		      if (opP->reg == PC)
 			{
-			  add_fix ('w', &opP->disp, 1, 0);
+			  add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 			}
 		      else
-			add_fix ('w', &opP->disp, 0, 0);
+			add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
 		    }
 		}
 	      addword (nextword);
@@ -2119,9 +2167,9 @@ m68k_ip (instring)
 				 fit (possible on m68000) let the
 				 fixup processing complain later.  */
 			      if (opP->reg == PC)
-				add_fix ('B', &opP->disp, 1, 1);
+				add_fix ('B', &opP->disp, 1, 1, 0);	/* FIXME? -fnf */
 			      else
-				add_fix ('B', &opP->disp, 0, 0);
+				add_fix ('B', &opP->disp, 0, 0, 0);	/* FIXME? -fnf */
 			    }
 			  else if (siz1 != SIZE_BYTE)
 			    {
@@ -2251,9 +2299,9 @@ m68k_ip (instring)
 	      if (siz1 != SIZE_UNSPEC && isvar (&opP->disp))
 		{
 		  if (opP->reg == PC || opP->reg == ZPC)
-		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2);
+		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2, opP->disp.baserel);
 		  else
-		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0);
+		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0, opP->disp.baserel);
 		}
 	      if (siz1 == SIZE_LONG)
 		addword (baseo >> 16);
@@ -2261,7 +2309,7 @@ m68k_ip (instring)
 		addword (baseo);
 
 	      if (siz2 != SIZE_UNSPEC && isvar (&opP->odisp))
-		add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0);
+		add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0, opP->disp.baserel);
 	      if (siz2 == SIZE_LONG)
 		addword (outro >> 16);
 	      if (siz2 != SIZE_UNSPEC)
@@ -2293,7 +2341,7 @@ m68k_ip (instring)
 		      && opP->disp.pic_reloc == pic_none
 #endif
 		      && S_GET_SEGMENT (adds (&opP->disp)) == now_seg
-		      && HAVE_LONG_BRANCH(current_architecture)
+		      && (HAVE_LONG_BRANCH(current_architecture) || flag_small_code)
 		      && !flag_long_jumps
 		      && !strchr ("~%&$?", s[0]))
 		    {
@@ -2305,8 +2353,20 @@ m68k_ip (instring)
 		    }
 		  /* Fall through into long */
 		case SIZE_LONG:
+#if 0
+        /* This doesn't work when the symbol is N_UNDF! We ignore this for now. */
+
+		  if (flag_small_code)
+		    {
+		      tmpreg=0x3A; /* 7.2 */
+		      add_frag (adds(&opP->disp),
+			        offs(&opP->disp),
+				TAB(ABSREL, SZ_UNDEF));
+		      break;
+		    }
+#endif
 		  if (isvar (&opP->disp))
-		    add_fix ('l', &opP->disp, 0, 0);
+		    add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 
 		  tmpreg = 0x39;/* 7.1 mode */
 		  addword (nextword >> 16);
@@ -2318,7 +2378,7 @@ m68k_ip (instring)
 		  /* Fall through.  */
 		case SIZE_WORD:	/* Word */
 		  if (isvar (&opP->disp))
-		    add_fix ('w', &opP->disp, 0, 0);
+		    add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
 
 		  tmpreg = 0x38;/* 7.0 mode */
 		  addword (nextword);
@@ -2354,7 +2414,7 @@ m68k_ip (instring)
 	    }
 	  tmpreg = get_num (&opP->disp, tmpreg);
 	  if (isvar (&opP->disp))
-	    add_fix (s[1], &opP->disp, 0, 0);
+	    add_fix (s[1], &opP->disp, 0, 0, opP->disp.baserel);
 	  switch (s[1])
 	    {
 	    case 'b':		/* Danger:  These do no check for
@@ -2423,10 +2483,10 @@ m68k_ip (instring)
                  which is a char, and may therefore be unsigned.  We
                  want to pass -1, but we pass 64 instead, and convert
                  back in md_pcrel_from.  */
-	      add_fix ('B', &opP->disp, 1, 64);
+	      add_fix ('B', &opP->disp, 1, 64, opP->disp.baserel);
 	      break;
 	    case 'W':
-	      add_fix ('w', &opP->disp, 1, 0);
+	      add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      break;
 	    case 'L':
@@ -2434,7 +2494,7 @@ m68k_ip (instring)
 	      if (!HAVE_LONG_BRANCH(current_architecture))
 		as_warn ("Can't use long branches on 68000/68010/5200");
 	      the_ins.opcode[the_ins.numo - 1] |= 0xff;
-	      add_fix ('l', &opP->disp, 1, 0);
+	      add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      addword (0);
 	      break;
@@ -2479,19 +2539,19 @@ m68k_ip (instring)
 		      break;
 		    }
 #endif
-		  add_fix ('w', &opP->disp, 1, 0);
+		  add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 		}
 	      addword (0);
 	      break;
 	    case 'C':		/* Fixed size LONG coproc branches */
-	      add_fix ('l', &opP->disp, 1, 0);
+	      add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      addword (0);
 	      break;
 	    case 'c':		/* Var size Coprocesssor branches */
 	      if (subs (&opP->disp))
 		{
-		  add_fix ('l', &opP->disp, 1, 0);
+		  add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 		  add_frag ((symbolS *) 0, (offsetT) 0, TAB (FBRANCH, LONG));
 		}
 	      else if (adds (&opP->disp))
@@ -2502,7 +2562,7 @@ m68k_ip (instring)
 		  /* add_frag ((symbolS *) 0, offs (&opP->disp),
 		     	       TAB(FBRANCH,SHORT)); */
 		  the_ins.opcode[the_ins.numo - 1] |= 0x40;
-		  add_fix ('l', &opP->disp, 1, 0);
+		  add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 		  addword (0);
 		  addword (0);
 		}
@@ -2856,7 +2916,7 @@ m68k_ip (instring)
 	  break;
 	case '_':	/* used only for move16 absolute 32-bit address */
 	  if (isvar (&opP->disp))
-	    add_fix ('l', &opP->disp, 0, 0);
+	    add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 	  tmpreg = get_num (&opP->disp, 80);
 	  addword (tmpreg >> 16);
 	  addword (tmpreg & 0xFFFF);
@@ -3162,8 +3222,8 @@ static const struct init_entry init_tabl
   { "a3", ADDR3 },
   { "a4", ADDR4 },
   { "a5", ADDR5 },
+  { "fp", ADDR5 },
   { "a6", ADDR6 },
-  { "fp", ADDR6 },
   { "a7", ADDR7 },
   { "sp", ADDR7 },
   { "ssp", ADDR7 },
@@ -3439,7 +3499,8 @@ md_assemble (str)
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
 			      get_reloc_code (n, the_ins.reloc[m].pcrel,
-					      the_ins.reloc[m].pic_reloc));
+					      the_ins.reloc[m].pic_reloc),
+			      the_ins.reloc[m].baserel);
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	  if (the_ins.reloc[m].wid == 'B')
 	    fixP->fx_signed = 1;
@@ -3486,7 +3547,8 @@ md_assemble (str)
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
 			      get_reloc_code (wid, the_ins.reloc[m].pcrel,
-					      the_ins.reloc[m].pic_reloc));
+					      the_ins.reloc[m].pic_reloc),
+			      the_ins.reloc[m].baserel);
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	}
       (void) frag_var (rs_machine_dependent, 10, 0,
@@ -3523,7 +3585,8 @@ md_assemble (str)
 			  &the_ins.reloc[m].exp,
 			  the_ins.reloc[m].pcrel,
 			  get_reloc_code (wid, the_ins.reloc[m].pcrel,
-					  the_ins.reloc[m].pic_reloc));
+					  the_ins.reloc[m].pic_reloc),
+			  the_ins.reloc[m].baserel);
       fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
     }
 }
@@ -4146,7 +4209,11 @@ md_convert_frag_1 (fragP)
     case TAB (ABRANCH, LONG):
       if (!HAVE_LONG_BRANCH(current_architecture))
 	{
-	  if (fragP->fr_opcode[0] == 0x61)
+          if (flag_small_code)
+            {
+              as_bad("Long branch in small code model, not supported.");
+            }
+          else if (fragP->fr_opcode[0] == 0x61)
 	    /* BSR */
 	    {
 	      fragP->fr_opcode[0] = 0x4E;
@@ -4158,7 +4225,7 @@ md_convert_frag_1 (fragP)
 		       fragP->fr_symbol,
 		       fragP->fr_offset,
 		       0,
-		       NO_RELOC);
+		       NO_RELOC, 0);
 
 	      fragP->fr_fix += 4;
 	      ext = 0;
@@ -4169,7 +4236,7 @@ md_convert_frag_1 (fragP)
 	      fragP->fr_opcode[0] = 0x4E;
 	      fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
 	      fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		       fragP->fr_offset, 0, NO_RELOC);
+		       fragP->fr_offset, 0, NO_RELOC, 0);
 	      fragP->fr_fix += 4;
 	      ext = 0;
 	    }
@@ -4197,7 +4264,7 @@ md_convert_frag_1 (fragP)
       *buffer_address++ = (char) 0xf9;
       fragP->fr_fix += 2;	/* account for jmp instruction */
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-	       fragP->fr_offset, 0, NO_RELOC);
+	       fragP->fr_offset, 0, NO_RELOC, 0);
       fragP->fr_fix += 4;
       ext = 0;
       break;
@@ -4214,7 +4281,7 @@ md_convert_frag_1 (fragP)
 
       fragP->fr_fix += 6;	/* account for bra/jmp instructions */
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-	       fragP->fr_offset, 0, NO_RELOC);
+	       fragP->fr_offset, 0, NO_RELOC, 0);
       fragP->fr_fix += 4;
       ext = 0;
       break;
@@ -4233,8 +4300,10 @@ md_convert_frag_1 (fragP)
       /* The thing to do here is force it to ABSOLUTE LONG, since
 	PCREL is really trying to shorten an ABSOLUTE address anyway */
       /* JF FOO This code has not been tested */
+      if (flag_small_code)
+        as_bad ("Trying to force a pcrel thing into absolute mode while in small code mode");
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
-	       0, NO_RELOC);
+	       0, NO_RELOC, 0);
       if ((fragP->fr_opcode[1] & 0x3F) != 0x3A)
 	as_bad ("Internal error (long PC-relative operand) for insn 0x%04x at 0x%lx",
 		(unsigned) fragP->fr_opcode[0],
@@ -4246,14 +4315,14 @@ md_convert_frag_1 (fragP)
       break;
     case TAB (PCLEA, SHORT):
       fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
-	       fragP->fr_offset, 1, NO_RELOC);
+	       fragP->fr_offset, 1, NO_RELOC, 0);
       fragP->fr_opcode[1] &= ~0x3F;
       fragP->fr_opcode[1] |= 0x3A; /* 072 - mode 7.2 */
       ext = 2;
       break;
     case TAB (PCLEA, LONG):
       fixP = fix_new (fragP, (int) (fragP->fr_fix) + 2, 4, fragP->fr_symbol,
-		      fragP->fr_offset, 1, NO_RELOC);
+		      fragP->fr_offset, 1, NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       /* Already set to mode 7.3; this indicates: PC indirect with
 	 suppressed index, 32-bit displacement.  */
@@ -4283,7 +4352,7 @@ md_convert_frag_1 (fragP)
       buffer_address[-1] = 0x20;
       fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
 		      fragP->fr_offset, (fragP->fr_opcode[1] & 077) == 073,
-		      NO_RELOC);
+		      NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       ext = 2;
       break;
@@ -4291,13 +4360,89 @@ md_convert_frag_1 (fragP)
       disp += 2;
       fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
 		      fragP->fr_offset, (fragP->fr_opcode[1] & 077) == 073,
-		      NO_RELOC);
+		      NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       assert (fragP->fr_fix >= 2);
       buffer_address[-2] |= 0x1;
       buffer_address[-1] = 0x30;
       ext = 4;
       break;
+    case TAB(ABSREL,BYTE):
+      as_bad ("ABSREL_BYTE: how the ** does this look ?? \n");
+      break;
+    case TAB(ABSREL,SHORT):
+      subseg_change (text_section, 0);
+      ext = 2;
+      fragP->fr_opcode[1] &= ~0x3f;
+      if ((S_GET_TYPE (fragP->fr_symbol)) == N_TEXT)
+        {
+          /* so this is really a pc-relative address */
+          fragP->fr_opcode[1] |=  0x3a;
+          fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol, fragP->fr_offset+2, 1, NO_RELOC, 0);
+  	break;
+        }
+      /* in that case we have to generate base-relative code
+       * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
+       *        will have to do the final patch in that case) */
+      fragP->fr_opcode[1] |=  0x2c;  /* (a4) */
+      fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol,fragP->fr_offset, 0, NO_RELOC, 1);
+      break;
+    case TAB(ABSREL,LONG):
+      as_bad ("ABSREL_LONG: sorry, not supported.\n");
+      break;
+  
+    case TAB(IMMREL,BYTE):
+      as_bad ("IMMREL_BYTE: how the ** does this look ?? \n");
+      break;
+    case TAB(IMMREL,SHORT):
+      subseg_change (text_section, 0);
+      ext = 0; 
+      if ((S_GET_TYPE (fragP->fr_symbol)) == N_TEXT)
+        {
+  	/* we can only fix operations on data registers, not on <ea> */
+ 	if ((fragP->fr_opcode[1] & 0x38) != 0)
+   	  {
+  	    /* use the normal reloc32, sigh... */
+  	    fix_new (fragP,(int)(fragP->fr_fix),4,fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+  	    fragP->fr_fix += 4;
+  	    break;
+  	  }
+  
+          /* so this is really a pc-relative address
+           * What we have to do now is a VERY UGLY AND BIG KLUDGE. Basically do the
+           * following thing:
+           *   turn
+           *     addl #foo,d0      (foo is N_TEXT)
+           *   into
+           *     pea  foo(pc)
+           *     addl (sp)+,d0
+           */
+          *buffer_address++ = fragP->fr_opcode[0]; /* save the original command */
+  	*buffer_address++ = fragP->fr_opcode[1];
+          fragP->fr_opcode[0] = 0x48; 	/* PEA */
+          fragP->fr_opcode[1] = 0x7a;
+          fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol, fragP->fr_offset+2, 1, NO_RELOC, 0);
+  	
+          *buffer_address++ = 0x9f;	/* sp@+ */
+  	fragP->fr_fix += 4;	/* two byte fix, two byte code extension */
+  	break;
+        }
+      /* in that case we have to generate base-relative code
+       * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
+       *        will have to do the final patch in that case) */
+  
+      /* analogous (more or less;-)) to above, the following conversion is done
+       *   turn
+       *     addl #bar,d0		(bar is N_DATA)
+       *   into
+       *	   addl #<bar>,d0	where <bar> is a baserel-reloc
+       *     addl a4,d0
+       */
+   
+      fix_new(fragP,(int)(fragP->fr_fix), 4,fragP->fr_symbol,fragP->fr_offset, 0, NO_RELOC, 1);
+      *buffer_address++ = 0xd0;
+      *buffer_address++ = 0x8c;
+      break;
     }
 
   if (ext)
@@ -4355,26 +4500,68 @@ md_estimate_size_before_relax (fragP, se
 	    fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE);
 	    break;
 	  }
-	else if ((fragP->fr_symbol == 0) || !HAVE_LONG_BRANCH(current_architecture))
+	else if ((fragP->fr_symbol == 0) || !HAVE_LONG_BRANCH(current_architecture) || !flag_small_code)
 	  {
 	    /* On 68000, or for absolute value, switch to abs long */
 	    /* FIXME, we should check abs val, pick short or long */
-	    if (fragP->fr_opcode[0] == 0x61)
+            if (fragP->fr_opcode[0] == 0x61)
 	      {
-		fragP->fr_opcode[0] = 0x4E;
-		fragP->fr_opcode[1] = (char) 0xB9; /* JBSR with ABSL LONG offset */
-		fix_new (fragP, fragP->fr_fix, 4,
-			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
-		fragP->fr_fix += 4;
+		if (flag_small_code)
+		  {
+		    /* leave the BSR, no need to change
+		     * it into a JSR (PC,..) */
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		    fragP->fr_opcode[1]=0x00;
+	          }
+	        else if (flag_short_refs)
+	          {
+		    subseg_change(text_section, 0);
+		    fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol,
+			    fragP->fr_offset + 2, 0, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		    fragP->fr_opcode[1]=0x00;
+		  }
+		else
+		  {
+		    fragP->fr_opcode[0] = 0x4E;
+		    fragP->fr_opcode[1] = (char) 0xB9; /* JBSR with ABSL LONG offset */
+		    subseg_change (text_section, 0);
+		    fix_new (fragP, fragP->fr_fix, 4,
+			     fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+		    fragP->fr_fix += 4;
+		  }
 		frag_wane (fragP);
 	      }
 	    else if (fragP->fr_opcode[0] == 0x60)
 	      {
-		fragP->fr_opcode[0] = 0x4E;
-		fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
-		fix_new (fragP, fragP->fr_fix, 4,
-			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
-		fragP->fr_fix += 4;
+		if (flag_small_code)
+  		  {
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
+	  	    fragP->fr_fix+=2;
+		  }
+                else if (flag_short_refs)
+                  {
+		    fragP->fr_opcode[0]= 0x4E;
+		    fragP->fr_opcode[1]= 0xF8;	/* JMP	with ABSL WORD offset */
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		  }
+		else
+		  {
+		    fragP->fr_opcode[0] = 0x4E;
+		    fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
+		    subseg_change (text_section, 0);
+		    fix_new (fragP, fragP->fr_fix, 4,
+			     fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+		    fragP->fr_fix += 4;
+		  }
 		frag_wane (fragP);
 	      }
 	    else
@@ -4385,7 +4572,7 @@ md_estimate_size_before_relax (fragP, se
 	else
 	  {			/* Symbol is still undefined.  Make it simple */
 	    fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
-		     fragP->fr_offset, 1, NO_RELOC);
+		     fragP->fr_offset, 1, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	    fragP->fr_opcode[1] = (char) 0xff;
 	    frag_wane (fragP);
@@ -4405,7 +4592,7 @@ md_estimate_size_before_relax (fragP, se
 	else
 	  {
 	    fix_new (fragP, (int) fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 1, NO_RELOC);
+		     fragP->fr_offset, 1, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	    fragP->fr_opcode[1] |= 0x40; /* Turn on LONG bit */
 	    frag_wane (fragP);
@@ -4450,7 +4637,7 @@ md_estimate_size_before_relax (fragP, se
 	    buffer_address[1] = (char) 0xf8;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 2;
 	  }
 	else
@@ -4461,7 +4648,7 @@ md_estimate_size_before_relax (fragP, se
 	    buffer_address[1] = (char) 0xf9;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	  }
 	frag_wane (fragP);
@@ -4491,7 +4678,7 @@ md_estimate_size_before_relax (fragP, se
 	    buffer_address[5] = (char) 0xf8;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 2;
 	  }
 	else
@@ -4502,7 +4689,7 @@ md_estimate_size_before_relax (fragP, se
 	    buffer_address[5] = (char) 0xf9;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	  }
 
@@ -4542,6 +4729,16 @@ md_estimate_size_before_relax (fragP, se
 	}
       break;
 
+    case TAB(ABSREL,SZ_UNDEF):
+	if ((S_GET_SEGMENT (fragP->fr_symbol)) == segment || flag_short_refs || flag_small_code) {
+		fragP->fr_subtype = TAB(ABSREL, SHORT);
+		fragP->fr_var += 2;
+	} else {
+		fragP->fr_subtype = TAB(ABSREL, LONG);
+		fragP->fr_var += 6;
+	}
+      break;
+
     default:
       break;
     }
@@ -4604,7 +4801,7 @@ md_ri_to_chars (the_bytes, ri)
   the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff;
   the_bytes[6] = ri->r_symbolnum & 0x0ff;
   the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) |
-		  ((ri->r_extern << 4) & 0x10));
+		  ((ri->r_extern << 4) & 0x10) | ((ri->r_baserel << 3) & 0x08));
 }
 
 #endif /* comment */
@@ -4638,7 +4835,7 @@ tc_aout_fix_to_chars (where, fixP, segme
   where[5] = (r_symbolnum >> 8) & 0x0ff;
   where[6] = r_symbolnum & 0x0ff;
   where[7] = (((fixP->fx_pcrel << 7) & 0x80) | ((nbytes_r_length[fixP->fx_size] << 5) & 0x60) |
-	      (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10));
+	      (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10) | ((fixP->tc_fix_data << 3) & 0x08));
 }
 #endif
 
@@ -4678,7 +4875,7 @@ md_create_long_jump (ptr, from_addr, to_
       md_number_to_chars (ptr, (valueT) 0x4EF9, 2);
       md_number_to_chars (ptr + 2, (valueT) offset, 4);
       fix_new (frag, (ptr + 2) - frag->fr_literal, 4, to_symbol, (offsetT) 0,
-	       0, NO_RELOC);
+	       0, NO_RELOC, 0);
     }
   else
     {
@@ -6549,7 +6746,7 @@ s_mri_endw (ignore)
 #ifdef OBJ_ELF
 CONST char *md_shortopts = "lSA:m:kQ:V";
 #else
-CONST char *md_shortopts = "lSA:m:k";
+CONST char *md_shortopts = "SA:m:s:k";
 #endif
 
 struct option md_longopts[] = {
@@ -6589,6 +6786,13 @@ md_parse_option (c, arg)
       flag_long_jumps = 1;
       break;
 
+    case 's':
+      if (!strcmp(arg, "c") || !strcmp(arg, "mallcode"))
+        flag_small_code = 1;
+      else
+        return 0;
+      break;
+      
     case 'A':
       if (*arg == 'm')
  	arg++;
@@ -6731,7 +6935,6 @@ md_show_usage (stream)
 {
   fprintf(stream, "\
 680X0 options:\n\
--l			use 1 word for refs to undefined symbols [default 2]\n\
 -m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060\n\
  | -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -m68360\n\
  | -mcpu32 | -m5200\n\
@@ -6745,6 +6948,7 @@ md_show_usage (stream)
 			[default yes for 68020 and up]\n\
 -pic, -k		generate position independent code\n\
 -S			turn jbsr into jsr\n\
+-smallcode, -sc		small code model\n\
 --register-prefix-optional\n\
 			recognize register names without prefix character\n\
 --bitwise-or		do not treat `|' as a comment character\n");
--- binutils-2.9.1/gas/config/tc-m68k.h	Fri May  1 08:44:43 1998
+++ binutils-2.9.1/gas/config/tc-m68k.h	Sun Aug 23 00:00:00 1998
@@ -35,6 +35,9 @@ struct fix;
 #ifdef TE_NetBSD
 #define TARGET_FORMAT "a.out-m68k-netbsd"
 #endif
+#ifdef TE_AMIGA
+#define TARGET_FORMAT "a.out-amiga"
+#endif
 #ifdef TE_LINUX
 #define TARGET_FORMAT "a.out-m68k-linux"
 #endif
@@ -43,6 +46,10 @@ struct fix;
 #endif
 #endif
 
+#ifdef OBJ_AMIGAHUNK
+#define TARGET_FORMAT "amiga"
+#endif
+
 #ifdef OBJ_ELF
 #define TARGET_FORMAT "elf32-m68k"
 #endif
@@ -74,13 +81,10 @@ struct fix;
 #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP)
 #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag)
 extern int tc_coff_sizemachdep PARAMS ((struct frag *));
-#ifdef TE_SUN3
 /* This variable contains the value to write out at the beginning of
-   the a.out file.  The 2<<16 means that this is a 68020 file instead
    of an old-style 68000 file */
 
-#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC);	/* Magic byte for file header */
-#endif /* TE_SUN3 */
+#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (OMAGIC);	/* Magic byte for file header */
 
 #ifndef AOUT_MACHTYPE
 #define AOUT_MACHTYPE m68k_aout_machtype
@@ -200,6 +204,9 @@ extern int m68k_parse_long_option PARAMS
 
 extern struct relax_type md_relax_table[];
 #define TC_GENERIC_RELAX_TABLE md_relax_table
+
+#define TC_FIX_TYPE char
+#define TC_INIT_FIX_DATA(p)
 
 /* Copied from write.c */
 /* This was formerly called M68K_AIM_KLUDGE.  */
--- binutils-2.9.1/gas/config/tc-ppc.c	Fri May  1 08:44:45 1998
+++ binutils-2.9.1/gas/config/tc-ppc.c	Sun Aug 23 00:00:00 1998
@@ -1278,7 +1278,7 @@ ppc_elf_cons (nbytes)
 	      register char *p = frag_more ((int) nbytes);
 	      int offset = nbytes - size;
 
-	      fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc);
+	      fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc, 0);
 	    }
 	}
       else
@@ -1656,7 +1656,7 @@ md_assemble (str)
 	  /* If there are fewer operands in the line then are called
 	     for by the instruction, we want to skip the optional
 	     operand.  */
-	  if (opcount < strlen (opcode->operands))
+	  if (opcount < strlen ((const char *) opcode->operands))
 	    skip_optional = 1;
 
 	  break;
@@ -2000,7 +2000,7 @@ md_assemble (str)
 
 	  fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, size,
 			      &fixups[i].exp, reloc_howto->pc_relative,
-			      fixups[i].reloc);
+			      fixups[i].reloc, 0);
 
 	  /* Turn off complaints that the addend is too large for things like
 	     foo+100000@ha.  */
@@ -2022,7 +2022,7 @@ md_assemble (str)
 		     &fixups[i].exp,
 		     (operand->flags & PPC_OPERAND_RELATIVE) != 0,
 		     ((bfd_reloc_code_real_type)
-		       (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+		       (fixups[i].opindex + (int) BFD_RELOC_UNUSED)),0);
     }
 }
 
--- binutils-2.9.1/gas/config/tc-ppc.h	Fri May  1 08:44:45 1998
+++ binutils-2.9.1/gas/config/tc-ppc.h	Sun Aug 23 00:00:00 1998
@@ -60,6 +60,11 @@ extern int target_big_endian;
 #endif
 #endif
 
+/* This is used by the Amiga to produce sun3 style a.out objects */
+#if defined(OBJ_AOUT) && defined(TE_SUN3) && 0
+#define TARGET_FORMAT "a.out-amiga"
+#endif
+
 /* PowerMac has a BFD slightly different from AIX's.  */
 #ifdef TE_POWERMAC
 #ifdef TARGET_FORMAT
--- binutils-2.9.1/gas/config/tc-sh.c	Fri May  1 08:44:45 1998
+++ binutils-2.9.1/gas/config/tc-sh.c	Sun Aug 23 00:00:00 1998
@@ -853,7 +853,7 @@ insert (where, how, pcrel)
 	       2,
 	       &immediate,
 	       pcrel,
-	       how);
+	       how, 0);
 }
 
 static void
@@ -1020,7 +1020,7 @@ md_assemble (str)
       /* Output a CODE reloc to tell the linker that the following
          bytes are instructions, not data.  */
       fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
-	       BFD_RELOC_SH_CODE);
+	       BFD_RELOC_SH_CODE, 0);
       seg_info (now_seg)->tc_segment_info_data.in_code = 1;
     }
 
@@ -1072,7 +1072,7 @@ sh_frob_label ()
       if (frag_now != last_label_frag
 	  || offset != last_label_offset)
 	{	
-	  fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, BFD_RELOC_SH_LABEL);
+	  fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, BFD_RELOC_SH_LABEL, 0);
 	  last_label_frag = frag_now;
 	  last_label_offset = offset;
 	}
@@ -1089,7 +1089,7 @@ sh_flush_pending_output ()
       && seg_info (now_seg)->tc_segment_info_data.in_code)
     {
       fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
-	       BFD_RELOC_SH_DATA);
+	       BFD_RELOC_SH_DATA, 0);
       seg_info (now_seg)->tc_segment_info_data.in_code = 0;
     }
 }
@@ -1202,7 +1202,7 @@ s_uses (ignore)
       return;
     }
 
-  fix_new_exp (frag_now, frag_now_fix (), 2, &ex, 1, BFD_RELOC_SH_USES);
+  fix_new_exp (frag_now, frag_now_fix (), 2, &ex, 1, BFD_RELOC_SH_USES, 0);
 
   demand_empty_rest_of_line ();
 }
@@ -1440,7 +1440,7 @@ sh_frob_section (abfd, sec, ignore)
 	 fragment address, so we undo that adjustment here.  */
       subseg_change (sec, 0);
       fix_new (sym->sy_frag, S_GET_VALUE (sym) - sym->sy_frag->fr_address,
-	       4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT);
+	       4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT, 0);
     }
 }
 
@@ -1492,7 +1492,7 @@ md_convert_frag (headers, seg, fragP)
     case C (COND_JUMP, COND8):
       subseg_change (seg, 0);
       fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
-	       1, BFD_RELOC_SH_PCDISP8BY2);
+	       1, BFD_RELOC_SH_PCDISP8BY2, 0);
       fragP->fr_fix += 2;
       fragP->fr_var = 0;
       break;
@@ -1500,7 +1500,7 @@ md_convert_frag (headers, seg, fragP)
     case C (UNCOND_JUMP, UNCOND12):
       subseg_change (seg, 0);
       fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
-	       1, BFD_RELOC_SH_PCDISP12BY2);
+	       1, BFD_RELOC_SH_PCDISP12BY2, 0);
       fragP->fr_fix += 2;
       fragP->fr_var = 0;
       break;
@@ -1578,13 +1578,13 @@ md_convert_frag (headers, seg, fragP)
 		 seg_info (seg)->dot,
 #endif
 		 fragP->fr_address + fragP->fr_fix + 6,
-		 1, BFD_RELOC_SH_PCDISP8BY2);
+		 1, BFD_RELOC_SH_PCDISP8BY2, 0);
 
 	/* Set up a jump instruction.  */
 	buffer[highbyte + 2] = 0xa0;
 	buffer[lowbyte + 2] = 0;
 	fix_new (fragP, fragP->fr_fix + 2, 2, fragP->fr_symbol,
-		 fragP->fr_offset, 1, BFD_RELOC_SH_PCDISP12BY2);
+		 fragP->fr_offset, 1, BFD_RELOC_SH_PCDISP12BY2, 0);
 
 	/* Fill in a NOP instruction.  */
 	buffer[highbyte + 4] = 0x0;
@@ -1755,7 +1755,7 @@ sh_handle_align (frag)
       && frag->fr_offset > 1
       && now_seg != bss_section)
     fix_new (frag, frag->fr_fix, 2, &abs_symbol, frag->fr_offset, 0,
-	     BFD_RELOC_SH_ALIGN);
+	     BFD_RELOC_SH_ALIGN, 0);
 
   if (frag->fr_type == rs_align_code
       && frag->fr_next->fr_address - frag->fr_address - frag->fr_fix != 0)
@@ -2115,9 +2115,9 @@ sh_do_align (n, fill, len, max)
          .byte.  */
       frag_align (1, 0, 0);
       if (target_big_endian)
-	frag_align_pattern (n, big_nop_pattern, sizeof big_nop_pattern, max);
+	frag_align_pattern (n, (const char *) big_nop_pattern, sizeof big_nop_pattern, max);
       else
-	frag_align_pattern (n, little_nop_pattern, sizeof little_nop_pattern,
+	frag_align_pattern (n, (const char *) little_nop_pattern, sizeof little_nop_pattern,
 			    max);
       return 1;
     }
--- binutils-2.9.1/gas/config/te-amiga.h	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/gas/config/te-amiga.h	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,14 @@
+/*
+ * te-amiga.h -- Amiga target environment declarations.
+ */
+
+#define TE_AMIGA 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#ifdef OBJ_HEADER
+#include OBJ_HEADER
+#else
+#include "obj-format.h"
+#endif
--- binutils-2.9.1/gas/configure	Fri May  1 08:45:07 1998
+++ binutils-2.9.1/gas/configure	Thu Jan 21 19:39:46 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -63,6 +63,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -180,6 +184,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -222,6 +230,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -352,7 +376,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -522,9 +546,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -586,7 +612,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:590: checking host system type" >&5
+echo "configure:616: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -607,7 +633,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:611: checking target system type" >&5
+echo "configure:637: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -625,7 +651,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:629: checking build system type" >&5
+echo "configure:655: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -655,21 +681,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:664: checking for a BSD compatible install" >&5
+echo "configure:691: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -708,13 +735,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:718: checking whether build environment is sane" >&5
+echo "configure:747: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -771,7 +800,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:775: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:804: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -817,7 +846,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:821: checking for working aclocal" >&5
+echo "configure:850: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -830,7 +859,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:834: checking for working autoconf" >&5
+echo "configure:863: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -843,7 +872,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:847: checking for working automake" >&5
+echo "configure:876: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -856,7 +885,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:860: checking for working autoheader" >&5
+echo "configure:889: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -869,7 +898,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:873: checking for working makeinfo" >&5
+echo "configure:902: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -932,15 +961,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:936: checking for $ac_word" >&5
+echo "configure:965: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -961,15 +991,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
+echo "configure:995: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -987,19 +1018,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1025: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1058: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1087: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:994: checking for $ac_word" >&5
+echo "configure:1120: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1034,25 +1161,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1172: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1042: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1203: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1214 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1066,18 +1229,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1076: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1245: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1081: checking whether we are using GNU C" >&5
+echo "configure:1250: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1086,7 +1255,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1097,11 +1266,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1105: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1278: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1116,18 +1289,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1141,7 +1341,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1145: checking for ld used by GCC" >&5
+echo "configure:1345: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1159,10 +1359,10 @@ echo "configure:1145: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1163: checking for GNU ld" >&5
+echo "configure:1363: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1166: checking for non-GNU ld" >&5
+echo "configure:1366: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1198,7 +1398,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1202: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1402: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1214,7 +1414,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1218: checking for BSD-compatible nm" >&5
+echo "configure:1418: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1251,7 +1451,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1255: checking whether ln -s works" >&5
+echo "configure:1455: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1261,14 +1461,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1287,8 +1497,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1291 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1501 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1506,6 +1716,7 @@ EOF
 			    fmt=aout em=mach bfd_gas=yes ;;
       i386-*-msdos*)        fmt=aout ;;
       i386-*-moss*)	    fmt=elf ;;
+      i386-*-beos*)         fmt=coff em=pe bfd_gas=yes ;;
       i386-*-pe)            fmt=coff em=pe ;;
       i386-*-cygwin32*)     fmt=coff em=pe bfd_gas=yes ;;
       i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
@@ -1521,6 +1732,8 @@ EOF
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
+      m68*-*-amigaoshunk)   fmt=amigahunk em=amiga bfd_gas=yes ;;
+      m68*-*-amigaos*)      fmt=aout em=amiga ;;
       m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
 			    fmt=aout em=sun3 ;;
       m68k-motorola-sysv*)  fmt=coff em=delta ;;
@@ -1567,7 +1780,7 @@ EOF
 		            fmt=coff em=pe ;;
       ppc-*-aix*)           fmt=coff ;;
       ppc-*-beos*)          fmt=coff ;;
-      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
+      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4* | ppc-*-amigaos*)
 			    fmt=elf ;;
       ppc-*-linux-gnu*)	    fmt=elf
 			    case "$endian" in
@@ -1974,7 +2187,7 @@ EOF
 
 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
   yes-*-coff)	need_bfd=yes ;;
-  no-*-coff)	need_bfd=yes
+  no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk)	need_bfd=yes
 		cat >> confdefs.h <<\EOF
 #define MANY_SEGMENTS 1
 EOF
@@ -2045,15 +2258,16 @@ EOF
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2049: checking for $ac_word" >&5
+echo "configure:2262: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -2071,19 +2285,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2292: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2325: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2354: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2078: checking for $ac_word" >&5
+echo "configure:2387: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -2118,25 +2428,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2439: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2126: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2470: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 2136 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2481 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2150,18 +2496,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2160: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2512: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2165: checking whether we are using GNU C" >&5
+echo "configure:2517: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2170,7 +2522,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2181,11 +2533,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2189: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2545: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2200,33 +2556,73 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
+
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+echo $ac_n "checking for host dependent CFLAGS""... $ac_c" 1>&6
+echo "configure:2603: checking for host dependent CFLAGS" >&5
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+echo "$ac_t""$other_host_cflags" 1>&6
+### end-GG-local
 
 for ac_prog in 'bison -y' byacc
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2222: checking for $ac_word" >&5
+echo "configure:2617: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -2250,15 +2646,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2254: checking for $ac_word" >&5
+echo "configure:2650: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -2283,7 +2680,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:2287: checking for yywrap in -l$ac_lib" >&5
+echo "configure:2684: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2291,7 +2688,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2692 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2302,7 +2699,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2325,7 +2722,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2329: checking how to run the C preprocessor" >&5
+echo "configure:2726: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2340,14 +2737,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2344 "configure"
+#line 2741 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -2357,14 +2754,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2361 "configure"
+#line 2758 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2775 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -2377,6 +2791,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -2386,7 +2802,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:2390: checking lex output file root" >&5
+echo "configure:2806: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2407,7 +2823,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2411: checking whether yytext is a pointer" >&5
+echo "configure:2827: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2419,14 +2835,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 2423 "configure"
+#line 2839 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -2449,7 +2865,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2453: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2869: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -2467,19 +2883,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:2471: checking for Cygwin32 environment" >&5
+echo "configure:2887: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2476 "configure"
+#line 2892 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:2483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -2496,19 +2912,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:2500: checking for Mingw32 environment" >&5
+echo "configure:2916: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2505 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -2527,7 +2943,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2531: checking for executable suffix" >&5
+echo "configure:2947: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2555,18 +2971,18 @@ for ac_hdr in string.h stdlib.h memory.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2559: checking for $ac_hdr" >&5
+echo "configure:2975: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2564 "configure"
+#line 2980 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2595,7 +3011,7 @@ done
 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
 # people who are not cross-compiling but are compiling cross-assemblers.
 echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6
-echo "configure:2599: checking whether compiling a cross-assembler" >&5
+echo "configure:3015: checking whether compiling a cross-assembler" >&5
 if test "${host}" = "${target}"; then
   cross_gas=no
 else
@@ -2610,19 +3026,19 @@ echo "$ac_t""$cross_gas" 1>&6
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2614: checking for working alloca.h" >&5
+echo "configure:3030: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2619 "configure"
+#line 3035 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2642,26 +3058,44 @@ EOF
 
 fi
 
+# Temporary ugly hack for BeOS.  Don't try to run the test for alloca
+# since it will succeed due to finding the version of alloca in the
+# runtime library.  We don't want to use that version, so let's pretend
+# we loaded it from the cache (default to 'no') and thus the package will configure
+# itself to use it's private copy of the C alloca replacement.  When the
+# horribly small default stack size problem is fixed (exists up through
+# at least DR8.2) then we can build gcc to start using it's builtin
+# alloca, we can allow mwcc to use it's builtin alloca, and this hack
+# can go away.
+if test "`uname`" = "BeOS"; then
+  test -z "$ac_cv_func_alloca_works" && ac_cv_func_alloca_works=no
+fi
+
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2647: checking for alloca" >&5
+echo "configure:3076: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2652 "configure"
+#line 3081 "configure"
 #include "confdefs.h"
 
-#ifdef __GNUC__
+#if 0	/* Never do this, it's unnecessary. -fnf */
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
 # else
-#  ifdef _AIX
- #pragma alloca
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
 #  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#    endif
 #   endif
 #  endif
 # endif
@@ -2671,7 +3105,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2696,19 +3130,19 @@ if test $ac_cv_func_alloca_works = no; t
   # that cause trouble.  Some versions do not even contain alloca or
   # contain a buggy version.  If you still want to use their alloca,
   # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.o
+  ALLOCA=alloca.${ac_objext}
   cat >> confdefs.h <<\EOF
 #define C_ALLOCA 1
 EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2707: checking whether alloca needs Cray hooks" >&5
+echo "configure:3141: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 3146 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2733,12 +3167,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2737: checking for $ac_func" >&5
+echo "configure:3171: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2742 "configure"
+#line 3176 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2761,7 +3195,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2788,7 +3222,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2792: checking stack direction for C alloca" >&5
+echo "configure:3226: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2796,7 +3230,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2800 "configure"
+#line 3234 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2815,7 +3249,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2837,21 +3271,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2841: checking for inline" >&5
+echo "configure:3275: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2848 "configure"
+#line 3282 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2881,12 +3315,12 @@ esac
 for ac_func in unlink remove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2885: checking for $ac_func" >&5
+echo "configure:3319: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2890 "configure"
+#line 3324 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2909,7 +3343,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2938,12 +3372,12 @@ done
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2942: checking for $ac_func" >&5
+echo "configure:3376: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2947 "configure"
+#line 3381 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2966,7 +3400,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2995,12 +3429,12 @@ done
 # enough, but on some of those systems, the assert macro relies on requoting
 # working properly!
 echo $ac_n "checking for working assert macro""... $ac_c" 1>&6
-echo "configure:2999: checking for working assert macro" >&5
+echo "configure:3433: checking for working assert macro" >&5
 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3004 "configure"
+#line 3438 "configure"
 #include "confdefs.h"
 #include <assert.h>
 #include <stdio.h>
@@ -3016,7 +3450,7 @@ assert (a == b
 
 ; return 0; }
 EOF
-if { (eval echo configure:3020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_assert_ok=yes
 else
@@ -3057,12 +3491,12 @@ gas_test_headers="
 "
 
 echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
-echo "configure:3061: checking whether declaration is required for strstr" >&5
+echo "configure:3495: checking whether declaration is required for strstr" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3066 "configure"
+#line 3500 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3073,7 +3507,7 @@ x = (f) strstr;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_strstr=no
 else
@@ -3094,12 +3528,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
-echo "configure:3098: checking whether declaration is required for malloc" >&5
+echo "configure:3532: checking whether declaration is required for malloc" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+#line 3537 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3110,7 +3544,7 @@ x = (f) malloc;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_malloc=no
 else
@@ -3131,12 +3565,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
-echo "configure:3135: checking whether declaration is required for free" >&5
+echo "configure:3569: checking whether declaration is required for free" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3140 "configure"
+#line 3574 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3147,7 +3581,7 @@ x = (f) free;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_free=no
 else
@@ -3168,12 +3602,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
-echo "configure:3172: checking whether declaration is required for sbrk" >&5
+echo "configure:3606: checking whether declaration is required for sbrk" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3177 "configure"
+#line 3611 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3184,7 +3618,7 @@ x = (f) sbrk;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_sbrk=no
 else
@@ -3208,12 +3642,12 @@ EOF
 # for it?
 
 echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
-echo "configure:3212: checking whether declaration is required for errno" >&5
+echo "configure:3646: checking whether declaration is required for errno" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3217 "configure"
+#line 3651 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_ERRNO_H
@@ -3228,7 +3662,7 @@ x = (f) errno;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_errno=no
 else
@@ -3273,7 +3707,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -3319,7 +3753,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -3340,7 +3776,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -3364,6 +3800,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -3381,6 +3818,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -3398,8 +3839,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -3410,6 +3851,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -3572,6 +4014,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -3617,6 +4060,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -3657,6 +4101,7 @@ rm -f targ-cpu.c targ-cpu.h obj-format.h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/gas/configure.in	Fri May  1 08:45:07 1998
+++ binutils-2.9.1/gas/configure.in	Sun Aug 23 00:00:00 1998
@@ -177,6 +177,7 @@ changequote([,])dnl
 			    fmt=aout em=mach bfd_gas=yes ;;
       i386-*-msdos*)        fmt=aout ;;
       i386-*-moss*)	    fmt=elf ;;
+      i386-*-beos*)         fmt=coff em=pe bfd_gas=yes ;;
       i386-*-pe)            fmt=coff em=pe ;;
       i386-*-cygwin32*)     fmt=coff em=pe bfd_gas=yes ;;
       i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
@@ -192,6 +193,8 @@ changequote([,])dnl
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
+      m68*-*-amigaoshunk)   fmt=amigahunk em=amiga bfd_gas=yes ;;
+      m68*-*-amigaos*)      fmt=aout em=amiga ;;
       m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
 			    fmt=aout em=sun3 ;;
       m68k-motorola-sysv*)  fmt=coff em=delta ;;
@@ -238,7 +241,7 @@ changequote([,])dnl
 		            fmt=coff em=pe ;;
       ppc-*-aix*)           fmt=coff ;;
       ppc-*-beos*)          fmt=coff ;;
-      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
+      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4* | ppc-*-amigaos*)
 			    fmt=elf ;;
       ppc-*-linux-gnu*)	    fmt=elf
 			    case "$endian" in
@@ -555,7 +558,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$
 
 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
   yes-*-coff)	need_bfd=yes ;;
-  no-*-coff)	need_bfd=yes
+  no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk)	need_bfd=yes
 		AC_DEFINE(MANY_SEGMENTS) ;;
 esac
 
@@ -604,6 +607,17 @@ AC_DEFINE_UNQUOTED(TARGET_VENDOR,	"${tar
 AC_DEFINE_UNQUOTED(TARGET_OS,		"${target_os}")
 
 AC_PROG_CC
+
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+AC_MSG_CHECKING(for host dependent CFLAGS)
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+AC_MSG_RESULT($other_host_cflags)
+### end-GG-local
 
 AC_PROG_YACC
 AC_PROG_LEX
--- binutils-2.9.1/gas/doc/Makefile.in	Fri May  1 08:44:56 1998
+++ binutils-2.9.1/gas/doc/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -123,33 +129,46 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/t
 INFO_DEPS = as.info gasp.info
 DVIS = as.dvi gasp.dvi
 TEXINFOS = as.texinfo gasp.texi
-MANS = as.1
+GUIDES = as.guide gasp.guide
+GUIDE_DEPS = as.guide gasp.guide
+HTMLS = as.html gasp.html
+HTML_DEPS = as.html gasp.html
+PS_S = as.ps gasp.ps
+PS_DEPS = as.ps gasp.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  Makefile.am Makefile.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
-default: all
+all: Makefile $(MANS)
 
 .SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+.SUFFIXES: .dvi .guide .html .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps doc/Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 
 as.info: as.texinfo
+as.guide: as.texinfo
+as.html: as.texinfo
+as.ps: as.dvi
 as.dvi: as.texinfo
 
 
 gasp.info: gasp.texi
+gasp.guide: gasp.texi
+gasp.html: gasp.texi
+gasp.ps: gasp.dvi
 gasp.dvi: gasp.texi
 
 
@@ -157,7 +176,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -165,39 +184,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -208,11 +239,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -225,13 +256,155 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps \
 	  as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr \
-	  as.cv as.cn gasp.aux gasp.cp gasp.cps gasp.dvi gasp.fn \
-	  gasp.fns gasp.ky gasp.kys gasp.ps gasp.log gasp.pg gasp.toc \
-	  gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op gasp.tr gasp.cv \
-	  gasp.cn
+	  as.cv as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
 
 clean-aminfo:
 
@@ -245,21 +418,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "as" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/as.1; then file=$(srcdir)/as.1; \
-	else file=as.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "as" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 tags: TAGS
 TAGS:
 
@@ -277,6 +474,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -293,12 +493,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-man
 
-all: Makefile $(MANS)
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(mandir)/man1
+	$(mkinstalldirs)  $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -315,24 +513,34 @@ distclean-generic:
 maintainer-clean-generic:
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-aminfo mostlyclean-generic
+mostlyclean:  mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-generic
 
-clean:  clean-aminfo clean-generic mostlyclean
+clean:  clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-generic mostlyclean
 
-distclean:  distclean-aminfo distclean-generic clean
+distclean:  distclean-aminfo distclean-guide distclean-html \
+		distclean-dvi distclean-ps distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
-maintainer-clean:  maintainer-clean-aminfo maintainer-clean-generic \
-		distclean
+maintainer-clean:  maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man \
-uninstall-man tags distdir info dvi installcheck install-info \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
+.PHONY: install-info-am uninstall-info install-guide uninstall-guide \
+install-ps uninstall-ps install-html uninstall-html install-dvi \
+uninstall-dvi mostlyclean-guide distclean-guide clean-guide \
+maintainer-clean-guide mostlyclean-html distclean-html clean-html \
+maintainer-clean-html mostlyclean-ps distclean-ps clean-ps \
+maintainer-clean-ps mostlyclean-dvi distclean-dvi clean-dvi \
+maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
+uninstall-man tags distdir info guide html ps dvi installcheck \
+install-info install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
--- binutils-2.9.1/gas/itbl-parse.c	Fri May  1 08:45:18 1998
+++ binutils-2.9.1/gas/itbl-parse.c	Sun Aug 23 00:00:00 1998
@@ -455,10 +455,10 @@ static const short yycheck[] = {     0,
    in version 1.24 of Bison.  */
 
 #ifndef alloca
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 #define alloca __builtin_alloca
 #else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #include <alloca.h>
 #else /* not sparc */
 #if defined (MSDOS) && !defined (__TURBOC__)
--- binutils-2.9.1/gas/Makefile.am	Fri May  1 08:45:03 1998
+++ binutils-2.9.1/gas/Makefile.am	Sun Aug 23 00:00:00 1998
@@ -63,6 +63,7 @@ CPU_TYPES = \
 # We deliberately omit som, since it does not work as a cross assembler.
 
 OBJ_FORMATS = \
+	amigahunk \
 	aout \
 	bout \
 	coff \
@@ -239,6 +240,7 @@ TARGET_CPU_HFILES = \
 # OBJ files in config
 
 OBJ_FORMAT_CFILES = \
+	config/obj-amigahunk.c \
 	config/obj-aout.c \
 	config/obj-bout.c \
 	config/obj-coff.c \
@@ -251,6 +253,7 @@ OBJ_FORMAT_CFILES = \
 	config/obj-vms.c
 
 OBJ_FORMAT_HFILES = \
+	config/obj-amigahunk.h \
 	config/obj-aout.h \
 	config/obj-bout.h \
 	config/obj-coff.h \
@@ -266,6 +269,7 @@ OBJ_FORMAT_HFILES = \
 
 TARG_ENV_HFILES = \
 	config/te-386bsd.h \
+	config/te-amiga.h \
 	config/te-aux.h \
 	config/te-delta.h \
 	config/te-delt88.h \
@@ -352,7 +356,7 @@ stamp-mk.com: vmsconf.sh Makefile
 EXTRA_DIST = make-gas.com
 
 DISTSTUFF = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c
-diststuff: $(DISTSTUFF) info
+diststuff: $(DISTSTUFF) info guide
 
 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-opc.h
 
@@ -448,6 +452,8 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff
 # We need all these explicit rules for the multi stuff.  Because of
 # these rules, we don't need one for OBJ_FORMAT_O.
 
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
+	$(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
 obj-aout.o : $(srcdir)/config/obj-aout.c
 	$(COMPILE) -c $(srcdir)/config/obj-aout.c
 obj-bout.o : $(srcdir)/config/obj-bout.c
@@ -964,6 +970,9 @@ TCDEP_m32r_elf = $(srcdir)/config/obj-el
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
   $(INCDIR)/opcode/cgen.h
+TCDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
 TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
   subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
@@ -1213,6 +1222,9 @@ OBJDEP_m32r_elf = $(srcdir)/config/obj-e
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+  $(INCDIR)/obstack.h
 OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/obstack.h
@@ -1436,6 +1448,8 @@ DEP_m32r_coff = $(srcdir)/config/obj-cof
 DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
+  $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
 DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
 DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
--- binutils-2.9.1/gas/Makefile.in	Fri May  1 08:45:03 1998
+++ binutils-2.9.1/gas/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -144,6 +150,7 @@ CPU_TYPES = \
 # We deliberately omit som, since it does not work as a cross assembler.
 
 OBJ_FORMATS = \
+	amigahunk \
 	aout \
 	bout \
 	coff \
@@ -320,6 +327,7 @@ TARGET_CPU_HFILES = \
 # OBJ files in config
 
 OBJ_FORMAT_CFILES = \
+	config/obj-amigahunk.c \
 	config/obj-aout.c \
 	config/obj-bout.c \
 	config/obj-coff.c \
@@ -332,6 +340,7 @@ OBJ_FORMAT_CFILES = \
 	config/obj-vms.c
 
 OBJ_FORMAT_HFILES = \
+	config/obj-amigahunk.h \
 	config/obj-aout.h \
 	config/obj-bout.h \
 	config/obj-coff.h \
@@ -347,6 +356,7 @@ OBJ_FORMAT_HFILES = \
 
 TARG_ENV_HFILES = \
 	config/te-386bsd.h \
+	config/te-amiga.h \
 	config/te-aux.h \
 	config/te-delta.h \
 	config/te-delt88.h \
@@ -610,6 +620,9 @@ TCDEP_m32r_elf = $(srcdir)/config/obj-el
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
   $(INCDIR)/opcode/cgen.h
+TCDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
 TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
   subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
@@ -859,6 +872,9 @@ OBJDEP_m32r_elf = $(srcdir)/config/obj-e
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+  $(INCDIR)/obstack.h
 OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/obstack.h
@@ -1082,6 +1098,8 @@ DEP_m32r_coff = $(srcdir)/config/obj-cof
 DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
+  $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
 DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
 DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
@@ -1228,21 +1246,21 @@ acconfig.h acinclude.m4 aclocal.m4 confi
 configure configure.in gdbinit.in itbl-lex.c itbl-parse.c stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
 OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
 
-default: all
+all: all-recursive-am all-am
 
 .SUFFIXES:
 .SUFFIXES: .S .c .l .lo .o .s .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -1354,7 +1372,8 @@ itbl-parse.h: itbl-parse.c
 
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+check-recursive installcheck-recursive info-recursive dvi-recursive \
+guide-recursive ps-recursive html-recursive:
 	@set fnord $(MAKEFLAGS); amf=$$2; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  target=`echo $@ | sed s/-recursive//`; \
@@ -1482,6 +1501,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: info-recursive
+guide: guide-recursive
+html: html-recursive
+ps: ps-recursive
 dvi: dvi-recursive
 check:
 	$(MAKE) check-recursive check-DEJAGNU
@@ -1505,8 +1527,6 @@ install: install-recursive install-exec-
 
 uninstall: uninstall-recursive
 
-all: all-recursive-am all-am
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs: installdirs-recursive
@@ -1556,20 +1576,21 @@ maintainer-clean:  maintainer-clean-recu
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
 uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
 all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+guide-recursive html-recursive ps-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
 distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
-info dvi installcheck install-info all-recursive-am all-am \
-install-exec-am install-exec install-data install uninstall all \
+info guide html ps dvi installcheck install-info all-recursive-am \
+all-am install-exec-am install-exec install-data install uninstall all \
 installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
@@ -1579,7 +1600,7 @@ stamp-mk.com: vmsconf.sh Makefile
 	sh $(srcdir)/vmsconf.sh $(GENERIC_OBJS) > new-make.com
 	$(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
 	touch stamp-mk.com
-diststuff: $(DISTSTUFF) info
+diststuff: $(DISTSTUFF) info guide
 
 $(OBJS): @ALL_OBJ_DEPS@
 
@@ -1628,6 +1649,8 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff
 # We need all these explicit rules for the multi stuff.  Because of
 # these rules, we don't need one for OBJ_FORMAT_O.
 
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
+	$(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
 obj-aout.o : $(srcdir)/config/obj-aout.c
 	$(COMPILE) -c $(srcdir)/config/obj-aout.c
 obj-bout.o : $(srcdir)/config/obj-bout.c
--- binutils-2.9.1/gas/read.c	Fri May  1 08:45:16 1998
+++ binutils-2.9.1/gas/read.c	Sun Aug 23 00:00:00 1998
@@ -53,6 +53,10 @@ Software Foundation, 59 Temple Place - S
 #define TC_START_LABEL(x,y) (x==':')
 #endif
 
+#ifdef OBJ_AMIGAHUNK
+extern segT data_chip_section, bss_chip_section;
+#endif
+
 /* The NOP_OPCODE is for the alignment fill value.
  * fill it a nop instruction so that the disassembler does not choke
  * on it
@@ -260,6 +264,9 @@ static const pseudo_typeS potable[] =
   {"common", s_mri_common, 0},
   {"common.s", s_mri_common, 1},
   {"data", s_data, 0},
+#ifdef OBJ_AMIGAHUNK
+  {"datachip", s_data_chip, 0},
+#endif
   {"dc", cons, 2},
   {"dc.b", cons, 1},
   {"dc.d", float_cons, 'd'},
@@ -1540,6 +1547,17 @@ s_data (ignore)
   demand_empty_rest_of_line ();
 }
 
+#ifdef OBJ_AMIGAHUNK
+void
+s_data_chip (ignore)
+     int ignore;
+{
+  int temp = get_absolute_expression ();
+  subseg_set (data_chip_section, (subsegT) temp);
+  demand_empty_rest_of_line ();
+}
+#endif
+
 /* Handle the .appfile pseudo-op.  This is automatically generated by
    do_scrub_chars when a preprocessor # line comment is seen with a
    file name.  This default definition may be overridden by the object
@@ -3582,7 +3600,7 @@ emit_expr (exp, nbytes)
 
 #ifdef BFD_ASSEMBLER
 #ifdef TC_CONS_FIX_NEW
-      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
+      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
 #else
       {
 	bfd_reloc_code_real_type r;
@@ -3607,12 +3625,12 @@ emit_expr (exp, nbytes)
 	    break;
 	  }
 	fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp,
-		     0, r);
+		     0, r, 0);
       }
 #endif
 #else
 #ifdef TC_CONS_FIX_NEW
-      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
+      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
 #else
       /* Figure out which reloc number to use.  Use TC_CONS_RELOC if
 	 it is defined, otherwise use NO_RELOC if it is defined,
@@ -3625,7 +3643,7 @@ emit_expr (exp, nbytes)
 #endif
 #endif
       fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp, 0,
-		   TC_CONS_RELOC);
+		   TC_CONS_RELOC, 0);
 #endif /* TC_CONS_FIX_NEW */
 #endif /* BFD_ASSEMBLER */
     }
@@ -4111,7 +4129,7 @@ sizeof_uleb128 (value)
   return size;
 }
 
-inline int
+int
 sizeof_leb128 (value, sign)
      valueT value;
      int sign;
@@ -4175,7 +4193,7 @@ output_uleb128 (p, value)
   return p - orig;
 }
 
-inline int
+int
 output_leb128 (p, value, sign)
      char *p;
      valueT value;
--- binutils-2.9.1/gas/read.h	Fri May  1 08:45:16 1998
+++ binutils-2.9.1/gas/read.h	Sun Aug 23 00:00:00 1998
@@ -117,6 +117,9 @@ extern void s_app_file PARAMS ((int));
 extern void s_app_line PARAMS ((int));
 extern void s_comm PARAMS ((int));
 extern void s_data PARAMS ((int));
+#ifdef OBJ_AMIGAHUNK
+extern void s_data_chip PARAMS ((int));
+#endif
 extern void s_desc PARAMS ((int));
 extern void s_else PARAMS ((int arg));
 extern void s_end PARAMS ((int arg));
--- binutils-2.9.1/gas/write.c	Fri May  1 08:45:18 1998
+++ binutils-2.9.1/gas/write.c	Sun Aug 23 00:00:00 1998
@@ -101,12 +101,12 @@ static int n_fixups;
 static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
 				       symbolS *add, symbolS *sub,
 				       offsetT offset, int pcrel,
-				       bfd_reloc_code_real_type r_type));
+				       bfd_reloc_code_real_type r_type, int baserel));
 #else
 static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
 				       symbolS *add, symbolS *sub,
 				       offsetT offset, int pcrel,
-				       int r_type));
+				       int r_type, int baserel));
 #endif
 #if defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS))
 static long fixup_segment PARAMS ((fixS * fixP, segT this_segment_type));
@@ -140,7 +140,7 @@ static void relax_and_size_all_segments 
  */
 static fixS *
 fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
-		  r_type)
+		  r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -153,6 +153,7 @@ fix_new_internal (frag, where, size, add
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;               /* TRUE if base-relative data */
 {
   fixS *fixP;
 
@@ -187,6 +188,7 @@ fix_new_internal (frag, where, size, add
   fixP->fx_signed = 0;
 
 #ifdef TC_FIX_TYPE
+  fixP->tc_fix_data = baserel;
   TC_INIT_FIX_DATA(fixP);
 #endif
 
@@ -233,7 +235,7 @@ fix_new_internal (frag, where, size, add
 /* Create a fixup relative to a symbol (plus a constant).  */
 
 fixS *
-fix_new (frag, where, size, add_symbol, offset, pcrel, r_type)
+fix_new (frag, where, size, add_symbol, offset, pcrel, r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -245,9 +247,10 @@ fix_new (frag, where, size, add_symbol, 
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;
 {
   return fix_new_internal (frag, where, size, add_symbol,
-			   (symbolS *) NULL, offset, pcrel, r_type);
+			   (symbolS *) NULL, offset, pcrel, r_type, baserel);
 }
 
 /* Create a fixup for an expression.  Currently we only support fixups
@@ -255,7 +258,7 @@ fix_new (frag, where, size, add_symbol, 
    file formats support anyhow.  */
 
 fixS *
-fix_new_exp (frag, where, size, exp, pcrel, r_type)
+fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -266,6 +269,7 @@ fix_new_exp (frag, where, size, exp, pcr
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;
 {
   symbolS *add = NULL;
   symbolS *sub = NULL;
@@ -285,7 +289,7 @@ fix_new_exp (frag, where, size, exp, pcr
 	exp->X_op_symbol = 0;
 	exp->X_add_symbol = stmp;
 	exp->X_add_number = 0;
-	return fix_new_exp (frag, where, size, exp, pcrel, r_type);
+	return fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel);
       }
 
     case O_symbol_rva:
@@ -324,7 +328,7 @@ fix_new_exp (frag, where, size, exp, pcr
     }
 
   return fix_new_internal (frag, where, size, add, sub, off,
-			   pcrel, r_type);
+			   pcrel, r_type, baserel);
 }
 
 /* Append a string onto another string, bumping the pointer along.  */
@@ -1134,7 +1138,7 @@ write_contents (abfd, sec, xxx)
 	      if (fill_size == 1)
 		{
 		  n_per_buf = sizeof (buf);
-		  memset (buf, *fill_literal, n_per_buf);
+		  memset (buf, *fill_literal & 0xFF, n_per_buf);	/* fnf - work around BeOS memset bug */
 		}
 	      else
 		{
@@ -1530,17 +1534,17 @@ write_object_file ()
 #ifdef TC_CONS_FIX_NEW
 	  TC_CONS_FIX_NEW (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp);
+		       2, &exp, 0);
 #else
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, BFD_RELOC_16);
+		       2, &exp, 0, BFD_RELOC_16, 0);
 #endif
 #else
 #if defined(TC_SPARC) || defined(TC_A29K) || defined(NEED_FX_R_TYPE)
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, NO_RELOC);
+		       2, &exp, 0, NO_RELOC, 0);
 #else
 #ifdef TC_NS32K
 	  fix_new_ns32k_exp (lie->frag,
@@ -1549,7 +1553,7 @@ write_object_file ()
 #else
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, 0);
+		       2, &exp, 0, 0, 0);
 #endif /* TC_NS32K */
 #endif /* TC_SPARC|TC_A29K|NEED_FX_R_TYPE */
 #endif /* BFD_ASSEMBLER */
@@ -2392,6 +2396,7 @@ fixup_segment (fixP, this_segment_type)
   char *place;
   long where;
   int pcrel, plt;
+  char baserel = 0;
   fragS *fragP;
   segT add_symbol_segment = absolute_section;
 
@@ -2430,6 +2435,9 @@ fixup_segment (fixP, this_segment_type)
       add_number = fixP->fx_offset;
       pcrel = fixP->fx_pcrel;
       plt = fixP->fx_plt;
+#ifdef TC_FIX_TYPE
+      baserel = fixP->tc_fix_data;
+#endif
 
       if (add_symbolP != NULL
 	  && add_symbolP->sy_mri_common)
@@ -2556,7 +2564,6 @@ fixup_segment (fixP, this_segment_type)
 		}
 	    }
 	}
-
       if (add_symbolP)
 	{
 	  if (add_symbol_segment == this_segment_type && pcrel && !plt
@@ -2668,6 +2675,11 @@ fixup_segment (fixP, this_segment_type)
 	      ++seg_reloc_count;
 	    }
 	}
+
+#if !defined(BFD_ASSEMBLER) && !defined(MANY_SEGMENTS)
+      if (baserel && add_number)
+        add_number -= text_last_frag->fr_address;
+#endif
 
       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
 	{
--- binutils-2.9.1/gas/write.h	Fri May  1 08:45:18 1998
+++ binutils-2.9.1/gas/write.h	Sun Aug 23 00:00:00 1998
@@ -177,17 +177,18 @@ extern void number_to_chars_bigendian   
 #ifdef BFD_ASSEMBLER
 extern fixS *fix_new
   PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
-	   offsetT offset, int pcrel, bfd_reloc_code_real_type r_type));
+	   offsetT offset, int pcrel, bfd_reloc_code_real_type r_type,
+	   int baserel));
 extern fixS *fix_new_exp
   PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
-	   bfd_reloc_code_real_type r_type));
+	   bfd_reloc_code_real_type r_type, int baserel));
 #else
 extern fixS *fix_new
   PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
-	   offsetT offset, int pcrel, int r_type));
+	   offsetT offset, int pcrel, int r_type, int baserel));
 extern fixS *fix_new_exp
   PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
-	   int r_type));
+	   int r_type, int baserel));
 #endif
 
 extern void write_print_statistics PARAMS ((FILE *));
--- binutils-2.9.1/gprof/configure	Fri May  1 08:49:42 1998
+++ binutils-2.9.1/gprof/configure	Thu Jan 21 19:39:59 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -57,6 +57,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -174,6 +178,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -216,6 +224,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -346,7 +370,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -516,9 +540,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -580,7 +606,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:584: checking host system type" >&5
+echo "configure:610: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -601,7 +627,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:605: checking target system type" >&5
+echo "configure:631: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -619,7 +645,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:623: checking build system type" >&5
+echo "configure:649: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -649,21 +675,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:658: checking for a BSD compatible install" >&5
+echo "configure:685: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -702,13 +729,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:712: checking whether build environment is sane" >&5
+echo "configure:741: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -765,7 +794,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:769: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:798: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -811,7 +840,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:815: checking for working aclocal" >&5
+echo "configure:844: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -824,7 +853,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:828: checking for working autoconf" >&5
+echo "configure:857: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -837,7 +866,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:841: checking for working automake" >&5
+echo "configure:870: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -850,7 +879,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:854: checking for working autoheader" >&5
+echo "configure:883: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -863,7 +892,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:867: checking for working makeinfo" >&5
+echo "configure:896: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -926,15 +955,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:930: checking for $ac_word" >&5
+echo "configure:959: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -955,15 +985,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:959: checking for $ac_word" >&5
+echo "configure:989: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -981,19 +1012,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1019: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1052: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1081: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:988: checking for $ac_word" >&5
+echo "configure:1114: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1028,25 +1155,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1166: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1036: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1197: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1046 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1208 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1060,18 +1223,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1239: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1075: checking whether we are using GNU C" >&5
+echo "configure:1244: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1080,7 +1249,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1091,11 +1260,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1099: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1272: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1110,18 +1283,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1135,7 +1335,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1139: checking for ld used by GCC" >&5
+echo "configure:1339: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1153,10 +1353,10 @@ echo "configure:1139: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1157: checking for GNU ld" >&5
+echo "configure:1357: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1160: checking for non-GNU ld" >&5
+echo "configure:1360: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1192,7 +1392,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1196: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1396: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1208,7 +1408,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1212: checking for BSD-compatible nm" >&5
+echo "configure:1412: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1245,7 +1445,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1249: checking whether ln -s works" >&5
+echo "configure:1449: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1255,14 +1455,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1281,8 +1491,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1285 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1495 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1319,15 +1529,16 @@ $libtool_flags --no-verify $ac_aux_dir/l
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1323: checking for $ac_word" >&5
+echo "configure:1533: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1345,19 +1556,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1563: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1596: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1625: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1352: checking for $ac_word" >&5
+echo "configure:1658: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1392,25 +1699,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1710: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1400: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1410 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1752 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1424,18 +1767,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1434: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1783: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1439: checking whether we are using GNU C" >&5
+echo "configure:1788: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1444,7 +1793,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1455,11 +1804,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1463: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1816: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1474,24 +1827,51 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1495: checking for POSIXized ISC" >&5
+echo "configure:1875: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -1521,8 +1901,20 @@ EOF
   ;;
 esac
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+echo $ac_n "checking for host dependent CFLAGS""... $ac_c" 1>&6
+echo "configure:1908: checking for host dependent CFLAGS" >&5
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+echo "$ac_t""$other_host_cflags" 1>&6
+### end-GG-local
+
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1526: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1918: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1540,19 +1932,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1544: checking for Cygwin32 environment" >&5
+echo "configure:1936: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1549 "configure"
+#line 1941 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1569,19 +1961,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1573: checking for Mingw32 environment" >&5
+echo "configure:1965: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1578 "configure"
+#line 1970 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1600,7 +1992,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1604: checking for executable suffix" >&5
+echo "configure:1996: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1647,7 +2039,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -1693,7 +2085,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -1714,7 +2108,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -1738,6 +2132,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -1755,6 +2150,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -1772,8 +2171,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -1784,6 +2183,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -1932,6 +2332,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -1977,6 +2378,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2008,6 +2410,7 @@ test -z "$CONFIG_HEADERS" || echo timest
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/gprof/configure.in	Fri May  1 08:49:42 1998
+++ binutils-2.9.1/gprof/configure.in	Sun Aug 23 00:00:00 1998
@@ -28,6 +28,17 @@ case "${target}" in
   ;;
 esac
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+AC_MSG_CHECKING(for host dependent CFLAGS)
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+AC_MSG_RESULT($other_host_cflags)
+### end-GG-local
+
 AM_MAINTAINER_MODE
 AM_CYGWIN32
 AM_EXEEXT
--- binutils-2.9.1/gprof/Makefile.am	Fri May  1 08:49:41 1998
+++ binutils-2.9.1/gprof/Makefile.am	Sun Aug 23 00:00:00 1998
@@ -25,7 +25,7 @@ EXTRA_DIST = flat_bl.c bsd_callg_bl.c fs
 
 BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
 
-diststuff: $(BUILT_SOURCES) info
+diststuff: $(BUILT_SOURCES) info guide
 
 .m.c:
 	awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
--- binutils-2.9.1/gprof/Makefile.in	Fri May  1 08:49:41 1998
+++ binutils-2.9.1/gprof/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -126,7 +132,14 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/t
 INFO_DEPS = gprof.info
 DVIS = gprof.dvi
 TEXINFOS = gprof.texi
-MANS = gprof.1
+GUIDES = gprof.guide
+GUIDE_DEPS = gprof.guide
+HTMLS = gprof.html
+HTML_DEPS = gprof.html
+PS_S = gprof.ps
+PS_DEPS = gprof.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 HEADERS =  $(noinst_HEADERS)
@@ -135,21 +148,21 @@ DIST_COMMON =  ChangeLog Makefile.am Mak
 aclocal.m4 configure configure.in gconfig.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(gprof_SOURCES)
 OBJECTS = $(gprof_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) $(HEADERS) gconfig.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .lo .m .o .ps .s .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .lo .m .o .ps .s .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -193,18 +206,18 @@ maintainer-clean-binPROGRAMS:
 
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(bindir)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
 uninstall-binPROGRAMS:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	done
 
 .c.o:
@@ -250,6 +263,9 @@ gprof$(EXEEXT): $(gprof_OBJECTS) $(gprof
 	$(LINK) $(gprof_LDFLAGS) $(gprof_OBJECTS) $(gprof_LDADD) $(LIBS)
 
 gprof.info: gprof.texi
+gprof.guide: gprof.texi
+gprof.html: gprof.texi
+gprof.ps: gprof.dvi
 gprof.dvi: gprof.texi
 
 
@@ -257,7 +273,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -265,39 +281,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -308,11 +336,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -325,11 +353,145 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
 	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
 	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
-	  gprof.cv gprof.cn
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
 
 clean-aminfo:
 
@@ -343,21 +505,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "gprof" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/gprof.1; then file=$(srcdir)/gprof.1; \
-	else file=gprof.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "gprof" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -428,6 +614,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -444,12 +633,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-binPROGRAMS uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) $(HEADERS) gconfig.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(bindir) $(mandir)/man1
+	$(mkinstalldirs)  $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -468,40 +655,52 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-binPROGRAMS \
 		mostlyclean-compile mostlyclean-libtool \
-		mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
+		mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-tags \
+		mostlyclean-generic
 
 clean:  clean-hdr clean-binPROGRAMS clean-compile clean-libtool \
-		clean-aminfo clean-tags clean-generic mostlyclean
+		clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-binPROGRAMS distclean-compile \
-		distclean-libtool distclean-aminfo distclean-tags \
-		distclean-generic clean
+		distclean-libtool distclean-aminfo distclean-guide \
+		distclean-html distclean-dvi distclean-ps \
+		distclean-tags distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info guide html ps dvi \
 installcheck install-info install-exec install-data install uninstall \
 all installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
-diststuff: $(BUILT_SOURCES) info
+diststuff: $(BUILT_SOURCES) info guide
 
 .m.c:
 	awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
--- binutils-2.9.1/include/coff/internal.h	Fri May  1 08:48:27 1998
+++ binutils-2.9.1/include/coff/internal.h	Sun Aug 23 00:00:00 1998
@@ -92,6 +92,10 @@ typedef struct _IMAGE_DATA_DIRECTORY 
 #define NT_EXE_IMAGE_BASE 0x400000
 #define NT_DLL_IMAGE_BASE 0x10000000
 
+/* default image base for BeOS */
+#define BEOS_EXE_IMAGE_BASE 0x80000000
+#define BEOS_DLL_IMAGE_BASE 0x80000000
+
 /* Extra stuff in a PE aouthdr */
 
 #define PE_DEF_SECTION_ALIGNMENT 0x1000
--- binutils-2.9.1/ld/acconfig.h	Fri May  1 08:48:47 1998
+++ binutils-2.9.1/ld/acconfig.h	Sun Aug 23 00:00:00 1998
@@ -20,3 +20,6 @@
 
 /* Do we need to use the b modifier when opening binary files?  */
 #undef USE_BINARY_FOPEN
+
+/* Are we building a cross linker */
+#undef CROSS_LINKER
--- binutils-2.9.1/ld/beos-ld.c	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/beos-ld.c	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,395 @@
+/*  Linker front end for BeOS.
+
+    Copyright (C) 1997 Free Software Foundation, Inc.
+
+    BeOS uses a proprietary Apple executable format called PEF.  However the
+    Metrowerks linker that is supplied with the system also reads XCOFF so
+    the gcc port generates XCOFF object files, which can be linked together,
+    along with other XCOFF objects from libraries, using the GNU linker with
+    the "-r" option to generate a single relocatable object file.  That file
+    can then be passed to the Metrowerks linker to add the BeOS runtime
+    support and generate a PEF executable.
+
+    This front end is compiled and installed in place of the regular GNU
+    linker, which is moved to ld-coff.  It first runs ld-coff with the args
+    that it is given, except that -o options are redirected to a temporary
+    file, and then it runs mwld to covert the relocatable temporary file
+    into a PEF executable in the file specified by the -o option (or "a.out"
+    as the default).
+
+    This front end was written by Fred Fish (fnf@cygnus.com) using various
+    pieces from gcc's "collect2.c".  Contributers to collect2.c include
+    Chris Smith (csmith@convex.com), Michael Meissner (meissner@cygnus.com),
+    Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
+
+    This is expected to be only a temporary solution.  I have formally
+    requested (9/96) a license from Apple to incorporate PEF support into
+    BFD using information from their licensed PEF documentation, and to have
+    that code covered *only* by the GNU General Public License.  That
+    request is still pending.  If PEF support is installed, then this useful
+    hack will go away.  Or perhaps Be will migrate to more open standards
+    first.
+
+This file is part of GLD, the Gnu Linker.
+
+GLD is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GLD is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GLD; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+
+#include "ansidecl.h"
+#include "config.h"
+
+#ifndef CROSS_LINKER
+#define CROSS_LINKER 0
+#endif
+
+#define TEMP_FILE_TEMPLATE "/tmp/ldhackXXXXXX"
+
+#ifndef LDNAME
+#define LDNAME "ld-coff"		/* The renamed GNU linker */
+#endif
+
+#ifndef TARGET_ALIAS
+#define TARGET_ALIAS ""
+#endif
+
+#define MW_LD "mwld"			/* The Metrowerks linker */
+#define DEFAULT_OFILE "a.out"		/* Default output file name */
+
+static int gflag = 0;			/* Non-zero if user specified -g flag */
+static int vflag = 0;			/* Non-zero if user specified -v flag */
+static int rflag = 0;			/* Non-zero if user specified -r flag or we are a cross linker */
+static char *ofile = NULL;		/* Output file name */
+static char *scratchfile;		/* Temporary file name */
+
+static void do_wait PARAMS ((char *));
+static void fork_execute PARAMS ((char *, char **));
+static void collect_exit PARAMS ((int));
+
+extern void *malloc ();
+extern char *getenv ();
+
+
+/* Die when sys call fails.  */
+
+static void
+fatal_perror (string, arg1, arg2, arg3)
+     char *string, *arg1, *arg2, *arg3;
+{
+  int e = errno;
+
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3);
+  fprintf (stderr, ": %s\n", strerror (e));
+  collect_exit (1);
+}
+
+/* Just die.  */
+
+static void
+fatal (string, arg1, arg2, arg3)
+     char *string, *arg1, *arg2, *arg3;
+{
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3);
+  fprintf (stderr, "\n");
+  collect_exit (1);
+}
+
+/* Write error message.  */
+
+static void
+error (string, arg1, arg2, arg3, arg4)
+     char *string, *arg1, *arg2, *arg3, *arg4;
+{
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3, arg4);
+  fprintf (stderr, "\n");
+}
+
+main (argc, argv)
+     int argc;
+     char *argv[];
+{
+  char **argp;
+  char **ldargs;
+  char **ldargp;
+  char **tmp_ofile;
+  char *ldname;
+  int offset;
+
+  argp = &argv[1];
+
+  /* Find the GNU linker. */
+
+  ldname = malloc (strlen (TARGET_ALIAS) + strlen (LDNAME) + 2);
+  if (strlen (TARGET_ALIAS) > 0)
+    {
+      sprintf (ldname, "%s-%s", TARGET_ALIAS, LDNAME);
+    }
+  else
+    {
+      strcpy (ldname, LDNAME);
+    }
+
+  /* Build the temporary file name, being careful to ensure that the
+     template is writable and not in const data. */
+
+  scratchfile = malloc (strlen (TEMP_FILE_TEMPLATE));
+  strcpy (scratchfile, TEMP_FILE_TEMPLATE);
+  mktemp (scratchfile);
+
+  /* Just add enough slop that we don't have to worry about being
+     off a little bit. */
+  ldargs = malloc ((argc + 16) * sizeof (char *));
+  ldargp = ldargs;
+
+  /* The first arg is the name of the GNU linker */
+
+  *ldargp++ = ldname;
+
+  while (*argp)
+    {
+      if (strcmp ("-g", *argp) == 0)
+	{
+	  gflag = 1;
+	}
+      else if (strcmp ("-v", *argp) == 0)
+	{
+	  vflag = 1;
+	}
+      else if (strcmp ("-r", *argp) == 0)
+	{
+	  /* Always pass explicit -r option on to GNU linker */
+	  rflag = 1;
+	  *ldargp++ = "-r";
+	}
+      else if (strcmp ("-o", *argp) == 0)
+	{
+	  /* Save the real output filename in ofile and
+	     substitute our temporary file name. */
+	  *ldargp++ = *argp++;
+	  ofile = *argp++;
+	  tmp_ofile = ldargp;
+	  *ldargp++ = scratchfile;
+	  /* Already handled args, skip to next */
+	  continue;
+	}
+      *ldargp++ = *argp++;
+    }
+
+  /* Now check to see if we saw an explicit -o option.  If so, it currently
+     points to the temporary file.  Leave it alone unless we also saw a -r
+     option, in which case redirect it back to the real output file since
+     we won't be running mwld.  If no explicit -o, need to add one unless
+     we are only running the GNU linker and not mwld. */
+
+  if (ofile == NULL)
+    {
+      /* No explicit -o option.  If not generating a relocatable
+	 file then need to use the temporary file between passes. */
+      if (!rflag && !CROSS_LINKER)
+	{
+	  *ldargp++ = "-o";
+	  *ldargp++ = scratchfile;
+	}
+    }
+  else
+    {
+      /* Got explicit -o option so it currently points to our scratch file.
+	 If also got -r option, need to point it back to our real output
+	 file. */
+      if (rflag || CROSS_LINKER)
+	{
+	  *tmp_ofile = ofile;
+	}
+    }
+  
+  /* Generally we always want to supply a "-r" option to the GNU linker,
+     unless we either got one on the input command line and thus already
+     have one, or else the environment variable BEOS_STUBS is given
+     which means that we are probably trying to find out what symbols are
+     undefined in the BeOS runtime by supplying a stub object that defines
+     the ones that are, and thus we don't want to supply "-r". */
+
+  if (!rflag)
+    {
+      char *stubs = getenv ("BEOS_STUBS");
+      *ldargp++ = stubs ? stubs : "-r";
+    }
+
+  /* Terminate the arg list to the GNU ld and run it. */
+
+  *ldargp++ = NULL;
+  fork_execute (ldargs[0], ldargs);
+
+  /* If we are not generating a relocatable output file, then we need
+     to run the Metrowerks linker to generate the final executable. */
+
+  if (!rflag && !CROSS_LINKER)
+    {
+      char *mapfile;
+      ldargp = ldargs;
+      *ldargp++ = MW_LD;
+      *ldargp++ = "-o";
+      *ldargp++ = ofile;
+      if (gflag)
+	{
+	  *ldargp++ = "-g";
+	  mapfile = malloc (strlen (ofile) + 6);
+	  sprintf (mapfile, "%s.xMAP", ofile);
+	  *ldargp++ = "-map";
+	  *ldargp++ = mapfile;
+	}
+      *ldargp++ = "-nodup";
+      *ldargp++ = scratchfile;
+      *ldargp++ = NULL;
+      fork_execute (ldargs[0], ldargs);
+
+      /* Since mwld doesn't make a file executable, we need to do that ourselves. */
+      ldargp = ldargs;
+      *ldargp++ = "chmod";
+      *ldargp++ = "+x";
+      *ldargp++ = ofile;
+      *ldargp++ = NULL;
+      fork_execute (ldargs[0], ldargs);
+    }
+
+  collect_exit (0);
+}
+
+/* Wait for a process to finish, and exit if a non-zero status is found.  */
+
+int
+collect_wait (prog)
+     char *prog;
+{
+  int status;
+
+  wait (&status);
+  if (status)
+    {
+      if (WIFSIGNALED (status))
+	{
+	  int sig = WTERMSIG (status);
+	  error ("%s terminated with signal %d %s",
+		 prog,
+		 sig,
+		 (status & 0200) ? ", core dumped" : "");
+	  collect_exit (127);
+	}
+
+      if (WIFEXITED (status))
+	return WEXITSTATUS (status);
+    }
+  return 0;
+}
+
+static void
+do_wait (prog)
+     char *prog;
+{
+  int ret = collect_wait (prog);
+  if (ret != 0)
+    {
+      error ("%s returned %d exit status", prog, ret);
+      collect_exit (ret);
+    }
+}
+
+/* Fork and execute a program, and wait for the reply.  */
+
+static void
+collect_execute (prog, argv, redir)
+     char *prog;
+     char **argv;
+     char *redir;
+{
+  int pid;
+
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      if (argv[0])
+	fprintf (stderr, "%s", argv[0]);
+      else
+	fprintf (stderr, "[cannot find %s]", prog);
+
+      for (p_argv = &argv[1]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  /* If we can't find a program we need, complain error.  Do this here
+     since we might not end up needing something that we couldn't find.  */
+
+  if (argv[0] == 0)
+    fatal ("cannot find `%s'", prog);
+
+  pid = fork ();
+  if (pid == -1)
+    {
+      fatal_perror ("fork");
+    }
+
+  if (pid == 0)			/* child context */
+    {
+      if (redir)
+	{
+	  unlink (redir);
+	  if (freopen (redir, "a", stdout) == NULL)
+	    fatal_perror ("redirecting stdout");
+	  if (freopen (redir, "a", stderr) == NULL)
+	    fatal_perror ("redirecting stderr");
+	}
+
+      execvp (argv[0], argv);
+      fatal_perror ("executing %s", prog);
+    }
+}
+
+static void
+fork_execute (prog, argv)
+     char *prog;
+     char **argv;
+{
+  collect_execute (prog, argv, NULL);
+  do_wait (prog);
+}
+
+/* Delete tempfiles and exit function.  */
+
+void
+collect_exit (status)
+     int status;
+{
+  if (status > 0)
+    {
+      unlink (ofile);
+    }
+  unlink (scratchfile);
+  exit (status);
+}
+
--- binutils-2.9.1/ld/config.in	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/config.in	Sun Aug 23 00:00:00 1998
@@ -24,6 +24,9 @@
 /* Do we need to use the b modifier when opening binary files?  */
 #undef USE_BINARY_FOPEN
 
+/* Are we building a cross linker */
+#undef CROSS_LINKER
+
 /* Define if you have the sbrk function.  */
 #undef HAVE_SBRK
 
--- binutils-2.9.1/ld/configure	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/configure	Thu Jan 21 19:40:06 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -653,21 +679,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:662: checking for a BSD compatible install" >&5
+echo "configure:689: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -706,13 +733,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:716: checking whether build environment is sane" >&5
+echo "configure:745: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -769,7 +798,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:802: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -815,7 +844,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:819: checking for working aclocal" >&5
+echo "configure:848: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -828,7 +857,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:832: checking for working autoconf" >&5
+echo "configure:861: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -841,7 +870,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:845: checking for working automake" >&5
+echo "configure:874: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -854,7 +883,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:858: checking for working autoheader" >&5
+echo "configure:887: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -867,7 +896,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:871: checking for working makeinfo" >&5
+echo "configure:900: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -930,15 +959,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:934: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -959,15 +989,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:963: checking for $ac_word" >&5
+echo "configure:993: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -985,19 +1016,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1056: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1085: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1118: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1032,25 +1159,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1170: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1050 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1212 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1064,18 +1227,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1243: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1079: checking whether we are using GNU C" >&5
+echo "configure:1248: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1084,7 +1253,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1095,11 +1264,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1276: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,18 +1287,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1139,7 +1339,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1143: checking for ld used by GCC" >&5
+echo "configure:1343: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1157,10 +1357,10 @@ echo "configure:1143: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1161: checking for GNU ld" >&5
+echo "configure:1361: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1164: checking for non-GNU ld" >&5
+echo "configure:1364: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1196,7 +1396,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1400: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1212,7 +1412,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1216: checking for BSD-compatible nm" >&5
+echo "configure:1416: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1249,7 +1449,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1253: checking whether ln -s works" >&5
+echo "configure:1453: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1259,14 +1459,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1285,8 +1495,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1289 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1499 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1354,15 +1564,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1358: checking for $ac_word" >&5
+echo "configure:1568: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1380,19 +1591,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1598: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1631: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1660: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1387: checking for $ac_word" >&5
+echo "configure:1693: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1427,25 +1734,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1745: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1435: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1776: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1445 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1787 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1459,18 +1802,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1469: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1818: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1474: checking whether we are using GNU C" >&5
+echo "configure:1823: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1479,7 +1828,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1490,11 +1839,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1498: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1851: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1509,35 +1862,62 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1529: checking for Cygwin32 environment" >&5
+echo "configure:1909: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1534 "configure"
+#line 1914 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1554,19 +1934,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1558: checking for Mingw32 environment" >&5
+echo "configure:1938: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1943 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1585,7 +1965,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1589: checking for executable suffix" >&5
+echo "configure:1969: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1614,15 +1994,16 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1618: checking for $ac_word" >&5
+echo "configure:1998: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -1646,15 +2027,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1650: checking for $ac_word" >&5
+echo "configure:2031: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -1679,7 +2061,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1683: checking for yywrap in -l$ac_lib" >&5
+echo "configure:2065: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1687,7 +2069,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1691 "configure"
+#line 2073 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1698,7 +2080,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1721,7 +2103,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1725: checking how to run the C preprocessor" >&5
+echo "configure:2107: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1736,14 +2118,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1740 "configure"
+#line 2122 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1753,14 +2135,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1757 "configure"
+#line 2139 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2156 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1773,6 +2172,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1782,7 +2183,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1786: checking lex output file root" >&5
+echo "configure:2187: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1803,7 +2204,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:1807: checking whether yytext is a pointer" >&5
+echo "configure:2208: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1815,14 +2216,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 2220 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -1844,8 +2245,23 @@ EOF
 fi
 
 
+# begin-GG-local
+echo $ac_n "checking whether compiling a cross-linker""... $ac_c" 1>&6
+echo "configure:2251: checking whether compiling a cross-linker" >&5
+if test "${host}" = "${target}"; then
+  cross_linker=no
+else
+  cross_linker=yes
+  cat >> confdefs.h <<\EOF
+#define CROSS_LINKER 1
+EOF
+
+fi
+echo "$ac_t""$cross_linker" 1>&6
+# end-GG-local
+
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1849: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2265: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1874,18 +2290,18 @@ for ac_hdr in string.h strings.h stdlib.
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1878: checking for $ac_hdr" >&5
+echo "configure:2294: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1883 "configure"
+#line 2299 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1913,12 +2329,12 @@ done
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1917: checking for $ac_func" >&5
+echo "configure:2333: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1922 "configure"
+#line 2338 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1941,7 +2357,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1970,12 +2386,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1974: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2390: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1979 "configure"
+#line 2395 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1983,7 +2399,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2008,7 +2424,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2012: checking for opendir in -ldir" >&5
+echo "configure:2428: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2016,7 +2432,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2020 "configure"
+#line 2436 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2027,7 +2443,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2049,7 +2465,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2053: checking for opendir in -lx" >&5
+echo "configure:2469: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2057,7 +2473,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2061 "configure"
+#line 2477 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2068,7 +2484,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2101,12 +2517,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2105: checking whether strstr must be declared" >&5
+echo "configure:2521: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2110 "configure"
+#line 2526 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2127,7 +2543,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2149,12 +2565,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2153: checking whether free must be declared" >&5
+echo "configure:2569: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2158 "configure"
+#line 2574 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2175,7 +2591,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -2197,12 +2613,12 @@ EOF
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2201: checking whether sbrk must be declared" >&5
+echo "configure:2617: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2622 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2223,7 +2639,7 @@ int main() {
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:2227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -2245,12 +2661,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2249: checking whether getenv must be declared" >&5
+echo "configure:2665: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2254 "configure"
+#line 2670 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2271,7 +2687,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2337,6 +2753,9 @@ done
 
 
 
+
+
+
 if test x${all_targets} = xtrue; then
   if test x${want64} = xtrue; then
     EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
@@ -2378,7 +2797,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2424,7 +2843,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2445,7 +2866,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2469,6 +2890,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2486,6 +2908,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2503,8 +2929,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2515,6 +2941,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -2532,6 +2959,9 @@ s%@HOSTING_LIBS@%$HOSTING_LIBS%g
 s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
 s%@EMUL@%$EMUL%g
 s%@TDIRS@%$TDIRS%g
+s%@LDNAME@%$LDNAME%g
+s%@EXTRA_PROGS@%$EXTRA_PROGS%g
+s%@EXTRA_INSTALL@%$EXTRA_INSTALL%g
 s%@EMULATION_OFILES@%$EMULATION_OFILES%g
 s%@TESTBFDLIB@%$TESTBFDLIB%g
 
@@ -2676,6 +3106,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -2721,6 +3152,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2752,6 +3184,7 @@ test -z "$CONFIG_HEADERS" || echo timest
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/ld/configure.host	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/configure.host	Sun Aug 23 00:00:00 1998
@@ -35,6 +35,10 @@ alpha*-*-*)
   NATIVE_LIB_DIRS=/usr/ccs/lib
   ;;
 
+i[3456]86-*-beos*)
+  NATIVE_LIB_DIRS=/boot/develop/lib/x86
+  ;;
+
 i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*)
   # The new BSD `make' has a bug: it doesn't pass empty arguments in
   # shell commands.  So we need to make this value non-empty in order
@@ -112,6 +116,10 @@ mips*-sgi-irix4*)
 mips*-sgi-irix[56]*)
   HOSTING_CRT0=/usr/lib/crt1.o
   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
+  ;;
+
+m68*-*-amigaos*)
+  HDEFINES=-mstackextend
   ;;
 
 m68*-*-linux*aout*)
--- binutils-2.9.1/ld/configure.in	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/configure.in	Sun Aug 23 00:00:00 1998
@@ -45,6 +45,17 @@ AC_PROG_YACC
 AC_PROG_LEX
 AC_DECL_YYTEXT
 
+# begin-GG-local
+AC_MSG_CHECKING(whether compiling a cross-linker)
+if test "${host}" = "${target}"; then
+  cross_linker=no
+else
+  cross_linker=yes
+  AC_DEFINE(CROSS_LINKER)
+fi
+AC_MSG_RESULT($cross_linker)
+# end-GG-local
+
 AM_MAINTAINER_MODE
 
 . ${srcdir}/configure.host
@@ -108,6 +119,9 @@ done
 
 AC_SUBST(EMUL)
 AC_SUBST(TDIRS)
+AC_SUBST(LDNAME)
+AC_SUBST(EXTRA_PROGS)
+AC_SUBST(EXTRA_INSTALL)
 
 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
 dnl target, and in those cases we should also build the 64 bit
--- binutils-2.9.1/ld/configure.tgt	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/configure.tgt	Sun Aug 23 00:00:00 1998
@@ -97,6 +97,7 @@ i[3456]86-*-winnt*)	targ_emul=i386pe ;;
 i[3456]86-*-pe)		targ_emul=i386pe ;;
 i[3456]86-*-cygwin32*)	targ_emul=i386pe ;;
 i[3456]86-*-mingw32*)	targ_emul=i386pe ;;
+i[3456]86-*-beos*)	targ_emul=i386beos ;;
 m8*-*-*)		targ_emul=m88kbcs ;;
 a29k-*-udi)		targ_emul=sa29200 ;;
 a29k-*-ebmon)		targ_emul=ebmon29k ;;
@@ -119,6 +120,7 @@ sh-*-*|sh-*-rtems*)	targ_emul=sh; targ_e
 m68k-sony-*)		targ_emul=news ;;
 m68k-hp-bsd*)		targ_emul=hp300bsd ;;
 m68*-motorola-sysv*)	targ_emul=delta68 ;;
+m68*-*-amigaos*)	targ_emul=amiga ; targ_extra_emuls=amiga_bss;;
 m68*-*-aout)		targ_emul=m68kaout ;;
 m68*-*-coff)		targ_emul=m68kcoff ;;
 m68*-*-elf)		targ_emul=m68kelf ;;
@@ -180,6 +182,8 @@ alpha*-*-netbsd*)	targ_emul=elf64alpha ;
 z8k-*-coff) 		targ_emul=z8002; targ_extra_emuls=z8001 ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)	targ_emul=pc532macha ;;
 ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
+powerpc-*-amigaos*)	targ_emul=elf32ppc ;;
+powerpc-*-amigaoshunk*)	targ_emul=ppcamiga ; targ_extra_emuls=ppcamiga_bss;;
 powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-linux-gnu* | powerpc-*-sysv* \
   | powerpc-*-netbsd*)
 	targ_emul=elf32ppc ;;
@@ -208,3 +212,24 @@ w65-*-*)		targ_emul=w65 ;;
   exit 1
 
 esac
+
+# Begin GG local change
+#
+# Note that you might think we could override program_transform_name in order to
+# force the installed GNU ld binary to be ld-coff for BeOS.  This actually does
+# work, until you configure and build the linker as part of a larger source
+# tree and INSTALL_XFORM is passed down from above and wipes out your change.
+# So we need an out-of-band method of renaming the installed binary that is
+# not affected by any other name transformation rules.
+
+case "${targ}" in
+powerpc-*-beos*)	LDNAME=ld-coff
+			EXTRA_PROGS=beos-ld
+			EXTRA_INSTALL=install-beos-ld
+			;;
+*)			LDNAME=ld
+			EXTRA_PROGS=
+			EXTRA_INSTALL=
+			;;
+esac
+# End GG local change
--- binutils-2.9.1/ld/emulparams/amiga_bss.sh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emulparams/amiga_bss.sh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga_bss
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x0
+PAGE_SIZE=0x0
+SEGMENT_SIZE=0x0
+NONPAGED_TEXT_START_ADDR=0x0
+TEMPLATE_NAME=amiga
+ARCH=m68k
--- binutils-2.9.1/ld/emulparams/amiga.sh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emulparams/amiga.sh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x0
+PAGE_SIZE=0x0
+SEGMENT_SIZE=0x0
+NONPAGED_TEXT_START_ADDR=0x0
+TEMPLATE_NAME=amiga
+ARCH=m68k
--- binutils-2.9.1/ld/emulparams/i386beos.sh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emulparams/i386beos.sh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,5 @@
+ARCH=i386
+SCRIPT_NAME=i386beos
+OUTPUT_FORMAT="pei-i386"
+RELOCATEABLE_OUTPUT_FORMAT="pe-i386"
+TEMPLATE_NAME=beos
--- binutils-2.9.1/ld/emulparams/ppcamiga_bss.sh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emulparams/ppcamiga_bss.sh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga_bss
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x400
+PAGE_SIZE=0x400
+SEGMENT_SIZE=0x400
+NONPAGED_TEXT_START_ADDR=0x400
+TEMPLATE_NAME=amiga
+ARCH=powerpc
--- binutils-2.9.1/ld/emulparams/ppcamiga.sh	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emulparams/ppcamiga.sh	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x400
+PAGE_SIZE=0x400
+SEGMENT_SIZE=0x400
+NONPAGED_TEXT_START_ADDR=0x400
+TEMPLATE_NAME=amiga
+ARCH=powerpc
--- binutils-2.9.1/ld/emultempl/amiga.em	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emultempl/amiga.em	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,290 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is is generated by a shell script.  DO NOT EDIT! */
+
+/* emulate the original gld for the given ${EMULATION_NAME}
+   Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+   Written by Steve Chamberlain steve@cygnus.com
+
+This file is part of GLD, the Gnu Linker.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#define TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+
+#include "getopt.h"
+#include "ld.h"
+#include "config.h"
+#include "ldmain.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldmisc.h"
+#include "ldexp.h"
+#include "ldlang.h"
+
+#if defined(TARGET_IS_amiga) || defined (TARGET_IS_ppcamiga)
+#include "libamiga.h"
+#else
+extern int amiga_base_relative; /* defined in amigaoslink.c */
+#endif
+
+/* 1 means, write out debug hunk, when producing a load file */
+extern int write_debug_hunk;
+
+/* This is the attribute to use for the next file */
+extern int amiga_attribute;
+
+/* generate a resident executable */
+extern int amiga_resident;
+
+/* generate a pOS executable */
+extern int amiga_pOS_flg;
+
+static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+
+/* Handle amiga specific options */
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+     int argc;
+     char **argv;
+{
+  int prevoptind = optind;
+  int prevopterr = opterr;
+  int indx;
+  int longind;
+  int optc;
+  long val;
+  char *end;
+
+#define OPTION_IGNORE (300)
+#define OPTION_AMIGA_CHIP               (OPTION_IGNORE + 1)
+#define OPTION_AMIGA_FAST               (OPTION_AMIGA_CHIP + 1)
+#define OPTION_AMIGA_ATTRIBUTE          (OPTION_AMIGA_FAST + 1)
+#define OPTION_AMIGA_DEBUG              (OPTION_AMIGA_ATTRIBUTE + 1)
+#define OPTION_AMIGA_DATADATA_RELOC     (OPTION_AMIGA_DEBUG + 1)
+#define OPTION_FLAVOR			(OPTION_AMIGA_DATADATA_RELOC + 1)
+#define OPTION_AMIGA_POS		(OPTION_FLAVOR + 1)
+
+  static struct option longopts[] = {
+    {"amiga-datadata-reloc", no_argument, NULL, OPTION_AMIGA_DATADATA_RELOC},
+    /*    '\0', NULL, "Relocate for resident program", ONE_DASH },*/
+    {"amiga-debug-hunk", no_argument, NULL, OPTION_AMIGA_DEBUG},
+    /*    '\0', NULL, "Output encapsulated stabs in debug hunk", ONE_DASH },*/
+    {"attribute", required_argument, NULL, OPTION_AMIGA_ATTRIBUTE},
+    /*'\0', NULL, "Set section attributes", ONE_DASH },*/
+    {"chip", no_argument, NULL, OPTION_AMIGA_CHIP},
+    /*'\0', NULL, "Force sections in chip memory", ONE_DASH },*/
+    {"fast", no_argument, NULL, OPTION_AMIGA_FAST},
+    /*'\0', NULL, "Force sections in fast memory", ONE_DASH },*/
+    {"flavor", required_argument, NULL, OPTION_FLAVOR},
+    /*'\0', NULL, "Select a library flavor", ONE_DASH },*/
+    {"pos", no_argument, NULL, OPTION_AMIGA_POS},
+    /*'\0', NULL, "Output a pOS executable", ONE_DASH },*/
+    {NULL, no_argument, NULL, 0}
+  };
+
+  indx = optind;
+  if (indx == 0)
+    indx = 1;
+
+  opterr = 0;
+  optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+  opterr = prevopterr;
+  switch (optc)
+    {
+    default:
+      optind = prevoptind;
+      return 0;
+
+    case 0:
+      /* Long option which just sets a flag.  */
+      break;
+
+    case OPTION_AMIGA_CHIP:
+      amiga_attribute=2; /* We do not use MEMF_FAST, so we do not have to include exec/memory.h*/
+      break;
+    case OPTION_AMIGA_FAST:
+      amiga_attribute=4;
+      break;
+    case OPTION_AMIGA_ATTRIBUTE:
+      {
+	char *end;
+	amiga_attribute = strtoul (optarg, &end, 0);
+	if (*end)
+	  einfo ("%P%F: invalid number \`%s\'\n", optarg);
+      }
+      break;
+    case OPTION_AMIGA_DEBUG:
+      write_debug_hunk=1; /* Write out debug hunk */
+      break;
+
+    case OPTION_AMIGA_DATADATA_RELOC:
+      amiga_resident=1; /* Write out datadata_reloc array */
+      break;
+
+    case OPTION_FLAVOR:
+      {
+	extern void ldfile_add_flavor (char*);
+	ldfile_add_flavor (optarg);
+      }
+      break;
+
+    case OPTION_AMIGA_POS:
+      amiga_pOS_flg = 1;
+      break;
+    }
+  return 1;
+}
+
+static void
+gld${EMULATION_NAME}_before_parse()
+{
+#if defined(TARGET_IS_amiga_bss) || defined (TARGET_IS_ppcamiga_bss)
+  amiga_base_relative=1;
+  amiga_resident=0;
+#endif
+
+#ifndef TARGET_			/* I.e., if not generic.  */
+  ldfile_output_architecture = bfd_arch_${ARCH};
+#endif /* not TARGET_ */
+}
+
+static void 
+gld${EMULATION_NAME}_after_parse()
+{
+  sort_flavors();
+}
+
+static void 
+gld${EMULATION_NAME}_after_open()
+{
+  ldctor_build_sets ();
+}
+
+#if defined(TARGET_IS_amiga) || defined (TARGET_IS_ppcamiga)
+
+static void
+ amiga_assign_attribute(lang_input_statement_type *);
+
+void
+amiga_after_allocation()
+{
+#if 0 /* Does not work at the moment */
+  lang_for_each_input_file (amiga_assign_attribute);
+#endif
+}
+
+static void
+amiga_assign_attribute(inp)
+     lang_input_statement_type *inp;
+{
+  asection *s;
+
+  if (inp->the_bfd->xvec->flavour==bfd_target_amiga_flavour)
+    {
+      for (s=inp->the_bfd->sections;s!=NULL;s=s->next)
+	amiga_per_section(s)->attribute=inp->amiga_attribute;
+    }
+
+}
+#else
+extern void
+amiga_after_allocation();
+#endif
+
+static char *
+gld${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc="-f ${srcdir}/emultempl/stringify.sed"
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+echo '  ; else return'                                     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
+echo '; }'                                                 >> e${EMULATION_NAME}.c
+
+else
+# Scripts read from the filesystem.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 1;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return "ldscripts/${EMULATION_NAME}.xu";
+  else if (link_info.relocateable == true)
+    return "ldscripts/${EMULATION_NAME}.xr";
+  else if (!config.text_read_only)
+    return "ldscripts/${EMULATION_NAME}.xbn";
+  else if (!config.magic_demand_paged)
+    return "ldscripts/${EMULATION_NAME}.xn";
+  else
+    return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld${EMULATION_NAME}_before_parse,	/* before_parse */
+  syslib_default,			/* syslib */
+  hll_default,				/* hll */
+  gld${EMULATION_NAME}_after_parse,
+  gld${EMULATION_NAME}_after_open,
+  amiga_after_allocation,		/* after_allocation */
+  set_output_arch_default,		/* set_output_arch */
+  ldemul_default_target,		/* choose_target */
+  before_allocation_default,		/* before_allocation */
+  gld${EMULATION_NAME}_get_script,	/* get_script */
+  "${EMULATION_NAME}",			/* emulation_name */
+  "${OUTPUT_FORMAT}",			/* target_name */
+  NULL,					/* finish */
+  NULL,					/* create_output_section_statements */
+  NULL,					/* open_dynamic_library */
+  NULL,					/* place_orphan */
+  NULL,					/* set_symbols */
+  gld${EMULATION_NAME}_parse_args,
+  NULL,					/* unrecognized file */
+};
+EOF
--- binutils-2.9.1/ld/emultempl/beos.em	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/emultempl/beos.em	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,837 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is part of GLD, the Gnu Linker.
+   Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
+
+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
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+/* For WINDOWS_NT */
+/* The original file generated returned different default scripts depending
+   on whether certain switches were set, but these switches pertain to the
+   Linux system and that particular version of coff.  In the NT case, we
+   only determine if the subsystem is console or windows in order to select
+   the correct entry point by default. */ 
+  
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "getopt.h"
+#include "libiberty.h"
+#include "ld.h"
+#include "ldmain.h"
+#include "ldgram.h"
+#include "ldexp.h"
+#include "ldlang.h"
+#include "ldemul.h"
+#include "ldlex.h"
+#include "ldmisc.h"
+#include "ldctor.h"
+#include "ldfile.h"
+#include "coff/internal.h"
+#include "../bfd/libcoff.h"
+
+#define TARGET_IS_${EMULATION_NAME}
+
+static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
+static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
+static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
+static boolean gld${EMULATION_NAME}_place_orphan
+  PARAMS ((lang_input_statement_type *, asection *));
+static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
+static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+
+#if 0 /* argument to qsort so don't prototype */
+static int sort_by_file_name PARAMS ((void *, void *));
+static int sort_by_section_name PARAMS ((void *, void *));
+#endif
+static lang_statement_union_type **sort_sections_1
+  PARAMS ((lang_statement_union_type **, lang_statement_union_type *, int,
+	   int (*)()));
+static void sort_sections PARAMS ((lang_statement_union_type *));
+
+static struct internal_extra_pe_aouthdr pe;
+static int dll;
+
+extern const char *output_filename;
+
+static void
+gld_${EMULATION_NAME}_before_parse()
+{
+  output_filename = "a.exe";
+  ldfile_output_architecture = bfd_arch_${ARCH};
+}
+
+/* PE format extra command line options.  */
+
+/* Used for setting flags in the PE header. */
+#define OPTION_BASE_FILE		(300  + 1)
+#define OPTION_DLL			(OPTION_BASE_FILE + 1)
+#define OPTION_FILE_ALIGNMENT		(OPTION_DLL + 1)
+#define OPTION_IMAGE_BASE		(OPTION_FILE_ALIGNMENT + 1)
+#define OPTION_MAJOR_IMAGE_VERSION	(OPTION_IMAGE_BASE + 1)
+#define OPTION_MAJOR_OS_VERSION		(OPTION_MAJOR_IMAGE_VERSION + 1)
+#define OPTION_MAJOR_SUBSYSTEM_VERSION	(OPTION_MAJOR_OS_VERSION + 1)
+#define OPTION_MINOR_IMAGE_VERSION	(OPTION_MAJOR_SUBSYSTEM_VERSION + 1)
+#define OPTION_MINOR_OS_VERSION		(OPTION_MINOR_IMAGE_VERSION + 1)
+#define OPTION_MINOR_SUBSYSTEM_VERSION	(OPTION_MINOR_OS_VERSION + 1)
+#define OPTION_SECTION_ALIGNMENT	(OPTION_MINOR_SUBSYSTEM_VERSION + 1)
+#define OPTION_STACK                    (OPTION_SECTION_ALIGNMENT + 1)
+#define OPTION_SUBSYSTEM                (OPTION_STACK + 1)
+#define OPTION_HEAP			(OPTION_SUBSYSTEM + 1)
+
+static struct option longopts[] = {
+  /* PE options */
+    {"base-file", required_argument, NULL, OPTION_BASE_FILE},
+    {"dll", no_argument, NULL, OPTION_DLL},
+    {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
+    {"heap", required_argument, NULL, OPTION_HEAP}, 
+    {"image-base", required_argument, NULL, OPTION_IMAGE_BASE}, 
+    {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
+    {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
+    {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
+    {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
+    {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
+    {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
+    {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
+    {"stack", required_argument, NULL, OPTION_STACK},
+    {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
+   {NULL, no_argument, NULL, 0}
+  };
+
+
+/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
+   parameters which may be input from the command line */
+
+typedef struct {
+  void *ptr;
+  int size;
+  int value;
+  char *symbol;
+  int inited;
+} definfo;
+
+#define D(field,symbol,def)  {&pe.field,sizeof(pe.field), def, symbol,0}
+
+static definfo init[] =
+{
+  /* imagebase must be first */
+#define IMAGEBASEOFF 0
+  D(ImageBase,"__image_base__", BEOS_EXE_IMAGE_BASE),
+#define DLLOFF 1
+  {&dll, sizeof(dll), 0, "__dll__"},
+  D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT),
+  D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT),
+  D(MajorOperatingSystemVersion,"__major_os_version__", 4),
+  D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
+  D(MajorImageVersion,"__major_image_version__", 1),
+  D(MinorImageVersion,"__minor_image_version__", 0),
+  D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
+  D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
+  D(Subsystem,"__subsystem__", 3),
+  D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
+  D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
+  D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
+  D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000),
+  D(LoaderFlags,"__loader_flags__", 0x0),
+  { NULL, 0, 0, NULL, 0 }
+};
+
+
+static void
+set_pe_name (name, val)
+     char *name;
+     long val;
+{
+  int i;
+  /* Find the name and set it. */
+  for (i = 0; init[i].ptr; i++)
+    {
+      if (strcmp (name, init[i].symbol) == 0)
+	{
+	  init[i].value = val;
+	  init[i].inited = 1;
+	  return;
+	}
+    }
+  abort();
+}
+
+
+static void
+set_pe_subsystem ()
+{
+  const char *sver;
+  int len;
+  int i;
+  static const struct 
+    {
+      const char *name;
+      const int value;
+      const char *entry;
+    }
+  v[] =
+    {
+      { "native", 1, "_NtProcessStartup" },
+      { "windows", 2, "_WinMainCRTStartup" },
+      { "wwindows", 2, "_wWinMainCRTStartup" },
+      { "console", 3, "_mainCRTStartup" },
+      { "wconsole", 3, "_wmainCRTStartup" },
+#if 0
+      /* The Microsoft linker does not recognize this.  */
+      { "os2", 5, "" },
+#endif
+      { "posix", 7, "___PosixProcessStartup"},
+      { 0, 0, 0 }
+    };
+
+  sver = strchr (optarg, ':');
+  if (sver == NULL)
+    len = strlen (optarg);
+  else
+    {
+      char *end;
+
+      len = sver - optarg;
+      set_pe_name ("__major_subsystem_version__",
+		   strtoul (sver + 1, &end, 0));
+      if (*end == '.')
+	set_pe_name ("__minor_subsystem_version__",
+		     strtoul (end + 1, &end, 0));
+      if (*end != '\0')
+	einfo ("%P: warning: bad version number in -subsystem option\n");
+    }
+
+  for (i = 0; v[i].name; i++)
+    {
+      if (strncmp (optarg, v[i].name, len) == 0
+	  && v[i].name[len] == '\0')
+	{
+	  set_pe_name ("__subsystem__", v[i].value);
+
+	  /* If the subsystem is windows, we use a different entry
+	     point.  We also register the entry point as an undefined
+	     symbol. from lang_add_entry() The reason we do
+	     this is so that the user
+	     doesn't have to because they would have to use the -u
+	     switch if they were specifying an entry point other than
+	     _mainCRTStartup.  Specifically, if creating a windows
+	     application, entry point _WinMainCRTStartup must be
+	     specified.  What I have found for non console
+	     applications (entry not _mainCRTStartup) is that the .obj
+	     that contains mainCRTStartup is brought in since it is
+	     the first encountered in libc.lib and it has other
+	     symbols in it which will be pulled in by the link
+	     process.  To avoid this, adding -u with the entry point
+	     name specified forces the correct .obj to be used.  We
+	     can avoid making the user do this by always adding the
+	     entry point name as an undefined symbol.  */
+	  lang_add_entry (v[i].entry, 1);
+
+	  return;
+	}
+    }
+  einfo ("%P%F: invalid subsystem type %s\n", optarg);
+}
+
+
+
+static void
+set_pe_value (name)
+     char *name;
+     
+{
+  char *end;
+  set_pe_name (name,  strtoul (optarg, &end, 0));
+  if (end == optarg)
+    {
+      einfo ("%P%F: invalid hex number for PE parameter '%s'\n", optarg);
+    }
+
+  optarg = end;
+}
+
+static void
+set_pe_stack_heap (resname, comname)
+     char *resname;
+     char *comname;
+{
+  set_pe_value (resname);
+  if (*optarg == ',')
+    {
+      optarg++;
+      set_pe_value (comname);
+    }
+  else if (*optarg)
+    {
+      einfo ("%P%F: strange hex info for PE parameter '%s'\n", optarg);
+    }
+}
+
+
+
+static int
+gld_${EMULATION_NAME}_parse_args(argc, argv)
+     int argc;
+     char **argv;
+{
+  int longind;
+  int optc;
+  int prevoptind = optind;
+  int prevopterr = opterr;
+  int wanterror;
+  static int lastoptind = -1;
+
+  if (lastoptind != optind)
+    opterr = 0;
+  wanterror = opterr;
+
+  lastoptind = optind;
+
+  optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+  opterr = prevopterr;
+
+  switch (optc)
+    {
+    default:
+      if (wanterror)
+	xexit (1);
+      optind =  prevoptind;
+      return 0;
+
+    case OPTION_BASE_FILE:
+      link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
+      if (link_info.base_file == NULL)
+	{
+	  fprintf (stderr, "%s: Can't open base file %s\n",
+		   program_name, optarg);
+	  xexit (1);
+	}
+      break;
+
+      /* PE options */
+    case OPTION_HEAP: 
+      set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
+      break;
+    case OPTION_STACK: 
+      set_pe_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__");
+      break;
+    case OPTION_SUBSYSTEM:
+      set_pe_subsystem ();
+      break;
+    case OPTION_MAJOR_OS_VERSION:
+      set_pe_value ("__major_os_version__");
+      break;
+    case OPTION_MINOR_OS_VERSION:
+      set_pe_value ("__minor_os_version__");
+      break;
+    case OPTION_MAJOR_SUBSYSTEM_VERSION:
+      set_pe_value ("__major_subsystem_version__");
+      break;
+    case OPTION_MINOR_SUBSYSTEM_VERSION:
+      set_pe_value ("__minor_subsystem_version__");
+      break;
+    case OPTION_MAJOR_IMAGE_VERSION:
+      set_pe_value ("__major_image_version__");
+      break;
+    case OPTION_MINOR_IMAGE_VERSION:
+      set_pe_value ("__minor_image_version__");
+      break;
+    case OPTION_FILE_ALIGNMENT:
+      set_pe_value ("__file_alignment__");
+      break;
+    case OPTION_SECTION_ALIGNMENT:
+      set_pe_value ("__section_alignment__");
+      break;
+    case OPTION_DLL:
+      set_pe_name ("__dll__", 1);
+      break;
+    case OPTION_IMAGE_BASE:
+      set_pe_value ("__image_base__");
+      break;
+    }
+  return 1;
+}
+
+/* Assign values to the special symbols before the linker script is
+   read.  */
+
+static void
+gld_${EMULATION_NAME}_set_symbols()
+{
+  /* Run through and invent symbols for all the
+     names and insert the defaults. */
+  int j;
+  lang_statement_list_type *save;
+
+  if (!init[IMAGEBASEOFF].inited)
+    {
+      if (link_info.relocateable)
+	init[IMAGEBASEOFF].value = 0;
+      else if (init[DLLOFF].value)
+	init[IMAGEBASEOFF].value = BEOS_DLL_IMAGE_BASE;
+      else
+	init[IMAGEBASEOFF].value = BEOS_EXE_IMAGE_BASE;
+    }
+
+  /* Don't do any symbol assignments if this is a relocateable link.  */
+  if (link_info.relocateable)
+    return;
+
+  /* Glue the assignments into the abs section */
+  save = stat_ptr;
+
+  stat_ptr = &(abs_output_section->children);
+
+  for (j = 0; init[j].ptr; j++)
+    {
+      long val = init[j].value;
+      lang_add_assignment (exp_assop ('=' ,init[j].symbol, exp_intop (val)));
+      if (init[j].size == sizeof(short))
+	*(short *)init[j].ptr = val;
+      else if (init[j].size == sizeof(int))
+	*(int *)init[j].ptr = val;
+      else if (init[j].size == sizeof(long))
+	*(long *)init[j].ptr = val;
+      /* This might be a long long or other special type.  */
+      else if (init[j].size == sizeof(bfd_vma))
+	*(bfd_vma *)init[j].ptr = val;
+      else	abort();
+    }
+  /* Restore the pointer. */
+  stat_ptr = save;
+  
+  if (pe.FileAlignment >
+      pe.SectionAlignment)
+    {
+      einfo ("%P: warning, file alignment > section alignment.\n");
+    }
+}
+
+static void
+gld_${EMULATION_NAME}_after_open()
+{
+  /* Pass the wacky PE command line options into the output bfd.
+     FIXME: This should be done via a function, rather than by
+     including an internal BFD header.  */
+  if (!coff_data(output_bfd)->pe)
+    {
+      einfo ("%F%P: PE operations on non PE file.\n");
+    }
+
+  pe_data(output_bfd)->pe_opthdr = pe;
+  pe_data(output_bfd)->dll = init[DLLOFF].value;
+
+}
+
+/* Callback functions for qsort in sort_sections. */
+
+static int
+sort_by_file_name (a, b)
+     void *a;
+     void *b;
+{
+  lang_statement_union_type **ra = a;
+  lang_statement_union_type **rb = b;
+  int i, a_sec, b_sec;
+
+  i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename,
+	      (*rb)->input_section.ifile->the_bfd->my_archive->filename);
+  if (i != 0)
+    return i;
+
+  i = strcmp ((*ra)->input_section.ifile->filename,
+		 (*rb)->input_section.ifile->filename);
+  if (i != 0)
+    return i;
+  /* the tail idata4/5 are the only ones without relocs to an
+     idata$6 section unless we are importing by ordinal, 
+     so sort them to last to terminate the IAT
+     and HNT properly. if no reloc this one is import by ordinal
+     so we have to sort by section contents */
+
+  if ( ((*ra)->input_section.section->reloc_count + (*rb)->input_section.section->reloc_count) )
+    {
+       i =  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? -1 : 0);
+       if ( i != 0)
+         return i;
+
+        return  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? 0 : 1);
+    }
+  else
+    {
+       if ( (strcmp( (*ra)->input_section.section->name, ".idata$6") == 0) )
+          return 0; /* don't sort .idata$6 or .idata$7 FIXME dlltool eliminate .idata$7 */
+
+       if (! bfd_get_section_contents ((*ra)->input_section.ifile->the_bfd, 
+         (*ra)->input_section.section, &a_sec, (file_ptr) 0, (bfd_size_type)sizeof(a_sec)))
+            einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                 (*ra)->input_section.ifile->the_bfd);
+
+       if (! bfd_get_section_contents ((*rb)->input_section.ifile->the_bfd, 
+        (*rb)->input_section.section, &b_sec, (file_ptr) 0, (bfd_size_type)sizeof(b_sec) ))
+           einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                (*rb)->input_section.ifile->the_bfd);
+
+      i =  ((a_sec < b_sec) ? -1 : 0);
+      if ( i != 0)
+        return i;
+      return  ((a_sec < b_sec) ? 0 : 1);
+   }
+return 0;
+}
+
+static int
+sort_by_section_name (a, b)
+     void *a;
+     void *b;
+{
+  lang_statement_union_type **ra = a;
+  lang_statement_union_type **rb = b;
+  int i;
+  i = strcmp ((*ra)->input_section.section->name,
+		 (*rb)->input_section.section->name);
+/* this is a hack to make .stab and .stabstr last, so we don't have
+   to fix strip/objcopy for .reloc sections.
+   FIXME stripping images with a .rsrc section still needs to be fixed */
+  if ( i != 0)
+    {
+      if ((strncmp ((*ra)->input_section.section->name, ".stab", 5) == 0)
+           && (strncmp ((*rb)->input_section.section->name, ".stab", 5) != 0))
+         return 1;
+      return i;
+    }
+  return i;
+}
+
+/* Subroutine of sort_sections to a contiguous subset of a list of sections.
+   NEXT_AFTER is the element after the last one to sort.
+   The result is a pointer to the last element's "next" pointer.  */
+
+static lang_statement_union_type **
+sort_sections_1 (startptr, next_after, count, sort_func)
+     lang_statement_union_type **startptr,*next_after;
+     int count;
+     int (*sort_func) ();
+{
+  lang_statement_union_type **vec;
+  lang_statement_union_type *p;
+  int i;
+  lang_statement_union_type **ret;
+
+  if (count == 0)
+    return startptr;
+
+  vec = ((lang_statement_union_type **)
+	 xmalloc (count * sizeof (lang_statement_union_type *)));
+
+  for (p = *startptr, i = 0; i < count; i++, p = p->next)
+    vec[i] = p;
+
+  qsort (vec, count, sizeof (vec[0]), sort_func);
+
+  /* Fill in the next pointers again. */
+  *startptr = vec[0];
+  for (i = 0; i < count - 1; i++)
+    vec[i]->header.next = vec[i + 1];
+  vec[i]->header.next = next_after;
+  ret = &vec[i]->header.next;
+  free (vec);
+  return ret;
+}
+
+/* Sort the .idata\$foo input sections of archives into filename order.
+   The reason is so dlltool can arrange to have the pe dll import information
+   generated correctly - the head of the list goes into dh.o, the tail into
+   dt.o, and the guts into ds[nnnn].o.  Note that this is only needed for the
+   .idata section.
+   FIXME: This may no longer be necessary with grouped sections.  Instead of
+   sorting on dh.o, ds[nnnn].o, dt.o, one could, for example, have dh.o use
+   .idata\$4h, have ds[nnnn].o use .idata\$4s[nnnn], and have dt.o use .idata\$4t.
+   This would have to be elaborated upon to handle multiple dll's
+   [assuming such an eloboration is possible of course].
+
+   We also sort sections in '\$' wild statements.  These are created by the
+   place_orphans routine to implement grouped sections.  */
+
+static void
+sort_sections (s)
+     lang_statement_union_type *s;
+{
+  for (; s ; s = s->next)
+    switch (s->header.type)
+      {
+      case lang_output_section_statement_enum:
+	sort_sections (s->output_section_statement.children.head);
+	break;
+      case lang_wild_statement_enum:
+	{
+	  lang_statement_union_type **p = &s->wild_statement.children.head;
+
+	  /* Is this the .idata section?  */
+	  if (s->wild_statement.section_name != NULL
+	      && strncmp (s->wild_statement.section_name, ".idata", 6) == 0)
+	    {
+	      /* Sort the children.  We want to sort any objects in
+                 the same archive.  In order to handle the case of
+                 including a single archive multiple times, we sort
+                 all the children by archive name and then by object
+                 name.  After sorting them, we re-thread the pointer
+                 chain.  */
+
+	      while (*p)
+		{
+		  lang_statement_union_type *start = *p;
+		  if (start->header.type != lang_input_section_enum
+		      || !start->input_section.ifile->the_bfd->my_archive)
+		    p = &(start->header.next);
+		  else
+		    {
+		      lang_statement_union_type *end;
+		      int count;
+
+		      for (end = start, count = 0;
+			   end && end->header.type == lang_input_section_enum;
+			   end = end->next)
+			count++;
+
+		      p = sort_sections_1 (p, end, count, sort_by_file_name);
+		    }
+		}
+	      break;
+	    }
+
+	  /* If this is a collection of grouped sections, sort them.
+	     The linker script must explicitly mention "*(.foo\$)" or
+	     "*(.foo\$*)".  Don't sort them if \$ is not the last
+	     character (not sure if this is really useful, but it
+	     allows explicitly mentioning some \$ sections and letting
+	     the linker handle the rest).  */
+	  if (s->wild_statement.section_name != NULL)
+	    {
+	      char *q = strchr (s->wild_statement.section_name, '\$');
+
+	      if (q != NULL
+		  && (q[1] == '\0'
+		      || (q[1] == '*' && q[2] == '\0')))
+		{
+		  lang_statement_union_type *end;
+		  int count;
+
+		  for (end = *p, count = 0; end; end = end->next)
+		    {
+		      if (end->header.type != lang_input_section_enum)
+			abort ();
+		      count++;
+		    }
+		  (void) sort_sections_1 (p, end, count, sort_by_section_name);
+		}
+	      break;
+	    }
+	}
+	break;
+      default:
+	break;
+      }
+}
+
+static void  
+gld_${EMULATION_NAME}_before_allocation()
+{
+  extern lang_statement_list_type *stat_ptr;
+
+#ifdef TARGET_IS_ppcpe
+  /* Here we rummage through the found bfds to collect toc information */
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (!ppc_process_before_allocation(is->the_bfd, &link_info))
+	  {
+	    einfo("Errors encountered processing file %s\n", is->filename);
+	  }
+      }
+  }
+
+  /* We have seen it all. Allocate it, and carry on */
+  ppc_allocate_toc_section (&link_info);
+#else
+#ifdef TARGET_IS_armpe
+  /* FIXME: we should be able to set the size of the interworking stub
+     section.
+
+     Here we rummage through the found bfds to collect glue
+     information.  FIXME: should this be based on a command line
+     option?  krk@cygnus.com */
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (!arm_process_before_allocation (is->the_bfd, & link_info))
+	  {
+	    einfo ("Errors encountered processing file %s", is->filename);
+	  }
+      }
+  }
+
+  /* We have seen it all. Allocate it, and carry on */
+  arm_allocate_interworking_sections (& link_info);
+#endif /* TARGET_IS_armpe */
+#endif /* TARGET_IS_ppcpe */
+
+  sort_sections (stat_ptr->head);
+}
+
+/* Place an orphan section.  We use this to put sections with a '\$' in them
+   into the right place.  Any section with a '\$' in them (e.g. .text\$foo)
+   gets mapped to the output section with everything from the '\$' on stripped
+   (e.g. .text).
+   See the Microsoft Portable Executable and Common Object File Format
+   Specification 4.1, section 4.2, Grouped Sections.
+
+   FIXME: This is now handled by the linker script using wildcards,
+   but I'm leaving this here in case we want to enable it for sections
+   which are not mentioned in the linker script.  */
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+     lang_input_statement_type *file;
+     asection *s;
+{
+  const char *secname;
+  char *output_secname, *ps;
+  lang_output_section_statement_type *os;
+  lang_statement_union_type *l;
+
+  if ((s->flags & SEC_ALLOC) == 0)
+    return false;
+
+  /* Don't process grouped sections unless doing a final link.
+     If they're marked as COMDAT sections, we don't want .text\$foo to
+     end up in .text and then have .text disappear because it's marked
+     link-once-discard.  */
+  if (link_info.relocateable)
+    return false;
+
+  secname = bfd_get_section_name (s->owner, s);
+
+  /* Everything from the '\$' on gets deleted so don't allow '\$' as the
+     first character.  */
+  if (*secname == '\$')
+    einfo ("%P%F: section %s has '\$' as first character\n", secname);
+  if (strchr (secname + 1, '\$') == NULL)
+    return false;
+
+  /* Look up the output section.  The Microsoft specs say sections names in
+     image files never contain a '\$'.  Fortunately, lang_..._lookup creates
+     the section if it doesn't exist.  */
+  output_secname = buystring (secname);
+  ps = strchr (output_secname + 1, '\$');
+  *ps = 0;
+  os = lang_output_section_statement_lookup (output_secname);
+
+  /* Find the '\$' wild statement for this section.  We currently require the
+     linker script to explicitly mention "*(.foo\$)".
+     FIXME: ppcpe.sc has .CRT\$foo in the .rdata section.  According to the
+     Microsoft docs this isn't correct so it's not (currently) handled.  */
+
+  ps[0] = '\$';
+  ps[1] = 0;
+  for (l = os->children.head; l; l = l->next)
+    {
+      if (l->header.type == lang_wild_statement_enum
+	  && strcmp (l->wild_statement.section_name, output_secname) == 0)
+	break;
+    }
+  ps[0] = 0;
+  if (l == NULL)
+#if 1
+    einfo ("%P%F: *(%s\$) missing from linker script\n", output_secname);
+#else /* FIXME: This block is untried.  It exists to convey the intent,
+	 should one decide to not require *(.foo\$) to appear in the linker
+	 script.  */
+    {
+      lang_wild_statement_type *new = new_stat (lang_wild_statement,
+						&os->children);
+      new->section_name = xmalloc (strlen (output_secname) + 2);
+      sprintf (new->section_name, "%s\$", output_secname);
+      new->filename = NULL;
+      lang_list_init (&new->children);
+      l = new;
+    }
+#endif
+
+  /* Link the input section in and we're done for now.
+     The sections still have to be sorted, but that has to wait until
+     all such sections have been processed by us.  The sorting is done by
+     sort_sections.  */
+  wild_doit (&l->wild_statement.children, s, os, file);
+
+  return true;
+}
+
+static char *
+gld_${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+# Scripts compiled in.
+# sed commands to quote an ld script as a C string.
+sc="-f ${srcdir}/emultempl/stringify.sed"
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+echo '  ; else return'                                     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
+echo '; }'                                                 >> e${EMULATION_NAME}.c
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld_${EMULATION_NAME}_before_parse,
+  syslib_default,
+  hll_default,
+  after_parse_default,
+  gld_${EMULATION_NAME}_after_open,
+  after_allocation_default,
+  set_output_arch_default,
+  ldemul_default_target,
+  gld_${EMULATION_NAME}_before_allocation,
+  gld_${EMULATION_NAME}_get_script,
+  "${EMULATION_NAME}",
+  "${OUTPUT_FORMAT}",
+  NULL, /* finish */
+  NULL, /* create output section statements */
+  NULL, /* open dynamic archive */
+  gld${EMULATION_NAME}_place_orphan,
+  gld_${EMULATION_NAME}_set_symbols,
+  gld_${EMULATION_NAME}_parse_args
+};
+EOF
--- binutils-2.9.1/ld/emultempl/pe.em	Fri May  1 08:48:55 1998
+++ binutils-2.9.1/ld/emultempl/pe.em	Sun Aug 23 00:00:00 1998
@@ -187,7 +187,9 @@ set_pe_subsystem ()
     {
       { "native", 1, "_NtProcessStartup" },
       { "windows", 2, "_WinMainCRTStartup" },
+      { "wwindows", 2, "_wWinMainCRTStartup" },
       { "console", 3, "_mainCRTStartup" },
+      { "wconsole", 3, "_wmainCRTStartup" },
 #if 0
       /* The Microsoft linker does not recognize this.  */
       { "os2", 5, "" },
@@ -222,7 +224,8 @@ set_pe_subsystem ()
 
 	  /* If the subsystem is windows, we use a different entry
 	     point.  We also register the entry point as an undefined
-	     symbol.  The reason we do this is so that the user
+	     symbol. from lang_add_entry() The reason we do
+	     this is so that the user
 	     doesn't have to because they would have to use the -u
 	     switch if they were specifying an entry point other than
 	     _mainCRTStartup.  Specifically, if creating a windows
@@ -237,7 +240,6 @@ set_pe_subsystem ()
 	     can avoid making the user do this by always adding the
 	     entry point name as an undefined symbol.  */
 	  lang_add_entry (v[i].entry, 1);
-	  ldlang_add_undef (v[i].entry);
 
 	  return;
 	}
@@ -444,15 +446,54 @@ sort_by_file_name (a, b)
 {
   lang_statement_union_type **ra = a;
   lang_statement_union_type **rb = b;
-  int i;
+  int i, a_sec, b_sec;
 
   i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename,
 	      (*rb)->input_section.ifile->the_bfd->my_archive->filename);
   if (i != 0)
     return i;
 
-  return strcmp ((*ra)->input_section.ifile->filename,
+  i = strcmp ((*ra)->input_section.ifile->filename,
 		 (*rb)->input_section.ifile->filename);
+  if (i != 0)
+    return i;
+  /* the tail idata4/5 are the only ones without relocs to an
+     idata$6 section unless we are importing by ordinal, 
+     so sort them to last to terminate the IAT
+     and HNT properly. if no reloc this one is import by ordinal
+     so we have to sort by section contents */
+
+  if ( ((*ra)->input_section.section->reloc_count + (*rb)->input_section.section->reloc_count) )
+    {
+       i =  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? -1 : 0);
+       if ( i != 0)
+         return i;
+
+        return  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? 0 : 1);
+    }
+  else
+    {
+       if ( (strcmp( (*ra)->input_section.section->name, ".idata$6") == 0) )
+          return 0; /* don't sort .idata$6 or .idata$7 FIXME dlltool eliminate .idata$7 */
+
+       if (! bfd_get_section_contents ((*ra)->input_section.ifile->the_bfd, 
+         (*ra)->input_section.section, &a_sec, (file_ptr) 0, (bfd_size_type)sizeof(a_sec)))
+            einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                 (*ra)->input_section.ifile->the_bfd);
+
+       if (! bfd_get_section_contents ((*rb)->input_section.ifile->the_bfd, 
+        (*rb)->input_section.section, &b_sec, (file_ptr) 0, (bfd_size_type)sizeof(b_sec) ))
+           einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                (*rb)->input_section.ifile->the_bfd);
+
+      i =  ((a_sec < b_sec) ? -1 : 0);
+      if ( i != 0)
+        return i;
+      return  ((a_sec < b_sec) ? 0 : 1);
+   }
+return 0;
 }
 
 static int
@@ -462,8 +503,20 @@ sort_by_section_name (a, b)
 {
   lang_statement_union_type **ra = a;
   lang_statement_union_type **rb = b;
-  return strcmp ((*ra)->input_section.section->name,
+  int i;
+  i = strcmp ((*ra)->input_section.section->name,
 		 (*rb)->input_section.section->name);
+/* this is a hack to make .stab and .stabstr last, so we don't have
+   to fix strip/objcopy for .reloc sections.
+   FIXME stripping images with a .rsrc section still needs to be fixed */
+  if ( i != 0)
+    {
+      if ((strncmp ((*ra)->input_section.section->name, ".stab", 5) == 0)
+           && (strncmp ((*rb)->input_section.section->name, ".stab", 5) != 0))
+         return 1;
+      return i;
+    }
+  return i;
 }
 
 /* Subroutine of sort_sections to a contiguous subset of a list of sections.
--- binutils-2.9.1/ld/genscripts.sh	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/genscripts.sh	Sun Aug 23 00:00:00 1998
@@ -16,7 +16,9 @@ target=$4
 target_alias=$5
 DEFAULT_EMULATION=$6
 NATIVE_LIB_DIRS=$7
-EMULATION_NAME=$8
+LIB_PATH=$8
+EMULATION_NAME=$9
+shift
 tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
 
 # Include the emulation-specific parameters:
--- binutils-2.9.1/ld/ldctor.c	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/ldctor.c	Sun Aug 23 00:00:00 1998
@@ -144,10 +144,13 @@ ldctor_build_sets ()
       /* If the symbol is defined, we may have been invoked from
 	 collect, and the sets may already have been built, so we do
 	 not do anything.  */
-      if (p->h->type == bfd_link_hash_defined
-	  || p->h->type == bfd_link_hash_defweak)
+      /* dgv -- libnix v1.1 uses absolute sets that are also explicitly
+	 defined in the library so that the sets need to be build even
+	 if the symbol is defined */
+      if ((output_bfd->xvec->flavour != bfd_target_amiga_flavour) &&
+	  (p->h->type == bfd_link_hash_defined
+	  || p->h->type == bfd_link_hash_defweak))
 	continue;
-
       /* For each set we build:
 	   set:
 	     .long number_of_elements
@@ -239,10 +242,17 @@ ldctor_build_sets ()
 	      if (e->name != NULL)
 		minfo ("%T\n", e->name);
 	      else
-		minfo ("%G\n", e->section->owner, e->section, e->value);
+		if (e->section->owner)
+		  minfo ("%G\n", e->section->owner, e->section, e->value);
+		else
+		  minfo ("%s\n", "** ABS **");
 	    }
 
-	  if (link_info.relocateable)
+	  /* dgv -- on the amiga, we want the constructors to be relocateable
+	     objects. However, this should be arranged somewhere else (FIXME) */
+	  if (link_info.relocateable ||
+	      (output_bfd->xvec->flavour == bfd_target_amiga_flavour &&
+	       e->section != bfd_abs_section_ptr))
 	    lang_add_reloc (p->reloc, howto, e->section, e->name,
 			    exp_intop (e->value));
 	  else
--- binutils-2.9.1/ld/ldfile.c	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/ldfile.c	Sun Aug 23 00:00:00 1998
@@ -39,6 +39,9 @@ Software Foundation, 59 Temple Place - S
 
 #include <ctype.h>
 
+static int n_flavors, flavors_len;
+char **flavors;
+
 const char *ldfile_input_filename;
 boolean ldfile_assumed_script = false;
 const char *ldfile_output_machine_name = "";
@@ -79,6 +82,32 @@ static boolean ldfile_open_file_search
 	   const char *lib, const char *suffix));
 static FILE *try_open PARAMS ((const char *name, const char *exten));
 
+static int flavors_cmp (f1, f2)
+     const void *f1, *f2;
+{
+  return strcmp (*(char**)f1, *(char**)f2);
+}
+
+void
+sort_flavors ()
+{
+  if (n_flavors > 1)
+    qsort ((void*)flavors, n_flavors, sizeof(char**), flavors_cmp);
+}
+
+void
+ldfile_add_flavor (name)
+     char *name;
+{
+  n_flavors++;
+  if (flavors)
+    flavors = (char**) xrealloc ((PTR)flavors, n_flavors*sizeof (char*));
+  else
+    flavors = (char**) xmalloc (sizeof (char*));
+  flavors [n_flavors-1] = name;
+  flavors_len += strlen (name);
+}
+
 void
 ldfile_add_library_path (name, cmdline)
      const char *name;
@@ -128,6 +157,7 @@ ldfile_open_file_search (arch, entry, li
      const char *suffix;
 {
   search_dirs_type *search;
+  char *flavor_dir = (char *) alloca (flavors_len + n_flavors + 1);
 
   /* If this is not an archive, try to open it in the current
      directory first.  */
@@ -142,6 +172,7 @@ ldfile_open_file_search (arch, entry, li
        search = search->next) 
     {
       char *string;
+      int i, count=n_flavors;
 
       if (entry->dynamic && ! link_info.relocateable)
 	{
@@ -171,15 +202,40 @@ ldfile_open_file_search (arch, entry, li
       else
 	sprintf (string, "%s%s%s", search->name, slash, entry->filename);
 
-      if (ldfile_try_open_bfd (string, entry))
-	{
-	  entry->filename = string;
-	  return true;
+      for (count = n_flavors; count>=0; count--) {
+	*flavor_dir = '\0';
+	for (i=0; i<count; i++) {
+	  strcat (flavor_dir, flavors[i]);
+	  strcat (flavor_dir, slash);
 	}
 
-      free (string);
+	string = (char *) xmalloc (strlen (search->name)
+				   + strlen (slash)
+				   + strlen (flavor_dir)
+				   + strlen (lib)
+				   + strlen (entry->filename)
+				   + strlen (arch)
+				   + strlen (suffix)
+				   + 1);
+	
+	if (entry->is_archive)
+	  sprintf (string, "%s%s%s%s%s%s%s", search->name, slash, flavor_dir,
+		   lib, entry->filename, arch, suffix);
+	else if (entry->filename[0] == '/' || entry->filename[0] == '.')
+	  strcpy (string, entry->filename);
+	else
+	  sprintf (string, "%s%s%s%s", search->name, slash, flavor_dir,
+		   entry->filename);
+	
+	if (ldfile_try_open_bfd (string, entry))
+	  {
+	    entry->filename = string;
+	    return true;
+	  }
+	
+	free (string);
+      }
     }
-
   return false;
 }
 
@@ -206,6 +262,15 @@ ldfile_open_file (entry)
 	   arch != (search_arch_type *) NULL;
 	   arch = arch->next)
 	{
+#if (defined (__BEOS__) && defined (__INTEL__))
+          if (ldfile_open_file_search (arch->name, entry, "lib", ".so.LIB"))
+            return;
+#endif
+#if defined (__CYGWIN32__)
+	  if (strcmp (default_target, "pei-i386") == 0
+	      && (ldfile_open_file_search (arch->name, entry, "", ".lib")))
+            return;
+#endif
 	  if (ldfile_open_file_search (arch->name, entry, "lib", ".a"))
 	    return;
 #ifdef VMS
--- binutils-2.9.1/ld/ldlang.c	Fri May  1 08:48:49 1998
+++ binutils-2.9.1/ld/ldlang.c	Sun Aug 23 00:00:00 1998
@@ -745,12 +745,32 @@ section_already_linked (abfd, sec, data)
 
   if ((flags & SEC_LINK_ONCE) == 0)
     return;
-
+  pei_get_comdat_info(sec);
   name = bfd_get_section_name (abfd, sec);
+  if (sec->pe_comdat_info != NULL)
+    {
+      if (sec->pe_comdat_info && sec->pe_comdat_info->asoc_sec != (int)NULL)
+	{
+	  /* .idata$2 & .idata$3 are not marked SEC_LINK_ONCE in MS .lib's
+	     assuming that any SEC_LINK_ONCE section that dosen't have a
+	     comdat symbol is an associated section and that the 
+	     section with the symbol has already been processed */
+	  for (l = sec_link_once_list; l != NULL; l = l->next)
+	    {
+	      if ((abfd == l->sec->owner) && (sec->pe_comdat_info->asoc_sec == l->sec->index + 1))
+		return;
+	    }
+	  sec->output_section = bfd_abs_section_ptr;
+	  return;
+	}
+    }
 
   for (l = sec_link_once_list; l != NULL; l = l->next)
     {
-      if (strcmp (name, bfd_get_section_name (l->sec->owner, l->sec)) == 0)
+     if ((strcmp (name, bfd_get_section_name (l->sec->owner, l->sec)) == 0)
+	 && sec->pe_comdat_info != NULL
+	 && (strcmp (sec->pe_comdat_info->name_buf, l->sec->pe_comdat_info->name_buf) == 0)
+	 && (strcmp (sec->pe_comdat_info->comdat_sym, l->sec->pe_comdat_info->comdat_sym) == 0))
 	{
 	  /* The section has already been linked.  See if we should
              issue a warning.  */
@@ -790,7 +810,7 @@ section_already_linked (abfd, sec, data)
 	}
     }
 
-  /* This is the first section with this name.  Record it.  */
+  /* This is the first section with this name and symbol.  Record it.  */
 
   l = (struct sec_link_once *) xmalloc (sizeof *l);
   l->sec = sec;
@@ -1442,6 +1462,27 @@ ldlang_add_undef (name)
   new->name = buystring (name);
 }
 
+/* exchange an older undefined entry point for a newer one
+   this will avoid dragging in the extra .o files
+   when the entry point is in a lib file */
+void
+ldlang_switch_undef_entry (name)
+     CONST char *CONST name;
+{
+  ldlang_undef_chain_list_type *new = ldlang_undef_chain_list_head;
+  while (new != (ldlang_undef_chain_list_type *) NULL)
+  {
+  if (strcmp (new->name, entry_symbol) == 0)
+     {
+     free(new->name);
+     new->name = buystring (name);
+     }
+  new = new->next;
+  }
+
+}
+
+
 /* Run through the list of undefineds created above and place them
    into the linker hash table as undefined symbols belonging to the
    script file.
@@ -3389,17 +3430,13 @@ lang_add_entry (name, cmdline)
       || cmdline
       || ! entry_from_cmdline)
     {
+      if (entry_symbol != NULL)
+         ldlang_switch_undef_entry (name);
+      else
+         ldlang_add_undef(name);
       entry_symbol = name;
       entry_from_cmdline = cmdline;
     }
-#if 0 
-  /* don't do this yet.  It seems to work (the executables run), but the 
-     image created is very different from what I was getting before indicating
-     that something else is being pulled in.  When everything else is working,
-     then try to put this back in to see if it will do the right thing for
-     other more complicated applications */
-  ldlang_add_undef (name);
-#endif
 }
 
 void
--- binutils-2.9.1/ld/ldlang.h	Fri May  1 08:48:49 1998
+++ binutils-2.9.1/ld/ldlang.h	Sun Aug 23 00:00:00 1998
@@ -256,6 +256,8 @@ typedef struct lang_input_statement_stru
   /*    unsigned int globals_in_this_file;*/
   const char *target;
   boolean real;
+  /* Added for AMIGA support of section attributes */
+  int amiga_attribute;
 } lang_input_statement_type;
 
 typedef struct
--- binutils-2.9.1/ld/ldmain.c	Fri May  1 08:48:49 1998
+++ binutils-2.9.1/ld/ldmain.c	Sun Aug 23 00:00:00 1998
@@ -147,8 +147,10 @@ remove_output ()
 {
   if (output_filename) 
     {
-      if (output_bfd && output_bfd->iostream)
+      if (output_bfd && output_bfd->iostream) {
 	fclose((FILE *)(output_bfd->iostream));
+	output_bfd->iostream = NULL;
+      }
       if (delete_output_file_on_failure)
 	unlink (output_filename);
     }
--- binutils-2.9.1/ld/ld.texinfo	Fri May  1 08:48:48 1998
+++ binutils-2.9.1/ld/ld.texinfo	Sun Aug 23 00:00:00 1998
@@ -1834,11 +1834,11 @@ other places they can appear for aesthet
 @table @code
 @item Assignment
 Semicolons must appear at the end of assignment expressions.
-@xref{Assignment}
+@xref{Assignment}.
 
 @item PHDRS
 Semicolons must appear at the end of a @code{PHDRS} statement.
-@xref{PHDRS}
+@xref{PHDRS}.
 @end table
 
 @node MEMORY
--- binutils-2.9.1/ld/Makefile.am	Fri May  1 08:48:47 1998
+++ binutils-2.9.1/ld/Makefile.am	Sun Aug 23 00:00:00 1998
@@ -93,6 +93,8 @@ ALL_EMULATIONS = \
 	ea29k.o \
 	eaixppc.o \
 	eaixrs6.o \
+	eamiga.o \
+	eamiga_bss.o \
 	ealpha.o \
 	earcelf.o \
 	earmaoutb.o \
@@ -128,6 +130,7 @@ ALL_EMULATIONS = \
 	ehp3hpux.o \
 	ehppaelf.o \
 	ei386aout.o \
+	ei386beos.o \
 	ei386bsd.o \
 	ei386coff.o \
 	ei386go32.o \
@@ -159,6 +162,8 @@ ALL_EMULATIONS = \
 	enews.o \
 	ens32knbsd.o \
 	epc532macha.o \
+	eppcamiga.o \
+	eppcamiga_bss.o \
 	eppcmacos.o \
 	eppcnw.o \
 	eppcpe.o \
@@ -225,10 +230,22 @@ ldemul-list.h: Makefile
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" "$(LIB_PATH)"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 @TDIRS@
 
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} amiga "$(tdir_amiga)"
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
+eppcamiga.c: $(srcdir)/emulparams/ppcamiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} ppcamiga "$(tdir_ppcamiga)"
+eppcamiga_bss.c: $(srcdir)/emulparams/ppcamiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} ppcamiga_bss "$(tdir_ppcamiga_bss)"
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} a29k "$(tdir_a29k)"
@@ -358,6 +375,9 @@ ehppaelf.c: $(srcdir)/emulparams/hppaelf
 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
+  $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} i386beos "$(tdir_i386beos)"
 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
@@ -542,6 +562,16 @@ ld_new_LDADD = $(EMULATION_OFILES) $(BFD
 $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
   ldctor.h ldexp.h ldlang.h ldgram.h
+
+# GG-local: For BeOS, we use a fake ld that calls GNU ld and then mwld.
+beos-ld: beos-ld.c
+	$(CC) -I. -I$(INCDIR) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -DLDNAME='"@LDNAME@"' -DTARGET_ALIAS='"@target_alias@"' -o $@ $(srcdir)/beos-ld.c
+
+install-beos-ld:
+	test -d $(tooldir) || mkdir $(tooldir)
+	test -d $(tooldir)/bin || mkdir $(tooldir)/bin
+	$(INSTALL_XFORM) beos-ld $(bindir)/ld
+	$(INSTALL_PROGRAM) beos-ld $(tooldir)/bin/ld
 
 # This is the real libbfd.a created by libtool.
 TESTBFDLIB = @TESTBFDLIB@
--- binutils-2.9.1/ld/Makefile.in	Fri May  1 08:48:47 1998
+++ binutils-2.9.1/ld/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -62,19 +68,17 @@ host_triplet = @host@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+EXTRA_INSTALL = @EXTRA_INSTALL@
+EXTRA_PROGS = @EXTRA_PROGS@
 HDEFINES = @HDEFINES@
-LD = @LD@
+LDNAME = @LDNAME@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
 NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 TDIRS = @TDIRS@
-VERSION = @VERSION@
 
 AUTOMAKE_OPTIONS = cygnus dejagnu
 
@@ -169,6 +173,8 @@ ALL_EMULATIONS = \
 	ea29k.o \
 	eaixppc.o \
 	eaixrs6.o \
+	eamiga.o \
+	eamiga_bss.o \
 	ealpha.o \
 	earcelf.o \
 	earmaoutb.o \
@@ -204,6 +210,7 @@ ALL_EMULATIONS = \
 	ehp3hpux.o \
 	ehppaelf.o \
 	ei386aout.o \
+	ei386beos.o \
 	ei386bsd.o \
 	ei386coff.o \
 	ei386go32.o \
@@ -235,6 +242,8 @@ ALL_EMULATIONS = \
 	enews.o \
 	ens32knbsd.o \
 	epc532macha.o \
+	eppcamiga.o \
+	eppcamiga_bss.o \
 	eppcmacos.o \
 	eppcnw.o \
 	eppcpe.o \
@@ -283,7 +292,7 @@ STAGESTUFF = *.o ldscripts/* e*.c
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" "$(LIB_PATH)"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 
 ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
@@ -324,12 +333,20 @@ CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then echo $(top_builddir)/../texinfo/makeinfo/makeinfo; else echo makeinfo; fi`
 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
 TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = ld.info
 DVIS = ld.dvi
 TEXINFOS = ld.texinfo
-MANS = ld.1
+GUIDES = ld.guide
+GUIDE_DEPS = ld.guide
+HTMLS = ld.html
+HTML_DEPS = ld.html
+PS_S = ld.ps
+PS_DEPS = ld.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  README ChangeLog Makefile.am Makefile.in NEWS TODO \
@@ -337,21 +354,24 @@ acconfig.h acinclude.m4 aclocal.m4 confi
 ldgram.c ldlex.c stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(ld_new_SOURCES)
 OBJECTS = $(ld_new_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) config.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .l .lo .o .ps .s .texi .texinfo .txi .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -445,6 +465,9 @@ ldgram.h: ldgram.c
 	$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
 
 ld.info: ld.texinfo
+ld.guide: ld.texinfo
+ld.html: ld.texinfo
+ld.ps: ld.dvi
 ld.dvi: ld.texinfo
 
 
@@ -452,7 +475,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -460,39 +483,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -503,11 +538,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -520,10 +555,140 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps \
 	  ld.log ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr \
-	  ld.cv ld.cn
+	  ld.cv ld.cn ld.guide ld.html ld.ps
 
 clean-aminfo:
 
@@ -537,21 +702,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "ld" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ld.1; then file=$(srcdir)/ld.1; \
-	else file=ld.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "ld" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -645,6 +834,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE) check-DEJAGNU
@@ -661,12 +853,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(mandir)/man1
+	$(mkinstalldirs)  $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -685,39 +875,50 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-noinstPROGRAMS \
 		mostlyclean-compile mostlyclean-libtool \
-		mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
-		mostlyclean-local
+		mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-tags \
+		mostlyclean-generic mostlyclean-local
 
 clean:  clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \
-		clean-aminfo clean-tags clean-generic mostlyclean
+		clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-noinstPROGRAMS distclean-compile \
-		distclean-libtool distclean-aminfo distclean-tags \
-		distclean-generic clean distclean-local
+		distclean-libtool distclean-aminfo distclean-guide \
+		distclean-html distclean-dvi distclean-ps \
+		distclean-tags distclean-generic clean distclean-local
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-noinstPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
-clean-aminfo maintainer-clean-aminfo install-man uninstall-man tags \
-mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir check-DEJAGNU info dvi installcheck install-info install-exec \
-install-data install uninstall all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir check-DEJAGNU info guide html \
+ps dvi installcheck install-info install-exec install-data install \
+uninstall all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
 
 
 ldmain.o: ldmain.c config.status
@@ -739,6 +940,18 @@ ldemul-list.h: Makefile
 	mv ldemul-tmp.h ldemul-list.h
 @TDIRS@
 
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} amiga "$(tdir_amiga)"
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
+eppcamiga.c: $(srcdir)/emulparams/ppcamiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} ppcamiga "$(tdir_ppcamiga)"
+eppcamiga_bss.c: $(srcdir)/emulparams/ppcamiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} ppcamiga_bss "$(tdir_ppcamiga_bss)"
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} a29k "$(tdir_a29k)"
@@ -868,6 +1081,9 @@ ehppaelf.c: $(srcdir)/emulparams/hppaelf
 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
+  $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} i386beos "$(tdir_i386beos)"
 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
@@ -1047,6 +1263,16 @@ ez8002.c: $(srcdir)/emulparams/z8002.sh 
 $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
   ldctor.h ldexp.h ldlang.h ldgram.h
+
+# GG-local: For BeOS, we use a fake ld that calls GNU ld and then mwld.
+beos-ld: beos-ld.c
+	$(CC) -I. -I$(INCDIR) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -DLDNAME='"@LDNAME@"' -DTARGET_ALIAS='"@target_alias@"' -o $@ $(srcdir)/beos-ld.c
+
+install-beos-ld:
+	test -d $(tooldir) || mkdir $(tooldir)
+	test -d $(tooldir)/bin || mkdir $(tooldir)/bin
+	$(INSTALL_XFORM) beos-ld $(bindir)/ld
+	$(INSTALL_PROGRAM) beos-ld $(tooldir)/bin/ld
 
 check-DEJAGNU: site.exp
 	srcroot=`cd $(srcdir) && pwd`; export srcroot; \
--- binutils-2.9.1/ld/scripttempl/amiga_bss.sc	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/scripttempl/amiga_bss.sc	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,41 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${STACKZERO+${RELOCATING+${STACKZERO}}}
+${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
+
+SECTIONS
+{
+  ${RELOCATING+. = ${TEXT_START_ADDR};}
+  .text :
+  {
+    ${RELOCATING+___machtype = ABSOLUTE(0x0);}
+    ${RELOCATING+__stext = .;}
+    *(.text)
+    ${RELOCATING+___datadata_relocs = .;}
+    ${RELOCATING+__etext = .;}
+    ${RELOCATING+___text_size = ABSOLUTE(__etext - __stext);}
+    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
+  }
+  ${RELOCATING+. = ${DATA_ALIGNMENT};}
+  .data :
+  {
+    ${RELOCATING+__sdata = .;}
+    ${CONSTRUCTING+CONSTRUCTORS}
+    *(.data)
+    ${RELOCATING+___a4_init = 0x7ffe;}
+    ${RELOCATING+___data_size = ABSOLUTE(__edata - __sdata);}
+    ${RELOCATING+___bss_size = ABSOLUTE(0);}
+  }
+  .bss :
+  {
+    *(.bss)
+    *(COMMON)
+    ${RELOCATING+__edata  =  .;}
+    ${RELOCATING+__bss_start  =  .;}
+    ${RELOCATING+__end = ALIGN(4) };
+  }
+}
+EOF
--- binutils-2.9.1/ld/scripttempl/amiga.sc	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/scripttempl/amiga.sc	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,48 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${STACKZERO+${RELOCATING+${STACKZERO}}}
+${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
+
+SECTIONS
+{
+  ${RELOCATING+. = ${TEXT_START_ADDR};}
+  .text :
+  {
+    ${RELOCATING+___machtype = ABSOLUTE(0x0);}
+    ${RELOCATING+__stext = .;}
+    *(.text)
+    ${RELOCATING+__etext = .;}
+    ${RELOCATING+___text_size = ABSOLUTE(__etext - __stext);}
+    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
+  }
+  ${RELOCATING+. = ${DATA_ALIGNMENT};}
+  .data :
+  {
+    ${RELOCATING+__sdata = .;}
+    ${CONSTRUCTING+CONSTRUCTORS}
+    *(.data)
+    ${RELOCATING+__edata = .;}
+    ${RELOCATING+___data_size = ABSOLUTE(__edata - __sdata);}
+  }
+  ${RELOCATING+. = ALIGN(0x0);}
+  .bss :
+  {
+    ${RELOCATING+ __bss_start = .};
+    *(.bss)
+    *(COMMON)
+    ${RELOCATING+__end = . };
+    ${RELOCATING+___bss_size = ABSOLUTE(__end - __bss_start);}
+  }
+  .data_chip :
+  {
+    *(.data_chip)
+  }
+  .bss_chip :
+  {
+    *(.bss_chip)
+  }
+}
+EOF
--- binutils-2.9.1/ld/scripttempl/i386beos.sc	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/ld/scripttempl/i386beos.sc	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,165 @@
+# Linker script for PE.
+
+if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
+  RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+fi
+
+# We can't easily and portably get an unquoted $ in a shell
+# substitution, so we do this instead.
+if test "${RELOCATING}"; then
+  R_TEXT='*(.text$*)'
+  R_DATA='*(.data$*)'
+  R_RDATA='*(.rdata$*)'
+  R_IDATA='
+    *(.idata$2)
+    *(.idata$3)
+    /* These zeroes mark the end of the import list.  */
+    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+    *(.idata$4)
+    *(.idata$5)
+    *(.idata$6)
+    *(.idata$7)'
+  R_CRT='*(.CRT$*)'
+  R_RSRC='*(.rsrc$*)'
+  R_EXC='*(.exc$*)'
+else
+  R_TEXT=
+  R_DATA=
+  R_RDATA=
+  R_IDATA=
+  R_CRT=
+  R_RSRC=
+  R_EXC=
+fi
+
+cat <<EOF
+${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
+${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+
+${LIB_SEARCH_DIRS}
+
+ENTRY(__start)
+${RELOCATING+header = .;}
+${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */}
+${RELOCATING+__ldused = .;}
+SECTIONS
+{
+  .text ${RELOCATING+ __image_base__ + __section_alignment__ } : 
+  {
+    ${RELOCATING+ __text_start__ = . ;}
+    ${RELOCATING+ *(.init)}
+    *(.text)
+    ${R_TEXT}
+    *(.glue_7t)
+    *(.glue_7)
+    ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; 
+			LONG (-1); *(.ctors); *(.ctor); LONG (0); }
+    ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; 
+			LONG (-1); *(.dtors); *(.dtor);  LONG (0); }
+    ${RELOCATING+ *(.fini)}
+    /* ??? Why is .gcc_exc here?  */
+    ${RELOCATING+ *(.gcc_exc)}
+    ${RELOCATING+ etext = .;}
+    ${RELOCATING+ __text_end__ = .;}
+    *(.gcc_except_table)
+  }
+
+  /* The Cygwin32 library uses a section to avoid copying certain data
+     on fork.  This used to be named ".data$nocopy".  The linker used
+     to include this between __data_start__ and __data_end__, but that
+     breaks building the cygwin32 dll.  Instead, we name the section
+     ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+
+  .data ${RELOCATING+BLOCK(__section_alignment__)} : 
+  {
+    ${RELOCATING+__data_start__ = . ;}
+    *(.data)
+    *(.data2)
+    ${R_DATA}
+    ${RELOCATING+__data_end__ = . ;}
+    ${RELOCATING+*(.data_cygwin_nocopy)}
+  }
+
+  .bss ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${RELOCATING+__bss_start__ = . ;}
+    *(.bss)
+    *(COMMON)
+    /* link.exe apparently pulls in .obj's because of UNDEF common
+	symbols, which is not the coff way, but that's MS for you. */
+    *(.CRT\$XCA)
+    *(.CRT\$XCZ)
+    *(.CRT\$XIA)
+    *(.CRT\$XIZ)
+    ${RELOCATING+__bss_end__ = . ;}
+  }
+
+  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    *(.rdata)
+    ${R_RDATA}
+    *(.eh_frame)
+  }
+
+  .edata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    *(.edata)
+  }
+
+  /DISCARD/ :
+  {
+    *(.debug\$S)
+    *(.debug\$T)
+    *(.debug\$F)
+    *(.drectve)
+  }
+
+  .idata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    /* This cannot currently be handled with grouped sections.
+	See pe.em:sort_sections.  */
+    ${R_IDATA}
+  }
+  .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    ${R_CRT}
+  }
+
+  .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    /* end is deprecated, don't use it */
+    ${RELOCATING+ end = .;}
+    ${RELOCATING+ __end__ = .;}
+  }
+
+  .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.reloc)
+    ${RELOCATING+ /* These zeroes mark the end of the reloc section.  */}
+    ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
+  }
+
+  .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.rsrc)
+    ${R_RSRC}
+  }
+
+  .exc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.exc)
+    ${R_EXC}
+  }
+
+  .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    [ .stab ]
+  }
+
+  .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    [ .stabstr ]
+  }
+${RELOCATING+end = .; /* MS startup code needs this */}
+}
+EOF
--- binutils-2.9.1/ld/scripttempl/pe.sc	Fri May  1 08:48:58 1998
+++ binutils-2.9.1/ld/scripttempl/pe.sc	Sun Aug 23 00:00:00 1998
@@ -37,7 +37,9 @@ ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABL
 ${LIB_SEARCH_DIRS}
 
 ENTRY(_mainCRTStartup)
-
+${RELOCATING+header = .;}
+${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */}
+${RELOCATING+__ldused = .;}
 SECTIONS
 {
   .text ${RELOCATING+ __image_base__ + __section_alignment__ } : 
@@ -79,6 +81,12 @@ SECTIONS
     ${RELOCATING+__bss_start__ = . ;}
     *(.bss)
     *(COMMON)
+    /* link.exe apparently pulls in .obj's because of UNDEF common
+	symbols, which is not the coff way, but that's MS for you. */
+    *(.CRT\$XCA)
+    *(.CRT\$XCZ)
+    *(.CRT\$XIA)
+    *(.CRT\$XIZ)
     ${RELOCATING+__bss_end__ = . ;}
   }
 
@@ -123,6 +131,8 @@ SECTIONS
   .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
   { 					
     *(.reloc)
+    ${RELOCATING+ /* These zeroes mark the end of the reloc section.  */}
+    ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
   }
 
   .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -140,6 +150,6 @@ SECTIONS
   {
     [ .stabstr ]
   }
-
+${RELOCATING+end = .; /* MS startup code needs this */}
 }
 EOF
--- binutils-2.9.1/libiberty/alloca-norm.h	Fri May  1 08:47:48 1998
+++ binutils-2.9.1/libiberty/alloca-norm.h	Sun Aug 23 00:00:00 1998
@@ -1,6 +1,6 @@
 /* "Normal" configuration for alloca.  */
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 #ifndef alloca
 #define alloca __builtin_alloca
 #endif
--- binutils-2.9.1/libiberty/ChangeLog	Fri May  1 08:47:47 1998
+++ binutils-2.9.1/libiberty/ChangeLog	Sun Aug 23 00:00:00 1998
@@ -129,6 +129,12 @@ Wed Sep 24 00:31:59 1997  Felix Lee  <fl
 	* config/mh-windows (EXTRA_OFILES): add asprintf.o and
  	strncasecmp.o.
 
+Mon Sep 22 14:26:22 1997  Fred Fish  <fnf@cygnus.com>
+
+	* Makefile.in (lneeded-list): Since xmalloc.o and xexit.o
+	are in REQUIRED_OFILES, there is no need to include them
+	again, so remove conditional include based on alloca.o use.
+
 Thu Aug 28 14:27:15 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
 	* vasprintf.c (vasprintf): Allow for _BSD_VA_LIST_.
--- binutils-2.9.1/libiberty/config/mh-amigaos	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/libiberty/config/mh-amigaos	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,12 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# We don't actually use libmmalloc.a, since there is no sbrk(),
+# but this allows us to compile it (and then ignore it).
+MMALLOC=
+MMALLOC_DISABLE = -DNO_MMALLOC
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+
+# Compile for automatic stack extension.
+HDEFINES = -mstackextend
--- binutils-2.9.1/libiberty/config/mh-beos	Wed Dec 31 17:00:00 1969
+++ binutils-2.9.1/libiberty/config/mh-beos	Sun Aug 23 00:00:00 1998
@@ -0,0 +1,7 @@
+# Host makefile fragment for BeOS
+
+# This is a temporary hack until the wimpy default 64k stack
+# limit in BeOS is either increased or made user settable somehow.
+# This probably won't happen until after the DR9 release.
+
+EXTRA_OFILES = alloca.o
--- binutils-2.9.1/libiberty/config.table	Fri May  1 08:47:49 1998
+++ binutils-2.9.1/libiberty/config.table	Sun Aug 23 00:00:00 1998
@@ -23,6 +23,8 @@ case "${host}" in
   *-*-sysv*)		frag=mh-sysv ;;
   *-*-go32)		frag=mh-go32 ;;
   i[345]86-*-windows*)	frag=mh-windows ;;
+  *-*-amigaos*)		frag=mh-amigaos ;;
+  *-*-beos*)		frag=mh-beos ;;
 
   *-*-vxworks5* | *-*-vxworks)
     # VxWorks 5 needs special action, because the usual
--- binutils-2.9.1/libiberty/Makefile.in	Fri May  1 08:47:47 1998
+++ binutils-2.9.1/libiberty/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -28,7 +28,7 @@
 
 srcdir = .
 
-prefix = /usr/local
+prefix = @prefix@
 
 exec_prefix = $(prefix)
 bindir = $(exec_prefix)/bin
@@ -63,15 +63,15 @@ INSTALL = $(SHELL) $(srcdir)/../install-
 INSTALL_PROGRAM = $(INSTALL)
 INSTALL_DATA = $(INSTALL)
 
-AR = ar
-AR_FLAGS = rc
+AR = @AR@
+ARFLAGS = @ARFLAGS@
 
 ERRORS_CC = $(CC)
 CC = cc
 CFLAGS = -g
 LIBCFLAGS = $(CFLAGS)
 MAKEINFO = makeinfo
-RANLIB = ranlib
+RANLIB = @RANLIB@
 
 PICFLAG =
 
@@ -100,7 +100,7 @@ EXTRA_OFILES = 
 # Flags to pass to a recursive make.
 FLAGS_TO_PASS = \
 	"AR=$(AR)" \
-	"AR_FLAGS=$(AR_FLAGS)" \
+	"ARFLAGS=$(ARFLAGS)" \
 	"CC=$(CC)" \
 	"CFLAGS=$(CFLAGS)" \
 	"LIBCFLAGS=$(LIBCFLAGS)" \
@@ -130,7 +130,7 @@ check installcheck:
 
 INCDIR=$(srcdir)/$(MULTISRCTOP)../include
 
-COMPILE.c = $(CC) -c $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
+COMPILE.c = $(CC) -c $(LIBCFLAGS) -I. -I$(INCDIR) -I$(srcdir) $(HDEFINES)
 .c.o:
 	test -z "$(PICFLAG)" || \
 	  $(COMPILE.c) $(PICFLAG) $< -o pic/$@
@@ -204,9 +204,6 @@ lneeded-list: $(EXTRA_OFILES) needed.awk
 	    *) f="$$f $$i" ;; \
 	  esac ; \
 	done ; \
-	case $$f in \
-	    *alloca.o*) f="$$f xmalloc.o xexit.o" ;; \
-	esac ; \
 	echo $$f >>lneeded-list
 
 # Generate an awk script that looks for functions in functions.def
@@ -243,7 +240,7 @@ needed2.awk: $(srcdir)/functions.def Mak
 	 >>needed2.awk
 
 dummy.o: $(srcdir)/dummy.c $(srcdir)/functions.def
-	$(CC) -c $(CFLAGS) -I. -I$(INCDIR) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
+	$(CC) -c $(CFLAGS) -I. -I$(INCDIR) -I$(srcdir) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
 
 errors: dummy.o $(EXTRA_OFILES)
 	-($(ERRORS_CC) -o dummy $(CFLAGS) $(LDFLAGS) $(ERRORS_LDFLAGS) dummy.o $(EXTRA_OFILES) $(LOADLIBES)) >errors 2>&1 || true
@@ -263,7 +260,7 @@ $(RULE1): $(REQUIRED_OFILES) $(DO_ALSO) 
 RULE2 = not-used
 $(RULE2): $(REQUIRED_OFILES) $(HOST_OFILES)
 	rm -rf $(TARGETLIB)
-	$(AR) $(AR_FLAGS) $(TARGETLIB) \
+	$(AR) $(ARFLAGS) $(TARGETLIB) \
 	  $(REQUIRED_OFILES) $(HOST_OFILES)
 	$(RANLIB) $(TARGETLIB)
 
--- binutils-2.9.1/libiberty/xmalloc.c	Fri May  1 08:47:56 1998
+++ binutils-2.9.1/libiberty/xmalloc.c	Sun Aug 23 00:00:00 1998
@@ -53,7 +53,7 @@ xmalloc_set_program_name (s)
      const char *s;
 {
   name = s;
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
+#if defined (HAVE_SBRK) && (! defined (_WIN32) || defined (__CYGWIN32__))
   /* Win32 ports other than cygwin32 don't have brk() */
   if (first_break == NULL)
     first_break = (char *) sbrk (0);
@@ -71,7 +71,7 @@ xmalloc (size)
   newmem = malloc (size);
   if (!newmem)
     {
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
+#if defined (HAVE_SBRK) && (! defined (_WIN32) || defined (__CYGWIN32__))
       extern char **environ;
       size_t allocated;
 
@@ -109,7 +109,7 @@ xrealloc (oldmem, size)
     newmem = realloc (oldmem, size);
   if (!newmem)
     {
-#ifndef __MINGW32__
+#if defined (HAVE_SBRK) && !defined (__MINGW32__)
       extern char **environ;
       size_t allocated;
 
--- binutils-2.9.1/ltconfig	Fri May  1 08:49:28 1998
+++ binutils-2.9.1/ltconfig	Tue May 11 13:33:47 1999
@@ -90,6 +90,7 @@ with_gcc=no
 with_gnu_ld=no
 
 old_AR="$AR"
+old_ARFLAGS="$ARFLAGS"
 old_CC="$CC"
 old_CFLAGS="$CFLAGS"
 old_CPPFLAGS="$CPPFLAGS"
@@ -320,12 +321,13 @@ aix3*)
 esac
 
 # Determine commands to create old-style static archives.
-old_archive_cmds='$AR cru $oldlib$oldobjs'
+old_archive_cmds='$AR $ARFLAGS $oldlib$oldobjs'
 old_postinstall_cmds='chmod 644 $oldlib'
 old_postuninstall_cmds=
 
 # Set a sane default for `AR'.
 test -z "$AR" && AR=ar
+test -z "$ARFLAGS" && ARFLAGS=cru
 
 # If RANLIB is not set, then run the test.
 if test "${RANLIB+set}" != "set"; then
@@ -732,7 +734,7 @@ else
   case "$host_os" in
   aix3*)
     allow_undefined_flag=unsupported
-    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
+    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR $ARFLAGS $lib $objdir/$soname'
     # Note: this linker hardcodes the directories in LIBPATH if there
     # are no directories specified by -L.
     hardcode_minus_L=yes
@@ -745,13 +747,13 @@ else
 
   aix4*)
     allow_undefined_flag=unsupported
-    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
+    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR $ARFLAGS $lib $objdir/$soname'
     hardcode_direct=yes
     hardcode_minus_L=yes
     ;;
 
   amigaos*)
-    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
+    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR $ARFLAGS $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
     hardcode_libdir_flag_spec='-L$libdir'
     hardcode_minus_L=yes
     ;;
@@ -1120,7 +1122,7 @@ aix3* | aix4*)
 amigaos*)
   library_names_spec='$libname.ixlibrary $libname.a'
   # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show \"(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)\"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
   ;;
 
 freebsd2* | freebsd3*)
@@ -1378,6 +1380,9 @@ host="$host"
 
 # The archiver.
 AR="$AR"
+
+# The flags passed to the archiver to create an archive
+ARFLAGS="$ARFLAGS"
 
 # The default C compiler.
 CC="$CC"
--- binutils-2.9.1/Makefile.in	Fri May  1 08:52:55 1998
+++ binutils-2.9.1/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -20,7 +20,7 @@
 
 srcdir = .
 
-prefix = /usr/local
+prefix = @prefix@
 exec_prefix = $(prefix)
 
 bindir=${exec_prefix}/bin
@@ -49,6 +49,9 @@ man6dir = $(mandir)/man6
 man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
+infodir = $(prefix)/info
+guidedir =$(prefix)/guide
+includedir = $(prefix)/include
 GDB_NLM_DEPS = 
 
 SHELL = /bin/sh
@@ -65,9 +68,9 @@ INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_DOSREL = install-dosrel-fake
 
 AS = as
-AR = ar
-AR_FLAGS = rc
-CC = cc
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+CC = @CC@
 
 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
 # here so that they can be overridden by Makefile fragments.
@@ -93,7 +96,7 @@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-
 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 
-RANLIB = ranlib
+RANLIB = @RANLIB@
 
 DLLTOOL = dlltool
 WINDRES = windres
@@ -318,7 +321,7 @@ NM_FOR_TARGET = ` \
 # Flags to pass down to all sub-makes.
 # Please keep these in alphabetical order.
 BASE_FLAGS_TO_PASS = \
-	"AR_FLAGS=$(AR_FLAGS)" \
+	"ARFLAGS=$(ARFLAGS)" \
 	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
 	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
 	"BISON=$(BISON)" \
@@ -854,7 +857,9 @@ DO_X = \
 	do-distclean \
 	do-dvi \
 	do-info \
+	do-guide \
 	do-install-info \
+	do-install-guide \
 	do-installcheck \
 	do-mostlyclean \
 	do-maintainer-clean \
@@ -879,9 +884,9 @@ $(DO_X):
 	      done; \
 	      ;; \
 	    esac ; \
-	    export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
+	    export AR ARFLAGS AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
 	    if (cd ./$$i; \
-	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "ARFLAGS=$${ARFLAGS}" "AS=$${AS}" \
 			"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 			"RANLIB=$${RANLIB}" \
 			"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
@@ -898,9 +903,9 @@ $(DO_X):
 	    for flag in $(EXTRA_TARGET_FLAGS); do \
 		eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
 	    done; \
-	    export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
+	    export AR ARFLAGS AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
 	    if (cd $(TARGET_SUBDIR)/$$i; \
-	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "ARFLAGS=$${ARFLAGS}" "AS=$${AS}" \
 			"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 			"RANLIB=$${RANLIB}" \
 			"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
@@ -911,10 +916,11 @@ $(DO_X):
 
 # Here are the targets which correspond to the do-X targets.
 
-.PHONY: info installcheck dvi install-info
+.PHONY: info guide installcheck dvi install-info install-guide
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
+guide: do-guide
 installcheck: do-installcheck
 dvi: do-dvi
 
@@ -927,6 +933,12 @@ install-info: do-install-info dir.info
 	  $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
 	else true ; fi
 
+install-guide: do-install-guide dir.guide
+	srcroot=`cd $(srcdir); pwd`; export srcroot; \
+	if [ -f dir.guide ] ; then \
+	  $(INSTALL_DATA) dir.guide $(guidedir)/dir.guide ; \
+	else true ; fi
+
 local-clean:
 	-rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
 
@@ -1350,7 +1362,7 @@ install-gcc:
 # This rule is used to install the modules which use FLAGS_TO_PASS.
 # To build a target install-X means to cd to X and make install.
 .PHONY: install-dosrel
-install-dosrel: installdirs info
+install-dosrel: installdirs info guide
 	@dir=`echo $@ | sed -e 's/install-//'`; \
 	if [ -f ./$${dir}/Makefile ] ; then \
 	  r=`pwd`; export r; \
@@ -1478,6 +1490,13 @@ dir.info: do-install-info
 	else true ; \
 	fi
 
+dir.guide: do-install-guide
+	if [ -f $(srcdir)/texinfo/gen-guide-dir ] ; then \
+	  $(srcdir)/texinfo/gen-guide-dir $(guidedir) $(srcdir)/texinfo/dir.guide-template > dir.guide.new ; \
+	  mv -f dir.guide.new dir.guide ; \
+	else true ; \
+	fi
+
 dist:
 	@echo "Building a full distribution of this tree isn't done"
 	@echo "via 'make dist'.  Check out the etc/ subdirectory" 
@@ -1513,7 +1532,7 @@ DEVO_SUPPORT= README Makefile.in configu
 # ChangeLog omitted because it may refer to files which are not in this
 # distribution (perhaps it would be better to include it anyway).
 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
-	make-stds.texi standards.info*
+	make-stds.texi standards.info* standards.guide*
 
 # When you use `make setup-dirs' or `make taz' you should always redefine
 # this macro.
--- binutils-2.9.1/opcodes/ChangeLog	Fri May  1 08:48:18 1998
+++ binutils-2.9.1/opcodes/ChangeLog	Sun Aug 23 00:00:00 1998
@@ -333,6 +333,11 @@ Thu Oct 23 21:13:37 1997  Fred Fish  <fn
  
 	* d10v-opc.c (d10v_opcodes): Correct entry for RTE.
  
+Mon Oct 20 11:16:19 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (AC_ARFLAGS): Add.
+	* configure: Regenerate.
+
 Mon Dec  8 11:21:07 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* disassemble.c: Remove disasm_symaddr() function.
--- binutils-2.9.1/opcodes/configure	Fri May  1 08:48:18 1998
+++ binutils-2.9.1/opcodes/configure	Thu Jan 21 19:40:14 1999
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not r
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -658,21 +684,22 @@ BFD_VERSION=`grep INIT_AUTOMAKE ${srcdir
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:667: checking for a BSD compatible install" >&5
+echo "configure:694: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -711,13 +738,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:721: checking whether build environment is sane" >&5
+echo "configure:750: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -774,7 +803,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:807: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -820,7 +849,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:824: checking for working aclocal" >&5
+echo "configure:853: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -833,7 +862,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:837: checking for working autoconf" >&5
+echo "configure:866: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -846,7 +875,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:850: checking for working automake" >&5
+echo "configure:879: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -859,7 +888,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:863: checking for working autoheader" >&5
+echo "configure:892: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -872,7 +901,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:876: checking for working makeinfo" >&5
+echo "configure:905: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -895,15 +924,16 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:899: checking for $ac_word" >&5
+echo "configure:928: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_AR="${ac_tool_prefix}ar"
@@ -923,18 +953,68 @@ fi
 
 
 
+ if test -z "$AR"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:961: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+fi
+echo $ac_n "checking what flags $AR needs to create archives""... $ac_c" 1>&6
+echo "configure:992: checking what flags $AR needs to create archives" >&5
+if eval "test \"`echo '$''{'gg_cv_arflags'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$CC" in
+  mwcc* | bcc*) ARFLAGS=${ARFLAGS-"-xml -o"} ;;
+  *)		ARFLAGS=${ARFLAGS-"cr"} ;;
+esac
+gg_cv_arflags=$ARFLAGS
+
+fi
+ARFLAGS="$gg_cv_arflags"
+echo "$ac_t""$ARFLAGS" 1>&6
+
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:930: checking for $ac_word" >&5
+echo "configure:1009: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
@@ -957,15 +1037,16 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:961: checking for $ac_word" >&5
+echo "configure:1041: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1039,15 +1120,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1043: checking for $ac_word" >&5
+echo "configure:1124: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1068,15 +1150,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1072: checking for $ac_word" >&5
+echo "configure:1154: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1094,19 +1177,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1184: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1217: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1246: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1101: checking for $ac_word" >&5
+echo "configure:1279: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1141,25 +1320,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1331: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1362: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1159 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1373 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1173,18 +1388,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1183: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1404: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1188: checking whether we are using GNU C" >&5
+echo "configure:1409: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1193,7 +1414,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1204,11 +1425,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1212: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1437: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1223,18 +1448,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1248,7 +1500,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1252: checking for ld used by GCC" >&5
+echo "configure:1504: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1266,10 +1518,10 @@ echo "configure:1252: checking for ld us
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1270: checking for GNU ld" >&5
+echo "configure:1522: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1273: checking for non-GNU ld" >&5
+echo "configure:1525: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1305,7 +1557,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1309: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1561: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1321,7 +1573,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1325: checking for BSD-compatible nm" >&5
+echo "configure:1577: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1358,7 +1610,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1362: checking whether ln -s works" >&5
+echo "configure:1614: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1368,14 +1620,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1394,8 +1656,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libto
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1398 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1660 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1473,7 +1735,7 @@ test "$program_transform_name" = "" && p
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1477: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1739: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1491,19 +1753,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1495: checking for Cygwin32 environment" >&5
+echo "configure:1757: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1500 "configure"
+#line 1762 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1520,19 +1782,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1524: checking for Mingw32 environment" >&5
+echo "configure:1786: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1791 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1551,7 +1813,7 @@ test "$am_cv_mingw32" = yes && MINGW32=y
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1555: checking for executable suffix" >&5
+echo "configure:1817: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1580,15 +1842,16 @@ echo "$ac_t""${am_cv_exeext}" 1>&6
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1584: checking for $ac_word" >&5
+echo "configure:1846: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1606,19 +1869,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1876: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1909: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1938: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1613: checking for $ac_word" >&5
+echo "configure:1971: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1653,25 +2012,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1661: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2054: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1671 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2065 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1685,18 +2080,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2096: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1700: checking whether we are using GNU C" >&5
+echo "configure:2101: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1705,7 +2106,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1716,11 +2117,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1724: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2129: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1735,18 +2140,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 . ${srcdir}/../bfd/configure.host
 
@@ -1756,7 +2188,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1760: checking how to run the C preprocessor" >&5
+echo "configure:2192: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1771,14 +2203,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1775 "configure"
+#line 2207 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1788,14 +2220,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1792 "configure"
+#line 2224 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2241 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1808,6 +2257,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1820,18 +2271,18 @@ for ac_hdr in string.h strings.h stdlib.
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1824: checking for $ac_hdr" >&5
+echo "configure:2275: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 2280 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1994,7 +2445,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2040,7 +2491,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2061,7 +2514,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2085,6 +2538,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2102,6 +2556,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2119,8 +2577,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2130,6 +2588,7 @@ s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@AR@%$AR%g
+s%@ARFLAGS@%$ARFLAGS%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
 s%@LD@%$LD%g
@@ -2284,6 +2743,7 @@ for ac_file in .. $CONFIG_HEADERS; do if
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -2329,6 +2789,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2360,6 +2821,7 @@ test -z "$CONFIG_HEADERS" || echo timest
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
--- binutils-2.9.1/opcodes/configure.in	Fri May  1 08:48:19 1998
+++ binutils-2.9.1/opcodes/configure.in	Sun Aug 23 00:00:00 1998
@@ -18,6 +18,7 @@ AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION}
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
+AC_ARFLAGS
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
 dnl Default to a non shared library.  This may be overridden by the
--- binutils-2.9.1/opcodes/m68k-dis.c	Fri May  1 08:48:20 1998
+++ binutils-2.9.1/opcodes/m68k-dis.c	Sun Aug 23 00:00:00 1998
@@ -49,7 +49,7 @@ CONST char * CONST fpcr_names[] = {
 
 static char *const reg_names[] = {
   "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
-  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",
+  "%a0", "%a1", "%a2", "%a3", "%a4", "%fp", "%a6", "%sp",
   "%ps", "%pc"};
 
 /* Sign-extend an (unsigned char). */
--- binutils-2.9.1/opcodes/Makefile.in	Fri May  1 08:48:18 1998
+++ binutils-2.9.1/opcodes/Makefile.in	Sun Aug 23 00:00:00 1998
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -64,17 +70,12 @@ target_triplet = @target@
 AR = @AR@
 BFD_MACHINES = @BFD_MACHINES@
 CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 HDEFINES = @HDEFINES@
-LD = @LD@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
-VERSION = @VERSION@
 archdefs = @archdefs@
 
 AUTOMAKE_OPTIONS = cygnus
@@ -212,6 +213,7 @@ LIBS = @LIBS@
 libopcodes_a_LIBADD = 
 libopcodes_a_SOURCES = libopcodes.a.c
 libopcodes_a_OBJECTS =  libopcodes.a.o
+ARFLAGS = @ARFLAGS@
 LTLIBRARIES =  $(lib_LTLIBRARIES)
 
 libopcodes_la_OBJECTS =  dis-buf.lo disassemble.lo
@@ -223,21 +225,24 @@ DIST_COMMON =  ChangeLog Makefile.am Mak
 aclocal.m4 config.in configure configure.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
 OBJECTS = libopcodes.a.o $(libopcodes_la_OBJECTS)
 
-default: all
+all: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
 
 .SUFFIXES:
 .SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -328,18 +333,18 @@ maintainer-clean-libLTLIBRARIES:
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
 
 uninstall-libLTLIBRARIES:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  $(LIBTOOL)  --mode=uninstall rm -f $(libdir)/$$p; \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
 	done
 
 libopcodes.la: $(libopcodes_la_OBJECTS) $(libopcodes_la_DEPENDENCIES)
@@ -413,6 +418,9 @@ distdir: $(DISTFILES)
 	  || cp -p $$d/$$file $(distdir)/$$file; \
 	done
 info:
+guide:
+html:
+ps:
 dvi:
 check:
 	$(MAKE)
@@ -429,12 +437,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-libLTLIBRARIES
 
-all: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(libdir)
+	$(mkinstalldirs)  $(DATADIR)$(libdir)
 
 
 mostlyclean-generic:
@@ -474,18 +480,18 @@ maintainer-clean:  maintainer-clean-hdr 
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
-distclean-noinstLIBRARIES clean-noinstLIBRARIES \
-maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck install-info install-exec install-data install uninstall \
-all installdirs mostlyclean-generic distclean-generic clean-generic \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-libLTLIBRARIES \
+distclean-libLTLIBRARIES clean-libLTLIBRARIES \
+maintainer-clean-libLTLIBRARIES uninstall-libLTLIBRARIES \
+install-libLTLIBRARIES tags mostlyclean-tags distclean-tags clean-tags \
+maintainer-clean-tags distdir info guide html ps dvi installcheck \
+install-info install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
