diff -uprN binutils-2.10/Makefile.in binutils-2.10.1/Makefile.in --- binutils-2.10/Makefile.in Sat Jun 10 13:35:45 2000 +++ binutils-2.10.1/Makefile.in Tue Nov 7 10:21:48 2000 @@ -1683,7 +1683,8 @@ 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* configure.texi configure.info* \ + configbuild.* configdev.* # When you use `make setup-dirs' or `make taz' you should always redefine # this macro. diff -uprN binutils-2.10/bfd/ChangeLog binutils-2.10.1/bfd/ChangeLog --- binutils-2.10/bfd/ChangeLog Thu Jun 1 21:09:06 2000 +++ binutils-2.10.1/bfd/ChangeLog Tue Nov 7 08:44:11 2000 @@ -1,3 +1,147 @@ +2000-11-07 Alan Modra + + * coff-h8300.c (special): Adjust reloc address. + + From mainline 2000-04-03 Kazu Hirata + * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to + the R_PCRWORD_B case. + +2000-11-05 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit + BFDs containing no sections to be merged, regardless of their flags. + +2000-11-04 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Suppress error message + if a relocation for an undefined symbol also results in an + overflow. + +2000-10-31 Philip Blundell + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle + EF_SOFT_FLOAT if it is defined. + + From 2000-05-23 H.J. Lu + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-10-27 Philip Blundell + + * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse + attempts to mix PIC code with non-PIC, just mark the output as + being position dependent. + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for + all mismatches, not just the first one. + +2000-10-23 Philip Blundell + + From 2000-05-23 H.J. Lu + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + +2000-10-23 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Undo previous + accidental checkin. + +2000-10-22 Philip Blundell + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make + PLT entries that could serve as a definition for a weak symbol. + + From 2000-06-05 H.J. Lu + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + + From 2000-05-23 H.J. Lu + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-10-16 Geoffrey Keating + + From 2000-10-14 Geoffrey Keating + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2000-10-15 Philip Blundell + + From 2000-09-08 Nick Clifton + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not + initialise flags in output bfd if the input bfd is the default + architecture with the default flags. + + From 2000-09-03 Philip Blundell + * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate + references to undefined symbols in debugging sections. + + From 2000-05-30 H.J. Lu + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + + From 2000-05-22 H.J. Lu + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + + From 2000-05-03 Martin v. Löwis + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + +2000-10-16 Philip Blundell + + * configure.in: Set version to 2.10.1. + * configure: Regenerate. + +2000-09-24 H.J. Lu + + From 2000-04-20 H.J. Lu + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + +2000-09-06 Philip Blundell + + Merge from mainline: + + 2000-05-31 Ulrich Drepper + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-09-06 Philip Blundell + + * config.bfd (arm*-*-uclinux*): New target. + (armeb-*-elf, arm*b-*-linux-gnu*): Likewise. + +2000-08-22 Doug Kwan + + * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. + * coffcode.h (coff_set_flags): Add detection of w65 architecture. + +2000-04-14 Matthew Green + + * config.bfd: Add NetBSD/sparc64 support. + 2000-05-31 Mark Kettenis Add support for FreeBSD/Alpha. diff -uprN binutils-2.10/bfd/coff-h8300.c binutils-2.10.1/bfd/coff-h8300.c --- binutils-2.10/bfd/coff-h8300.c Mon Mar 13 23:57:25 2000 +++ binutils-2.10.1/bfd/coff-h8300.c Tue Nov 7 08:44:11 2000 @@ -192,18 +192,18 @@ h8300_coff_link_hash_table_create (abfd) return &ret->root.root; } -/* special handling for H8/300 relocs. +/* Special handling for H8/300 relocs. We only come here for pcrel stuff and return normally if not an -r link. When doing -r, we can't do any arithmetic for the pcrel stuff, because the code in reloc.c assumes that we can manipulate the targets of the pcrel branches. This isn't so, since the H8/300 can do relaxing, which means that the gap after the instruction may not be enough to - contain the offset required for the branch, so we have to use the only - the addend until the final link */ + contain the offset required for the branch, so we have to use only + the addend until the final link. */ static bfd_reloc_status_type special (abfd, reloc_entry, symbol, data, input_section, output_bfd, - error_message) + error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -215,6 +215,8 @@ special (abfd, reloc_entry, symbol, data if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; + /* Adjust the reloc address to that in the output section. */ + reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } @@ -900,6 +902,11 @@ h8300_reloc16_extra_cases (abfd, link_in /* Write it. */ bfd_put_8 (abfd, tmp, data + dst_address - 2); + break; + + case 0x5c: + /* bsr:16 -> bsr:8 */ + bfd_put_8 (abfd, 0x55, data + dst_address - 2); break; default: diff -uprN binutils-2.10/bfd/coff-w65.c binutils-2.10.1/bfd/coff-w65.c --- binutils-2.10/bfd/coff-w65.c Mon Jul 19 15:55:15 1999 +++ binutils-2.10.1/bfd/coff-w65.c Tue Aug 22 22:02:06 2000 @@ -401,4 +401,4 @@ h8300_reloc16_extra_cases (abfd, link_in bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section -CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w95", BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_LITTLE_COFF_TARGET_VEC (w65_vec, "coff-w65", BFD_IS_RELAXABLE, 0, '_', NULL) diff -uprN binutils-2.10/bfd/coffcode.h binutils-2.10.1/bfd/coffcode.h --- binutils-2.10/bfd/coffcode.h Wed Mar 1 20:39:07 2000 +++ binutils-2.10.1/bfd/coffcode.h Tue Aug 22 22:02:06 2000 @@ -2582,6 +2582,12 @@ coff_set_flags (abfd, magicp, flagsp) return true; #endif +#ifdef W65MAGIC + case bfd_arch_w65: + *magicp = W65MAGIC; + return true; +#endif + default: /* Unknown architecture */ /* return false; -- fall through to "return false" below, to avoid "statement never reached" errors on the one below. */ diff -uprN binutils-2.10/bfd/config.bfd binutils-2.10.1/bfd/config.bfd --- binutils-2.10/bfd/config.bfd Sat May 13 13:23:45 2000 +++ binutils-2.10.1/bfd/config.bfd Wed Sep 6 21:57:43 2000 @@ -79,6 +79,10 @@ case "${targ}" in alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; + sparc64-*-netbsd*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + ;; #endif /* BFD64 */ arc-*-elf*) @@ -122,7 +126,11 @@ case "${targ}" in targ_selvecs=armcoff_big_vec targ_underscore=yes ;; - arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix*) + armeb-*-elf | arm*b-*-linux-gnu*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; + arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; diff -uprN binutils-2.10/bfd/configure binutils-2.10.1/bfd/configure --- binutils-2.10/bfd/configure Thu Jun 1 21:09:06 2000 +++ binutils-2.10.1/bfd/configure Mon Oct 16 12:27:20 2000 @@ -1050,7 +1050,7 @@ fi PACKAGE=bfd -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -uprN binutils-2.10/bfd/configure.in binutils-2.10.1/bfd/configure.in --- binutils-2.10/bfd/configure.in Thu Jun 1 21:09:07 2000 +++ binutils-2.10.1/bfd/configure.in Mon Oct 16 12:27:22 2000 @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.10) +AM_INIT_AUTOMAKE(bfd, 2.10.1) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. diff -uprN binutils-2.10/bfd/elf-hppa.h binutils-2.10.1/bfd/elf-hppa.h --- binutils-2.10/bfd/elf-hppa.h Wed Mar 1 19:40:53 2000 +++ binutils-2.10.1/bfd/elf-hppa.h Sun Oct 22 16:19:56 2000 @@ -1079,7 +1079,8 @@ elf_hppa_relocate_section (output_bfd, i relocation = 0; } /* Allow undefined symbols in shared libraries. */ - else if (info->shared && !info->no_undefined) + else if (info->shared && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) { if (info->symbolic) (*info->callbacks->undefined_symbol) diff -uprN binutils-2.10/bfd/elf.c binutils-2.10.1/bfd/elf.c --- binutils-2.10/bfd/elf.c Mon May 29 06:18:32 2000 +++ binutils-2.10.1/bfd/elf.c Wed Sep 6 22:24:15 2000 @@ -4488,18 +4488,13 @@ _bfd_elf_slurp_version_tables (abfd) Elf_Internal_Shdr *hdr; Elf_External_Verdef *everdef; Elf_Internal_Verdef *iverdef; + Elf_Internal_Verdef *iverdefarr; + Elf_Internal_Verdef iverdefmem; unsigned int i; + unsigned int maxidx; hdr = &elf_tdata (abfd)->dynverdef_hdr; - elf_tdata (abfd)->verdef = - ((Elf_Internal_Verdef *) - bfd_zalloc (abfd, hdr->sh_info * sizeof (Elf_Internal_Verdef))); - if (elf_tdata (abfd)->verdef == NULL) - goto error_return; - - elf_tdata (abfd)->cverdefs = hdr->sh_info; - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); if (contents == NULL) goto error_return; @@ -4507,15 +4502,42 @@ _bfd_elf_slurp_version_tables (abfd) || bfd_read ((PTR) contents, 1, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; + /* We know the number of entries in the section but not the maximum + index. Therefore we have to run through all entries and find + the maximum. */ + everdef = (Elf_External_Verdef *) contents; + maxidx = 0; + for (i = 0; i < hdr->sh_info; ++i) + { + _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); + + if ((iverdefmem.vd_ndx & VERSYM_VERSION) > maxidx) + maxidx = iverdefmem.vd_ndx & VERSYM_VERSION; + + everdef = ((Elf_External_Verdef *) + ((bfd_byte *) everdef + iverdefmem.vd_next)); + } + + elf_tdata (abfd)->verdef = + ((Elf_Internal_Verdef *) + bfd_zalloc (abfd, maxidx * sizeof (Elf_Internal_Verdef))); + if (elf_tdata (abfd)->verdef == NULL) + goto error_return; + + elf_tdata (abfd)->cverdefs = maxidx; + everdef = (Elf_External_Verdef *) contents; - iverdef = elf_tdata (abfd)->verdef; - for (i = 0; i < hdr->sh_info; i++, iverdef++) + iverdefarr = elf_tdata (abfd)->verdef; + for (i = 0; i < hdr->sh_info; i++) { Elf_External_Verdaux *everdaux; Elf_Internal_Verdaux *iverdaux; unsigned int j; - _bfd_elf_swap_verdef_in (abfd, everdef, iverdef); + _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); + + iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1]; + memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef)); iverdef->vd_bfd = abfd; diff -uprN binutils-2.10/bfd/elf32-arm.h binutils-2.10.1/bfd/elf32-arm.h --- binutils-2.10/bfd/elf32-arm.h Wed Mar 1 19:40:53 2000 +++ binutils-2.10.1/bfd/elf32-arm.h Tue Nov 7 08:44:11 2000 @@ -1756,7 +1756,14 @@ elf32_arm_relocate_section (output_bfd, (!info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 ) - && ((input_section->flags & SEC_ALLOC) != 0) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_ARM_ABS32 relocations in its + sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) ) relocation_needed = 0; break; @@ -1800,14 +1807,17 @@ elf32_arm_relocate_section (output_bfd, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } @@ -1836,10 +1846,15 @@ elf32_arm_relocate_section (output_bfd, switch (r) { case bfd_reloc_overflow: - if (!((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; + /* If the overflowing reloc was to an undefined symbol, + we have already printed one error message and there + is no point complaining again. */ + if ((! h || + h->root.type != bfd_link_hash_undefined) + && (!((*info->callbacks->reloc_overflow) + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset)))) + return false; break; case bfd_reloc_undefined: @@ -1923,10 +1938,6 @@ elf32_arm_copy_private_bfd_data (ibfd, o if (elf_flags_init (obfd) && in_flags != out_flags) { - /* Cannot mix PIC and non-PIC code. */ - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - return false; - /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) return false; @@ -1946,6 +1957,10 @@ Warning: Clearing the interwork flag in in_flags &= ~EF_INTERWORK; } + + /* Likewise for PIC, though don't warn for this case. */ + if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) + in_flags &= ~EF_PIC; } elf_elfheader (obfd)->e_flags = in_flags; @@ -1963,6 +1978,9 @@ elf32_arm_merge_private_bfd_data (ibfd, { flagword out_flags; flagword in_flags; + boolean flags_compatible = true; + boolean null_input_bfd = true; + asection *sec; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -1994,13 +2012,14 @@ elf32_arm_merge_private_bfd_data (ibfd, if (!elf_flags_init (obfd)) { - /* If the input is the default architecture then do not - bother setting the flags for the output architecture, - instead allow future merges to do this. If no future - merges ever set these flags then they will retain their - unitialised values, which surprise surprise, correspond + /* If the input is the default architecture and had the default + flags then do not bother setting the flags for the output + architecture, instead allow future merges to do this. If no + future merges ever set these flags then they will retain their + uninitialised values, which surprise surprise, correspond to the default values. */ - if (bfd_get_arch_info (ibfd)->the_default) + if (bfd_get_arch_info (ibfd)->the_default + && elf_elfheader (ibfd)->e_flags == 0) return true; elf_flags_init (obfd) = true; @@ -2013,48 +2032,77 @@ elf32_arm_merge_private_bfd_data (ibfd, return true; } - /* Check flag compatibility. */ + /* Identical flags must be compatible. */ if (in_flags == out_flags) return true; - /* Complain about various flag mismatches. */ + /* Check to see if the input BFD actually contains any sections. + If not, its flags may not have been initialised either, but it cannot + actually cause any incompatibility. */ + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + { + /* Ignore synthetic glue sections. */ + if (strcmp (sec->name, ".glue_7") + && strcmp (sec->name, ".glue_7t")) + { + null_input_bfd = false; + break; + } + } + if (null_input_bfd) + return true; + + /* If any of the input BFDs is non-PIC, the output is also position + dependent. */ + if (!(in_flags & EF_PIC)) + elf_elfheader (obfd)->e_flags &= ~EF_PIC; + /* Complain about various flag mismatches. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), bfd_get_filename (ibfd), in_flags & EF_APCS_26 ? 26 : 32, bfd_get_filename (obfd), out_flags & EF_APCS_26 ? 26 : 32); + flags_compatible = false; + } if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) - _bfd_error_handler (_ ("\ + { + _bfd_error_handler (_ ("\ Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), bfd_get_filename (ibfd), in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"), bfd_get_filename (obfd), out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); + flags_compatible = false; + } - if ((in_flags & EF_PIC) != (out_flags & EF_PIC)) - _bfd_error_handler (_ ("\ -Error: %s is compiled as position %s code, whereas %s is not"), - bfd_get_filename (ibfd), - in_flags & EF_PIC ? _ ("independent") : _ ("dependent"), - bfd_get_filename (obfd)); - - /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) +#ifdef EF_SOFT_FLOAT + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) { _bfd_error_handler (_ ("\ +Error: %s uses %s floating point, whereas %s uses %s floating point"), + bfd_get_filename (ibfd), + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), + bfd_get_filename (obfd), + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + flags_compatible = false; + } +#endif + + /* Interworking mismatch is only a warning. */ + if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + _bfd_error_handler (_ ("\ Warning: %s %s interworking, whereas %s %s"), bfd_get_filename (ibfd), in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"), bfd_get_filename (obfd), out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); - return true; - } - return false; + return flags_compatible; } /* Display the flags field */ diff -uprN binutils-2.10/bfd/elf32-i386.c binutils-2.10.1/bfd/elf32-i386.c --- binutils-2.10/bfd/elf32-i386.c Wed Mar 1 19:40:53 2000 +++ binutils-2.10.1/bfd/elf32-i386.c Sun Oct 22 16:19:57 2000 @@ -1291,7 +1291,9 @@ elf_i386_relocate_section (output_bfd, i sections against symbols defined externally in shared libraries. We can't do anything with them here. */ - || (input_section->flags & SEC_DEBUGGING) != 0))) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some @@ -1313,14 +1315,17 @@ elf_i386_relocate_section (output_bfd, i } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elf32-m68k.c binutils-2.10.1/bfd/elf32-m68k.c --- binutils-2.10/bfd/elf32-m68k.c Wed Mar 1 20:39:07 2000 +++ binutils-2.10.1/bfd/elf32-m68k.c Sun Oct 22 16:19:57 2000 @@ -1479,14 +1479,17 @@ elf_m68k_relocate_section (output_bfd, i } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (!(info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elf32-mcore.c binutils-2.10.1/bfd/elf32-mcore.c --- binutils-2.10/bfd/elf32-mcore.c Wed Mar 1 20:39:07 2000 +++ binutils-2.10.1/bfd/elf32-mcore.c Sun Oct 22 16:19:57 2000 @@ -532,7 +532,8 @@ mcore_elf_relocate_section (output_bfd, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { diff -uprN binutils-2.10/bfd/elf32-mips.c binutils-2.10.1/bfd/elf32-mips.c --- binutils-2.10/bfd/elf32-mips.c Sat Mar 11 02:23:10 2000 +++ binutils-2.10.1/bfd/elf32-mips.c Mon Oct 23 13:38:15 2000 @@ -5930,7 +5930,8 @@ mips_elf_calculate_relocation (abfd, and check to see if they exist by looking at their addresses. */ symbol = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic && !info->no_undefined + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) symbol = 0; else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0) { @@ -5948,7 +5949,8 @@ mips_elf_calculate_relocation (abfd, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->root.other))))) return bfd_reloc_undefined; symbol = 0; } diff -uprN binutils-2.10/bfd/elf32-ppc.c binutils-2.10.1/bfd/elf32-ppc.c --- binutils-2.10/bfd/elf32-ppc.c Wed Mar 1 19:40:54 2000 +++ binutils-2.10.1/bfd/elf32-ppc.c Fri Nov 3 17:15:59 2000 @@ -2687,6 +2687,13 @@ ppc_elf_finish_dynamic_symbol (output_bf /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } } @@ -3101,7 +3108,9 @@ ppc_elf_relocate_section (output_bfd, in } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { @@ -3111,7 +3120,8 @@ ppc_elf_relocate_section (output_bfd, in input_section, rel->r_offset, (!info->shared - || info->no_undefined))) + || info->no_undefined + || ELF_ST_VISIBILITY (h->other)))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elf32-sparc.c binutils-2.10.1/bfd/elf32-sparc.c --- binutils-2.10/bfd/elf32-sparc.c Wed Mar 1 19:40:54 2000 +++ binutils-2.10.1/bfd/elf32-sparc.c Sun Oct 22 16:19:57 2000 @@ -1213,14 +1213,17 @@ elf32_sparc_relocate_section (output_bfd } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elf64-alpha.c binutils-2.10.1/bfd/elf64-alpha.c --- binutils-2.10/bfd/elf64-alpha.c Tue Apr 4 12:23:34 2000 +++ binutils-2.10.1/bfd/elf64-alpha.c Mon Oct 23 13:38:15 2000 @@ -3475,14 +3475,17 @@ elf64_alpha_relocate_section (output_bfd } else if (h->root.root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) relocation = 0; else { if (!((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->root.other))))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elf64-sparc.c binutils-2.10.1/bfd/elf64-sparc.c --- binutils-2.10/bfd/elf64-sparc.c Wed Mar 1 19:40:54 2000 +++ binutils-2.10.1/bfd/elf64-sparc.c Sun Oct 22 16:19:57 2000 @@ -2049,14 +2049,17 @@ sparc64_elf_relocate_section (output_bfd } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic && !info->no_undefined) + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - (!info->shared || info->no_undefined)))) + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) return false; relocation = 0; } diff -uprN binutils-2.10/bfd/elflink.c binutils-2.10.1/bfd/elflink.c --- binutils-2.10/bfd/elflink.c Wed Mar 1 19:40:54 2000 +++ binutils-2.10.1/bfd/elflink.c Sun Oct 22 16:19:57 2000 @@ -226,20 +226,13 @@ _bfd_elf_link_record_dynamic_symbol (inf { case STV_INTERNAL: case STV_HIDDEN: - /* This symbol must be defined in the shared object or - executable. */ - if (h->root.type == bfd_link_hash_undefined) + if (h->root.type != bfd_link_hash_undefined + && h->root.type != bfd_link_hash_undefweak) { - bfd * abfd = h->root.u.undef.abfd; - const char * name = h->root.root.string; - - (*info->callbacks->undefined_symbol) - (info, name, abfd, bfd_und_section_ptr, 0, true); + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + return true; } - - h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - break; - + default: break; } diff -uprN binutils-2.10/bfd/elflink.h binutils-2.10.1/bfd/elflink.h --- binutils-2.10/bfd/elflink.h Wed Mar 1 20:39:07 2000 +++ binutils-2.10.1/bfd/elflink.h Mon Oct 16 18:57:08 2000 @@ -1852,6 +1852,18 @@ elf_link_add_object_symbols (abfd, info) goto error_return; } } + else if (dynsym && h->dynindx != -1) + /* If the symbol already has a dynamic index, but + visibility says it should not be visible, turn it into + a local symbol. */ + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + (*bed->elf_backend_hide_symbol) (h); + break; + } } } @@ -3339,10 +3351,12 @@ elf_fix_symbol_flags (h, eif) /* If -Bsymbolic was used (which means to bind references to global symbols to the definition within the shared object), and this symbol was defined in a regular object, then it actually doesn't - need a PLT entry. */ + need a PLT entry. Likewise, if the symbol has any kind of + visibility (internal, hidden, or protected), it doesn't need a + PLT. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared - && eif->info->symbolic + && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT; @@ -5071,6 +5085,11 @@ elf_link_output_extsym (h, data) bindtype = STB_WEAK; sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info)); } + + /* If a symbol is not defined locally, we clear the visibility + field. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); /* If this symbol should be put in the .dynsym section, then put it there now. We have already know the symbol index. We also fill diff -uprN binutils-2.10/binutils/ChangeLog binutils-2.10.1/binutils/ChangeLog --- binutils-2.10/binutils/ChangeLog Tue May 30 08:51:02 2000 +++ binutils-2.10.1/binutils/ChangeLog Fri Nov 3 17:15:59 2000 @@ -1,3 +1,99 @@ +2000-11-01 Philip Blundell + + From 2000-06-15 H.J. Lu + * dyn-string.c: Removed. Not needed with dyn-string.c in + libiberty. + * dyn-string.h: Likewise. + * Makefile.am: Remove references to dyn-string.c and + dyn-string.h. Rebuild dependency. + * Makefile.in: Rebuild. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-14 Philip Blundell + + * config.sub, config.guess: Update from mainline sources. + + From 2000-09-07 H.J. Lu + + * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. + * configure: Rebuild. + + From 2000-08-17 Nick Clifton + + * readelf.c (display_debug_pubnames): Only issue warning + message once. Terminate message with a new line. + (display_debug_aranges): Only display version 2 debug info. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Change "AUXILARY" to + "AUXILIARY". + (process_dynamic_segment): Print out strings for DT_CONFIG, + DT_DEPAUDIT, DT_AUDIT and DT_RUNPATH. + + From 2000-07-19 H.J. Lu + + * readelf.c (process_dynamic_segment): Change DF_1_NODEPLIB + to DF_1_NODEFLIB. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Fix DT_CHECKSUM. + + From 2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Change DT_FEATURE_1 to + DT_FEATURE. + (process_dynamic_segment): Likewise. + + * readelf.c (get_dynamic_type): Handle DT_CONFIG, DT_DEPAUDIT, + DT_AUDIT, DT_PLTPAD, DT_MOVETAB and DT_CHECKSUM. + (process_dynamic_segment): Handle DTF_1_CONFEXP, DF_1_NODEPLIB, + DF_1_NODUMP and DF_1_CONLFAT. + + From 2000-07-01 Alexander Aganichev + + * stabs.c (parse_stab_type): Divide size in bits by 8 as binutils + struct debug_type stores size in bytes. + + From 2000-08-17 Christopher C. Chimelis + + * objdump.c (LONGEST_ARCH): Set to sizeof("powerpc:common"). + + From 2000-07-11 Mark Kettenis + + * objdump.c (usage): Make output of `objdump --help' more + consistent with the rest of the GNU world. Add a line describing + the purpose of the program. + + From 2000-06-24 Nick Clifton + + * objdump.c (usage): Fix description of --stabs switch. + + From 2000-07-18 Nick Clifton + + * binutils.texi (readelf): Fix spelling typo. + + From 2000-07-19 Mark Kettenis + + * nm.c (usage): Change output of `nm --help' to include a + description of the purpose of the program and a detailed + description of the accepted options. + +2000-09-05 Todd Vierling + + From 2000-08-14 Todd Vierling + * objcopy.c (strip_main): Silently accept -d as an alias for -g + for compatability with old BSD systems. + +2000-09-04 Todd Vierling + + * strip.1: Fix stray '\' in -o formatting. + 2000-05-30 Alan Modra * objdump.c (display_target_list): Use bfd_close_all_done, not diff -uprN binutils-2.10/binutils/Makefile.am binutils-2.10.1/binutils/Makefile.am --- binutils-2.10/binutils/Makefile.am Fri Apr 7 05:39:24 2000 +++ binutils-2.10.1/binutils/Makefile.am Fri Nov 3 17:15:59 2000 @@ -74,7 +74,7 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \ - windres.h winduni.h dyn-string.h + windres.h winduni.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h @@ -84,7 +84,7 @@ CFILES = addr2line.c ar.c arsup.c bucomm objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \ stabs.c strings.c sysdump.c version.c wrstabs.c \ windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \ - resres.c dyn-string.c dllwrap.c rename.c + resres.c dllwrap.c rename.c GENERATED_CFILES = \ underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ @@ -242,7 +242,7 @@ sysinfo.h: sysinfo.c srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) -dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS) +dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) dlltool.o:dlltool.c @@ -267,7 +267,7 @@ windres_SOURCES = windres.c resrc.c resc winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -dllwrap_SOURCES = dllwrap.c dyn-string.c version.c +dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) @@ -391,7 +391,7 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ $(INCDIR)/libiberty.h debug.h dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h dyn-string.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h \ dlltool.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h @@ -484,11 +484,9 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCD resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h windres.h winduni.h -dyn-string.o: dyn-string.c config.h $(INCDIR)/ansidecl.h \ - dyn-string.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h underscore.o: underscore.c diff -uprN binutils-2.10/binutils/Makefile.in binutils-2.10.1/binutils/Makefile.in --- binutils-2.10/binutils/Makefile.in Fri Apr 7 05:39:24 2000 +++ binutils-2.10.1/binutils/Makefile.in Fri Nov 3 17:15:59 2000 @@ -151,8 +151,7 @@ DLLWRAP_PROG = dllwrap SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 \ - addr2line.1 nlmconv.1 $(DEMANGLER_NAME).1 +man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_NAME).1 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@ @@ -174,24 +173,15 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" -HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \ - windres.h winduni.h dyn-string.h +HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h windres.h winduni.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h -CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \ - dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \ - maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \ - objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \ - stabs.c strings.c sysdump.c version.c wrstabs.c \ - windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \ - resres.c dyn-string.c dllwrap.c rename.c +CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c stabs.c strings.c sysdump.c version.c wrstabs.c windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c resres.c dllwrap.c rename.c -GENERATED_CFILES = \ - underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ - defparse.c deflex.c nlmheader.c rcparse.c rclex.c +GENERATED_CFILES = underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c defparse.c deflex.c nlmheader.c rcparse.c rclex.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c @@ -208,29 +198,12 @@ LIBIBERTY = ../libiberty/libiberty.a POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES) -EXPECT = `if [ -f $$r/../expect/expect ] ; then \ - echo $$r/../expect/expect ; \ - else echo expect ; fi` - -RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \ - echo ${srcdir}/../dejagnu/runtest ; \ - else echo runtest ; fi` - - -CC_FOR_TARGET = ` \ - if [ -f $$r/../gcc/xgcc ] ; then \ - if [ -f $$r/../newlib/Makefile ] ; then \ - echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ - else \ - echo $$r/../gcc/xgcc -B$$r/../gcc/; \ - fi; \ - else \ - if [ "@host@" = "@target@" ] ; then \ - echo $(CC); \ - else \ - echo gcc | sed '$(transform)'; \ - fi; \ - fi` +EXPECT = `if [ -f $$r/../expect/expect ] ; then echo $$r/../expect/expect ; else echo expect ; fi` + +RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest ; fi` + + +CC_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CC); else echo gcc | sed '$(transform)'; fi; fi` info_TEXINFOS = binutils.texi @@ -266,7 +239,7 @@ addr2line_SOURCES = addr2line.c $(BULIBS srconv_SOURCES = srconv.c coffgrok.c $(BULIBS) -dlltool_SOURCES = dlltool.c defparse.y deflex.l dyn-string.c $(BULIBS) +dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS) dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS) @@ -275,26 +248,22 @@ sysdump_SOURCES = sysdump.c $(BULIBS) nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ - winduni.c resres.c $(BULIBS) +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) -dllwrap_SOURCES = dllwrap.c dyn-string.c version.c +dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) -DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ - syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c +DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c -DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ - site.exp site.bak +DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h site.exp site.bak MAINTAINERCLEANFILES = config.texi -MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum \ - abcdefgh* +MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum abcdefgh* CLEANFILES = dep.sed DEP DEP1 DEP2 @@ -330,15 +299,15 @@ coffdump_OBJECTS = coffdump.o coffgrok. coffdump_LDADD = $(LDADD) coffdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a coffdump_LDFLAGS = -dlltool_OBJECTS = dlltool.o defparse.o deflex.o dyn-string.o bucomm.o \ -version.o filemode.o +dlltool_OBJECTS = dlltool.o defparse.o deflex.o bucomm.o version.o \ +filemode.o dlltool_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a dlltool_LDFLAGS = windres_OBJECTS = windres.o resrc.o rescoff.o resbin.o rcparse.o \ rclex.o winduni.o resres.o bucomm.o version.o filemode.o windres_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a windres_LDFLAGS = -dllwrap_OBJECTS = dllwrap.o dyn-string.o version.o +dllwrap_OBJECTS = dllwrap.o version.o dllwrap_DEPENDENCIES = ../libiberty/libiberty.a dllwrap_LDFLAGS = size_OBJECTS = size.o bucomm.o version.o filemode.o @@ -1247,7 +1216,7 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ $(INCDIR)/libiberty.h debug.h dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h dyn-string.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h \ dlltool.h filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h @@ -1340,11 +1309,9 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCD resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ $(INCDIR)/libiberty.h windres.h winduni.h -dyn-string.o: dyn-string.c config.h $(INCDIR)/ansidecl.h \ - dyn-string.h dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h underscore.o: underscore.c diff -uprN binutils-2.10/binutils/binutils.info binutils-2.10.1/binutils/binutils.info --- binutils-2.10/binutils/binutils.info Sat Jun 10 13:39:56 2000 +++ binutils-2.10.1/binutils/binutils.info Tue Nov 7 10:26:08 2000 @@ -39,36 +39,36 @@ versions.  Indirect: binutils.info-1: 1845 -binutils.info-2: 49760 -binutils.info-3: 96951 +binutils.info-2: 49762 +binutils.info-3: 96952  Tag Table: (Indirect) Node: Top1845 -Node: ar3094 -Node: ar cmdline5268 -Node: ar scripts13107 -Node: nm18786 -Node: objcopy25756 -Node: objdump38583 -Node: ranlib49011 -Node: size49760 -Node: strings52491 -Node: strip54316 -Node: c++filt57281 -Ref: c++filt-Footnote-160138 -Node: addr2line60244 -Node: nlmconv62650 -Node: windres65254 -Node: dlltool70306 -Node: readelf79647 -Node: Selecting The Target System82798 -Node: Target Selection83815 -Node: Architecture Selection86516 -Node: Linker Emulation Selection87747 -Node: Reporting Bugs88625 -Node: Bug Criteria89376 -Node: Bug Reporting89922 -Node: Index96951 +Node: ar3096 +Node: ar cmdline5270 +Node: ar scripts13109 +Node: nm18788 +Node: objcopy25758 +Node: objdump38585 +Node: ranlib49013 +Node: size49762 +Node: strings52493 +Node: strip54318 +Node: c++filt57283 +Ref: c++filt-Footnote-160140 +Node: addr2line60246 +Node: nlmconv62652 +Node: windres65256 +Node: dlltool70308 +Node: readelf79649 +Node: Selecting The Target System82799 +Node: Target Selection83816 +Node: Architecture Selection86517 +Node: Linker Emulation Selection87748 +Node: Reporting Bugs88626 +Node: Bug Criteria89377 +Node: Bug Reporting89923 +Node: Index96952  End Tag Table diff -uprN binutils-2.10/binutils/binutils.info-1 binutils-2.10.1/binutils/binutils.info-1 --- binutils-2.10/binutils/binutils.info-1 Sat Jun 10 13:39:56 2000 +++ binutils-2.10.1/binutils/binutils.info-1 Tue Nov 7 10:26:08 2000 @@ -43,7 +43,7 @@ Introduction ************ This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.10): +binary utilities (collectively version 2.10.1): * Menu: diff -uprN binutils-2.10/binutils/binutils.info-2 binutils-2.10.1/binutils/binutils.info-2 --- binutils-2.10/binutils/binutils.info-2 Sat Jun 10 13:39:56 2000 +++ binutils-2.10.1/binutils/binutils.info-2 Tue Nov 7 10:26:08 2000 @@ -968,8 +968,8 @@ equivalent. At least one option besides `-D' `--use-dynamic' When displaying symbols, this option makes `readelf' use the - symblol table in the file's dynamic section, rather than the one - in the symbols section. + symbol table in the file's dynamic section, rather than the one in + the symbols section. `-x ' `--hex-dump=' diff -uprN binutils-2.10/binutils/binutils.texi binutils-2.10.1/binutils/binutils.texi --- binutils-2.10/binutils/binutils.texi Wed Apr 5 06:36:40 2000 +++ binutils-2.10.1/binutils/binutils.texi Sat Oct 14 19:42:22 2000 @@ -2530,7 +2530,7 @@ exist. @item -D @itemx --use-dynamic When displaying symbols, this option makes @code{readelf} use the -symblol table in the file's dynamic section, rather than the one in the +symbol table in the file's dynamic section, rather than the one in the symbols section. @item -x diff -uprN binutils-2.10/binutils/config.texi binutils-2.10.1/binutils/config.texi --- binutils-2.10/binutils/config.texi Sat Jun 10 13:39:55 2000 +++ binutils-2.10.1/binutils/config.texi Tue Nov 7 10:26:07 2000 @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff -uprN binutils-2.10/binutils/configure binutils-2.10.1/binutils/configure --- binutils-2.10/binutils/configure Sun May 28 11:57:50 2000 +++ binutils-2.10.1/binutils/configure Mon Oct 16 12:27:23 2000 @@ -49,7 +49,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -164,7 +163,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -335,11 +333,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -505,16 +498,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -601,7 +590,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:605: checking host system type" >&5 +echo "configure:594: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -622,7 +611,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:626: checking target system type" >&5 +echo "configure:615: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -640,7 +629,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:644: checking build system type" >&5 +echo "configure:633: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -662,6 +651,249 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${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:658: 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="gcc" + 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 + +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:688: 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_prog_rejected=no + 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 + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +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 + + 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:739: 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; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:771: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 782 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:787: \"$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 + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + 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:813: 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:818: 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 + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +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:846: 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 + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +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 "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:878: 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 + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -675,7 +907,7 @@ test "$host_alias" != "$target_alias" && # 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:679: checking for a BSD compatible install" >&5 +echo "configure:911: 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 @@ -728,7 +960,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:732: checking whether build environment is sane" >&5 +echo "configure:964: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -785,7 +1017,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:789: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1021: 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 @@ -814,7 +1046,7 @@ fi PACKAGE=binutils -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -831,7 +1063,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:835: checking for working aclocal" >&5 +echo "configure:1067: 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. @@ -844,7 +1076,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:848: checking for working autoconf" >&5 +echo "configure:1080: 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. @@ -857,7 +1089,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:861: checking for working automake" >&5 +echo "configure:1093: 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. @@ -870,7 +1102,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:874: checking for working autoheader" >&5 +echo "configure:1106: 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. @@ -883,7 +1115,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:887: checking for working makeinfo" >&5 +echo "configure:1119: 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. @@ -969,7 +1201,7 @@ 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:973: checking for $ac_word" >&5 +echo "configure:1205: 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 @@ -996,228 +1228,6 @@ else echo "$ac_t""no" 1>&6 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:1003: 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="gcc" - 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 - -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:1033: 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_prog_rejected=no - 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 - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -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 - - 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:1084: 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; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1116: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1127 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1132: \"$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 - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - 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:1158: 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:1163: 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 - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -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:1191: 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 - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -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 "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1230,7 +1240,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:1234: checking for ld used by GCC" >&5 +echo "configure:1244: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1254,10 +1264,10 @@ echo "configure:1234: 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:1258: checking for GNU ld" >&5 +echo "configure:1268: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1261: checking for non-GNU ld" >&5 +echo "configure:1271: 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 @@ -1292,7 +1302,7 @@ else 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:1296: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1306: 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 @@ -1308,7 +1318,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:1312: checking for BSD-compatible nm" >&5 +echo "configure:1322: 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 @@ -1344,7 +1354,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1348: checking whether ln -s works" >&5 +echo "configure:1358: 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 @@ -1393,8 +1403,8 @@ test x"$silent" = xyes && libtool_flags= case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1397 "configure"' > conftest.$ac_ext - if { (eval echo configure:1398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1407 "configure"' > conftest.$ac_ext + if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1415,19 +1425,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1419: checking whether the C compiler needs -belf" >&5 +echo "configure:1429: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1563,7 +1573,7 @@ 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:1567: checking for $ac_word" >&5 +echo "configure:1577: 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 @@ -1593,7 +1603,7 @@ 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:1597: checking for $ac_word" >&5 +echo "configure:1607: 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 @@ -1644,7 +1654,7 @@ fi # 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:1648: 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 @@ -1676,7 +1686,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1690: 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. @@ -1687,12 +1697,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1691 "configure" +#line 1701 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1706: \"$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 @@ -1718,12 +1728,12 @@ 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:1722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1732: 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:1727: checking whether we are using GNU C" >&5 +echo "configure:1737: 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 @@ -1732,7 +1742,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1736: \"$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:1746: \"$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 @@ -1751,7 +1761,7 @@ 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:1755: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1765: 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 @@ -1788,7 +1798,7 @@ 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:1792: checking for $ac_word" >&5 +echo "configure:1802: 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 @@ -1819,7 +1829,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1823: checking how to run the C preprocessor" >&5 +echo "configure:1833: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1834,13 +1844,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1854: \"$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 : @@ -1851,13 +1861,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1871: \"$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 : @@ -1868,13 +1878,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < 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; } +{ (eval echo configure:1888: \"$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 : @@ -1904,7 +1914,7 @@ 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:1908: checking for $ac_word" >&5 +echo "configure:1918: 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 @@ -1937,7 +1947,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # 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:1941: checking for $ac_word" >&5 +echo "configure:1951: 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 @@ -1971,7 +1981,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1975: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1985: 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 @@ -1979,7 +1989,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2004: \"$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 @@ -2013,7 +2023,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2017: checking lex output file root" >&5 +echo "configure:2027: 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 @@ -2034,7 +2044,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:2038: checking whether yytext is a pointer" >&5 +echo "configure:2048: 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 @@ -2046,14 +2056,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2067: \"$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 @@ -2076,34 +2086,13 @@ fi ALL_LINGUAS= -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:2081: 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 - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2102: checking for ANSI C header files" >&5 +echo "configure:2091: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2111,7 +2100,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2104: \"$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* @@ -2128,7 +2117,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2146,7 +2135,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2167,7 +2156,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2178,7 +2167,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2202,18 +2191,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2206: checking for working const" >&5 +echo "configure:2195: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2277,21 +2266,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2281: checking for inline" >&5 +echo "configure:2270: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2317,12 +2306,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2321: checking for off_t" >&5 +echo "configure:2310: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2350,12 +2339,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2354: checking for size_t" >&5 +echo "configure:2343: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2385,19 +2374,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:2389: checking for working alloca.h" >&5 +echo "configure:2378: 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 < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2390: \"$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 @@ -2418,12 +2407,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2422: checking for alloca" >&5 +echo "configure:2411: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2444: \"$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 @@ -2483,12 +2472,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2487: checking whether alloca needs Cray hooks" >&5 +echo "configure:2476: 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 <&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:2517: checking for $ac_func" >&5 +echo "configure:2506: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2534: \"$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 @@ -2568,7 +2557,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2572: checking stack direction for C alloca" >&5 +echo "configure:2561: 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 @@ -2576,7 +2565,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2588: \"$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 @@ -2620,17 +2609,17 @@ 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:2624: checking for $ac_hdr" >&5 +echo "configure:2613: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2623: \"$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* @@ -2659,12 +2648,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2663: checking for $ac_func" >&5 +echo "configure:2652: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2680: \"$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 @@ -2712,7 +2701,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2716: checking for working mmap" >&5 +echo "configure:2705: 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 @@ -2720,7 +2709,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2807,7 +2799,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2828,7 +2820,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2846,7 +2838,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2860,7 +2852,7 @@ main() } EOF -if { (eval echo configure:2864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2856: \"$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 @@ -2888,17 +2880,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2892: checking for $ac_hdr" >&5 +echo "configure:2884: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2894: \"$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* @@ -2928,12 +2920,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2932: checking for $ac_func" >&5 +echo "configure:2924: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2952: \"$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 @@ -2985,12 +2977,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2989: checking for $ac_func" >&5 +echo "configure:2981: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3009: \"$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 @@ -3047,19 +3039,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3051: checking for LC_MESSAGES" >&5 +echo "configure:3043: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3080,7 +3072,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3084: checking whether NLS is requested" >&5 +echo "configure:3076: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3100,7 +3092,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3104: checking whether included gettext is requested" >&5 +echo "configure:3096: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3119,17 +3111,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3123: checking for libintl.h" >&5 +echo "configure:3115: checking for libintl.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3125: \"$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* @@ -3146,19 +3138,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3150: checking for gettext in libc" >&5 +echo "configure:3142: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3174,7 +3166,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3178: checking for bindtextdomain in -lintl" >&5 +echo "configure:3170: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3182,7 +3174,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3189: \"$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 @@ -3209,19 +3201,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3213: checking for gettext in libintl" >&5 +echo "configure:3205: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3249,7 +3241,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3253: checking for $ac_word" >&5 +echo "configure:3245: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3283,12 +3275,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3287: checking for $ac_func" >&5 +echo "configure:3279: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3307: \"$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 @@ -3338,7 +3330,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3342: checking for $ac_word" >&5 +echo "configure:3334: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3374,7 +3366,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3378: checking for $ac_word" >&5 +echo "configure:3370: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3406,7 +3398,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3446,7 +3438,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3450: checking for $ac_word" >&5 +echo "configure:3442: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3480,7 +3472,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3484: checking for $ac_word" >&5 +echo "configure:3476: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3516,7 +3508,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3520: checking for $ac_word" >&5 +echo "configure:3512: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3606,7 +3598,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3610: checking for catalogs to be installed" >&5 +echo "configure:3602: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3634,17 +3626,17 @@ echo "configure:3610: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3638: checking for linux/version.h" >&5 +echo "configure:3630: checking for linux/version.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3640: \"$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* @@ -3707,7 +3699,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3711: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3703: 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" @@ -3730,12 +3722,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3734: checking for Cygwin environment" >&5 +echo "configure:3726: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3763,19 +3755,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3767: checking for mingw32 environment" >&5 +echo "configure:3759: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3794,7 +3786,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3798: checking for executable suffix" >&5 +echo "configure:3790: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3804,10 +3796,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -3847,7 +3839,7 @@ 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:3851: checking for $ac_word" >&5 +echo "configure:3843: 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 @@ -3886,7 +3878,7 @@ fi # 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:3890: checking for a BSD compatible install" >&5 +echo "configure:3882: 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 @@ -3953,7 +3945,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:3957: checking for build system executable suffix" >&5 +echo "configure:3949: 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 @@ -3988,17 +3980,17 @@ 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:3992: checking for $ac_hdr" >&5 +echo "configure:3984: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3994: \"$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* @@ -4025,12 +4017,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4029: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4021: 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 < #include @@ -4046,7 +4038,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4069,19 +4061,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:4073: checking for working alloca.h" >&5 +echo "configure:4065: 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 < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4077: \"$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 @@ -4102,12 +4094,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4106: checking for alloca" >&5 +echo "configure:4098: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4131: \"$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 @@ -4167,12 +4159,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4171: checking whether alloca needs Cray hooks" >&5 +echo "configure:4163: 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 <&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:4201: checking for $ac_func" >&5 +echo "configure:4193: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4221: \"$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 @@ -4252,7 +4244,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4256: checking stack direction for C alloca" >&5 +echo "configure:4248: 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 @@ -4260,7 +4252,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4275: \"$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 @@ -4303,12 +4295,12 @@ fi for ac_func in sbrk utimes setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4307: checking for $ac_func" >&5 +echo "configure:4299: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4327: \"$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 @@ -4359,14 +4351,14 @@ done # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:4363: checking for library containing frexp" >&5 +echo "configure:4355: checking for library containing frexp" >&5 if eval "test \"`echo '$''{'ac_cv_search_frexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_frexp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="none required" else @@ -4388,7 +4380,7 @@ rm -f conftest* test "$ac_cv_search_frexp" = "no" && for i in m; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_frexp="-l$i" break @@ -4421,19 +4413,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:4425: checking for time_t in time.h" >&5 +echo "configure:4417: 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 < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -4454,19 +4446,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4458: checking for time_t in sys/types.h" >&5 +echo "configure:4450: 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 < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:4470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -4489,12 +4481,12 @@ fi # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:4493: checking for utime.h" >&5 +echo "configure:4485: 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 < #ifdef HAVE_TIME_H @@ -4505,7 +4497,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:4509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -4526,12 +4518,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:4530: checking whether fprintf must be declared" >&5 +echo "configure:4522: 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 < @@ -4552,7 +4544,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -4573,12 +4565,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4577: checking whether strstr must be declared" >&5 +echo "configure:4569: 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 < @@ -4599,7 +4591,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4620,12 +4612,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4624: checking whether sbrk must be declared" >&5 +echo "configure:4616: 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 < @@ -4646,7 +4638,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4667,12 +4659,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4671: checking whether getenv must be declared" >&5 +echo "configure:4663: 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 < @@ -4693,7 +4685,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4714,12 +4706,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4718: checking whether environ must be declared" >&5 +echo "configure:4710: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4740,7 +4732,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -5045,6 +5037,7 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g +s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -5057,7 +5050,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@RANLIB@%$RANLIB%g -s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@LIBTOOL@%$LIBTOOL%g s%@YACC@%$YACC%g diff -uprN binutils-2.10/binutils/configure.in binutils-2.10.1/binutils/configure.in --- binutils-2.10/binutils/configure.in Sun May 28 11:57:50 2000 +++ binutils-2.10.1/binutils/configure.in Mon Oct 16 12:27:24 2000 @@ -4,8 +4,9 @@ AC_PREREQ(2.13) AC_INIT(ar.c) AC_CANONICAL_SYSTEM +AC_ISC_POSIX -AM_INIT_AUTOMAKE(binutils, 2.10) +AM_INIT_AUTOMAKE(binutils, 2.10.1) AM_PROG_LIBTOOL diff -uprN binutils-2.10/binutils/dyn-string.c binutils-2.10.1/binutils/dyn-string.c --- binutils-2.10/binutils/dyn-string.c Tue Aug 31 16:12:20 1999 +++ binutils-2.10.1/binutils/dyn-string.c Thu Jan 1 01:00:00 1970 @@ -1,107 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - - This file is part of GNU CC. - - GNU CC 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. - - GNU CC 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This file lives in at least two places: binutils and gcc. - Don't change one without the other. */ - -#include "config.h" -#ifdef IN_GCC -#include "system.h" -#include "gansidecl.h" -#else -#include "ansidecl.h" -#endif -#include "dyn-string.h" - -extern char *xmalloc (); -extern char *xrealloc (); - -/* Create a new dynamic string capable of holding at least SPACE - characters, including the terminating NUL. If SPACE is 0, it - will be silently increased to 1. */ - -dyn_string_t -dyn_string_new (space) - int space; -{ - dyn_string_t result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); - - if (space == 0) - /* We need at least one byte in which to store the terminating - NUL. */ - space = 1; - - result->allocated = space; - result->s = (char*) xmalloc (space); - result->length = 0; - result->s[0] = '\0'; - - return result; -} - -/* Free the memory used by DS. */ - -void -dyn_string_delete (ds) - dyn_string_t ds; -{ - free (ds->s); - free (ds); -} - -/* Append the NUL-terminated string S to DS, resizing DS if - necessary. */ - -dyn_string_t -dyn_string_append (ds, s) - dyn_string_t ds; - char *s; -{ - int len = strlen (s); - dyn_string_resize (ds, ds->length + len + 1 /* '\0' */); - strcpy (ds->s + ds->length, s); - ds->length += len; - - return ds; -} - -/* Increase the capacity of DS so that it can hold at least SPACE - characters, including the terminating NUL. This function will not - (at present) reduce the capacity of DS. */ - -dyn_string_t -dyn_string_resize (ds, space) - dyn_string_t ds; - int space; -{ - int new_allocated = ds->allocated; - - while (space > new_allocated) - new_allocated *= 2; - - if (new_allocated != ds->allocated) - { - /* We actually need more space. */ - ds->allocated = new_allocated; - ds->s = (char*) xrealloc (ds->s, ds->allocated); - } - - return ds; -} diff -uprN binutils-2.10/binutils/dyn-string.h binutils-2.10.1/binutils/dyn-string.h --- binutils-2.10/binutils/dyn-string.h Tue Aug 31 16:12:20 1999 +++ binutils-2.10.1/binutils/dyn-string.h Thu Jan 1 01:00:00 1970 @@ -1,34 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - - This file is part of GNU CC. - - GNU CC 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. - - GNU CC 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This file lives in at least two places: binutils and gcc. - Don't change one without the other. */ - -typedef struct dyn_string -{ - int allocated; /* The amount of space allocated for the string. */ - int length; /* The actual length of the string. */ - char *s; /* The string itself, NUL-terminated. */ -}* dyn_string_t; - -extern dyn_string_t dyn_string_new PARAMS((int)); -extern void dyn_string_delete PARAMS((dyn_string_t)); -extern dyn_string_t dyn_string_append PARAMS((dyn_string_t, char*)); -extern dyn_string_t dyn_string_resize PARAMS((dyn_string_t, int)); diff -uprN binutils-2.10/binutils/nm.c binutils-2.10.1/binutils/nm.c --- binutils-2.10/binutils/nm.c Fri Apr 7 05:39:24 2000 +++ binutils-2.10.1/binutils/nm.c Sat Oct 14 19:42:22 2000 @@ -291,19 +291,38 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("\ -Usage: %s [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n\ - [--debug-syms] [--extern-only] [--print-armap] [--print-file-name]\n\ - [--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]\n\ - [--undefined-only] [--portability] [-f {bsd,sysv,posix}]\n\ - [--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]\n\ - [--defined-only] [--line-numbers]\n\ - [--version] [--help]\n\ - [file...]\n"), - program_name); + fprintf (stream, _("Usage: %s [OPTION]... [FILE]...\n"), program_name); + fprintf (stream, _("List symbols from FILEs (a.out by default).\n")); + fprintf (stream, _("\n\ + -a, --debug-syms Display debugger-only symbols\n\ + -A, --print-file-name Print name of the input file before every symbol\n\ + -B Same as --format=bsd\n\ + -C, --demangle Decode low-level symbol names into user-level names\n\ + --no-demangle Do not demangle low-level symbol names\n\ + -D, --dynamic Display dynamic symbols instead of normal symbols\n\ + --defined-only Display only defined symbols\n\ + -e (ignored)\n\ + -f, --format=FORMAT Use the output format FORMAT. FORMAT can be `bsd',\n\ + `sysv' or `posix'. The default is `bsd'\n\ + -g, --extern-only Display only external symbols\n\ + -h, --help Display this information\n\ + -l, --line-numbers Use debugging information to find a filename and\n\ + line number for each symbol\n\ + -n, --numeric-sort Sort symbols numerically by address\n\ + -o Same as -A\n\ + -p, --no-sort Do not sort the symbols\n\ + -P, --portability Same as --format=posix\n\ + -r, --reverse-sort Reverse the sense of the sort\n\ + -s, --print-armap Include index for symbols from archive members\n\ + --size-sort Sort symbols by size\n\ + -t, --radix=RADIX Use RADIX for printing symbol values\n\ + --target=BFDNAME Specify the target object format as BFDNAME\n\ + -u, --undefined-only Display only undefined symbols\n\ + -V, --version Display this program's version number\n\ +\n")); list_supported_targets (program_name, stream); if (status == 0) - fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } diff -uprN binutils-2.10/binutils/objcopy.c binutils-2.10.1/binutils/objcopy.c --- binutils-2.10/binutils/objcopy.c Sun May 28 11:57:50 2000 +++ binutils-2.10.1/binutils/objcopy.c Tue Sep 5 09:56:22 2000 @@ -1663,7 +1663,7 @@ strip_main (argc, argv) struct section_list *p; char *output_file = NULL; - while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpgxXVv", + while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXVv", strip_options, (int *) 0)) != EOF) { switch (c) @@ -1687,6 +1687,7 @@ strip_main (argc, argv) break; case 'S': case 'g': + case 'd': /* NetBSD, historic BSD strip */ strip_symbols = STRIP_DEBUG; break; case OPTION_STRIP_UNNEEDED: diff -uprN binutils-2.10/binutils/objdump.c binutils-2.10.1/binutils/objdump.c --- binutils-2.10/binutils/objdump.c Tue May 30 08:51:02 2000 +++ binutils-2.10.1/binutils/objdump.c Sat Oct 14 19:34:28 2000 @@ -220,55 +220,56 @@ usage (stream, status) FILE *stream; int status; { - fprintf (stream, _("Usage: %s file(s)\n"), program_name); - fprintf (stream, _(" At least one of the following switches must be given:\n")); + fprintf (stream, _("Usage: %s OPTION... FILE...\n"), program_name); + fprintf (stream, _("Display information from object FILE.\n")); + fprintf (stream, _("\n At least one of the following switches must be given:\n")); fprintf (stream, _("\ - -a --archive-headers Display archive header information\n\ - -f --file-headers Display the contents of the overall file header\n\ - -p --private-headers Display object format specific file header contents\n\ - -h --[section-]headers Display the contents of the section headers\n\ - -x --all-headers Display the contents of all headers\n\ - -d --disassemble Display assembler contents of executable sections\n\ - -D --disassemble-all Display assembler contents of all sections\n\ - -S --source Intermix source code with disassembly\n\ - -s --full-contents Display the full contents of all sections requested\n\ - -g --debugging Display debug information in object file\n\ - -G --stabs Display the STABS contents of an ELF format file\n\ - -t --syms Display the contents of the symbol table(s)\n\ - -T --dynamic-syms Display the contents of the dynamic symbol table\n\ - -r --reloc Display the relocation entries in the file\n\ - -R --dynamic-reloc Display the dynamic relocation entries in the file\n\ - -V --version Display this program's version number\n\ - -i --info List object formats and architectures supported\n\ - -H --help Display this information\n\ + -a, --archive-headers Display archive header information\n\ + -f, --file-headers Display the contents of the overall file header\n\ + -p, --private-headers Display object format specific file header contents\n\ + -h, --[section-]headers Display the contents of the section headers\n\ + -x, --all-headers Display the contents of all headers\n\ + -d, --disassemble Display assembler contents of executable sections\n\ + -D, --disassemble-all Display assembler contents of all sections\n\ + -S, --source Intermix source code with disassembly\n\ + -s, --full-contents Display the full contents of all sections requested\n\ + -g, --debugging Display debug information in object file\n\ + -G, --stabs Display (in raw form) any STABS info in the file\n\ + -t, --syms Display the contents of the symbol table(s)\n\ + -T, --dynamic-syms Display the contents of the dynamic symbol table\n\ + -r, --reloc Display the relocation entries in the file\n\ + -R, --dynamic-reloc Display the dynamic relocation entries in the file\n\ + -V, --version Display this program's version number\n\ + -i, --info List object formats and architectures supported\n\ + -H, --help Display this information\n\ ")); if (status != 2) { fprintf (stream, _("\n The following switches are optional:\n")); fprintf (stream, _("\ - -b --target Specify the target object format as \n\ - -m --architecture Specify the target architecture as \n\ - -j --section Only display information for section \n\ - -M --disassembler-options Pass text on to the disassembler\n\ + -b, --target=BFDNAME Specify the target object format as BFDNAME\n\ + -m, --architecture=MACHINE Specify the target architecture as MACHINE\n\ + -j, --section=NAME Only display information for section NAME\n\ + -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n\ -EB --endian=big Assume big endian format when disassembling\n\ -EL --endian=little Assume little endian format when disassembling\n\ --file-start-context Include context from start of file (with -S)\n\ - -l --line-numbers Include line numbers and filenames in output\n\ - -C --demangle Decode mangled/processed symbol names\n\ - -w --wide Format output for more than 80 columns\n\ - -z --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\ - --start-address Only process data whoes address is >= \n\ - --stop-address Only process data whoes address is <= \n\ + -l, --line-numbers Include line numbers and filenames in output\n\ + -C, --demangle Decode mangled/processed symbol names\n\ + -w, --wide Format output for more than 80 columns\n\ + -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\ + --start-address=ADDR Only process data whoes address is >= ADDR\n\ + --stop-address=ADDR Only process data whoes address is <= ADDR\n\ --prefix-addresses Print complete address alongside disassembly\n\ --[no-]show-raw-insn Display hex alongside symbolic disassembly\n\ - --adjust-vma Add to all displayed section addresses\n\ + --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\ \n")); list_supported_targets (program_name, stream); - + disassembler_usage (stream); } if (status == 0) - fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); + fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); exit (status); } @@ -2606,7 +2607,7 @@ dump_reloc_set (abfd, sec, relpp, relcou } /* The length of the longest architecture name + 1. */ -#define LONGEST_ARCH sizeof("rs6000:6000") +#define LONGEST_ARCH sizeof("powerpc:common") static const char * endian_string (endian) diff -uprN binutils-2.10/binutils/readelf.c binutils-2.10.1/binutils/readelf.c --- binutils-2.10/binutils/readelf.c Tue May 23 09:39:06 2000 +++ binutils-2.10.1/binutils/readelf.c Sat Oct 14 21:43:13 2000 @@ -1063,15 +1063,21 @@ get_dynamic_type (type) case DT_PREINIT_ARRAY: return "PREINIT_ARRAY"; case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ"; + case DT_CHECKSUM: return "CHECKSUM"; case DT_PLTPADSZ: return "PLTPADSZ"; case DT_MOVEENT: return "MOVEENT"; case DT_MOVESZ: return "MOVESZ"; - case DT_FEATURE_1: return "FEATURE_1"; + case DT_FEATURE: return "FEATURE"; case DT_POSFLAG_1: return "POSFLAG_1"; case DT_SYMINSZ: return "SYMINSZ"; case DT_SYMINENT: return "SYMINENT"; /* aka VALRNGHI */ case DT_ADDRRNGLO: return "ADDRRNGLO"; + case DT_CONFIG: return "CONFIG"; + case DT_DEPAUDIT: return "DEPAUDIT"; + case DT_AUDIT: return "AUDIT"; + case DT_PLTPAD: return "PLTPAD"; + case DT_MOVETAB: return "MOVETAB"; case DT_SYMINFO: return "SYMINFO"; /* aka ADDRRNGHI */ case DT_VERSYM: return "VERSYM"; @@ -1084,7 +1090,7 @@ get_dynamic_type (type) case DT_VERNEED: return "VERNEED"; case DT_VERNEEDNUM: return "VERNEEDNUM"; - case DT_AUXILIARY: return "AUXILARY"; + case DT_AUXILIARY: return "AUXILIARY"; case DT_USED: return "USED"; case DT_FILTER: return "FILTER"; @@ -3202,12 +3208,33 @@ process_dynamic_segment (file) case DT_AUXILIARY: case DT_FILTER: + case DT_CONFIG: + case DT_DEPAUDIT: + case DT_AUDIT: if (do_dynamic) { - if (entry->d_tag == DT_AUXILIARY) - printf (_("Auxiliary library")); - else - printf (_("Filter library")); + switch (entry->d_tag) + { + case DT_AUXILIARY: + printf (_("Auxiliary library")); + break; + + case DT_FILTER: + printf (_("Filter library")); + break; + + case DT_CONFIG: + printf (_("Configuration file")); + break; + + case DT_DEPAUDIT: + printf (_("Dependency audit library")); + break; + + case DT_AUDIT: + printf (_("Audit library")); + break; + } if (dynamic_strings) printf (": [%s]\n", dynamic_strings + entry->d_un.d_val); @@ -3220,7 +3247,7 @@ process_dynamic_segment (file) } break; - case DT_FEATURE_1: + case DT_FEATURE: if (do_dynamic) { printf (_("Flags:")); @@ -3234,6 +3261,11 @@ process_dynamic_segment (file) printf (" PARINIT"); val ^= DTF_1_PARINIT; } + if (val & DTF_1_CONFEXP) + { + printf (" CONFEXP"); + val ^= DTF_1_CONFEXP; + } if (val != 0) printf (" %lx", val); puts (""); @@ -3331,6 +3363,21 @@ process_dynamic_segment (file) printf (" INTERPOSE"); val ^= DF_1_INTERPOSE; } + if (val & DF_1_NODEFLIB) + { + printf (" NODEFLIB"); + val ^= DF_1_NODEFLIB; + } + if (val & DF_1_NODUMP) + { + printf (" NODUMP"); + val ^= DF_1_NODUMP; + } + if (val & DF_1_CONLFAT) + { + printf (" CONLFAT"); + val ^= DF_1_CONLFAT; + } if (val != 0) printf (" %lx", val); puts (""); @@ -3359,6 +3406,7 @@ process_dynamic_segment (file) case DT_DEBUG : case DT_TEXTREL : case DT_JMPREL : + case DT_RUNPATH : dynamic_info[entry->d_tag] = entry->d_un.d_val; if (do_dynamic) @@ -3389,6 +3437,10 @@ process_dynamic_segment (file) printf (_("Library rpath: [%s]"), name); break; + case DT_RUNPATH: + printf (_("Library runpath: [%s]"), name); + break; + default: print_vma (entry->d_un.d_val, PREFIX_HEX); break; @@ -5039,7 +5091,14 @@ display_debug_pubnames (section, start, if (pubnames.pn_version != 2) { - warn (_("Only DWARF 2 pubnames are currently supported")); + static int warned = 0; + + if (! warned) + { + warn (_("Only DWARF 2 pubnames are currently supported\n")); + warned = 1; + } + continue; } @@ -6356,6 +6415,12 @@ display_debug_aranges (section, start, f arange.ar_info_offset = BYTE_GET (external->ar_info_offset); arange.ar_pointer_size = BYTE_GET (external->ar_pointer_size); arange.ar_segment_size = BYTE_GET (external->ar_segment_size); + + if (arange.ar_version != 2) + { + warn (_("Only DWARF 2 aranges are currently supported.\n")); + break; + } printf (_(" Length: %ld\n"), arange.ar_length); printf (_(" Version: %d\n"), arange.ar_version); diff -uprN binutils-2.10/binutils/stabs.c binutils-2.10.1/binutils/stabs.c --- binutils-2.10/binutils/stabs.c Fri Jan 14 23:10:21 2000 +++ binutils-2.10.1/binutils/stabs.c Sat Oct 14 19:35:19 2000 @@ -1261,6 +1261,7 @@ parse_stab_type (dhandle, info, typename { case 's': size = atoi (attr + 1); + size /= 8; /* Size is in bits. We store it in bytes. */ if (size <= 0) size = -1; break; diff -uprN binutils-2.10/binutils/strip.1 binutils-2.10.1/binutils/strip.1 --- binutils-2.10/binutils/strip.1 Mon May 3 08:29:10 1999 +++ binutils-2.10.1/binutils/strip.1 Mon Sep 4 18:37:35 2000 @@ -26,7 +26,7 @@ strip \- Discard symbols from object fil .RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals "\|]" .RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]" .RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]" -.RB "[\|" \-o\ \fIfile\f\R "\|]" +.RB "[\|" \-o\ \fIfile\fR "\|]" .RB "[\|" \-p\fR\ |\ \fB\-\-preserve\-dates "\|]" .RB "[\|" \-v\fR\ |\ \fB\-\-verbose "\|]" .RB "[\|" \-V\fR\ |\ \fB\-\-version "\|]" diff -uprN binutils-2.10/config.guess binutils-2.10.1/config.guess --- binutils-2.10/config.guess Thu Feb 24 05:38:51 2000 +++ binutils-2.10.1/config.guess Mon Oct 16 18:51:02 2000 @@ -2,7 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-09-05' + # This file 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 @@ -36,6 +38,46 @@ # (but try to keep the structure clean). # +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of this system. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then @@ -77,7 +119,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in - amiga) machine=m68k-cbm ;; + amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; @@ -173,7 +215,7 @@ EOF echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} @@ -266,7 +308,7 @@ EOF exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor + # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not @@ -360,7 +402,7 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] @@ -458,6 +500,8 @@ EOF 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE #include #include @@ -588,7 +632,7 @@ EOF echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos @@ -604,7 +648,7 @@ EOF hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -614,12 +658,6 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) @@ -631,6 +669,9 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -649,6 +690,9 @@ EOF *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; *:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -670,6 +714,9 @@ EOF echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; + elf_i?86) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 @@ -721,11 +768,15 @@ EOF if test "$?" = 0 ; then LIBC="libc1" fi - fi + fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then @@ -807,6 +858,8 @@ EOF rm -f $dummy.c $dummy elif test "${UNAME_MACHINE}" = "s390"; then echo s390-ibm-linux && exit 0 + elif test "${UNAME_MACHINE}" = "x86_64"; then + echo x86_64-unknown-linux-gnu && exit 0 else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. @@ -851,6 +904,7 @@ EOF EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. @@ -987,7 +1041,7 @@ EOF mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -1018,14 +1072,37 @@ EOF *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; - Power*:Mac*OS:*:*) - echo powerpc-apple-macos${UNAME_RELEASE} + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; - *:Mac*OS:*:*) - echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE} + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) - echo i386-qnx-qnx${UNAME_VERSION} + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; esac @@ -1166,6 +1243,47 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess version = $version + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -uprN binutils-2.10/config.sub binutils-2.10.1/config.sub --- binutils-2.10/config.sub Thu Feb 24 21:20:57 2000 +++ binutils-2.10.1/config.sub Mon Oct 16 18:51:02 2000 @@ -2,7 +2,9 @@ # Configuration validation subroutine script, version 1.1. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-09-11' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -27,7 +29,6 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. @@ -50,30 +51,61 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -99,7 +131,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; @@ -172,27 +204,35 @@ case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | we32k | ns16k | clipper | i370 | sh | sh[34] \ + | powerpc | powerpcle \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30 | avr) + | thumb | d10v | d30v | fr30 | avr) basic_machine=$basic_machine-unknown ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) + i[234567]86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -202,12 +242,14 @@ case $basic_machine in ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ @@ -219,7 +261,8 @@ case $basic_machine in | mipstx39-* | mipstx39el-* | mcore-* \ | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-* | tic54x-* | c54x-* | x86_64-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -256,14 +299,14 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) @@ -317,6 +360,9 @@ case $basic_machine in crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -471,8 +517,9 @@ case $basic_machine in basic_machine=i386-unknown os=-mingw32 ;; - i386-qnx | qnx) - basic_machine=i386-qnx + i[34567]86-pw32 | pw32) + basic_machine=i586-unknown + os=-pw32 ;; iris | iris4d) basic_machine=mips-sgi @@ -596,6 +643,9 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -628,7 +678,7 @@ case $basic_machine in pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -637,7 +687,7 @@ case $basic_machine in pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -752,6 +802,10 @@ case $basic_machine in basic_machine=t3e-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -853,6 +907,9 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; + sh3 | sh4) + base_machine=sh-unknown + ;; sparc | sparcv9) basic_machine=sparc-sun ;; @@ -933,9 +990,22 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) @@ -982,6 +1052,9 @@ case $os in -ns2 ) os=-nextstep2 ;; + -nsk*) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -995,9 +1068,6 @@ case $os in -oss*) os=-sysv3 ;; - -qnx) - os=-qnx4 - ;; -svr4) os=-sysv4 ;; @@ -1248,3 +1318,11 @@ case $basic_machine in esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -uprN binutils-2.10/etc/configbuild.ein binutils-2.10.1/etc/configbuild.ein --- binutils-2.10/etc/configbuild.ein Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configbuild.ein Mon May 3 08:29:06 1999 @@ -0,0 +1,149 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: configbuild.fig +%%Creator: fig2dev Version 3.1 Patchlevel 1 +%%CreationDate: Fri Jun 12 20:13:16 1998 +%%For: ian@tito.cygnus.com (Ian Lance Taylor) +%%Orientation: Portrait +%%BoundingBox: 0 0 322 173 +%%Pages: 0 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {} def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +-62.0 226.0 translate +1 -1 scale + +/clp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/l {lineto} bind def +/m {moveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit + 0.06000 0.06000 sc +7.500 slw +% Polyline +n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr +% Polyline +n 1500 1425 m 1500 2100 l gs col-1 s gr +n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1500 2625 m 1500 3300 l gs col-1 s gr +n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 2925 900 m 3825 900 l 3825 1425 l 2925 1425 l clp gs col-1 s gr +% Polyline +n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2220 2625 105 arcto 4 {pop} repeat 2325 2625 2325 2205 105 arcto 4 {pop} repeat 2325 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 2850 2100 m 4125 2100 l 4125 2625 l 2850 2625 l clp gs col-1 s gr +% Polyline +n 3375 1425 m 3375 2100 l gs col-1 s gr +n 3405.00 1980.00 m 3375.00 2100.00 l 3345.00 1980.00 l 3375.50 1980.50 l 3405.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5100 900 m 6300 900 l 6300 1350 l 5100 1350 l clp gs col-1 s gr +% Polyline +n 5625 1350 m 5625 2100 l gs col-1 s gr +n 5655.00 1980.00 m 5625.00 2100.00 l 5595.00 1980.00 l 5625.50 1980.50 l 5655.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5205 2100 m 5100 2100 5100 2520 105 arcto 4 {pop} repeat 5100 2625 6270 2625 105 arcto 4 {pop} repeat 6375 2625 6375 2205 105 arcto 4 {pop} repeat 6375 2100 5205 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 5625 2625 m 5625 3300 l gs col-1 s gr +n 5655.00 3180.00 m 5625.00 3300.00 l 5595.00 3180.00 l 5625.50 3180.50 l 5655.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 5100 3300 m 6225 3300 l 6225 3750 l 5100 3750 l clp gs col-1 s gr +% Polyline + [1 50.0] 50.000000 setdash +n 2850 2400 m 2325 2400 l gs col-1 s gr [] 0 setdash +n 2445.00 2430.00 m 2325.00 2400.00 l 2445.00 2370.00 l 2445.50 2400.50 l 2445.00 2430.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline + [1 50.0] 50.000000 setdash +n 4125 2400 m 5100 2400 l gs col-1 s gr [] 0 setdash +n 4980.00 2370.00 m 5100.00 2400.00 l 4980.00 2430.00 l 4980.50 2400.50 l 4980.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1050 3300 m 1950 3300 l 1950 3750 l 1050 3750 l clp gs col-1 s gr +/Times-Roman findfont 180.00 scalefont setfont +1200 1200 m +gs 1 -1 sc (config.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 1200 m +gs 1 -1 sc (configure) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 3600 m +gs 1 -1 sc (config.h) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 1200 m +gs 1 -1 sc (Makefile.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 2400 m +gs 1 -1 sc (config.status) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5250 3600 m +gs 1 -1 sc (Makefile) col-1 show gr +$F2psEnd +restore diff -uprN binutils-2.10/etc/configbuild.fig binutils-2.10.1/etc/configbuild.fig --- binutils-2.10/etc/configbuild.fig Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configbuild.fig Mon May 3 08:29:06 1999 @@ -0,0 +1,50 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 900 2100 900 2100 1425 1050 1425 1050 900 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 1425 1500 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 2625 1500 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2925 900 3825 900 3825 1425 2925 1425 2925 900 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 2325 2625 2325 2100 1050 2100 1050 2625 2325 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2850 2100 4125 2100 4125 2625 2850 2625 2850 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3375 1425 3375 2100 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5100 900 6300 900 6300 1350 5100 1350 5100 900 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5625 1350 5625 2100 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 6375 2625 6375 2100 5100 2100 5100 2625 6375 2625 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5625 2625 5625 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5100 3300 6225 3300 6225 3750 5100 3750 5100 3300 +2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2850 2400 2325 2400 +2 1 2 1 -1 7 0 0 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4125 2400 5100 2400 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 3300 1950 3300 1950 3750 1050 3750 1050 3300 +4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 1200 config.in\001 +4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 1200 configure\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 3000 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 1200 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 180 600 1200 3600 config.h\001 +4 0 -1 0 0 0 12 0.0000000 4 135 855 5250 1200 Makefile.in\001 +4 0 -1 0 0 0 12 0.0000000 4 180 990 5250 2400 config.status\001 +4 0 -1 0 0 0 12 0.0000000 4 135 675 5250 3600 Makefile\001 Binary files binutils-2.10/etc/configbuild.jin and binutils-2.10.1/etc/configbuild.jin differ diff -uprN binutils-2.10/etc/configbuild.tin binutils-2.10.1/etc/configbuild.tin --- binutils-2.10/etc/configbuild.tin Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configbuild.tin Mon May 3 08:29:06 1999 @@ -0,0 +1,9 @@ + config.in *configure* Makefile.in + | | | + | v | + | config.status | + | | | + *config.status*<======+==========>*config.status* + | | + v v + config.h Makefile diff -uprN binutils-2.10/etc/configdev.ein binutils-2.10.1/etc/configdev.ein --- binutils-2.10/etc/configdev.ein Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configdev.ein Mon May 3 08:29:06 1999 @@ -0,0 +1,185 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: configdev.fig +%%Creator: fig2dev Version 3.1 Patchlevel 1 +%%CreationDate: Mon Jun 15 17:35:19 1998 +%%For: ian@tito.cygnus.com (Ian Lance Taylor) +%%Orientation: Portrait +%%BoundingBox: 0 0 344 317 +%%Pages: 0 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {} def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +-62.0 370.0 translate +1 -1 scale + +/clp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/l {lineto} bind def +/m {moveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit + 0.06000 0.06000 sc +7.500 slw +% Polyline +n 1050 900 m 2100 900 l 2100 1425 l 1050 1425 l clp gs col-1 s gr +% Polyline +n 2925 900 m 3975 900 l 3975 1425 l 2925 1425 l clp gs col-1 s gr +% Polyline +n 5550 900 m 6750 900 l 6750 1350 l 5550 1350 l clp gs col-1 s gr +% Polyline +n 3750 1800 m 5025 1800 l 5025 2250 l 3750 2250 l clp gs col-1 s gr +% Polyline +n 1155 2100 m 1050 2100 1050 2520 105 arcto 4 {pop} repeat 1050 2625 2070 2625 105 arcto 4 {pop} repeat 2175 2625 2175 2205 105 arcto 4 {pop} repeat 2175 2100 1155 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 5550 3300 m 6675 3300 l 6675 3750 l 5550 3750 l clp gs col-1 s gr +% Polyline +n 5655 2100 m 5550 2100 5550 2520 105 arcto 4 {pop} repeat 5550 2625 6495 2625 105 arcto 4 {pop} repeat 6600 2625 6600 2205 105 arcto 4 {pop} repeat 6600 2100 5655 2100 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 3750 3600 m 4875 3600 l 4875 4050 l 3750 4050 l clp gs col-1 s gr +% Polyline +n 3855 2700 m 3750 2700 3750 3045 105 arcto 4 {pop} repeat 3750 3150 4545 3150 105 arcto 4 {pop} repeat 4650 3150 4650 2805 105 arcto 4 {pop} repeat 4650 2700 3855 2700 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 2850 5700 m 3750 5700 l 3750 6150 l 2850 6150 l clp gs col-1 s gr +% Polyline +n 3030 4800 m 2925 4800 2925 5145 105 arcto 4 {pop} repeat 2925 5250 3645 5250 105 arcto 4 {pop} repeat 3750 5250 3750 4905 105 arcto 4 {pop} repeat 3750 4800 3030 4800 105 arcto 4 {pop} repeat clp gs col-1 s gr +% Polyline +n 1500 1425 m 1500 2100 l gs col-1 s gr +n 1530.00 1980.00 m 1500.00 2100.00 l 1470.00 1980.00 l 1500.50 1980.50 l 1530.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1425 m 3300 4800 l gs col-1 s gr +n 3330.00 4680.00 m 3300.00 4800.00 l 3270.00 4680.00 l 3300.50 4680.50 l 3330.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1575 m 1875 1575 l 1875 2100 l gs col-1 s gr +n 1905.00 1980.00 m 1875.00 2100.00 l 1845.00 1980.00 l 1875.50 1980.50 l 1905.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 1575 m 5700 1575 l 5700 2100 l gs col-1 s gr +n 5730.00 1980.00 m 5700.00 2100.00 l 5670.00 1980.00 l 5700.50 1980.50 l 5730.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 6225 1350 m 6225 2100 l gs col-1 s gr +n 6255.00 1980.00 m 6225.00 2100.00 l 6195.00 1980.00 l 6225.50 1980.50 l 6255.00 1980.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 6075 2625 m 6075 3300 l gs col-1 s gr +n 6105.00 3180.00 m 6075.00 3300.00 l 6045.00 3180.00 l 6075.50 3180.50 l 6105.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 2250 m 4200 2700 l gs col-1 s gr +n 4230.00 2580.00 m 4200.00 2700.00 l 4170.00 2580.00 l 4200.50 2580.50 l 4230.00 2580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 3150 m 4200 3600 l gs col-1 s gr +n 4230.00 3480.00 m 4200.00 3600.00 l 4170.00 3480.00 l 4200.50 3480.50 l 4230.00 3480.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 4200 4050 m 4200 4500 l 3675 4500 l 3675 4800 l gs col-1 s gr +n 3705.00 4680.00 m 3675.00 4800.00 l 3645.00 4680.00 l 3675.50 4680.50 l 3705.00 4680.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3375 5250 m 3375 5700 l gs col-1 s gr +n 3405.00 5580.00 m 3375.00 5700.00 l 3345.00 5580.00 l 3375.50 5580.50 l 3405.00 5580.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 3300 2925 m 3750 2925 l gs col-1 s gr +n 3630.00 2895.00 m 3750.00 2925.00 l 3630.00 2955.00 l 3630.50 2925.50 l 3630.00 2895.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1500 2625 m 1500 3300 l gs col-1 s gr +n 1530.00 3180.00 m 1500.00 3300.00 l 1470.00 3180.00 l 1500.50 3180.50 l 1530.00 3180.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +% Polyline +n 1050 3300 m 2100 3300 l 2100 3750 l 1050 3750 l clp gs col-1 s gr +% Polyline +n 4875 3825 m 5250 3825 l 5250 2400 l 5550 2400 l gs col-1 s gr +n 5430.00 2370.00 m 5550.00 2400.00 l 5430.00 2430.00 l 5430.50 2400.50 l 5430.00 2370.00 l clp gs 0.00 setgray ef gr gs col-1 s gr +/Times-Roman findfont 180.00 scalefont setfont +1200 1200 m +gs 1 -1 sc (acconfig.h) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 1200 m +gs 1 -1 sc (configure.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 1200 m +gs 1 -1 sc (Makefile.am) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 2100 m +gs 1 -1 sc (acinclude.m4) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 2400 m +gs 1 -1 sc (autoheader) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +1200 3600 m +gs 1 -1 sc (config.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 3600 m +gs 1 -1 sc (Makefile.in) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +5700 2400 m +gs 1 -1 sc (automake) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 3900 m +gs 1 -1 sc (aclocal.m4) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3900 3000 m +gs 1 -1 sc (aclocal) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 6000 m +gs 1 -1 sc (configure) col-1 show gr +/Times-Roman findfont 180.00 scalefont setfont +3000 5100 m +gs 1 -1 sc (autoconf) col-1 show gr +$F2psEnd +restore diff -uprN binutils-2.10/etc/configdev.fig binutils-2.10.1/etc/configdev.fig --- binutils-2.10/etc/configdev.fig Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configdev.fig Mon May 3 08:29:06 1999 @@ -0,0 +1,80 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 900 2100 900 2100 1425 1050 1425 1050 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2925 900 3975 900 3975 1425 2925 1425 2925 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5550 900 6750 900 6750 1350 5550 1350 5550 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 3750 1800 5025 1800 5025 2250 3750 2250 3750 1800 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 2175 2625 2175 2100 1050 2100 1050 2625 2175 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 5550 3300 6675 3300 6675 3750 5550 3750 5550 3300 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 6600 2625 6600 2100 5550 2100 5550 2625 6600 2625 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 3750 3600 4875 3600 4875 4050 3750 4050 3750 3600 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 4650 3150 4650 2700 3750 2700 3750 3150 4650 3150 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 2850 5700 3750 5700 3750 6150 2850 6150 2850 5700 +2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5 + 3750 5250 3750 4800 2925 4800 2925 5250 3750 5250 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 1425 1500 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3300 1425 3300 4800 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 1.00 60.00 120.00 + 3300 1575 1875 1575 1875 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 3 + 1 1 1.00 60.00 120.00 + 3300 1575 5700 1575 5700 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 6225 1350 6225 2100 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 6075 2625 6075 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4200 2250 4200 2700 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4200 3150 4200 3600 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 + 1 1 1.00 60.00 120.00 + 4200 4050 4200 4500 3675 4500 3675 4800 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3375 5250 3375 5700 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3300 2925 3750 2925 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1500 2625 1500 3300 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 0 0 0 5 + 1050 3300 2100 3300 2100 3750 1050 3750 1050 3300 +2 1 0 1 -1 7 0 0 -1 0.000 0 0 -1 1 0 4 + 1 1 1.00 60.00 120.00 + 4875 3825 5250 3825 5250 2400 5550 2400 +4 0 -1 0 0 0 12 0.0000000 4 180 780 1200 1200 acconfig.h\001 +4 0 -1 0 0 0 12 0.0000000 4 180 885 3000 1200 configure.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 945 5700 1200 Makefile.am\001 +4 0 -1 0 0 0 12 0.0000000 4 135 990 3900 2100 acinclude.m4\001 +4 0 -1 0 0 0 12 0.0000000 4 135 840 1200 2400 autoheader\001 +4 0 -1 0 0 0 12 0.0000000 4 180 645 1200 3600 config.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 855 5700 3600 Makefile.in\001 +4 0 -1 0 0 0 12 0.0000000 4 135 735 5700 2400 automake\001 +4 0 -1 0 0 0 12 0.0000000 4 135 810 3900 3900 aclocal.m4\001 +4 0 -1 0 0 0 12 0.0000000 4 135 540 3900 3000 aclocal\001 +4 0 -1 0 0 0 12 0.0000000 4 180 705 3000 6000 configure\001 +4 0 -1 0 0 0 12 0.0000000 4 135 660 3000 5100 autoconf\001 Binary files binutils-2.10/etc/configdev.jin and binutils-2.10.1/etc/configdev.jin differ diff -uprN binutils-2.10/etc/configdev.tin binutils-2.10.1/etc/configdev.tin --- binutils-2.10/etc/configdev.tin Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configdev.tin Mon May 3 08:29:06 1999 @@ -0,0 +1,17 @@ + acconfig.h configure.in Makefile.am + | | | + | --------------+---------------------- | + | | | | | + v v | acinclude.m4 | | + *autoheader* | | v v + | | v --->*automake* + v |--->*aclocal* | | + config.in | | | v + | v | Makefile.in + | aclocal.m4--- + | | + v v + *autoconf* + | + v + configure diff -uprN binutils-2.10/etc/configure.info binutils-2.10.1/etc/configure.info --- binutils-2.10/etc/configure.info Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configure.info Mon May 29 15:08:52 2000 @@ -0,0 +1,95 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +Indirect: +configure.info-1: 971 +configure.info-2: 48782 +configure.info-3: 98073 + +Tag Table: +(Indirect) +Node: Top971 +Node: Introduction1502 +Node: Goals2583 +Node: Tools3302 +Node: History4291 +Node: Building7284 +Node: Getting Started10374 +Node: Write configure.in10886 +Node: Write Makefile.am18132 +Node: Write acconfig.h21290 +Node: Generate files22827 +Node: Getting Started Example24788 +Node: Getting Started Example 125538 +Node: Getting Started Example 227475 +Node: Getting Started Example 330591 +Node: Generate Files in Example32961 +Node: Files34042 +Node: Developer Files34653 +Node: Developer Files Picture35028 +Node: Written Developer Files36320 +Node: Generated Developer Files38863 +Node: Build Files41998 +Node: Build Files Picture42654 +Node: Build Files Description43409 +Node: Support Files45406 +Node: Configuration Names48283 +Node: Configuration Name Definition48782 +Node: Using Configuration Names51100 +Node: Cross Compilation Tools53067 +Node: Cross Compilation Concepts53757 +Node: Host and Target54719 +Node: Using the Host Type56215 +Node: Specifying the Target57559 +Node: Using the Target Type58343 +Node: Cross Tools in the Cygnus Tree61769 +Node: Host and Target Libraries62821 +Node: Target Library Configure Scripts66561 +Node: Make Targets in Cygnus Tree69644 +Node: Target libiberty70983 +Node: Canadian Cross72361 +Node: Canadian Cross Example73201 +Node: Canadian Cross Concepts74315 +Node: Build Cross Host Tools75822 +Node: Build and Host Options76769 +Node: CCross not in Cygnus Tree78550 +Node: CCross in Cygnus Tree79523 +Node: Standard Cygnus CCross79939 +Node: Cross Cygnus CCross81294 +Node: Supporting Canadian Cross84085 +Node: CCross in Configure84695 +Node: CCross in Make87852 +Node: Cygnus Configure89446 +Node: Cygnus Configure Basics90280 +Node: Cygnus Configure in C++ Libraries94954 +Node: Multilibs95956 +Node: Multilibs in gcc97000 +Node: Multilibs in Target Libraries98073 +Node: FAQ102257 +Node: Index106353 + +End Tag Table diff -uprN binutils-2.10/etc/configure.info-1 binutils-2.10.1/etc/configure.info-1 --- binutils-2.10/etc/configure.info-1 Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configure.info-1 Mon May 29 15:08:52 2000 @@ -0,0 +1,1313 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Top, Next: Introduction, Up: (dir) + +GNU configure and build system +****************************** + + The GNU configure and build system. + +* Menu: + +* Introduction:: Introduction. +* Getting Started:: Getting Started. +* Files:: Files. +* Configuration Names:: Configuration Names. +* Cross Compilation Tools:: Cross Compilation Tools. +* Canadian Cross:: Canadian Cross. +* Cygnus Configure:: Cygnus Configure. +* Multilibs:: Multilibs. +* FAQ:: Frequently Asked Questions. +* Index:: Index. + + +File: configure.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top + +Introduction +************ + + This document describes the GNU configure and build systems. It +describes how autoconf, automake, libtool, and make fit together. It +also includes a discussion of the older Cygnus configure system. + + This document does not describe in detail how to use each of the +tools; see the respective manuals for that. Instead, it describes +which files the developer must write, which files are machine generated +and how they are generated, and where certain common problems should be +addressed. + + This document draws on several sources, including the autoconf +manual by David MacKenzie (*note autoconf overview: (autoconf)Top.), +the automake manual by David MacKenzie and Tom Tromey (*note automake +overview: (automake)Top.), the libtool manual by Gordon Matzigkeit +(*note libtool overview: (libtool)Top.), and the Cygnus configure +manual by K. Richard Pixley. + +* Menu: + +* Goals:: Goals. +* Tools:: The tools. +* History:: History. +* Building:: Building. + + +File: configure.info, Node: Goals, Next: Tools, Up: Introduction + +Goals +===== + + The GNU configure and build system has two main goals. + + The first is to simplify the development of portable programs. The +system permits the developer to concentrate on writing the program, +simplifying many details of portability across Unix and even Windows +systems, and permitting the developer to describe how to build the +program using simple rules rather than complex Makefiles. + + The second is to simplify the building of programs distributed as +source code. All programs are built using a simple, standardized, two +step process. The program builder need not install any special tools in +order to build the program. + + +File: configure.info, Node: Tools, Next: History, Prev: Goals, Up: Introduction + +Tools +===== + + The GNU configure and build system is comprised of several different +tools. Program developers must build and install all of these tools. + + People who just want to build programs from distributed sources +normally do not need any special tools beyond a Unix shell, a make +program, and a C compiler. + +autoconf + provides a general portability framework, based on testing the + features of the host system at build time. + +automake + a system for describing how to build a program, permitting the + developer to write a simplified `Makefile'. + +libtool + a standardized approach to building shared libraries. + +gettext + provides a framework for translation of text messages into other + languages; not really discussed in this document. + +m4 + autoconf requires the GNU version of m4; the standard Unix m4 does + not suffice. + +perl + automake requires perl. + + +File: configure.info, Node: History, Next: Building, Prev: Tools, Up: Introduction + +History +======= + + This is a very brief and probably inaccurate history. + + As the number of Unix variants increased during the 1980s, it became +harder to write programs which could run on all variants. While it was +often possible to use `#ifdef' to identify particular systems, +developers frequently did not have access to every system, and the +characteristics of some systems changed from version to version. + + By 1992, at least three different approaches had been developed: + * The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael + Manfredi. + + * The Cygnus configure script, by K. Richard Pixley, and the gcc + configure script, by Richard Stallman. These use essentially the + same approach, and the developers communicated regularly. + + * The autoconf program, by David MacKenzie. + + The Metaconfig program is still used for Perl and a few other +programs. It is part of the Dist package. I do not know if it is +being developed. + + In 1994, David MacKenzie and others modified autoconf to incorporate +all the features of Cygnus configure. Since then, there has been a +slow but steady conversion of GNU programs from Cygnus configure to +autoconf. gcc has been converted, eliminating the gcc configure script. + + GNU autoconf was regularly maintained until late 1996. As of this +writing in June, 1998, it has no public maintainer. + + Most programs are built using the make program, which requires the +developer to write Makefiles describing how to build the programs. +Since most programs are built in pretty much the same way, this led to a +lot of duplication. + + The X Window system is built using the imake tool, which uses a +database of rules to eliminate the duplication. However, building a +tool which was developed using imake requires that the builder have +imake installed, violating one of the goals of the GNU system. + + The new BSD make provides a standard library of Makefile fragments, +which permits developers to write very simple Makefiles. However, this +requires that the builder install the new BSD make program. + + In 1994, David MacKenzie wrote the first version of automake, which +permitted writing a simple build description which was converted into a +Makefile which could be used by the standard make program. In 1995, Tom +Tromey completely rewrote automake in Perl, and he continues to enhance +it. + + Various free packages built libraries, and by around 1995 several +included support to build shared libraries on various platforms. +However, there was no consistent approach. In early 1996, Gordon +Matzigkeit began working on libtool, which provided a standardized +approach to building shared libraries. This was integrated into +automake from the start. + + The development of automake and libtool was driven by the GNITS +project, a group of GNU maintainers who designed standardized tools to +help meet the GNU coding standards. + + +File: configure.info, Node: Building, Prev: History, Up: Introduction + +Building +======== + + Most readers of this document should already know how to build a +tool by running `configure' and `make'. This section may serve as a +quick introduction or reminder. + + Building a tool is normally as simple as running `configure' +followed by `make'. You should normally run `configure' from an empty +directory, using some path to refer to the `configure' script in the +source directory. The directory in which you run `configure' is called +the "object directory". + + In order to use a object directory which is different from the source +directory, you must be using the GNU version of `make', which has the +required `VPATH' support. Despite this restriction, using a different +object directory is highly recommended: + * It keeps the files generated during the build from cluttering up + your sources. + + * It permits you to remove the built files by simply removing the + entire build directory. + + * It permits you to build from the same sources with several sets of + configure options simultaneously. + + If you don't have GNU `make', you will have to run `configure' in +the source directory. All GNU packages should support this; in +particular, GNU packages should not assume the presence of GNU `make'. + + After running `configure', you can build the tools by running `make'. + + To install the tools, run `make install'. Installing the tools will +copy the programs and any required support files to the "installation +directory". The location of the installation directory is controlled +by `configure' options, as described below. + + In the Cygnus tree at present, the info files are built and +installed as a separate step. To build them, run `make info'. To +install them, run `make install-info'. + + All `configure' scripts support a wide variety of options. The most +interesting ones are `--with' and `--enable' options which are +generally specific to particular tools. You can usually use the +`--help' option to get a list of interesting options for a particular +configure script. + + The only generic options you are likely to use are the `--prefix' +and `--exec-prefix' options. These options are used to specify the +installation directory. + + The directory named by the `--prefix' option will hold machine +independent files such as info files. + + The directory named by the `--exec-prefix' option, which is normally +a subdirectory of the `--prefix' directory, will hold machine dependent +files such as executables. + + The default for `--prefix' is `/usr/local'. The default for +`--exec-prefix' is the value used for `--prefix'. + + The convention used in Cygnus releases is to use a `--prefix' option +of `/usr/cygnus/RELEASE', where RELEASE is the name of the release, and +to use a `--exec-prefix' option of `/usr/cygnus/RELEASE/H-HOST', where +HOST is the configuration name of the host system (*note Configuration +Names::). + + Do not use either the source or the object directory as the +installation directory. That will just lead to confusion. + + +File: configure.info, Node: Getting Started, Next: Files, Prev: Introduction, Up: Top + +Getting Started +*************** + + To start using the GNU configure and build system with your software +package, you must write three files, and you must run some tools to +manually generate additional files. + +* Menu: + +* Write configure.in:: Write configure.in. +* Write Makefile.am:: Write Makefile.am. +* Write acconfig.h:: Write acconfig.h. +* Generate files:: Generate files. +* Getting Started Example:: Example. + + +File: configure.info, Node: Write configure.in, Next: Write Makefile.am, Up: Getting Started + +Write configure.in +================== + + You must first write the file `configure.in'. This is an autoconf +input file, and the autoconf manual describes in detail what this file +should look like. + + You will write tests in your `configure.in' file to check for +conditions that may change from one system to another, such as the +presence of particular header files or functions. + + For example, not all systems support the `gettimeofday' function. +If you want to use the `gettimeofday' function when it is available, +and to use some other function when it is not, you would check for this +by putting `AC_CHECK_FUNCS(gettimeofday)' in `configure.in'. + + When the configure script is run at build time, this will arrange to +define the preprocessor macro `HAVE_GETTIMEOFDAY' to the value 1 if the +`gettimeofday' function is available, and to not define the macro at +all if the function is not available. Your code can then use `#ifdef' +to test whether it is safe to call `gettimeofday'. + + If you have an existing body of code, the `autoscan' program may +help identify potential portability problems, and hence configure tests +that you will want to use. *Note Invoking autoscan: (autoconf)Invoking +autoscan. + + Another handy tool for an existing body of code is `ifnames'. This +will show you all the preprocessor conditionals that the code already +uses. *Note Invoking ifnames: (autoconf)Invoking ifnames. + + Besides the portability tests which are specific to your particular +package, every `configure.in' file should contain the following macros. + +`AC_INIT' + This macro takes a single argument, which is the name of a file in + your package. For example, `AC_INIT(foo.c)'. + +`AC_PREREQ(VERSION)' + This macro is optional. It may be used to indicate the version of + `autoconf' that you are using. This will prevent users from + running an earlier version of `autoconf' and perhaps getting an + invalid `configure' script. For example, `AC_PREREQ(2.12)'. + +`AM_INIT_AUTOMAKE' + This macro takes two arguments: the name of the package, and a + version number. For example, `AM_INIT_AUTOMAKE(foo, 1.0)'. (This + macro is not needed if you are not using automake). + +`AM_CONFIG_HEADER' + This macro names the header file which will hold the preprocessor + macro definitions at run time. Normally this should be + `config.h'. Your sources would then use `#include "config.h"' to + include it. + + This macro may optionally name the input file for that header + file; by default, this is `config.h.in', but that file name works + poorly on DOS filesystems. Therefore, it is often better to name + it explicitly as `config.in'. + + This is what you should normally put in `configure.in': + AM_CONFIG_HEADER(config.h:config.in) + + (If you are not using automake, use `AC_CONFIG_HEADER' rather than + `AM_CONFIG_HEADER'). + +`AM_MAINTAINER_MODE' + This macro always appears in Cygnus configure scripts. Other + programs may or may not use it. + + If this macro is used, the `--enable-maintainer-mode' option is + required to enable automatic rebuilding of generated files used by + the configure system. This of course requires that developers be + aware of, and use, that option. + + If this macro is not used, then the generated files will always be + rebuilt automatically. This will cause problems if the wrong + versions of autoconf, automake, or others are in the builder's + `PATH'. + + (If you are not using automake, you do not need to use this macro). + +`AC_EXEEXT' + Either this macro or `AM_EXEEXT' always appears in Cygnus configure + files. Other programs may or may not use one of them. + + This macro looks for the executable suffix used on the host + system. On Unix systems, this is the empty string. On Windows + systems, this is `.exe'. This macro directs automake to use the + executable suffix as appropriate when creating programs. This + macro does not take any arguments. + + The `AC_EXEEXT' form is new, and is part of a Cygnus patch to + autoconf to support compiling with Visual C++. Older programs use + `AM_EXEEXT' instead. + + (Programs which do not use automake use neither `AC_EXEEXT' nor + `AM_EXEEXT'). + +`AC_PROG_CC' + If you are writing C code, you will normally want to use this + macro. It locates the C compiler to use. It does not take any + arguments. + + However, if this `configure.in' file is for a library which is to + be compiled by a cross compiler which may not fully work, then you + will not want to use `AC_PROG_CC'. Instead, you will want to use a + variant which does not call the macro `AC_PROG_CC_WORKS'. Examples + can be found in various `configure.in' files for libraries that are + compiled with cross compilers, such as libiberty or libgloss. + This is essentially a bug in autoconf, and there will probably be + a better workaround at some point. + +`AC_PROG_CXX' + If you are writing C++ code, you will want to use this macro. It + locates the C++ compiler to use. It does not take any arguments. + The same cross compiler comments apply as for `AC_PROG_CC'. + +`AM_PROG_LIBTOOL' + If you want to build libraries, and you want to permit them to be + shared, or you want to link against libraries which were built + using libtool, then you will need this macro. This macro is + required in order to use libtool. + + By default, this will cause all libraries to be built as shared + libraries. To prevent this-to change the default-use + `AM_DISABLE_SHARED' before `AM_PROG_LIBTOOL'. The configure + options `--enable-shared' and `--disable-shared' may be used to + override the default at build time. + +`AC_DEFINE(_GNU_SOURCE)' + GNU packages should normally include this line before any other + feature tests. This defines the macro `_GNU_SOURCE' when + compiling, which directs the libc header files to provide the + standard GNU system interfaces including all GNU extensions. If + this macro is not defined, certain GNU extensions may not be + available. + +`AC_OUTPUT' + This macro takes a list of file names which the configure process + should produce. This is normally a list of one or more `Makefile' + files in different directories. If your package lives entirely in + a single directory, you would use simply `AC_OUTPUT(Makefile)'. + If you also have, for example, a `lib' subdirectory, you would use + `AC_OUTPUT(Makefile lib/Makefile)'. + + If you want to use locally defined macros in your `configure.in' +file, then you will need to write a `acinclude.m4' file which defines +them (if not using automake, this file is called `aclocal.m4'). +Alternatively, you can put separate macros in an `m4' subdirectory, and +put `ACLOCAL_AMFLAGS = -I m4' in your `Makefile.am' file so that the +`aclocal' program will be able to find them. + + The different macro prefixes indicate which tool defines the macro. +Macros which start with `AC_' are part of autoconf. Macros which start +with `AM_' are provided by automake or libtool. + + +File: configure.info, Node: Write Makefile.am, Next: Write acconfig.h, Prev: Write configure.in, Up: Getting Started + +Write Makefile.am +================= + + You must write the file `Makefile.am'. This is an automake input +file, and the automake manual describes in detail what this file should +look like. + + The automake commands in `Makefile.am' mostly look like variable +assignments in a `Makefile'. automake recognizes special variable +names, and automatically add make rules to the output as needed. + + There will be one `Makefile.am' file for each directory in your +package. For each directory with subdirectories, the `Makefile.am' +file should contain the line + SUBDIRS = DIR DIR ... + +where each DIR is the name of a subdirectory. + + For each `Makefile.am', there should be a corresponding `Makefile' +in the `AC_OUTPUT' macro in `configure.in'. + + Every `Makefile.am' written at Cygnus should contain the line + AUTOMAKE_OPTIONS = cygnus + +This puts automake into Cygnus mode. See the automake manual for +details. + + You may to include the version number of `automake' that you are +using on the `AUTOMAKE_OPTIONS' line. For example, + AUTOMAKE_OPTIONS = cygnus 1.3 + +This will prevent users from running an earlier version of `automake' +and perhaps getting an invalid `Makefile.in'. + + If your package builds a program, then in the directory where that +program is built you will normally want a line like + bin_PROGRAMS = PROGRAM + +where PROGRAM is the name of the program. You will then want a line +like + PROGRAM_SOURCES = FILE FILE ... + +where each FILE is the name of a source file to link into the program +(e.g., `foo.c'). + + If your package builds a library, and you do not want the library to +ever be built as a shared library, then in the directory where that +library is built you will normally want a line like + lib_LIBRARIES = libNAME.a + +where `libNAME.a' is the name of the library. You will then want a +line like + libNAME_a_SOURCES = FILE FILE ... + +where each FILE is the name of a source file to add to the library. + + If your package builds a library, and you want to permit building the +library as a shared library, then in the directory where that library is +built you will normally want a line like + lib_LTLIBRARIES = libNAME.la + The use of `LTLIBRARIES', and the `.la' extension, indicate a +library to be built using libtool. As usual, you will then want a line +like + libNAME_la_SOURCES = FILE FILE ... + + The strings `bin' and `lib' that appear above in `bin_PROGRAMS' and +`lib_LIBRARIES' are not arbitrary. They refer to particular +directories, which may be set by the `--bindir' and `--libdir' options +to `configure'. If those options are not used, the default values are +based on the `--prefix' or `--exec-prefix' options to `configure'. It +is possible to use other names if the program or library should be +installed in some other directory. + + The `Makefile.am' file may also contain almost anything that may +appear in a normal `Makefile'. automake also supports many other +special variables, as well as conditionals. + + See the automake manual for more information. + + +File: configure.info, Node: Write acconfig.h, Next: Generate files, Prev: Write Makefile.am, Up: Getting Started + +Write acconfig.h +================ + + If you are generating a portability header file, (i.e., you are using +`AM_CONFIG_HEADER' in `configure.in'), then you will have to write a +`acconfig.h' file. It will have to contain the following lines. + + /* Name of package. */ + #undef PACKAGE + + /* Version of package. */ + #undef VERSION + + This requirement is really a bug in the system, and the requirement +may be eliminated at some later date. + + The `acconfig.h' file will also similar comment and `#undef' lines +for any unusual macros in the `configure.in' file, including any macro +which appears in a `AC_DEFINE' macro. + + In particular, if you are writing a GNU package and therefore include +`AC_DEFINE(_GNU_SOURCE)' in `configure.in' as suggested above, you will +need lines like this in `acconfig.h': + /* Enable GNU extensions. */ + #undef _GNU_SOURCE + + Normally the `autoheader' program will inform you of any such +requirements by printing an error message when it is run. However, if +you do anything particular odd in your `configure.in' file, you will +have to make sure that the right entries appear in `acconfig.h', since +otherwise the results of the tests may not be available in the +`config.h' file which your code will use. + + (Thee `PACKAGE' and `VERSION' lines are not required if you are not +using automake, and in that case you may not need a `acconfig.h' file +at all). + + +File: configure.info, Node: Generate files, Next: Getting Started Example, Prev: Write acconfig.h, Up: Getting Started + +Generate files +============== + + Once you have written `configure.in', `Makefile.am', `acconfig.h', +and possibly `acinclude.m4', you must use autoconf and automake +programs to produce the first versions of the generated files. This is +done by executing the following sequence of commands. + + aclocal + autoconf + autoheader + automake + + The `aclocal' and `automake' commands are part of the automake +package, and the `autoconf' and `autoheader' commands are part of the +autoconf package. + + If you are using a `m4' subdirectory for your macros, you will need +to use the `-I m4' option when you run `aclocal'. + + If you are not using the Cygnus tree, use the `-a' option when +running `automake' command in order to copy the required support files +into your source directory. + + If you are using libtool, you must build and install the libtool +package with the same `--prefix' and `--exec-prefix' options as you +used with the autoconf and automake packages. You must do this before +running any of the above commands. If you are not using the Cygnus +tree, you will need to run the `libtoolize' program to copy the libtool +support files into your directory. + + Once you have managed to run these commands without getting any +errors, you should create a new empty directory, and run the `configure' +script which will have been created by `autoconf' with the +`--enable-maintainer-mode' option. This will give you a set of +Makefiles which will include rules to automatically rebuild all the +generated files. + + After doing that, whenever you have changed some of the input files +and want to regenerated the other files, go to your object directory +and run `make'. Doing this is more reliable than trying to rebuild the +files manually, because there are complex order dependencies and it is +easy to forget something. + + +File: configure.info, Node: Getting Started Example, Prev: Generate files, Up: Getting Started + +Example +======= + + Let's consider a trivial example. + + Suppose we want to write a simple version of `touch'. Our program, +which we will call `poke', will take a single file name argument, and +use the `utime' system call to set the modification and access times of +the file to the current time. We want this program to be highly +portable. + + We'll first see what this looks like without using autoconf and +automake, and then see what it looks like with them. + +* Menu: + +* Getting Started Example 1:: First Try. +* Getting Started Example 2:: Second Try. +* Getting Started Example 3:: Third Try. +* Generate Files in Example:: Generate Files. + + +File: configure.info, Node: Getting Started Example 1, Next: Getting Started Example 2, Up: Getting Started Example + +First Try +--------- + + Here is our first try at `poke.c'. Note that we've written it +without ANSI/ISO C prototypes, since we want it to be highly portable. + + #include + #include + #include + #include + + int + main (argc, argv) + int argc; + char **argv; + { + if (argc != 2) + { + fprintf (stderr, "Usage: poke file\n"); + exit (1); + } + + if (utime (argv[1], NULL) < 0) + { + perror ("utime"); + exit (1); + } + + exit (0); + } + + We also write a simple `Makefile'. + + CC = gcc + CFLAGS = -g -O2 + + all: poke + + poke: poke.o + $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o + + So far, so good. + + Unfortunately, there are a few problems. + + On older Unix systems derived from BSD 4.3, the `utime' system call +does not accept a second argument of `NULL'. On those systems, we need +to pass a pointer to `struct utimbuf' structure. Unfortunately, even +older systems don't define that structure; on those systems, we need to +pass an array of two `long' values. + + The header file `stdlib.h' was invented by ANSI C, and older systems +don't have a copy. We included it above to get a declaration of `exit'. + + We can find some of these portability problems by running +`autoscan', which will create a `configure.scan' file which we can use +as a prototype for our `configure.in' file. I won't show the output, +but it will notice the potential problems with `utime' and `stdlib.h'. + + In our `Makefile', we don't provide any way to install the program. +This doesn't matter much for such a simple example, but a real program +will need an `install' target. For that matter, we will also want a +`clean' target. + + +File: configure.info, Node: Getting Started Example 2, Next: Getting Started Example 3, Prev: Getting Started Example 1, Up: Getting Started Example + +Second Try +---------- + + Here is our second try at this program. + + We modify `poke.c' to use preprocessor macros to control what +features are available. (I've cheated a bit by using the same macro +names which autoconf will use). + + #include + + #ifdef STDC_HEADERS + #include + #endif + + #include + + #ifdef HAVE_UTIME_H + #include + #endif + + #ifndef HAVE_UTIME_NULL + + #include + + #ifndef HAVE_STRUCT_UTIMBUF + + struct utimbuf + { + long actime; + long modtime; + }; + + #endif + + static int + utime_now (file) + char *file; + { + struct utimbuf now; + + now.actime = now.modtime = time (NULL); + return utime (file, &now); + } + + #define utime(f, p) utime_now (f) + + #endif /* HAVE_UTIME_NULL */ + + int + main (argc, argv) + int argc; + char **argv; + { + if (argc != 2) + { + fprintf (stderr, "Usage: poke file\n"); + exit (1); + } + + if (utime (argv[1], NULL) < 0) + { + perror ("utime"); + exit (1); + } + + exit (0); + } + + Here is the associated `Makefile'. We've added support for the +preprocessor flags we use. We've also added `install' and `clean' +targets. + + # Set this to your installation directory. + bindir = /usr/local/bin + + # Uncomment this if you have the standard ANSI/ISO C header files. + # STDC_HDRS = -DSTDC_HEADERS + + # Uncomment this if you have utime.h. + # UTIME_H = -DHAVE_UTIME_H + + # Uncomment this if utime (FILE, NULL) works on your system. + # UTIME_NULL = -DHAVE_UTIME_NULL + + # Uncomment this if struct utimbuf is defined in utime.h. + # UTIMBUF = -DHAVE_STRUCT_UTIMBUF + + CC = gcc + CFLAGS = -g -O2 + + ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) + + all: poke + + poke: poke.o + $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o + + .c.o: + $(CC) -c $(ALL_CFLAGS) poke.c + + install: poke + cp poke $(bindir)/poke + + clean: + rm poke poke.o + + Some problems with this approach should be clear. + + Users who want to compile poke will have to know how `utime' works +on their systems, so that they can uncomment the `Makefile' correctly. + + The installation is done using `cp', but many systems have an +`install' program which may be used, and which supports optional +features such as stripping debugging information out of the installed +binary. + + The use of `Makefile' variables like `CC', `CFLAGS' and `LDFLAGS' +follows the requirements of the GNU standards. This is convenient for +all packages, since it reduces surprises for users. However, it is +easy to get the details wrong, and wind up with a slightly nonstandard +distribution. + + +File: configure.info, Node: Getting Started Example 3, Next: Generate Files in Example, Prev: Getting Started Example 2, Up: Getting Started Example + +Third Try +--------- + + For our third try at this program, we will write a `configure.in' +script to discover the configuration features on the host system, rather +than requiring the user to edit the `Makefile'. We will also write a +`Makefile.am' rather than a `Makefile'. + + The only change to `poke.c' is to add a line at the start of the +file: + #include "config.h" + + The new `configure.in' file is as follows. + + AC_INIT(poke.c) + AM_INIT_AUTOMAKE(poke, 1.0) + AM_CONFIG_HEADER(config.h:config.in) + AC_PROG_CC + AC_HEADER_STDC + AC_CHECK_HEADERS(utime.h) + AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) + AC_FUNC_UTIME_NULL + AC_OUTPUT(Makefile) + + The first four macros in this file, and the last one, were described +above; see *Note Write configure.in::. If we omit these macros, then +when we run `automake' we will get a reminder that we need them. + + The other macros are standard autoconf macros. + +`AC_HEADER_STDC' + Check for standard C headers. + +`AC_CHECK_HEADERS' + Check whether a particular header file exists. + +`AC_EGREP_HEADER' + Check for a particular string in a particular header file, in this + case checking for `utimbuf' in `utime.h'. + +`AC_FUNC_UTIME_NULL' + Check whether `utime' accepts a NULL second argument to set the + file change time to the current time. + + See the autoconf manual for a more complete description. + + The new `Makefile.am' file is as follows. Note how simple this is +compared to our earlier `Makefile'. + + bin_PROGRAMS = poke + + poke_SOURCES = poke.c + + This means that we should build a single program name `poke'. It +should be installed in the binary directory, which we called `bindir' +earlier. The program `poke' is built from the source file `poke.c'. + + We must also write a `acconfig.h' file. Besides `PACKAGE' and +`VERSION', which must be mentioned for all packages which use automake, +we must include `HAVE_STRUCT_UTIMBUF', since we mentioned it in an +`AC_DEFINE'. + + /* Name of package. */ + #undef PACKAGE + + /* Version of package. */ + #undef VERSION + + /* Whether utime.h defines struct utimbuf. */ + #undef HAVE_STRUCT_UTIMBUF + + +File: configure.info, Node: Generate Files in Example, Prev: Getting Started Example 3, Up: Getting Started Example + +Generate Files +-------------- + + We must now generate the other files, using the following commands. + + aclocal + autoconf + autoheader + automake + + When we run `autoheader', it will remind us of any macros we forgot +to add to `acconfig.h'. + + When we run `automake', it will want to add some files to our +distribution. It will add them automatically if we use the +`--add-missing' option. + + By default, `automake' will run in GNU mode, which means that it +will want us to create certain additional files; as of this writing, it +will want `NEWS', `README', `AUTHORS', and `ChangeLog', all of which +are files which should appear in a standard GNU distribution. We can +either add those files, or run `automake' with the `--foreign' option. + + Running these tools will generate the following files, all of which +are described in the next chapter. + + * `aclocal.m4' + + * `configure' + + * `config.in' + + * `Makefile.in' + + * `stamp-h.in' + + +File: configure.info, Node: Files, Next: Configuration Names, Prev: Getting Started, Up: Top + +Files +***** + + As was seen in the previous chapter, the GNU configure and build +system uses a number of different files. The developer must write a +few files. The others are generated by various tools. + + The system is rather flexible, and can be used in many different +ways. In describing the files that it uses, I will describe the common +case, and mention some other cases that may arise. + +* Menu: + +* Developer Files:: Developer Files. +* Build Files:: Build Files. +* Support Files:: Support Files. + + +File: configure.info, Node: Developer Files, Next: Build Files, Up: Files + +Developer Files +=============== + + This section describes the files written or generated by the +developer of a package. + +* Menu: + +* Developer Files Picture:: Developer Files Picture. +* Written Developer Files:: Written Developer Files. +* Generated Developer Files:: Generated Developer Files. + + +File: configure.info, Node: Developer Files Picture, Next: Written Developer Files, Up: Developer Files + +Developer Files Picture +----------------------- + + Here is a picture of the files which are written by the developer, +the generated files which would be included with a complete source +distribution, and the tools which create those files. The file names +are plain text and the tool names are enclosed by `*' characters (e.g., +`autoheader' is the name of a tool, not the name of a file). + + acconfig.h configure.in Makefile.am + | | | + | --------------+---------------------- | + | | | | | + v v | acinclude.m4 | | + *autoheader* | | v v + | | v --->*automake* + v |--->*aclocal* | | + config.in | | | v + | v | Makefile.in + | aclocal.m4--- + | | + v v + *autoconf* + | + v + configure + + +File: configure.info, Node: Written Developer Files, Next: Generated Developer Files, Prev: Developer Files Picture, Up: Developer Files + +Written Developer Files +----------------------- + + The following files would be written by the developer. + +`configure.in' + This is the configuration script. This script contains + invocations of autoconf macros. It may also contain ordinary + shell script code. This file will contain feature tests for + portability issues. The last thing in the file will normally be + an `AC_OUTPUT' macro listing which files to create when the + builder runs the configure script. This file is always required + when using the GNU configure system. *Note Write configure.in::. + +`Makefile.am' + This is the automake input file. It describes how the code should + be built. It consists of definitions of automake variables. It + may also contain ordinary Makefile targets. This file is only + needed when using automake (newer tools normally use automake, but + there are still older tools which have not been converted, in + which the developer writes `Makefile.in' directly). *Note Write + Makefile.am::. + +`acconfig.h' + When the configure script creates a portability header file, by + using `AM_CONFIG_HEADER' (or, if not using automake, + `AC_CONFIG_HEADER'), this file is used to describe macros which are + not recognized by the `autoheader' command. This is normally a + fairly uninteresting file, consisting of a collection of `#undef' + lines with comments. Normally any call to `AC_DEFINE' in + `configure.in' will require a line in this file. *Note Write + acconfig.h::. + +`acinclude.m4' + This file is not always required. It defines local autoconf + macros. These macros may then be used in `configure.in'. If you + don't need any local autoconf macros, then you don't need this + file at all. In fact, in general, you never need local autoconf + macros, since you can put everything in `configure.in', but + sometimes a local macro is convenient. + + Newer tools may omit `acinclude.m4', and instead use a + subdirectory, typically named `m4', and define `ACLOCAL_AMFLAGS = + -I m4' in `Makefile.am' to force `aclocal' to look there for macro + definitions. The macro definitions are then placed in separate + files in that directory. + + The `acinclude.m4' file is only used when using automake; in older + tools, the developer writes `aclocal.m4' directly, if it is needed. + + +File: configure.info, Node: Generated Developer Files, Prev: Written Developer Files, Up: Developer Files + +Generated Developer Files +------------------------- + + The following files would be generated by the developer. + + When using automake, these files are normally not generated manually +after the first time. Instead, the generated `Makefile' contains rules +to automatically rebuild the files as required. When +`AM_MAINTAINER_MODE' is used in `configure.in' (the normal case in +Cygnus code), the automatic rebuilding rules will only be defined if +you configure using the `--enable-maintainer-mode' option. + + When using automatic rebuilding, it is important to ensure that all +the various tools have been built and installed on your `PATH'. Using +automatic rebuilding is highly recommended, so much so that I'm not +going to explain what you have to do if you don't use it. + +`configure' + This is the configure script which will be run when building the + package. This is generated by `autoconf' from `configure.in' and + `aclocal.m4'. This is a shell script. + +`Makefile.in' + This is the file which the configure script will turn into the + `Makefile' at build time. This file is generated by `automake' + from `Makefile.am'. If you aren't using automake, you must write + this file yourself. This file is pretty much a normal `Makefile', + with some configure substitutions for certain variables. + +`aclocal.m4' + This file is created by the `aclocal' program, based on the + contents of `configure.in' and `acinclude.m4' (or, as noted in the + description of `acinclude.m4' above, on the contents of an `m4' + subdirectory). This file contains definitions of autoconf macros + which `autoconf' will use when generating the file `configure'. + These autoconf macros may be defined by you in `acinclude.m4' or + they may be defined by other packages such as automake, libtool or + gettext. If you aren't using automake, you will normally write + this file yourself; in that case, if `configure.in' uses only + standard autoconf macros, this file will not be needed at all. + +`config.in' + This file is created by `autoheader' based on `acconfig.h' and + `configure.in'. At build time, the configure script will define + some of the macros in it to create `config.h', which may then be + included by your program. This permits your C code to use + preprocessor conditionals to change its behaviour based on the + characteristics of the host system. This file may also be called + `config.h.in'. + +`stamp.h-in' + This rather uninteresting file, which I omitted from the picture, + is generated by `automake'. It always contains the string + `timestamp'. It is used as a timestamp file indicating whether + `config.in' is up to date. Using a timestamp file means that + `config.in' can be marked as up to date without actually changing + its modification time. This is useful since `config.in' depends + upon `configure.in', but it is easy to change `configure.in' in a + way which does not affect `config.in'. + + +File: configure.info, Node: Build Files, Next: Support Files, Prev: Developer Files, Up: Files + +Build Files +=========== + + This section describes the files which are created at configure and +build time. These are the files which somebody who builds the package +will see. + + Of course, the developer will also build the package. The +distinction between developer files and build files is not that the +developer does not see the build files, but that somebody who only +builds the package does not have to worry about the developer files. + +* Menu: + +* Build Files Picture:: Build Files Picture. +* Build Files Description:: Build Files Description. + + +File: configure.info, Node: Build Files Picture, Next: Build Files Description, Up: Build Files + +Build Files Picture +------------------- + + Here is a picture of the files which will be created at build time. +`config.status' is both a created file and a shell script which is run +to create other files, and the picture attempts to show that. + + config.in *configure* Makefile.in + | | | + | v | + | config.status | + | | | + *config.status*<======+==========>*config.status* + | | + v v + config.h Makefile + + +File: configure.info, Node: Build Files Description, Prev: Build Files Picture, Up: Build Files + +Build Files Description +----------------------- + + This is a description of the files which are created at build time. + +`config.status' + The first step in building a package is to run the `configure' + script. The `configure' script will create the file + `config.status', which is itself a shell script. When you first + run `configure', it will automatically run `config.status'. An + `Makefile' derived from an automake generated `Makefile.in' will + contain rules to automatically run `config.status' again when + necessary to recreate certain files if their inputs change. + +`Makefile' + This is the file which make will read to build the program. The + `config.status' script will transform `Makefile.in' into + `Makefile'. + +`config.h' + This file defines C preprocessor macros which C code can use to + adjust its behaviour on different systems. The `config.status' + script will transform `config.in' into `config.h'. + +`config.cache' + This file did not fit neatly into the picture, and I omitted it. + It is used by the `configure' script to cache results between + runs. This can be an important speedup. If you modify + `configure.in' in such a way that the results of old tests should + change (perhaps you have added a new library to `LDFLAGS'), then + you will have to remove `config.cache' to force the tests to be + rerun. + + The autoconf manual explains how to set up a site specific cache + file. This can speed up running `configure' scripts on your + system. + +`stamp.h' + This file, which I omitted from the picture, is similar to + `stamp-h.in'. It is used as a timestamp file indicating whether + `config.h' is up to date. This is useful since `config.h' depends + upon `config.status', but it is easy for `config.status' to change + in a way which does not affect `config.h'. + + +File: configure.info, Node: Support Files, Prev: Build Files, Up: Files + +Support Files +============= + + The GNU configure and build system requires several support files to +be included with your distribution. You do not normally need to concern +yourself with these. If you are using the Cygnus tree, most are already +present. Otherwise, they will be installed with your source by +`automake' (with the `--add-missing' option) and `libtoolize'. + + You don't have to put the support files in the top level directory. +You can put them in a subdirectory, and use the `AC_CONFIG_AUX_DIR' +macro in `configure.in' to tell `automake' and the `configure' script +where they are. + + In this section, I describe the support files, so that you can know +what they are and why they are there. + +`ABOUT-NLS' + Added by automake if you are using gettext. This is a + documentation file about the gettext project. + +`ansi2knr.c' + Used by an automake generated `Makefile' if you put `ansi2knr' in + `AUTOMAKE_OPTIONS' in `Makefile.am'. This permits compiling ANSI + C code with a K&R C compiler. + +`ansi2knr.1' + The man page which goes with `ansi2knr.c'. + +`config.guess' + A shell script which determines the configuration name for the + system on which it is run. + +`config.sub' + A shell script which canonicalizes a configuration name entered by + a user. + +`elisp-comp' + Used to compile Emacs LISP files. + +`install-sh' + A shell script which installs a program. This is used if the + configure script can not find an install binary. + +`ltconfig' + Used by libtool. This is a shell script which configures libtool + for the particular system on which it is used. + +`ltmain.sh' + Used by libtool. This is the actual libtool script which is used, + after it is configured by `ltconfig' to build a library. + +`mdate-sh' + A shell script used by an automake generated `Makefile' to pretty + print the modification time of a file. This is used to maintain + version numbers for texinfo files. + +`missing' + A shell script used if some tool is missing entirely. This is + used by an automake generated `Makefile' to avoid certain sorts of + timestamp problems. + +`mkinstalldirs' + A shell script which creates a directory, including all parent + directories. This is used by an automake generated `Makefile' + during installation. + +`texinfo.tex' + Required if you have any texinfo files. This is used when + converting Texinfo files into DVI using `texi2dvi' and TeX. + +`ylwrap' + A shell script used by an automake generated `Makefile' to run + programs like `bison', `yacc', `flex', and `lex'. These programs + default to producing output files with a fixed name, and the + `ylwrap' script runs them in a subdirectory to avoid file name + conflicts when using a parallel make program. + + +File: configure.info, Node: Configuration Names, Next: Cross Compilation Tools, Prev: Files, Up: Top + +Configuration Names +******************* + + The GNU configure system names all systems using a "configuration +name". All such names used to be triplets (they may now contain four +parts in certain cases), and the term "configuration triplet" is still +seen. + +* Menu: + +* Configuration Name Definition:: Configuration Name Definition. +* Using Configuration Names:: Using Configuration Names. + diff -uprN binutils-2.10/etc/configure.info-2 binutils-2.10.1/etc/configure.info-2 --- binutils-2.10/etc/configure.info-2 Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configure.info-2 Mon May 29 15:08:52 2000 @@ -0,0 +1,1137 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Configuration Name Definition, Next: Using Configuration Names, Up: Configuration Names + +Configuration Name Definition +============================= + + This is a string of the form CPU-MANUFACTURER-OPERATING_SYSTEM. In +some cases, this is extended to a four part form: +CPU-MANUFACTURER-KERNEL-OPERATING_SYSTEM. + + When using a configuration name in a configure option, it is normally +not necessary to specify an entire name. In particular, the +MANUFACTURER field is often omitted, leading to strings such as +`i386-linux' or `sparc-sunos'. The shell script `config.sub' will +translate these shortened strings into the canonical form. autoconf +will arrange for `config.sub' to be run automatically when it is needed. + + The fields of a configuration name are as follows: + +CPU + The type of processor. This is typically something like `i386' or + `sparc'. More specific variants are used as well, such as + `mipsel' to indicate a little endian MIPS processor. + +MANUFACTURER + A somewhat freeform field which indicates the manufacturer of the + system. This is often simply `unknown'. Other common strings are + `pc' for an IBM PC compatible system, or the name of a workstation + vendor, such as `sun'. + +OPERATING_SYSTEM + The name of the operating system which is run on the system. This + will be something like `solaris2.5' or `irix6.3'. There is no + particular restriction on the version number, and strings like + `aix4.1.4.0' are seen. For an embedded system, which has no + operating system, this field normally indicates the type of object + file format, such as `elf' or `coff'. + +KERNEL + This is used mainly for GNU/Linux. A typical GNU/Linux + configuration name is `i586-pc-linux-gnulibc1'. In this case the + kernel, `linux', is separated from the operating system, + `gnulibc1'. + + The shell script `config.guess' will normally print the correct +configuration name for the system on which it is run. It does by +running `uname' and by examining other characteristics of the system. + + Because `config.guess' can normally determine the configuration name +for a machine, it is normally only necessary to specify a configuration +name when building a cross-compiler or when building using a +cross-compiler. + + +File: configure.info, Node: Using Configuration Names, Prev: Configuration Name Definition, Up: Configuration Names + +Using Configuration Names +========================= + + A configure script will sometimes have to make a decision based on a +configuration name. You will need to do this if you have to compile +code differently based on something which can not be tested using a +standard autoconf feature test. + + It is normally better to test for particular features, rather than to +test for a particular system. This is because as Unix evolves, +different systems copy features from one another. Even if you need to +determine whether the feature is supported based on a configuration +name, you should define a macro which describes the feature, rather than +defining a macro which describes the particular system you are on. + + Testing for a particular system is normally done using a case +statement in `configure.in'. The case statement might look something +like the following, assuming that `host' is a shell variable holding a +canonical configuration name (which will be the case if `configure.in' +uses the `AC_CANONICAL_HOST' or `AC_CANONICAL_SYSTEM' macro). + + case "${host}" in + i[3456]86-*-linux-gnu*) do something ;; + sparc*-sun-solaris2.[56789]*) do something ;; + sparc*-sun-solaris*) do something ;; + mips*-*-elf*) do something ;; + esac + + It is particularly important to use `*' after the operating system +field, in order to match the version number which will be generated by +`config.guess'. + + In most cases you must be careful to match a range of processor +types. For most processor families, a trailing `*' suffices, as in +`mips*' above. For the i386 family, something along the lines of +`i[3456]86' suffices at present. For the m68k family, you will need +something like `m68*'. Of course, if you do not need to match on the +processor, it is simpler to just replace the entire field by a `*', as +in `*-*-irix*'. + + +File: configure.info, Node: Cross Compilation Tools, Next: Canadian Cross, Prev: Configuration Names, Up: Top + +Cross Compilation Tools +*********************** + + The GNU configure and build system can be used to build "cross +compilation" tools. A cross compilation tool is a tool which runs on +one system and produces code which runs on another system. + +* Menu: + +* Cross Compilation Concepts:: Cross Compilation Concepts. +* Host and Target:: Host and Target. +* Using the Host Type:: Using the Host Type. +* Specifying the Target:: Specifying the Target. +* Using the Target Type:: Using the Target Type. +* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree + + +File: configure.info, Node: Cross Compilation Concepts, Next: Host and Target, Up: Cross Compilation Tools + +Cross Compilation Concepts +========================== + + A compiler which produces programs which run on a different system +is a cross compilation compiler, or simply a "cross compiler". +Similarly, we speak of cross assemblers, cross linkers, etc. + + In the normal case, a compiler produces code which runs on the same +system as the one on which the compiler runs. When it is necessary to +distinguish this case from the cross compilation case, such a compiler +is called a "native compiler". Similarly, we speak of native +assemblers, etc. + + Although the debugger is not strictly speaking a compilation tool, +it is nevertheless meaningful to speak of a cross debugger: a debugger +which is used to debug code which runs on another system. Everything +that is said below about configuring cross compilation tools applies to +the debugger as well. + + +File: configure.info, Node: Host and Target, Next: Using the Host Type, Prev: Cross Compilation Concepts, Up: Cross Compilation Tools + +Host and Target +=============== + + When building cross compilation tools, there are two different +systems involved: the system on which the tools will run, and the +system for which the tools generate code. + + The system on which the tools will run is called the "host" system. + + The system for which the tools generate code is called the "target" +system. + + For example, suppose you have a compiler which runs on a GNU/Linux +system and generates ELF programs for a MIPS embedded system. In this +case the GNU/Linux system is the host, and the MIPS ELF system is the +target. Such a compiler could be called a GNU/Linux cross MIPS ELF +compiler, or, equivalently, a `i386-linux-gnu' cross `mips-elf' +compiler. + + Naturally, most programs are not cross compilation tools. For those +programs, it does not make sense to speak of a target. It only makes +sense to speak of a target for tools like `gcc' or the `binutils' which +actually produce running code. For example, it does not make sense to +speak of the target of a tool like `bison' or `make'. + + Most cross compilation tools can also serve as native tools. For a +native compilation tool, it is still meaningful to speak of a target. +For a native tool, the target is the same as the host. For example, for +a GNU/Linux native compiler, the host is GNU/Linux, and the target is +also GNU/Linux. + + +File: configure.info, Node: Using the Host Type, Next: Specifying the Target, Prev: Host and Target, Up: Cross Compilation Tools + +Using the Host Type +=================== + + In almost all cases the host system is the system on which you run +the `configure' script, and on which you build the tools (for the case +when they differ, *note Canadian Cross::). + + If your configure script needs to know the configuration name of the +host system, and the package is not a cross compilation tool and +therefore does not have a target, put `AC_CANONICAL_HOST' in +`configure.in'. This macro will arrange to define a few shell +variables when the `configure' script is run. + +`host' + The canonical configuration name of the host. This will normally + be determined by running the `config.guess' shell script, although + the user is permitted to override this by using an explicit + `--host' option. + +`host_alias' + In the unusual case that the user used an explicit `--host' option, + this will be the argument to `--host'. In the normal case, this + will be the same as the `host' variable. + +`host_cpu' +`host_vendor' +`host_os' + The first three parts of the canonical configuration name. + + The shell variables may be used by putting shell code in +`configure.in'. For an example, see *Note Using Configuration Names::. + + +File: configure.info, Node: Specifying the Target, Next: Using the Target Type, Prev: Using the Host Type, Up: Cross Compilation Tools + +Specifying the Target +===================== + + By default, the `configure' script will assume that the target is +the same as the host. This is the more common case; for example, it +leads to a native compiler rather than a cross compiler. + + If you want to build a cross compilation tool, you must specify the +target explicitly by using the `--target' option when you run +`configure'. The argument to `--target' is the configuration name of +the system for which you wish to generate code. *Note Configuration +Names::. + + For example, to build tools which generate code for a MIPS ELF +embedded system, you would use `--target mips-elf'. + + +File: configure.info, Node: Using the Target Type, Next: Cross Tools in the Cygnus Tree, Prev: Specifying the Target, Up: Cross Compilation Tools + +Using the Target Type +===================== + + When writing `configure.in' for a cross compilation tool, you will +need to use information about the target. To do this, put +`AC_CANONICAL_SYSTEM' in `configure.in'. + + `AC_CANONICAL_SYSTEM' will look for a `--target' option and +canonicalize it using the `config.sub' shell script. It will also run +`AC_CANONICAL_HOST' (*note Using the Host Type::). + + The target type will be recorded in the following shell variables. +Note that the host versions of these variables will also be defined by +`AC_CANONICAL_HOST'. + +`target' + The canonical configuration name of the target. + +`target_alias' + The argument to the `--target' option. If the user did not specify + a `--target' option, this will be the same as `host_alias'. + +`target_cpu' +`target_vendor' +`target_os' + The first three parts of the canonical target configuration name. + + Note that if `host' and `target' are the same string, you can assume +a native configuration. If they are different, you can assume a cross +configuration. + + It is arguably possible for `host' and `target' to represent the +same system, but for the strings to not be identical. For example, if +`config.guess' returns `sparc-sun-sunos4.1.4', and somebody configures +with `--target sparc-sun-sunos4.1', then the slight differences between +the two versions of SunOS may be unimportant for your tool. However, +in the general case it can be quite difficult to determine whether the +differences between two configuration names are significant or not. +Therefore, by convention, if the user specifies a `--target' option +without specifying a `--host' option, it is assumed that the user wants +to configure a cross compilation tool. + + The variables `target' and `target_alias' should be handled +differently. + + In general, whenever the user may actually see a string, +`target_alias' should be used. This includes anything which may appear +in the file system, such as a directory name or part of a tool name. +It also includes any tool output, unless it is clearly labelled as the +canonical target configuration name. This permits the user to use the +`--target' option to specify how the tool will appear to the outside +world. + + On the other hand, when checking for characteristics of the target +system, `target' should be used. This is because a wide variety of +`--target' options may map into the same canonical configuration name. +You should not attempt to duplicate the canonicalization done by +`config.sub' in your own code. + + By convention, cross tools are installed with a prefix of the +argument used with the `--target' option, also known as `target_alias' +(*note Using the Target Type::). If the user does not use the +`--target' option, and thus is building a native tool, no prefix is +used. + + For example, if gcc is configured with `--target mips-elf', then the +installed binary will be named `mips-elf-gcc'. If gcc is configured +without a `--target' option, then the installed binary will be named +`gcc'. + + The autoconf macro `AC_ARG_PROGRAM' will handle this for you. If +you are using automake, no more need be done; the programs will +automatically be installed with the correct prefixes. Otherwise, see +the autoconf documentation for `AC_ARG_PROGRAM'. + + +File: configure.info, Node: Cross Tools in the Cygnus Tree, Prev: Using the Target Type, Up: Cross Compilation Tools + +Cross Tools in the Cygnus Tree +============================== + + The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. + + In the Cygnus tree, the top level `configure' script uses the old +Cygnus configure system, not autoconf. The top level `Makefile.in' is +written to build packages based on what is in the source tree, and +supports building a large number of tools in a single +`configure'/`make' step. + + The Cygnus tree may be configured with a `--target' option. The +`--target' option applies recursively to every subdirectory, and +permits building an entire set of cross tools at once. + +* Menu: + +* Host and Target Libraries:: Host and Target Libraries. +* Target Library Configure Scripts:: Target Library Configure Scripts. +* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. +* Target libiberty:: Target libiberty + + +File: configure.info, Node: Host and Target Libraries, Next: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree + +Host and Target Libraries +------------------------- + + The Cygnus tree distinguishes host libraries from target libraries. + + Host libraries are built with the compiler used to build the programs +which run on the host, which is called the host compiler. This includes +libraries such as `bfd' and `tcl'. These libraries are built with the +host compiler, and are linked into programs like the binutils or gcc +which run on the host. + + Target libraries are built with the target compiler. If gcc is +present in the source tree, then the target compiler is the gcc that is +built using the host compiler. Target libraries are libraries such as +`newlib' and `libstdc++'. These libraries are not linked into the host +programs, but are instead made available for use with programs built +with the target compiler. + + For the rest of this section, assume that gcc is present in the +source tree, so that it will be used to build the target libraries. + + There is a complication here. The configure process needs to know +which compiler you are going to use to build a tool; otherwise, the +feature tests will not work correctly. The Cygnus tree handles this by +not configuring the target libraries until the target compiler is +built. In order to permit everything to build using a single +`configure'/`make', the configuration of the target libraries is +actually triggered during the make step. + + When the target libraries are configured, the `--target' option is +not used. Instead, the `--host' option is used with the argument of +the `--target' option for the overall configuration. If no `--target' +option was used for the overall configuration, the `--host' option will +be passed with the output of the `config.guess' shell script. Any +`--build' option is passed down unchanged. + + This translation of configuration options is done because since the +target libraries are compiled with the target compiler, they are being +built in order to run on the target of the overall configuration. By +the definition of host, this means that their host system is the same as +the target system of the overall configuration. + + The same process is used for both a native configuration and a cross +configuration. Even when using a native configuration, the target +libraries will be configured and built using the newly built compiler. +This is particularly important for the C++ libraries, since there is no +reason to assume that the C++ compiler used to build the host tools (if +there even is one) uses the same ABI as the g++ compiler which will be +used to build the target libraries. + + There is one difference between a native configuration and a cross +configuration. In a native configuration, the target libraries are +normally configured and built as siblings of the host tools. In a cross +configuration, the target libraries are normally built in a subdirectory +whose name is the argument to `--target'. This is mainly for +historical reasons. + + To summarize, running `configure' in the Cygnus tree configures all +the host libraries and tools, but does not configure any of the target +libraries. Running `make' then does the following steps: + + * Build the host libraries. + + * Build the host programs, including gcc. Note that we call gcc + both a host program (since it runs on the host) and a target + compiler (since it generates code for the target). + + * Using the newly built target compiler, configure the target + libraries. + + * Build the target libraries. + + The steps need not be done in precisely this order, since they are +actually controlled by `Makefile' targets. + + +File: configure.info, Node: Target Library Configure Scripts, Next: Make Targets in Cygnus Tree, Prev: Host and Target Libraries, Up: Cross Tools in the Cygnus Tree + +Target Library Configure Scripts +-------------------------------- + + There are a few things you must know in order to write a configure +script for a target library. This is just a quick sketch, and beginners +shouldn't worry if they don't follow everything here. + + The target libraries are configured and built using a newly built +target compiler. There may not be any startup files or libraries for +this target compiler. In fact, those files will probably be built as +part of some target library, which naturally means that they will not +exist when your target library is configured. + + This means that the configure script for a target library may not use +any test which requires doing a link. This unfortunately includes many +useful autoconf macros, such as `AC_CHECK_FUNCS'. autoconf macros +which do a compile but not a link, such as `AC_CHECK_HEADERS', may be +used. + + This is a severe restriction, but normally not a fatal one, as target +libraries can often assume the presence of other target libraries, and +thus know which functions will be available. + + As of this writing, the autoconf macro `AC_PROG_CC' does a link to +make sure that the compiler works. This may fail in a target library, +so target libraries must use a different set of macros to locate the +compiler. See the `configure.in' file in a directory like `libiberty' +or `libgloss' for an example. + + As noted in the previous section, target libraries are sometimes +built in directories which are siblings to the host tools, and are +sometimes built in a subdirectory. The `--with-target-subdir' configure +option will be passed when the library is configured. Its value will be +an empty string if the target library is a sibling. Its value will be +the name of the subdirectory if the target library is in a subdirectory. + + If the overall build is not a native build (i.e., the overall +configure used the `--target' option), then the library will be +configured with the `--with-cross-host' option. The value of this +option will be the host system of the overall build. Recall that the +host system of the library will be the target of the overall build. If +the overall build is a native build, the `--with-cross-host' option +will not be used. + + A library which can be built both standalone and as a target library +may want to install itself into different directories depending upon the +case. When built standalone, or when built native, the library should +be installed in `$(libdir)'. When built as a target library which is +not native, the library should be installed in `$(tooldir)/lib'. The +`--with-cross-host' option may be used to distinguish these cases. + + This same test of `--with-cross-host' may be used to see whether it +is OK to use link tests in the configure script. If the +`--with-cross-host' option is not used, then the library is being built +either standalone or native, and a link should work. + + +File: configure.info, Node: Make Targets in Cygnus Tree, Next: Target libiberty, Prev: Target Library Configure Scripts, Up: Cross Tools in the Cygnus Tree + +Make Targets in Cygnus Tree +--------------------------- + + The top level `Makefile' in the Cygnus tree defines targets for +every known subdirectory. + + For every subdirectory DIR which holds a host library or program, +the `Makefile' target `all-DIR' will build that library or program. + + There are dependencies among host tools. For example, building gcc +requires first building gas, because the gcc build process invokes the +target assembler. These dependencies are reflected in the top level +`Makefile'. + + For every subdirectory DIR which holds a target library, the +`Makefile' target `configure-target-DIR' will configure that library. +The `Makefile' target `all-target-DIR' will build that library. + + Every `configure-target-DIR' target depends upon `all-gcc', since +gcc, the target compiler, is required to configure the tool. Every +`all-target-DIR' target depends upon the corresponding +`configure-target-DIR' target. + + There are several other targets which may be of interest for each +directory: `install-DIR', `clean-DIR', and `check-DIR'. There are also +corresponding `target' versions of these for the target libraries , +such as `install-target-DIR'. + + +File: configure.info, Node: Target libiberty, Prev: Make Targets in Cygnus Tree, Up: Cross Tools in the Cygnus Tree + +Target libiberty +---------------- + + The `libiberty' subdirectory is currently a special case, in that it +is the only directory which is built both using the host compiler and +using the target compiler. + + This is because the files in `libiberty' are used when building the +host tools, and they are also incorporated into the `libstdc++' target +library as support code. + + This duality does not pose any particular difficulties. It means +that there are targets for both `all-libiberty' and +`all-target-libiberty'. + + In a native configuration, when target libraries are not built in a +subdirectory, the same objects are normally used as both the host build +and the target build. This is normally OK, since libiberty contains +only C code, and in a native configuration the results of the host +compiler and the target compiler are normally interoperable. + + Irix 6 is again an exception here, since the SGI native compiler +defaults to using the `O32' ABI, and gcc defaults to using the `N32' +ABI. On Irix 6, the target libraries are built in a subdirectory even +for a native configuration, avoiding this problem. + + There are currently no other libraries built for both the host and +the target, but there is no conceptual problem with adding more. + + +File: configure.info, Node: Canadian Cross, Next: Cygnus Configure, Prev: Cross Compilation Tools, Up: Top + +Canadian Cross +************** + + It is possible to use the GNU configure and build system to build a +program which will run on a system which is different from the system on +which the tools are built. In other words, it is possible to build +programs using a cross compiler. + + This is referred to as a "Canadian Cross". + +* Menu: + +* Canadian Cross Example:: Canadian Cross Example. +* Canadian Cross Concepts:: Canadian Cross Concepts. +* Build Cross Host Tools:: Build Cross Host Tools. +* Build and Host Options:: Build and Host Options. +* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. +* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. +* Supporting Canadian Cross:: Supporting Canadian Cross. + + +File: configure.info, Node: Canadian Cross Example, Next: Canadian Cross Concepts, Up: Canadian Cross + +Canadian Cross Example +====================== + + Here is an example of a Canadian Cross. + + While running on a GNU/Linux, you can build a program which will run +on a Solaris system. You would use a GNU/Linux cross Solaris compiler +to build the program. + + Of course, you could not run the resulting program on your GNU/Linux +system. You would have to copy it over to a Solaris system before you +would run it. + + Of course, you could also simply build the programs on the Solaris +system in the first place. However, perhaps the Solaris system is not +available for some reason; perhaps you actually don't have one, but you +want to build the tools for somebody else to use. Or perhaps your +GNU/Linux system is much faster than your Solaris system. + + A Canadian Cross build is most frequently used when building +programs to run on a non-Unix system, such as DOS or Windows. It may +be simpler to configure and build on a Unix system than to support the +configuration machinery on a non-Unix system. + + +File: configure.info, Node: Canadian Cross Concepts, Next: Build Cross Host Tools, Prev: Canadian Cross Example, Up: Canadian Cross + +Canadian Cross Concepts +======================= + + When building a Canadian Cross, there are at least two different +systems involved: the system on which the tools are being built, and +the system on which the tools will run. + + The system on which the tools are being built is called the "build" +system. + + The system on which the tools will run is called the host system. + + For example, if you are building a Solaris program on a GNU/Linux +system, as in the previous section, the build system would be GNU/Linux, +and the host system would be Solaris. + + It is, of course, possible to build a cross compiler using a Canadian +Cross (i.e., build a cross compiler using a cross compiler). In this +case, the system for which the resulting cross compiler generates code +is called the target system. (For a more complete discussion of host +and target systems, *note Host and Target::). + + An example of building a cross compiler using a Canadian Cross would +be building a Windows cross MIPS ELF compiler on a GNU/Linux system. In +this case the build system would be GNU/Linux, the host system would be +Windows, and the target system would be MIPS ELF. + + The name Canadian Cross comes from the case when the build, host, and +target systems are all different. At the time that these issues were +all being hashed out, Canada had three national political parties. + + +File: configure.info, Node: Build Cross Host Tools, Next: Build and Host Options, Prev: Canadian Cross Concepts, Up: Canadian Cross + +Build Cross Host Tools +====================== + + In order to configure a program for a Canadian Cross build, you must +first build and install the set of cross tools you will use to build the +program. + + These tools will be build cross host tools. That is, they will run +on the build system, and will produce code that runs on the host system. + + It is easy to confuse the meaning of build and host here. Always +remember that the build system is where you are doing the build, and the +host system is where the resulting program will run. Therefore, you +need a build cross host compiler. + + In general, you must have a complete cross environment in order to do +the build. This normally means a cross compiler, cross assembler, and +so forth, as well as libraries and include files for the host system. + + +File: configure.info, Node: Build and Host Options, Next: CCross not in Cygnus Tree, Prev: Build Cross Host Tools, Up: Canadian Cross + +Build and Host Options +====================== + + When you run `configure', you must use both the `--build' and +`--host' options. + + The `--build' option is used to specify the configuration name of +the build system. This can normally be the result of running the +`config.guess' shell script, and it is reasonable to use +`--build=`config.guess`'. + + The `--host' option is used to specify the configuration name of the +host system. + + As we explained earlier, `config.guess' is used to set the default +value for the `--host' option (*note Using the Host Type::). We can +now see that since `config.guess' returns the type of system on which +it is run, it really identifies the build system. Since the host +system is normally the same as the build system (i.e., people do not +normally build using a cross compiler), it is reasonable to use the +result of `config.guess' as the default for the host system when the +`--host' option is not used. + + It might seem that if the `--host' option were used without the +`--build' option that the configure script could run `config.guess' to +determine the build system, and presume a Canadian Cross if the result +of `config.guess' differed from the `--host' option. However, for +historical reasons, some configure scripts are routinely run using an +explicit `--host' option, rather than using the default from +`config.guess'. As noted earlier, it is difficult or impossible to +reliably compare configuration names (*note Using the Target Type::). +Therefore, by convention, if the `--host' option is used, but the +`--build' option is not used, then the build system defaults to the +host system. + + +File: configure.info, Node: CCross not in Cygnus Tree, Next: CCross in Cygnus Tree, Prev: Build and Host Options, Up: Canadian Cross + +Canadian Cross not in Cygnus Tree. +================================== + + If you are not using the Cygnus tree, you must explicitly specify the +cross tools which you want to use to build the program. This is done by +setting environment variables before running the `configure' script. + + You must normally set at least the environment variables `CC', `AR', +and `RANLIB' to the cross tools which you want to use to build. + + For some programs, you must set additional cross tools as well, such +as `AS', `LD', or `NM'. + + You would set these environment variables to the build cross tools +which you are going to use. + + For example, if you are building a Solaris program on a GNU/Linux +system, and your GNU/Linux cross Solaris compiler were named +`solaris-gcc', then you would set the environment variable `CC' to +`solaris-gcc'. + + +File: configure.info, Node: CCross in Cygnus Tree, Next: Supporting Canadian Cross, Prev: CCross not in Cygnus Tree, Up: Canadian Cross + +Canadian Cross in Cygnus Tree +============================= + + This section describes configuring and building a Canadian Cross when +using the Cygnus tree. + +* Menu: + +* Standard Cygnus CCross:: Building a Normal Program. +* Cross Cygnus CCross:: Building a Cross Program. + + +File: configure.info, Node: Standard Cygnus CCross, Next: Cross Cygnus CCross, Up: CCross in Cygnus Tree + +Building a Normal Program +------------------------- + + When configuring a Canadian Cross in the Cygnus tree, all the +appropriate environment variables are automatically set to `HOST-TOOL', +where HOST is the value used for the `--host' option, and TOOL is the +name of the tool (e.g., `gcc', `as', etc.). These tools must be on +your `PATH'. + + Adding a prefix of HOST will give the usual name for the build cross +host tools. To see this, consider that when these cross tools were +built, they were configured to run on the build system and to produce +code for the host system. That is, they were configured with a +`--target' option that is the same as the system which we are now +calling the host. Recall that the default name for installed cross +tools uses the target system as a prefix (*note Using the Target +Type::). Since that is the system which we are now calling the host, +HOST is the right prefix to use. + + For example, if you configure with `--build=i386-linux-gnu' and +`--host=solaris', then the Cygnus tree will automatically default to +using the compiler `solaris-gcc'. You must have previously built and +installed this compiler, probably by doing a build with no `--host' +option and with a `--target' option of `solaris'. + + +File: configure.info, Node: Cross Cygnus CCross, Prev: Standard Cygnus CCross, Up: CCross in Cygnus Tree + +Building a Cross Program +------------------------ + + There are additional considerations if you want to build a cross +compiler, rather than a native compiler, in the Cygnus tree using a +Canadian Cross. + + When you build a cross compiler using the Cygnus tree, then the +target libraries will normally be built with the newly built target +compiler (*note Host and Target Libraries::). However, this will not +work when building with a Canadian Cross. This is because the newly +built target compiler will be a program which runs on the host system, +and therefore will not be able to run on the build system. + + Therefore, when building a cross compiler with the Cygnus tree, you +must first install a set of build cross target tools. These tools will +be used when building the target libraries. + + Note that this is not a requirement of a Canadian Cross in general. +For example, it would be possible to build just the host cross target +tools on the build system, to copy the tools to the host system, and to +build the target libraries on the host system. The requirement for +build cross target tools is imposed by the Cygnus tree, which expects +to be able to build both host programs and target libraries in a single +`configure'/`make' step. Because it builds these in a single step, it +expects to be able to build the target libraries on the build system, +which means that it must use a build cross target toolchain. + + For example, suppose you want to build a Windows cross MIPS ELF +compiler on a GNU/Linux system. You must have previously installed +both a GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF +compiler. + + In order to build the Windows (configuration name `i386-cygwin32') +cross MIPS ELF (configure name `mips-elf') compiler, you might execute +the following commands (long command lines are broken across lines with +a trailing backslash as a continuation character). + + mkdir linux-x-cygwin32 + cd linux-x-cygwin32 + SRCDIR/configure --target i386-cygwin32 --prefix=INSTALLDIR \ + --exec-prefix=INSTALLDIR/H-i386-linux + make + make install + cd .. + mkdir linux-x-mips-elf + cd linux-x-mips-elf + SRCDIR/configure --target mips-elf --prefix=INSTALLDIR \ + --exec-prefix=INSTALLDIR/H-i386-linux + make + make install + cd .. + mkdir cygwin32-x-mips-elf + cd cygwin32-x-mips-elf + SRCDIR/configure --build=i386-linux-gnu --host=i386-cygwin32 \ + --target=mips-elf --prefix=WININSTALLDIR \ + --exec-prefix=WININSTALLDIR/H-i386-cygwin32 + make + make install + + You would then copy the contents of WININSTALLDIR over to the +Windows machine, and run the resulting programs. + + +File: configure.info, Node: Supporting Canadian Cross, Prev: CCross in Cygnus Tree, Up: Canadian Cross + +Supporting Canadian Cross +========================= + + If you want to make it possible to build a program you are developing +using a Canadian Cross, you must take some care when writing your +configure and make rules. Simple cases will normally work correctly. +However, it is not hard to write configure and make tests which will +fail in a Canadian Cross. + +* Menu: + +* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. +* CCross in Make:: Supporting Canadian Cross in Makefiles. + + +File: configure.info, Node: CCross in Configure, Next: CCross in Make, Up: Supporting Canadian Cross + +Supporting Canadian Cross in Configure Scripts +---------------------------------------------- + + In a `configure.in' file, after calling `AC_PROG_CC', you can find +out whether this is a Canadian Cross configure by examining the shell +variable `cross_compiling'. In a Canadian Cross, which means that the +compiler is a cross compiler, `cross_compiling' will be `yes'. In a +normal configuration, `cross_compiling' will be `no'. + + You ordinarily do not need to know the type of the build system in a +configure script. However, if you do need that information, you can get +it by using the macro `AC_CANONICAL_SYSTEM', the same macro that is +used to determine the target system. This macro will set the variables +`build', `build_alias', `build_cpu', `build_vendor', and `build_os', +which correspond to the similar `target' and `host' variables, except +that they describe the build system. + + When writing tests in `configure.in', you must remember that you +want to test the host environment, not the build environment. + + Macros like `AC_CHECK_FUNCS' which use the compiler will test the +host environment. That is because the tests will be done by running the +compiler, which is actually a build cross host compiler. If the +compiler can find the function, that means that the function is present +in the host environment. + + Tests like `test -f /dev/ptyp0', on the other hand, will test the +build environment. Remember that the configure script is running on the +build system, not the host system. If your configure scripts examines +files, those files will be on the build system. Whatever you determine +based on those files may or may not be the case on the host system. + + Most autoconf macros will work correctly for a Canadian Cross. The +main exception is `AC_TRY_RUN'. This macro tries to compile and run a +test program. This will fail in a Canadian Cross, because the program +will be compiled for the host system, which means that it will not run +on the build system. + + The `AC_TRY_RUN' macro provides an optional argument to tell the +configure script what to do in a Canadian Cross. If that argument is +not present, you will get a warning when you run `autoconf': + warning: AC_TRY_RUN called without default to allow cross compiling + +This tells you that the resulting `configure' script will not work with +a Canadian Cross. + + In some cases while it may better to perform a test at configure +time, it is also possible to perform the test at run time. In such a +case you can use the cross compiling argument to `AC_TRY_RUN' to tell +your program that the test could not be performed at configure time. + + There are a few other autoconf macros which will not work correctly +with a Canadian Cross: a partial list is `AC_FUNC_GETPGRP', +`AC_FUNC_SETPGRP', `AC_FUNC_SETVBUF_REVERSED', and +`AC_SYS_RESTARTABLE_SYSCALLS'. The `AC_CHECK_SIZEOF' macro is +generally not very useful with a Canadian Cross; it permits an optional +argument indicating the default size, but there is no way to know what +the correct default should be. + + +File: configure.info, Node: CCross in Make, Prev: CCross in Configure, Up: Supporting Canadian Cross + +Supporting Canadian Cross in Makefiles. +--------------------------------------- + + The main Canadian Cross issue in a `Makefile' arises when you want +to use a subsidiary program to generate code or data which you will then +include in your real program. + + If you compile this subsidiary program using `$(CC)' in the usual +way, you will not be able to run it. This is because `$(CC)' will +build a program for the host system, but the program is being built on +the build system. + + You must instead use a compiler for the build system, rather than the +host system. In the Cygnus tree, this make variable `$(CC_FOR_BUILD)' +will hold a compiler for the build system. + + Note that you should not include `config.h' in a file you are +compiling with `$(CC_FOR_BUILD)'. The `configure' script will build +`config.h' with information for the host system. However, you are +compiling the file using a compiler for the build system (a native +compiler). Subsidiary programs are normally simple filters which do no +user interaction, and it is normally possible to write them in a highly +portable fashion so that the absence of `config.h' is not crucial. + + The gcc `Makefile.in' shows a complex situation in which certain +files, such as `rtl.c', must be compiled into both subsidiary programs +run on the build system and into the final program. This approach may +be of interest for advanced build system hackers. Note that the build +system compiler is rather confusingly called `HOST_CC'. + + +File: configure.info, Node: Cygnus Configure, Next: Multilibs, Prev: Canadian Cross, Up: Top + +Cygnus Configure +**************** + + The Cygnus configure script predates autoconf. All of its +interesting features have been incorporated into autoconf. No new +programs should be written to use the Cygnus configure script. + + However, the Cygnus configure script is still used in a few places: +at the top of the Cygnus tree and in a few target libraries in the +Cygnus tree. Until those uses have been replaced with autoconf, some +brief notes are appropriate here. This is not complete documentation, +but it should be possible to use this as a guide while examining the +scripts themselves. + +* Menu: + +* Cygnus Configure Basics:: Cygnus Configure Basics. +* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. + + +File: configure.info, Node: Cygnus Configure Basics, Next: Cygnus Configure in C++ Libraries, Up: Cygnus Configure + +Cygnus Configure Basics +======================= + + Cygnus configure does not use any generated files; there is no +program corresponding to `autoconf'. Instead, there is a single shell +script named `configure' which may be found at the top of the Cygnus +tree. This shell script was written by hand; it was not generated by +autoconf, and it is incorrect, and indeed harmful, to run `autoconf' in +the top level of a Cygnus tree. + + Cygnus configure works in a particular directory by examining the +file `configure.in' in that directory. That file is broken into four +separate shell scripts. + + The first is the contents of `configure.in' up to a line that starts +with `# per-host:'. This is the common part. + + The second is the rest of `configure.in' up to a line that starts +with `# per-target:'. This is the per host part. + + The third is the rest of `configure.in' up to a line that starts +with `# post-target:'. This is the per target part. + + The fourth is the remainder of `configure.in'. This is the post +target part. + + If any of these comment lines are missing, the corresponding shell +script is empty. + + Cygnus configure will first execute the common part. This must set +the shell variable `srctrigger' to the name of a source file, to +confirm that Cygnus configure is looking at the right directory. This +may set the shell variables `package_makefile_frag' and +`package_makefile_rules_frag'. + + Cygnus configure will next set the `build' and `host' shell +variables, and execute the per host part. This may set the shell +variable `host_makefile_frag'. + + Cygnus configure will next set the `target' variable, and execute +the per target part. This may set the shell variable +`target_makefile_frag'. + + Any of these scripts may set the `subdirs' shell variable. This +variable is a list of subdirectories where a `Makefile.in' file may be +found. Cygnus configure will automatically look for a `Makefile.in' +file in the current directory. The `subdirs' shell variable is not +normally used, and I believe that the only directory which uses it at +present is `newlib'. + + For each `Makefile.in', Cygnus configure will automatically create a +`Makefile' by adding definitions for `make' variables such as `host' +and `target', and automatically editing the values of `make' variables +such as `prefix' if they are present. + + Also, if any of the `makefile_frag' shell variables are set, Cygnus +configure will interpret them as file names relative to either the +working directory or the source directory, and will read the contents of +the file into the generated `Makefile'. The file contents will be read +in after the first line in `Makefile.in' which starts with `####'. + + These `Makefile' fragments are used to customize behaviour for a +particular host or target. They serve to select particular files to +compile, and to define particular preprocessor macros by providing +values for `make' variables which are then used during compilation. +Cygnus configure, unlike autoconf, normally does not do feature tests, +and normally requires support to be added manually for each new host. + + The `Makefile' fragment support is similar to the autoconf +`AC_SUBST_FILE' macro. + + After creating each `Makefile', the post target script will be run +(i.e., it may be run several times). This script may further customize +the `Makefile'. When it is run, the shell variable `Makefile' will +hold the name of the `Makefile', including the appropriate directory +component. + + Like an autoconf generated `configure' script, Cygnus configure will +create a file named `config.status' which, when run, will automatically +recreate the configuration. The `config.status' file will simply +execute the Cygnus configure script again with the appropriate +arguments. + + Any of the parts of `configure.in' may set the shell variables +`files' and `links'. Cygnus configure will set up symlinks from the +names in `links' to the files named in `files'. This is similar to the +autoconf `AC_LINK_FILES' macro. + + Finally, any of the parts of `configure.in' may set the shell +variable `configdirs' to a set of subdirectories. If it is set, Cygnus +configure will recursively run the configure process in each +subdirectory. If the subdirectory uses Cygnus configure, it will +contain a `configure.in' file but no `configure' file, in which case +Cygnus configure will invoke itself recursively. If the subdirectory +has a `configure' file, Cygnus configure assumes that it is an autoconf +generated `configure' script, and simply invokes it directly. + + +File: configure.info, Node: Cygnus Configure in C++ Libraries, Prev: Cygnus Configure Basics, Up: Cygnus Configure + +Cygnus Configure in C++ Libraries +================================= + + The C++ library configure system, written by Per Bothner, deserves +special mention. It uses Cygnus configure, but it does feature testing +like that done by autoconf generated `configure' scripts. This +approach is used in the libraries `libio', `libstdc++', and `libg++'. + + Most of the `Makefile' information is written out by the shell +script `libio/config.shared'. Each `configure.in' file sets certain +shell variables, and then invokes `config.shared' to create two package +`Makefile' fragments. These fragments are then incorporated into the +resulting `Makefile' by the Cygnus configure script. + + The file `_G_config.h' is created in the `libio' object directory by +running the shell script `libio/gen-params'. This shell script uses +feature tests to define macros and typedefs in `_G_config.h'. + + +File: configure.info, Node: Multilibs, Next: FAQ, Prev: Cygnus Configure, Up: Top + +Multilibs +********* + + For some targets gcc may have different processor requirements +depending upon command line options. An obvious example is the +`-msoft-float' option supported on several processors. This option +means that the floating point registers are not available, which means +that floating point operations must be done by calling an emulation +subroutine rather than by using machine instructions. + + For such options, gcc is often configured to compile target libraries +twice: once with `-msoft-float' and once without. When gcc compiles +target libraries more than once, the resulting libraries are called +"multilibs". + + Multilibs are not really part of the GNU configure and build system, +but we discuss them here since they require support in the `configure' +scripts and `Makefile's used for target libraries. + +* Menu: + +* Multilibs in gcc:: Multilibs in gcc. +* Multilibs in Target Libraries:: Multilibs in Target Libraries. + + +File: configure.info, Node: Multilibs in gcc, Next: Multilibs in Target Libraries, Up: Multilibs + +Multilibs in gcc +================ + + In gcc, multilibs are defined by setting the variable +`MULTILIB_OPTIONS' in the target `Makefile' fragment. Several other +`MULTILIB' variables may also be defined there. *Note The Target +Makefile Fragment: (gcc)Target Fragment. + + If you have built gcc, you can see what multilibs it uses by running +it with the `-print-multi-lib' option. The output `.;' means that no +multilibs are used. In general, the output is a sequence of lines, one +per multilib. The first part of each line, up to the `;', is the name +of the multilib directory. The second part is a list of compiler +options separated by `@' characters. + + Multilibs are built in a tree of directories. The top of the tree, +represented by `.' in the list of multilib directories, is the default +library to use when no special compiler options are used. The +subdirectories of the tree hold versions of the library to use when +particular compiler options are used. + diff -uprN binutils-2.10/etc/configure.info-3 binutils-2.10.1/etc/configure.info-3 --- binutils-2.10/etc/configure.info-3 Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configure.info-3 Mon May 29 15:08:52 2000 @@ -0,0 +1,285 @@ +This is configure.info, produced by makeinfo version 4.0 from +./configure.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* configure: (configure). The GNU configure and build system +END-INFO-DIR-ENTRY + + This file documents the GNU configure and build system. + + Copyright (C) 1998 Cygnus Solutions. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: configure.info, Node: Multilibs in Target Libraries, Prev: Multilibs in gcc, Up: Multilibs + +Multilibs in Target Libraries +============================= + + The target libraries in the Cygnus tree are automatically built with +multilibs. That means that each library is built multiple times. + + This default is set in the top level `configure.in' file, by adding +`--enable-multilib' to the list of arguments passed to configure when +it is run for the target libraries (*note Host and Target Libraries::). + + Each target library uses the shell script `config-ml.in', written by +Doug Evans, to prepare to build target libraries. This shell script is +invoked after the `Makefile' has been created by the `configure' +script. If multilibs are not enabled, it does nothing, otherwise it +modifies the `Makefile' to support multilibs. + + The `config-ml.in' script makes one copy of the `Makefile' for each +multilib in the appropriate subdirectory. When configuring in the +source directory (which is not recommended), it will build a symlink +tree of the sources in each subdirectory. + + The `config-ml.in' script sets several variables in the various +`Makefile's. The `Makefile.in' must have definitions for these +variables already; `config-ml.in' simply changes the existing values. +The `Makefile' should use default values for these variables which will +do the right thing in the subdirectories. + +`MULTISRCTOP' + `config-ml.in' will set this to a sequence of `../' strings, where + the number of strings is the number of multilib levels in the + source tree. The default value should be the empty string. + +`MULTIBUILDTOP' + `config-ml.in' will set this to a sequence of `../' strings, where + the number of strings is number of multilib levels in the object + directory. The default value should be the empty string. This + will differ from `MULTISRCTOP' when configuring in the source tree + (which is not recommended). + +`MULTIDIRS' + In the top level `Makefile' only, `config-ml.in' will set this to + the list of multilib subdirectories. The default value should be + the empty string. + +`MULTISUBDIR' + `config-ml.in' will set this to the installed subdirectory name to + use for this subdirectory, with a leading `/'. The default value + shold be the empty string. + +`MULTIDO' +`MULTICLEAN' + In the top level `Makefile' only, `config-ml.in' will set these + variables to commands to use when doing a recursive make. These + variables should both default to the string `true', so that by + default nothing happens. + + All references to the parent of the source directory should use the +variable `MULTISRCTOP'. Instead of writing `$(srcdir)/..', you must +write `$(srcdir)/$(MULTISRCTOP)..'. + + Similarly, references to the parent of the object directory should +use the variable `MULTIBUILDTOP'. + + In the installation target, the libraries should be installed in the +subdirectory `MULTISUBDIR'. Instead of installing +`$(libdir)/libfoo.a', install `$(libdir)$(MULTISUBDIR)/libfoo.a'. + + The `config-ml.in' script also modifies the top level `Makefile' to +add `multi-do' and `multi-clean' targets which are used when building +multilibs. + + The default target of the `Makefile' should include the following +command: + @$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do + +This assumes that `$(FLAGS_TO_PASS)' is defined as a set of variables +to pass to a recursive invocation of `make'. This will build all the +multilibs. Note that the default value of `MULTIDO' is `true', so by +default this command will do nothing. It will only do something in the +top level `Makefile' if multilibs were enabled. + + The `install' target of the `Makefile' should include the following +command: + @$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do + + In general, any operation, other than clean, which should be +performed on all the multilibs should use a `$(MULTIDO)' line, setting +the variable `DO' to the target of each recursive call to `make'. + + The `clean' targets (`clean', `mostlyclean', etc.) should use +`$(MULTICLEAN)'. For example, the `clean' target should do this: + @$(MULTICLEAN) DO=clean multi-clean + + +File: configure.info, Node: FAQ, Next: Index, Prev: Multilibs, Up: Top + +Frequently Asked Questions +************************** + +Which do I run first, `autoconf' or `automake'? + Except when you first add autoconf or automake support to a + package, you shouldn't run either by hand. Instead, configure + with the `--enable-maintainer-mode' option, and let `make' take + care of it. + +`autoconf' says something about undefined macros. + This means that you have macros in your `configure.in' which are + not defined by `autoconf'. You may be using an old version of + `autoconf'; try building and installing a newer one. Make sure the + newly installled `autoconf' is first on your `PATH'. Also, see + the next question. + +My `configure' script has stuff like `CY_GNU_GETTEXT' in it. + This means that you have macros in your `configure.in' which should + be defined in your `aclocal.m4' file, but aren't. This usually + means that `aclocal' was not able to appropriate definitions of the + macros. Make sure that you have installed all the packages you + need. In particular, make sure that you have installed libtool + (this is where `AM_PROG_LIBTOOL' is defined) and gettext (this is + where `CY_GNU_GETTEXT' is defined, at least in the Cygnus version + of gettext). + +My `Makefile' has `@' characters in it. + This may mean that you tried to use an autoconf substitution in + your `Makefile.in' without adding the appropriate `AC_SUBST' call + to your `configure' script. Or it may just mean that you need to + rebuild `Makefile' in your build directory. To rebuild `Makefile' + from `Makefile.in', run the shell script `config.status' with no + arguments. If you need to force `configure' to run again, first + run `config.status --recheck'. These runs are normally done + automatically by `Makefile' targets, but if your `Makefile' has + gotten messed up you'll need to help them along. + +Why do I have to run both `config.status --recheck' and `config.status'? + Normally, you don't; they will be run automatically by `Makefile' + targets. If you do need to run them, use `config.status --recheck' + to run the `configure' script again with the same arguments as the + first time you ran it. Use `config.status' (with no arguments) to + regenerate all files (`Makefile', `config.h', etc.) based on the + results of the configure script. The two cases are separate + because it isn't always necessary to regenerate all the files + after running `config.status --recheck'. The `Makefile' targets + generated by automake will use the environment variables + `CONFIG_FILES' and `CONFIG_HEADERS' to only regenerate files as + they are needed. + +What is the Cygnus tree? + The Cygnus tree is used for various packages including gdb, the GNU + binutils, and egcs. It is also, of course, used for Cygnus + releases. It is the build system which was developed at Cygnus, + using the Cygnus configure script. It permits building many + different packages with a single configure and make. The + configure scripts in the tree are being converted to autoconf, but + the general build structure remains intact. + +Why do I have to keep rebuilding and reinstalling the tools? + I know, it's a pain. Unfortunately, there are bugs in the tools + themselves which need to be fixed, and each time that happens + everybody who uses the tools need to reinstall new versions of + them. I don't know if there is going to be a clever fix until the + tools stabilize. + +Why not just have a Cygnus tree `make' target to update the tools? + The tools unfortunately need to be installed before they can be + used. That means that they must be built using an appropriate + prefix, and it seems unwise to assume that every configuration + uses an appropriate prefix. It might be possible to make them + work in place, or it might be possible to install them in some + subdirectory; so far these approaches have not been implemented. + + +File: configure.info, Node: Index, Prev: FAQ, Up: Top + +Index +***** + +* Menu: + +* --build option: Build and Host Options. +* --host option: Build and Host Options. +* --target option: Specifying the Target. +* _GNU_SOURCE: Write configure.in. +* AC_CANONICAL_HOST: Using the Host Type. +* AC_CANONICAL_SYSTEM: Using the Target Type. +* AC_CONFIG_HEADER: Write configure.in. +* AC_EXEEXT: Write configure.in. +* AC_INIT: Write configure.in. +* AC_OUTPUT: Write configure.in. +* AC_PREREQ: Write configure.in. +* AC_PROG_CC: Write configure.in. +* AC_PROG_CXX: Write configure.in. +* acconfig.h: Written Developer Files. +* acconfig.h, writing: Write acconfig.h. +* acinclude.m4: Written Developer Files. +* aclocal.m4: Generated Developer Files. +* AM_CONFIG_HEADER: Write configure.in. +* AM_DISABLE_SHARED: Write configure.in. +* AM_EXEEXT: Write configure.in. +* AM_INIT_AUTOMAKE: Write configure.in. +* AM_MAINTAINER_MODE: Write configure.in. +* AM_PROG_LIBTOOL: Write configure.in. +* AM_PROG_LIBTOOL in configure: FAQ. +* build option: Build and Host Options. +* building with a cross compiler: Canadian Cross. +* canadian cross: Canadian Cross. +* canadian cross in configure: CCross in Configure. +* canadian cross in cygnus tree: CCross in Cygnus Tree. +* canadian cross in makefile: CCross in Make. +* canadian cross, configuring: Build and Host Options. +* canonical system names: Configuration Names. +* config.cache: Build Files Description. +* config.h: Build Files Description. +* config.h.in: Generated Developer Files. +* config.in: Generated Developer Files. +* config.status: Build Files Description. +* config.status --recheck: FAQ. +* configuration names: Configuration Names. +* configuration triplets: Configuration Names. +* configure: Generated Developer Files. +* configure build system: Build and Host Options. +* configure host: Build and Host Options. +* configure target: Specifying the Target. +* configure.in: Written Developer Files. +* configure.in, writing: Write configure.in. +* configuring a canadian cross: Build and Host Options. +* cross compiler: Cross Compilation Concepts. +* cross compiler, building with: Canadian Cross. +* cross tools: Cross Compilation Tools. +* CY_GNU_GETTEXT in configure: FAQ. +* cygnus configure: Cygnus Configure. +* goals: Goals. +* history: History. +* host names: Configuration Names. +* host option: Build and Host Options. +* host system: Host and Target. +* host triplets: Configuration Names. +* HOST_CC: CCross in Make. +* libg++ configure: Cygnus Configure in C++ Libraries. +* libio configure: Cygnus Configure in C++ Libraries. +* libstdc++ configure: Cygnus Configure in C++ Libraries. +* Makefile: Build Files Description. +* Makefile, garbage characters: FAQ. +* Makefile.am: Written Developer Files. +* Makefile.am, writing: Write Makefile.am. +* Makefile.in: Generated Developer Files. +* multilibs: Multilibs. +* stamp-h: Build Files Description. +* stamp-h.in: Generated Developer Files. +* system names: Configuration Names. +* system types: Configuration Names. +* target option: Specifying the Target. +* target system: Host and Target. +* triplets: Configuration Names. +* undefined macros: FAQ. + + diff -uprN binutils-2.10/etc/configure.texi binutils-2.10.1/etc/configure.texi --- binutils-2.10/etc/configure.texi Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/etc/configure.texi Mon May 3 08:29:06 1999 @@ -0,0 +1,2644 @@ +\input texinfo +@c %**start of header +@setfilename configure.info +@settitle The GNU configure and build system +@setchapternewpage off +@c %**end of header + +@dircategory GNU admin +@direntry +* configure: (configure). The GNU configure and build system +@end direntry + +@ifinfo +This file documents the GNU configure and build system. + +Copyright (C) 1998 Cygnus Solutions. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph + + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + +@titlepage +@title The GNU configure and build system +@author Ian Lance Taylor + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1998 Cygnus Solutions + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end titlepage + +@ifinfo +@node Top +@top GNU configure and build system + +The GNU configure and build system. + +@menu +* Introduction:: Introduction. +* Getting Started:: Getting Started. +* Files:: Files. +* Configuration Names:: Configuration Names. +* Cross Compilation Tools:: Cross Compilation Tools. +* Canadian Cross:: Canadian Cross. +* Cygnus Configure:: Cygnus Configure. +* Multilibs:: Multilibs. +* FAQ:: Frequently Asked Questions. +* Index:: Index. +@end menu + +@end ifinfo + +@node Introduction +@chapter Introduction + +This document describes the GNU configure and build systems. It +describes how autoconf, automake, libtool, and make fit together. It +also includes a discussion of the older Cygnus configure system. + +This document does not describe in detail how to use each of the tools; +see the respective manuals for that. Instead, it describes which files +the developer must write, which files are machine generated and how they +are generated, and where certain common problems should be addressed. + +@ifnothtml +This document draws on several sources, including the autoconf manual by +David MacKenzie (@pxref{Top, , autoconf overview, autoconf, Autoconf}), +the automake manual by David MacKenzie and Tom Tromey (@pxref{Top, , +automake overview, automake, GNU Automake}), the libtool manual by +Gordon Matzigkeit (@pxref{Top, , libtool overview, libtool, GNU +libtool}), and the Cygnus configure manual by K. Richard Pixley. +@end ifnothtml +@ifhtml +This document draws on several sources, including +@uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html, the +autoconf manual} by David MacKenzie, +@uref{http://www.delorie.com/gnu/docs/automake/automake_toc.html, the +automake manual} by David MacKenzie and Tom Tromey, +@uref{http://www.delorie.com/gnu/docs/libtool/libtool_toc.html, the +libtool manual} by Gordon Matzigkeit, and the Cygnus configure manual by +K. Richard Pixley. +@end ifhtml + +@menu +* Goals:: Goals. +* Tools:: The tools. +* History:: History. +* Building:: Building. +@end menu + +@node Goals +@section Goals +@cindex goals + +The GNU configure and build system has two main goals. + +The first is to simplify the development of portable programs. The +system permits the developer to concentrate on writing the program, +simplifying many details of portability across Unix and even Windows +systems, and permitting the developer to describe how to build the +program using simple rules rather than complex Makefiles. + +The second is to simplify the building of programs distributed as source +code. All programs are built using a simple, standardized, two step +process. The program builder need not install any special tools in +order to build the program. + +@node Tools +@section Tools + +The GNU configure and build system is comprised of several different +tools. Program developers must build and install all of these tools. + +People who just want to build programs from distributed sources normally +do not need any special tools beyond a Unix shell, a make program, and a +C compiler. + +@table @asis +@item autoconf +provides a general portability framework, based on testing the features +of the host system at build time. +@item automake +a system for describing how to build a program, permitting the developer +to write a simplified @file{Makefile}. +@item libtool +a standardized approach to building shared libraries. +@item gettext +provides a framework for translation of text messages into other +languages; not really discussed in this document. +@item m4 +autoconf requires the GNU version of m4; the standard Unix m4 does not +suffice. +@item perl +automake requires perl. +@end table + +@node History +@section History +@cindex history + +This is a very brief and probably inaccurate history. + +As the number of Unix variants increased during the 1980s, it became +harder to write programs which could run on all variants. While it was +often possible to use @code{#ifdef} to identify particular systems, +developers frequently did not have access to every system, and the +characteristics of some systems changed from version to version. + +By 1992, at least three different approaches had been developed: +@itemize @bullet +@item +The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael +Manfredi. +@item +The Cygnus configure script, by K. Richard Pixley, and the gcc configure +script, by Richard Stallman. These use essentially the same approach, +and the developers communicated regularly. +@item +The autoconf program, by David MacKenzie. +@end itemize + +The Metaconfig program is still used for Perl and a few other programs. +It is part of the Dist package. I do not know if it is being developed. + +In 1994, David MacKenzie and others modified autoconf to incorporate all +the features of Cygnus configure. Since then, there has been a slow but +steady conversion of GNU programs from Cygnus configure to autoconf. gcc +has been converted, eliminating the gcc configure script. + +GNU autoconf was regularly maintained until late 1996. As of this +writing in June, 1998, it has no public maintainer. + +Most programs are built using the make program, which requires the +developer to write Makefiles describing how to build the programs. +Since most programs are built in pretty much the same way, this led to a +lot of duplication. + +The X Window system is built using the imake tool, which uses a database +of rules to eliminate the duplication. However, building a tool which +was developed using imake requires that the builder have imake +installed, violating one of the goals of the GNU system. + +The new BSD make provides a standard library of Makefile fragments, +which permits developers to write very simple Makefiles. However, this +requires that the builder install the new BSD make program. + +In 1994, David MacKenzie wrote the first version of automake, which +permitted writing a simple build description which was converted into a +Makefile which could be used by the standard make program. In 1995, Tom +Tromey completely rewrote automake in Perl, and he continues to enhance +it. + +Various free packages built libraries, and by around 1995 several +included support to build shared libraries on various platforms. +However, there was no consistent approach. In early 1996, Gordon +Matzigkeit began working on libtool, which provided a standardized +approach to building shared libraries. This was integrated into +automake from the start. + +The development of automake and libtool was driven by the GNITS project, +a group of GNU maintainers who designed standardized tools to help meet +the GNU coding standards. + +@node Building +@section Building + +Most readers of this document should already know how to build a tool by +running @samp{configure} and @samp{make}. This section may serve as a +quick introduction or reminder. + +Building a tool is normally as simple as running @samp{configure} +followed by @samp{make}. You should normally run @samp{configure} from +an empty directory, using some path to refer to the @samp{configure} +script in the source directory. The directory in which you run +@samp{configure} is called the @dfn{object directory}. + +In order to use a object directory which is different from the source +directory, you must be using the GNU version of @samp{make}, which has +the required @samp{VPATH} support. Despite this restriction, using a +different object directory is highly recommended: +@itemize @bullet +@item +It keeps the files generated during the build from cluttering up your +sources. +@item +It permits you to remove the built files by simply removing the entire +build directory. +@item +It permits you to build from the same sources with several sets of +configure options simultaneously. +@end itemize + +If you don't have GNU @samp{make}, you will have to run @samp{configure} +in the source directory. All GNU packages should support this; in +particular, GNU packages should not assume the presence of GNU +@samp{make}. + +After running @samp{configure}, you can build the tools by running +@samp{make}. + +To install the tools, run @samp{make install}. Installing the tools +will copy the programs and any required support files to the +@dfn{installation directory}. The location of the installation +directory is controlled by @samp{configure} options, as described below. + +In the Cygnus tree at present, the info files are built and installed as +a separate step. To build them, run @samp{make info}. To install them, +run @samp{make install-info}. + +All @samp{configure} scripts support a wide variety of options. The +most interesting ones are @samp{--with} and @samp{--enable} options +which are generally specific to particular tools. You can usually use +the @samp{--help} option to get a list of interesting options for a +particular configure script. + +The only generic options you are likely to use are the @samp{--prefix} +and @samp{--exec-prefix} options. These options are used to specify the +installation directory. + +The directory named by the @samp{--prefix} option will hold machine +independent files such as info files. + +The directory named by the @samp{--exec-prefix} option, which is +normally a subdirectory of the @samp{--prefix} directory, will hold +machine dependent files such as executables. + +The default for @samp{--prefix} is @file{/usr/local}. The default for +@samp{--exec-prefix} is the value used for @samp{--prefix}. + +The convention used in Cygnus releases is to use a @samp{--prefix} +option of @file{/usr/cygnus/@var{release}}, where @var{release} is the +name of the release, and to use a @samp{--exec-prefix} option of +@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is the +configuration name of the host system (@pxref{Configuration Names}). + +Do not use either the source or the object directory as the installation +directory. That will just lead to confusion. + +@node Getting Started +@chapter Getting Started + +To start using the GNU configure and build system with your software +package, you must write three files, and you must run some tools to +manually generate additional files. + +@menu +* Write configure.in:: Write configure.in. +* Write Makefile.am:: Write Makefile.am. +* Write acconfig.h:: Write acconfig.h. +* Generate files:: Generate files. +* Getting Started Example:: Example. +@end menu + +@node Write configure.in +@section Write configure.in +@cindex @file{configure.in}, writing + +You must first write the file @file{configure.in}. This is an autoconf +input file, and the autoconf manual describes in detail what this file +should look like. + +You will write tests in your @file{configure.in} file to check for +conditions that may change from one system to another, such as the +presence of particular header files or functions. + +For example, not all systems support the @samp{gettimeofday} function. +If you want to use the @samp{gettimeofday} function when it is +available, and to use some other function when it is not, you would +check for this by putting @samp{AC_CHECK_FUNCS(gettimeofday)} in +@file{configure.in}. + +When the configure script is run at build time, this will arrange to +define the preprocessor macro @samp{HAVE_GETTIMEOFDAY} to the value 1 if +the @samp{gettimeofday} function is available, and to not define the +macro at all if the function is not available. Your code can then use +@samp{#ifdef} to test whether it is safe to call @samp{gettimeofday}. + +If you have an existing body of code, the @samp{autoscan} program may +help identify potential portability problems, and hence configure tests +that you will want to use. +@ifnothtml +@xref{Invoking autoscan, , , autoconf, the autoconf manual}. +@end ifnothtml +@ifhtml +See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_4.html, the +autoscan documentation}. +@end ifhtml + +Another handy tool for an existing body of code is @samp{ifnames}. This +will show you all the preprocessor conditionals that the code already +uses. +@ifnothtml +@xref{Invoking ifnames, , , autoconf, the autoconf manual}. +@end ifnothtml +@ifhtml +See @uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_5.html, the +ifnames documentation}. +@end ifhtml + +Besides the portability tests which are specific to your particular +package, every @file{configure.in} file should contain the following +macros. + +@table @samp +@item AC_INIT +@cindex @samp{AC_INIT} +This macro takes a single argument, which is the name of a file in your +package. For example, @samp{AC_INIT(foo.c)}. + +@item AC_PREREQ(@var{VERSION}) +@cindex @samp{AC_PREREQ} +This macro is optional. It may be used to indicate the version of +@samp{autoconf} that you are using. This will prevent users from +running an earlier version of @samp{autoconf} and perhaps getting an +invalid @file{configure} script. For example, @samp{AC_PREREQ(2.12)}. + +@item AM_INIT_AUTOMAKE +@cindex @samp{AM_INIT_AUTOMAKE} +This macro takes two arguments: the name of the package, and a version +number. For example, @samp{AM_INIT_AUTOMAKE(foo, 1.0)}. (This macro is +not needed if you are not using automake). + +@item AM_CONFIG_HEADER +@cindex @samp{AM_CONFIG_HEADER} +This macro names the header file which will hold the preprocessor macro +definitions at run time. Normally this should be @file{config.h}. Your +sources would then use @samp{#include "config.h"} to include it. + +This macro may optionally name the input file for that header file; by +default, this is @file{config.h.in}, but that file name works poorly on +DOS filesystems. Therefore, it is often better to name it explicitly as +@file{config.in}. + +This is what you should normally put in @file{configure.in}: +@example +AM_CONFIG_HEADER(config.h:config.in) +@end example + +@cindex @samp{AC_CONFIG_HEADER} +(If you are not using automake, use @samp{AC_CONFIG_HEADER} rather than +@samp{AM_CONFIG_HEADER}). + +@item AM_MAINTAINER_MODE +@cindex @samp{AM_MAINTAINER_MODE} +This macro always appears in Cygnus configure scripts. Other programs +may or may not use it. + +If this macro is used, the @samp{--enable-maintainer-mode} option is +required to enable automatic rebuilding of generated files used by the +configure system. This of course requires that developers be aware of, +and use, that option. + +If this macro is not used, then the generated files will always be +rebuilt automatically. This will cause problems if the wrong versions +of autoconf, automake, or others are in the builder's @samp{PATH}. + +(If you are not using automake, you do not need to use this macro). + +@item AC_EXEEXT +@cindex @samp{AC_EXEEXT} +@cindex @samp{AM_EXEEXT} +Either this macro or @samp{AM_EXEEXT} always appears in Cygnus configure +files. Other programs may or may not use one of them. + +This macro looks for the executable suffix used on the host system. On +Unix systems, this is the empty string. On Windows systems, this is +@samp{.exe}. This macro directs automake to use the executable suffix +as appropriate when creating programs. This macro does not take any +arguments. + +The @samp{AC_EXEEXT} form is new, and is part of a Cygnus patch to +autoconf to support compiling with Visual C++. Older programs use +@samp{AM_EXEEXT} instead. + +(Programs which do not use automake use neither @samp{AC_EXEEXT} nor +@samp{AM_EXEEXT}). + +@item AC_PROG_CC +@cindex @samp{AC_PROG_CC} +If you are writing C code, you will normally want to use this macro. It +locates the C compiler to use. It does not take any arguments. + +However, if this @file{configure.in} file is for a library which is to +be compiled by a cross compiler which may not fully work, then you will +not want to use @samp{AC_PROG_CC}. Instead, you will want to use a +variant which does not call the macro @samp{AC_PROG_CC_WORKS}. Examples +can be found in various @file{configure.in} files for libraries that are +compiled with cross compilers, such as libiberty or libgloss. This is +essentially a bug in autoconf, and there will probably be a better +workaround at some point. + +@item AC_PROG_CXX +@cindex @samp{AC_PROG_CXX} +If you are writing C++ code, you will want to use this macro. It +locates the C++ compiler to use. It does not take any arguments. The +same cross compiler comments apply as for @samp{AC_PROG_CC}. + +@item AM_PROG_LIBTOOL +@cindex @samp{AM_PROG_LIBTOOL} +If you want to build libraries, and you want to permit them to be +shared, or you want to link against libraries which were built using +libtool, then you will need this macro. This macro is required in order +to use libtool. + +@cindex @samp{AM_DISABLE_SHARED} +By default, this will cause all libraries to be built as shared +libraries. To prevent this--to change the default--use +@samp{AM_DISABLE_SHARED} before @samp{AM_PROG_LIBTOOL}. The configure +options @samp{--enable-shared} and @samp{--disable-shared} may be used +to override the default at build time. + +@item AC_DEFINE(_GNU_SOURCE) +@cindex @samp{_GNU_SOURCE} +GNU packages should normally include this line before any other feature +tests. This defines the macro @samp{_GNU_SOURCE} when compiling, which +directs the libc header files to provide the standard GNU system +interfaces including all GNU extensions. If this macro is not defined, +certain GNU extensions may not be available. + +@item AC_OUTPUT +@cindex @samp{AC_OUTPUT} +This macro takes a list of file names which the configure process should +produce. This is normally a list of one or more @file{Makefile} files +in different directories. If your package lives entirely in a single +directory, you would use simply @samp{AC_OUTPUT(Makefile)}. If you also +have, for example, a @file{lib} subdirectory, you would use +@samp{AC_OUTPUT(Makefile lib/Makefile)}. +@end table + +If you want to use locally defined macros in your @file{configure.in} +file, then you will need to write a @file{acinclude.m4} file which +defines them (if not using automake, this file is called +@file{aclocal.m4}). Alternatively, you can put separate macros in an +@file{m4} subdirectory, and put @samp{ACLOCAL_AMFLAGS = -I m4} in your +@file{Makefile.am} file so that the @samp{aclocal} program will be able +to find them. + +The different macro prefixes indicate which tool defines the macro. +Macros which start with @samp{AC_} are part of autoconf. Macros which +start with @samp{AM_} are provided by automake or libtool. + +@node Write Makefile.am +@section Write Makefile.am +@cindex @file{Makefile.am}, writing + +You must write the file @file{Makefile.am}. This is an automake input +file, and the automake manual describes in detail what this file should +look like. + +The automake commands in @file{Makefile.am} mostly look like variable +assignments in a @file{Makefile}. automake recognizes special variable +names, and automatically add make rules to the output as needed. + +There will be one @file{Makefile.am} file for each directory in your +package. For each directory with subdirectories, the @file{Makefile.am} +file should contain the line +@smallexample +SUBDIRS = @var{dir} @var{dir} @dots{} +@end smallexample +@noindent +where each @var{dir} is the name of a subdirectory. + +For each @file{Makefile.am}, there should be a corresponding +@file{Makefile} in the @samp{AC_OUTPUT} macro in @file{configure.in}. + +Every @file{Makefile.am} written at Cygnus should contain the line +@smallexample +AUTOMAKE_OPTIONS = cygnus +@end smallexample +@noindent +This puts automake into Cygnus mode. See the automake manual for +details. + +You may to include the version number of @samp{automake} that you are +using on the @samp{AUTOMAKE_OPTIONS} line. For example, +@smallexample +AUTOMAKE_OPTIONS = cygnus 1.3 +@end smallexample +@noindent +This will prevent users from running an earlier version of +@samp{automake} and perhaps getting an invalid @file{Makefile.in}. + +If your package builds a program, then in the directory where that +program is built you will normally want a line like +@smallexample +bin_PROGRAMS = @var{program} +@end smallexample +@noindent +where @var{program} is the name of the program. You will then want a +line like +@smallexample +@var{program}_SOURCES = @var{file} @var{file} @dots{} +@end smallexample +@noindent +where each @var{file} is the name of a source file to link into the +program (e.g., @samp{foo.c}). + +If your package builds a library, and you do not want the library to +ever be built as a shared library, then in the directory where that +library is built you will normally want a line like +@smallexample +lib_LIBRARIES = lib@var{name}.a +@end smallexample +@noindent +where @samp{lib@var{name}.a} is the name of the library. You will then +want a line like +@smallexample +lib@var{name}_a_SOURCES = @var{file} @var{file} @dots{} +@end smallexample +@noindent +where each @var{file} is the name of a source file to add to the +library. + +If your package builds a library, and you want to permit building the +library as a shared library, then in the directory where that library is +built you will normally want a line like +@smallexample +lib_LTLIBRARIES = lib@var{name}.la +@end smallexample +The use of @samp{LTLIBRARIES}, and the @samp{.la} extension, indicate a +library to be built using libtool. As usual, you will then want a line +like +@smallexample +lib@var{name}_la_SOURCES = @var{file} @var{file} @dots{} +@end smallexample + +The strings @samp{bin} and @samp{lib} that appear above in +@samp{bin_PROGRAMS} and @samp{lib_LIBRARIES} are not arbitrary. They +refer to particular directories, which may be set by the @samp{--bindir} +and @samp{--libdir} options to @file{configure}. If those options are +not used, the default values are based on the @samp{--prefix} or +@samp{--exec-prefix} options to @file{configure}. It is possible to use +other names if the program or library should be installed in some other +directory. + +The @file{Makefile.am} file may also contain almost anything that may +appear in a normal @file{Makefile}. automake also supports many other +special variables, as well as conditionals. + +See the automake manual for more information. + +@node Write acconfig.h +@section Write acconfig.h +@cindex @file{acconfig.h}, writing + +If you are generating a portability header file, (i.e., you are using +@samp{AM_CONFIG_HEADER} in @file{configure.in}), then you will have to +write a @file{acconfig.h} file. It will have to contain the following +lines. + +@smallexample +/* Name of package. */ +#undef PACKAGE + +/* Version of package. */ +#undef VERSION +@end smallexample + +This requirement is really a bug in the system, and the requirement may +be eliminated at some later date. + +The @file{acconfig.h} file will also similar comment and @samp{#undef} +lines for any unusual macros in the @file{configure.in} file, including +any macro which appears in a @samp{AC_DEFINE} macro. + +In particular, if you are writing a GNU package and therefore include +@samp{AC_DEFINE(_GNU_SOURCE)} in @file{configure.in} as suggested above, +you will need lines like this in @file{acconfig.h}: +@smallexample +/* Enable GNU extensions. */ +#undef _GNU_SOURCE +@end smallexample + +Normally the @samp{autoheader} program will inform you of any such +requirements by printing an error message when it is run. However, if +you do anything particular odd in your @file{configure.in} file, you +will have to make sure that the right entries appear in +@file{acconfig.h}, since otherwise the results of the tests may not be +available in the @file{config.h} file which your code will use. + +(Thee @samp{PACKAGE} and @samp{VERSION} lines are not required if you +are not using automake, and in that case you may not need a +@file{acconfig.h} file at all). + +@node Generate files +@section Generate files + +Once you have written @file{configure.in}, @file{Makefile.am}, +@file{acconfig.h}, and possibly @file{acinclude.m4}, you must use +autoconf and automake programs to produce the first versions of the +generated files. This is done by executing the following sequence of +commands. + +@smallexample +aclocal +autoconf +autoheader +automake +@end smallexample + +The @samp{aclocal} and @samp{automake} commands are part of the automake +package, and the @samp{autoconf} and @samp{autoheader} commands are part +of the autoconf package. + +If you are using a @file{m4} subdirectory for your macros, you will need +to use the @samp{-I m4} option when you run @samp{aclocal}. + +If you are not using the Cygnus tree, use the @samp{-a} option when +running @samp{automake} command in order to copy the required support +files into your source directory. + +If you are using libtool, you must build and install the libtool package +with the same @samp{--prefix} and @samp{--exec-prefix} options as you +used with the autoconf and automake packages. You must do this before +running any of the above commands. If you are not using the Cygnus +tree, you will need to run the @samp{libtoolize} program to copy the +libtool support files into your directory. + +Once you have managed to run these commands without getting any errors, +you should create a new empty directory, and run the @samp{configure} +script which will have been created by @samp{autoconf} with the +@samp{--enable-maintainer-mode} option. This will give you a set of +Makefiles which will include rules to automatically rebuild all the +generated files. + +After doing that, whenever you have changed some of the input files and +want to regenerated the other files, go to your object directory and run +@samp{make}. Doing this is more reliable than trying to rebuild the +files manually, because there are complex order dependencies and it is +easy to forget something. + +@node Getting Started Example +@section Example + +Let's consider a trivial example. + +Suppose we want to write a simple version of @samp{touch}. Our program, +which we will call @samp{poke}, will take a single file name argument, +and use the @samp{utime} system call to set the modification and access +times of the file to the current time. We want this program to be +highly portable. + +We'll first see what this looks like without using autoconf and +automake, and then see what it looks like with them. + +@menu +* Getting Started Example 1:: First Try. +* Getting Started Example 2:: Second Try. +* Getting Started Example 3:: Third Try. +* Generate Files in Example:: Generate Files. +@end menu + +@node Getting Started Example 1 +@subsection First Try + +Here is our first try at @samp{poke.c}. Note that we've written it +without ANSI/ISO C prototypes, since we want it to be highly portable. + +@example +#include +#include +#include +#include + +int +main (argc, argv) + int argc; + char **argv; +@{ + if (argc != 2) + @{ + fprintf (stderr, "Usage: poke file\n"); + exit (1); + @} + + if (utime (argv[1], NULL) < 0) + @{ + perror ("utime"); + exit (1); + @} + + exit (0); +@} +@end example + +We also write a simple @file{Makefile}. + +@example +CC = gcc +CFLAGS = -g -O2 + +all: poke + +poke: poke.o + $(CC) -o poke $(CFLAGS) $(LDFLAGS) poke.o +@end example + +So far, so good. + +Unfortunately, there are a few problems. + +On older Unix systems derived from BSD 4.3, the @samp{utime} system call +does not accept a second argument of @samp{NULL}. On those systems, we +need to pass a pointer to @samp{struct utimbuf} structure. +Unfortunately, even older systems don't define that structure; on those +systems, we need to pass an array of two @samp{long} values. + +The header file @file{stdlib.h} was invented by ANSI C, and older +systems don't have a copy. We included it above to get a declaration of +@samp{exit}. + +We can find some of these portability problems by running +@samp{autoscan}, which will create a @file{configure.scan} file which we +can use as a prototype for our @file{configure.in} file. I won't show +the output, but it will notice the potential problems with @samp{utime} +and @file{stdlib.h}. + +In our @file{Makefile}, we don't provide any way to install the program. +This doesn't matter much for such a simple example, but a real program +will need an @samp{install} target. For that matter, we will also want +a @samp{clean} target. + +@node Getting Started Example 2 +@subsection Second Try + +Here is our second try at this program. + +We modify @file{poke.c} to use preprocessor macros to control what +features are available. (I've cheated a bit by using the same macro +names which autoconf will use). + +@example +#include + +#ifdef STDC_HEADERS +#include +#endif + +#include + +#ifdef HAVE_UTIME_H +#include +#endif + +#ifndef HAVE_UTIME_NULL + +#include + +#ifndef HAVE_STRUCT_UTIMBUF + +struct utimbuf +@{ + long actime; + long modtime; +@}; + +#endif + +static int +utime_now (file) + char *file; +@{ + struct utimbuf now; + + now.actime = now.modtime = time (NULL); + return utime (file, &now); +@} + +#define utime(f, p) utime_now (f) + +#endif /* HAVE_UTIME_NULL */ + +int +main (argc, argv) + int argc; + char **argv; +@{ + if (argc != 2) + @{ + fprintf (stderr, "Usage: poke file\n"); + exit (1); + @} + + if (utime (argv[1], NULL) < 0) + @{ + perror ("utime"); + exit (1); + @} + + exit (0); +@} +@end example + +Here is the associated @file{Makefile}. We've added support for the +preprocessor flags we use. We've also added @samp{install} and +@samp{clean} targets. + +@example +# Set this to your installation directory. +bindir = /usr/local/bin + +# Uncomment this if you have the standard ANSI/ISO C header files. +# STDC_HDRS = -DSTDC_HEADERS + +# Uncomment this if you have utime.h. +# UTIME_H = -DHAVE_UTIME_H + +# Uncomment this if utime (FILE, NULL) works on your system. +# UTIME_NULL = -DHAVE_UTIME_NULL + +# Uncomment this if struct utimbuf is defined in utime.h. +# UTIMBUF = -DHAVE_STRUCT_UTIMBUF + +CC = gcc +CFLAGS = -g -O2 + +ALL_CFLAGS = $(STDC_HDRS) $(UTIME_H) $(UTIME_NULL) $(UTIMBUF) $(CFLAGS) + +all: poke + +poke: poke.o + $(CC) -o poke $(ALL_CFLAGS) $(LDFLAGS) poke.o + +.c.o: + $(CC) -c $(ALL_CFLAGS) poke.c + +install: poke + cp poke $(bindir)/poke + +clean: + rm poke poke.o +@end example + +Some problems with this approach should be clear. + +Users who want to compile poke will have to know how @samp{utime} works +on their systems, so that they can uncomment the @file{Makefile} +correctly. + +The installation is done using @samp{cp}, but many systems have an +@samp{install} program which may be used, and which supports optional +features such as stripping debugging information out of the installed +binary. + +The use of @file{Makefile} variables like @samp{CC}, @samp{CFLAGS} and +@samp{LDFLAGS} follows the requirements of the GNU standards. This is +convenient for all packages, since it reduces surprises for users. +However, it is easy to get the details wrong, and wind up with a +slightly nonstandard distribution. + +@node Getting Started Example 3 +@subsection Third Try + +For our third try at this program, we will write a @file{configure.in} +script to discover the configuration features on the host system, rather +than requiring the user to edit the @file{Makefile}. We will also write +a @file{Makefile.am} rather than a @file{Makefile}. + +The only change to @file{poke.c} is to add a line at the start of the +file: +@smallexample +#include "config.h" +@end smallexample + +The new @file{configure.in} file is as follows. + +@example +AC_INIT(poke.c) +AM_INIT_AUTOMAKE(poke, 1.0) +AM_CONFIG_HEADER(config.h:config.in) +AC_PROG_CC +AC_HEADER_STDC +AC_CHECK_HEADERS(utime.h) +AC_EGREP_HEADER(utimbuf, utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF)) +AC_FUNC_UTIME_NULL +AC_OUTPUT(Makefile) +@end example + +The first four macros in this file, and the last one, were described +above; see @ref{Write configure.in}. If we omit these macros, then when +we run @samp{automake} we will get a reminder that we need them. + +The other macros are standard autoconf macros. + +@table @samp +@item AC_HEADER_STDC +Check for standard C headers. +@item AC_CHECK_HEADERS +Check whether a particular header file exists. +@item AC_EGREP_HEADER +Check for a particular string in a particular header file, in this case +checking for @samp{utimbuf} in @file{utime.h}. +@item AC_FUNC_UTIME_NULL +Check whether @samp{utime} accepts a NULL second argument to set the +file change time to the current time. +@end table + +See the autoconf manual for a more complete description. + +The new @file{Makefile.am} file is as follows. Note how simple this is +compared to our earlier @file{Makefile}. + +@example +bin_PROGRAMS = poke + +poke_SOURCES = poke.c +@end example + +This means that we should build a single program name @samp{poke}. It +should be installed in the binary directory, which we called +@samp{bindir} earlier. The program @samp{poke} is built from the source +file @file{poke.c}. + +We must also write a @file{acconfig.h} file. Besides @samp{PACKAGE} and +@samp{VERSION}, which must be mentioned for all packages which use +automake, we must include @samp{HAVE_STRUCT_UTIMBUF}, since we mentioned +it in an @samp{AC_DEFINE}. + +@example +/* Name of package. */ +#undef PACKAGE + +/* Version of package. */ +#undef VERSION + +/* Whether utime.h defines struct utimbuf. */ +#undef HAVE_STRUCT_UTIMBUF +@end example + +@node Generate Files in Example +@subsection Generate Files + +We must now generate the other files, using the following commands. + +@smallexample +aclocal +autoconf +autoheader +automake +@end smallexample + +When we run @samp{autoheader}, it will remind us of any macros we forgot +to add to @file{acconfig.h}. + +When we run @samp{automake}, it will want to add some files to our +distribution. It will add them automatically if we use the +@samp{--add-missing} option. + +By default, @samp{automake} will run in GNU mode, which means that it +will want us to create certain additional files; as of this writing, it +will want @file{NEWS}, @file{README}, @file{AUTHORS}, and +@file{ChangeLog}, all of which are files which should appear in a +standard GNU distribution. We can either add those files, or run +@samp{automake} with the @samp{--foreign} option. + +Running these tools will generate the following files, all of which are +described in the next chapter. + +@itemize @bullet +@item +@file{aclocal.m4} +@item +@file{configure} +@item +@file{config.in} +@item +@file{Makefile.in} +@item +@file{stamp-h.in} +@end itemize + +@node Files +@chapter Files + +As was seen in the previous chapter, the GNU configure and build system +uses a number of different files. The developer must write a few files. +The others are generated by various tools. + +The system is rather flexible, and can be used in many different ways. +In describing the files that it uses, I will describe the common case, +and mention some other cases that may arise. + +@menu +* Developer Files:: Developer Files. +* Build Files:: Build Files. +* Support Files:: Support Files. +@end menu + +@node Developer Files +@section Developer Files + +This section describes the files written or generated by the developer +of a package. + +@menu +* Developer Files Picture:: Developer Files Picture. +* Written Developer Files:: Written Developer Files. +* Generated Developer Files:: Generated Developer Files. +@end menu + +@node Developer Files Picture +@subsection Developer Files Picture + +Here is a picture of the files which are written by the developer, the +generated files which would be included with a complete source +distribution, and the tools which create those files. +@ifinfo +The file names are plain text and the tool names are enclosed by +@samp{*} characters +@end ifinfo +@ifnotinfo +The file names are in rectangles with square corners and the tool names +are in rectangles with rounded corners +@end ifnotinfo +(e.g., @samp{autoheader} is the name of a tool, not the name of a file). + +@image{configdev} + +@node Written Developer Files +@subsection Written Developer Files + +The following files would be written by the developer. + +@table @file +@item configure.in +@cindex @file{configure.in} +This is the configuration script. This script contains invocations of +autoconf macros. It may also contain ordinary shell script code. This +file will contain feature tests for portability issues. The last thing +in the file will normally be an @samp{AC_OUTPUT} macro listing which +files to create when the builder runs the configure script. This file +is always required when using the GNU configure system. @xref{Write +configure.in}. + +@item Makefile.am +@cindex @file{Makefile.am} +This is the automake input file. It describes how the code should be +built. It consists of definitions of automake variables. It may also +contain ordinary Makefile targets. This file is only needed when using +automake (newer tools normally use automake, but there are still older +tools which have not been converted, in which the developer writes +@file{Makefile.in} directly). @xref{Write Makefile.am}. + +@item acconfig.h +@cindex @file{acconfig.h} +When the configure script creates a portability header file, by using +@samp{AM_CONFIG_HEADER} (or, if not using automake, +@samp{AC_CONFIG_HEADER}), this file is used to describe macros which are +not recognized by the @samp{autoheader} command. This is normally a +fairly uninteresting file, consisting of a collection of @samp{#undef} +lines with comments. Normally any call to @samp{AC_DEFINE} in +@file{configure.in} will require a line in this file. @xref{Write +acconfig.h}. + +@item acinclude.m4 +@cindex @file{acinclude.m4} +This file is not always required. It defines local autoconf macros. +These macros may then be used in @file{configure.in}. If you don't need +any local autoconf macros, then you don't need this file at all. In +fact, in general, you never need local autoconf macros, since you can +put everything in @file{configure.in}, but sometimes a local macro is +convenient. + +Newer tools may omit @file{acinclude.m4}, and instead use a +subdirectory, typically named @file{m4}, and define +@samp{ACLOCAL_AMFLAGS = -I m4} in @file{Makefile.am} to force +@samp{aclocal} to look there for macro definitions. The macro +definitions are then placed in separate files in that directory. + +The @file{acinclude.m4} file is only used when using automake; in older +tools, the developer writes @file{aclocal.m4} directly, if it is needed. +@end table + +@node Generated Developer Files +@subsection Generated Developer Files + +The following files would be generated by the developer. + +When using automake, these files are normally not generated manually +after the first time. Instead, the generated @file{Makefile} contains +rules to automatically rebuild the files as required. When +@samp{AM_MAINTAINER_MODE} is used in @file{configure.in} (the normal +case in Cygnus code), the automatic rebuilding rules will only be +defined if you configure using the @samp{--enable-maintainer-mode} +option. + +When using automatic rebuilding, it is important to ensure that all the +various tools have been built and installed on your @samp{PATH}. Using +automatic rebuilding is highly recommended, so much so that I'm not +going to explain what you have to do if you don't use it. + +@table @file +@item configure +@cindex @file{configure} +This is the configure script which will be run when building the +package. This is generated by @samp{autoconf} from @file{configure.in} +and @file{aclocal.m4}. This is a shell script. + +@item Makefile.in +@cindex @file{Makefile.in} +This is the file which the configure script will turn into the +@file{Makefile} at build time. This file is generated by +@samp{automake} from @file{Makefile.am}. If you aren't using automake, +you must write this file yourself. This file is pretty much a normal +@file{Makefile}, with some configure substitutions for certain +variables. + +@item aclocal.m4 +@cindex @file{aclocal.m4} +This file is created by the @samp{aclocal} program, based on the +contents of @file{configure.in} and @file{acinclude.m4} (or, as noted in +the description of @file{acinclude.m4} above, on the contents of an +@file{m4} subdirectory). This file contains definitions of autoconf +macros which @samp{autoconf} will use when generating the file +@file{configure}. These autoconf macros may be defined by you in +@file{acinclude.m4} or they may be defined by other packages such as +automake, libtool or gettext. If you aren't using automake, you will +normally write this file yourself; in that case, if @file{configure.in} +uses only standard autoconf macros, this file will not be needed at all. + +@item config.in +@cindex @file{config.in} +@cindex @file{config.h.in} +This file is created by @samp{autoheader} based on @file{acconfig.h} and +@file{configure.in}. At build time, the configure script will define +some of the macros in it to create @file{config.h}, which may then be +included by your program. This permits your C code to use preprocessor +conditionals to change its behaviour based on the characteristics of the +host system. This file may also be called @file{config.h.in}. + +@item stamp.h-in +@cindex @file{stamp-h.in} +This rather uninteresting file, which I omitted from the picture, is +generated by @samp{automake}. It always contains the string +@samp{timestamp}. It is used as a timestamp file indicating whether +@file{config.in} is up to date. Using a timestamp file means that +@file{config.in} can be marked as up to date without actually changing +its modification time. This is useful since @file{config.in} depends +upon @file{configure.in}, but it is easy to change @file{configure.in} +in a way which does not affect @file{config.in}. +@end table + +@node Build Files +@section Build Files + +This section describes the files which are created at configure and +build time. These are the files which somebody who builds the package +will see. + +Of course, the developer will also build the package. The distinction +between developer files and build files is not that the developer does +not see the build files, but that somebody who only builds the package +does not have to worry about the developer files. + +@menu +* Build Files Picture:: Build Files Picture. +* Build Files Description:: Build Files Description. +@end menu + +@node Build Files Picture +@subsection Build Files Picture + +Here is a picture of the files which will be created at build time. +@file{config.status} is both a created file and a shell script which is +run to create other files, and the picture attempts to show that. + +@image{configbuild} + +@node Build Files Description +@subsection Build Files Description + +This is a description of the files which are created at build time. + +@table @file +@item config.status +@cindex @file{config.status} +The first step in building a package is to run the @file{configure} +script. The @file{configure} script will create the file +@file{config.status}, which is itself a shell script. When you first +run @file{configure}, it will automatically run @file{config.status}. +An @file{Makefile} derived from an automake generated @file{Makefile.in} +will contain rules to automatically run @file{config.status} again when +necessary to recreate certain files if their inputs change. + +@item Makefile +@cindex @file{Makefile} +This is the file which make will read to build the program. The +@file{config.status} script will transform @file{Makefile.in} into +@file{Makefile}. + +@item config.h +@cindex @file{config.h} +This file defines C preprocessor macros which C code can use to adjust +its behaviour on different systems. The @file{config.status} script +will transform @file{config.in} into @file{config.h}. + +@item config.cache +@cindex @file{config.cache} +This file did not fit neatly into the picture, and I omitted it. It is +used by the @file{configure} script to cache results between runs. This +can be an important speedup. If you modify @file{configure.in} in such +a way that the results of old tests should change (perhaps you have +added a new library to @samp{LDFLAGS}), then you will have to remove +@file{config.cache} to force the tests to be rerun. + +The autoconf manual explains how to set up a site specific cache file. +This can speed up running @file{configure} scripts on your system. + +@item stamp.h +@cindex @file{stamp-h} +This file, which I omitted from the picture, is similar to +@file{stamp-h.in}. It is used as a timestamp file indicating whether +@file{config.h} is up to date. This is useful since @file{config.h} +depends upon @file{config.status}, but it is easy for +@file{config.status} to change in a way which does not affect +@file{config.h}. +@end table + +@node Support Files +@section Support Files + +The GNU configure and build system requires several support files to be +included with your distribution. You do not normally need to concern +yourself with these. If you are using the Cygnus tree, most are already +present. Otherwise, they will be installed with your source by +@samp{automake} (with the @samp{--add-missing} option) and +@samp{libtoolize}. + +You don't have to put the support files in the top level directory. You +can put them in a subdirectory, and use the @samp{AC_CONFIG_AUX_DIR} +macro in @file{configure.in} to tell @samp{automake} and the +@file{configure} script where they are. + +In this section, I describe the support files, so that you can know what +they are and why they are there. + +@table @file +@item ABOUT-NLS +Added by automake if you are using gettext. This is a documentation +file about the gettext project. +@item ansi2knr.c +Used by an automake generated @file{Makefile} if you put @samp{ansi2knr} +in @samp{AUTOMAKE_OPTIONS} in @file{Makefile.am}. This permits +compiling ANSI C code with a K&R C compiler. +@item ansi2knr.1 +The man page which goes with @file{ansi2knr.c}. +@item config.guess +A shell script which determines the configuration name for the system on +which it is run. +@item config.sub +A shell script which canonicalizes a configuration name entered by a +user. +@item elisp-comp +Used to compile Emacs LISP files. +@item install-sh +A shell script which installs a program. This is used if the configure +script can not find an install binary. +@item ltconfig +Used by libtool. This is a shell script which configures libtool for +the particular system on which it is used. +@item ltmain.sh +Used by libtool. This is the actual libtool script which is used, after +it is configured by @file{ltconfig} to build a library. +@item mdate-sh +A shell script used by an automake generated @file{Makefile} to pretty +print the modification time of a file. This is used to maintain version +numbers for texinfo files. +@item missing +A shell script used if some tool is missing entirely. This is used by +an automake generated @file{Makefile} to avoid certain sorts of +timestamp problems. +@item mkinstalldirs +A shell script which creates a directory, including all parent +directories. This is used by an automake generated @file{Makefile} +during installation. +@item texinfo.tex +Required if you have any texinfo files. This is used when converting +Texinfo files into DVI using @samp{texi2dvi} and @TeX{}. +@item ylwrap +A shell script used by an automake generated @file{Makefile} to run +programs like @samp{bison}, @samp{yacc}, @samp{flex}, and @samp{lex}. +These programs default to producing output files with a fixed name, and +the @file{ylwrap} script runs them in a subdirectory to avoid file name +conflicts when using a parallel make program. +@end table + +@node Configuration Names +@chapter Configuration Names +@cindex configuration names +@cindex configuration triplets +@cindex triplets +@cindex host names +@cindex host triplets +@cindex canonical system names +@cindex system names +@cindex system types + +The GNU configure system names all systems using a @dfn{configuration +name}. All such names used to be triplets (they may now contain four +parts in certain cases), and the term @dfn{configuration triplet} is +still seen. + +@menu +* Configuration Name Definition:: Configuration Name Definition. +* Using Configuration Names:: Using Configuration Names. +@end menu + +@node Configuration Name Definition +@section Configuration Name Definition + +This is a string of the form +@var{cpu}-@var{manufacturer}-@var{operating_system}. In some cases, +this is extended to a four part form: +@var{cpu}-@var{manufacturer}-@var{kernel}-@var{operating_system}. + +When using a configuration name in a configure option, it is normally +not necessary to specify an entire name. In particular, the +@var{manufacturer} field is often omitted, leading to strings such as +@samp{i386-linux} or @samp{sparc-sunos}. The shell script +@file{config.sub} will translate these shortened strings into the +canonical form. autoconf will arrange for @file{config.sub} to be run +automatically when it is needed. + +The fields of a configuration name are as follows: + +@table @var +@item cpu +The type of processor. This is typically something like @samp{i386} or +@samp{sparc}. More specific variants are used as well, such as +@samp{mipsel} to indicate a little endian MIPS processor. +@item manufacturer +A somewhat freeform field which indicates the manufacturer of the +system. This is often simply @samp{unknown}. Other common strings are +@samp{pc} for an IBM PC compatible system, or the name of a workstation +vendor, such as @samp{sun}. +@item operating_system +The name of the operating system which is run on the system. This will +be something like @samp{solaris2.5} or @samp{irix6.3}. There is no +particular restriction on the version number, and strings like +@samp{aix4.1.4.0} are seen. For an embedded system, which has no +operating system, this field normally indicates the type of object file +format, such as @samp{elf} or @samp{coff}. +@item kernel +This is used mainly for GNU/Linux. A typical GNU/Linux configuration +name is @samp{i586-pc-linux-gnulibc1}. In this case the kernel, +@samp{linux}, is separated from the operating system, @samp{gnulibc1}. +@end table + +The shell script @file{config.guess} will normally print the correct +configuration name for the system on which it is run. It does by +running @samp{uname} and by examining other characteristics of the +system. + +Because @file{config.guess} can normally determine the configuration +name for a machine, it is normally only necessary to specify a +configuration name when building a cross-compiler or when building using +a cross-compiler. + +@node Using Configuration Names +@section Using Configuration Names + +A configure script will sometimes have to make a decision based on a +configuration name. You will need to do this if you have to compile +code differently based on something which can not be tested using a +standard autoconf feature test. + +It is normally better to test for particular features, rather than to +test for a particular system. This is because as Unix evolves, +different systems copy features from one another. Even if you need to +determine whether the feature is supported based on a configuration +name, you should define a macro which describes the feature, rather than +defining a macro which describes the particular system you are on. + +Testing for a particular system is normally done using a case statement +in @file{configure.in}. The case statement might look something like +the following, assuming that @samp{host} is a shell variable holding a +canonical configuration name (which will be the case if +@file{configure.in} uses the @samp{AC_CANONICAL_HOST} or +@samp{AC_CANONICAL_SYSTEM} macro). + +@smallexample +case "$@{host@}" in +i[3456]86-*-linux-gnu*) do something ;; +sparc*-sun-solaris2.[56789]*) do something ;; +sparc*-sun-solaris*) do something ;; +mips*-*-elf*) do something ;; +esac +@end smallexample + +It is particularly important to use @samp{*} after the operating system +field, in order to match the version number which will be generated by +@file{config.guess}. + +In most cases you must be careful to match a range of processor types. +For most processor families, a trailing @samp{*} suffices, as in +@samp{mips*} above. For the i386 family, something along the lines of +@samp{i[3456]86} suffices at present. For the m68k family, you will +need something like @samp{m68*}. Of course, if you do not need to match +on the processor, it is simpler to just replace the entire field by a +@samp{*}, as in @samp{*-*-irix*}. + +@node Cross Compilation Tools +@chapter Cross Compilation Tools +@cindex cross tools + +The GNU configure and build system can be used to build @dfn{cross +compilation} tools. A cross compilation tool is a tool which runs on +one system and produces code which runs on another system. + +@menu +* Cross Compilation Concepts:: Cross Compilation Concepts. +* Host and Target:: Host and Target. +* Using the Host Type:: Using the Host Type. +* Specifying the Target:: Specifying the Target. +* Using the Target Type:: Using the Target Type. +* Cross Tools in the Cygnus Tree:: Cross Tools in the Cygnus Tree +@end menu + +@node Cross Compilation Concepts +@section Cross Compilation Concepts + +@cindex cross compiler +A compiler which produces programs which run on a different system is a +cross compilation compiler, or simply a @dfn{cross compiler}. +Similarly, we speak of cross assemblers, cross linkers, etc. + +In the normal case, a compiler produces code which runs on the same +system as the one on which the compiler runs. When it is necessary to +distinguish this case from the cross compilation case, such a compiler +is called a @dfn{native compiler}. Similarly, we speak of native +assemblers, etc. + +Although the debugger is not strictly speaking a compilation tool, it is +nevertheless meaningful to speak of a cross debugger: a debugger which +is used to debug code which runs on another system. Everything that is +said below about configuring cross compilation tools applies to the +debugger as well. + +@node Host and Target +@section Host and Target +@cindex host system +@cindex target system + +When building cross compilation tools, there are two different systems +involved: the system on which the tools will run, and the system for +which the tools generate code. + +The system on which the tools will run is called the @dfn{host} system. + +The system for which the tools generate code is called the @dfn{target} +system. + +For example, suppose you have a compiler which runs on a GNU/Linux +system and generates ELF programs for a MIPS embedded system. In this +case the GNU/Linux system is the host, and the MIPS ELF system is the +target. Such a compiler could be called a GNU/Linux cross MIPS ELF +compiler, or, equivalently, a @samp{i386-linux-gnu} cross +@samp{mips-elf} compiler. + +Naturally, most programs are not cross compilation tools. For those +programs, it does not make sense to speak of a target. It only makes +sense to speak of a target for tools like @samp{gcc} or the +@samp{binutils} which actually produce running code. For example, it +does not make sense to speak of the target of a tool like @samp{bison} +or @samp{make}. + +Most cross compilation tools can also serve as native tools. For a +native compilation tool, it is still meaningful to speak of a target. +For a native tool, the target is the same as the host. For example, for +a GNU/Linux native compiler, the host is GNU/Linux, and the target is +also GNU/Linux. + +@node Using the Host Type +@section Using the Host Type + +In almost all cases the host system is the system on which you run the +@samp{configure} script, and on which you build the tools (for the case +when they differ, @pxref{Canadian Cross}). + +@cindex @samp{AC_CANONICAL_HOST} +If your configure script needs to know the configuration name of the +host system, and the package is not a cross compilation tool and +therefore does not have a target, put @samp{AC_CANONICAL_HOST} in +@file{configure.in}. This macro will arrange to define a few shell +variables when the @samp{configure} script is run. + +@table @samp +@item host +The canonical configuration name of the host. This will normally be +determined by running the @file{config.guess} shell script, although the +user is permitted to override this by using an explicit @samp{--host} +option. +@item host_alias +In the unusual case that the user used an explicit @samp{--host} option, +this will be the argument to @samp{--host}. In the normal case, this +will be the same as the @samp{host} variable. +@item host_cpu +@itemx host_vendor +@itemx host_os +The first three parts of the canonical configuration name. +@end table + +The shell variables may be used by putting shell code in +@file{configure.in}. For an example, see @ref{Using Configuration +Names}. + +@node Specifying the Target +@section Specifying the Target + +By default, the @samp{configure} script will assume that the target is +the same as the host. This is the more common case; for example, it +leads to a native compiler rather than a cross compiler. + +@cindex @samp{--target} option +@cindex target option +@cindex configure target +If you want to build a cross compilation tool, you must specify the +target explicitly by using the @samp{--target} option when you run +@samp{configure}. The argument to @samp{--target} is the configuration +name of the system for which you wish to generate code. +@xref{Configuration Names}. + +For example, to build tools which generate code for a MIPS ELF embedded +system, you would use @samp{--target mips-elf}. + +@node Using the Target Type +@section Using the Target Type + +@cindex @samp{AC_CANONICAL_SYSTEM} +When writing @file{configure.in} for a cross compilation tool, you will +need to use information about the target. To do this, put +@samp{AC_CANONICAL_SYSTEM} in @file{configure.in}. + +@samp{AC_CANONICAL_SYSTEM} will look for a @samp{--target} option and +canonicalize it using the @file{config.sub} shell script. It will also +run @samp{AC_CANONICAL_HOST} (@pxref{Using the Host Type}). + +The target type will be recorded in the following shell variables. Note +that the host versions of these variables will also be defined by +@samp{AC_CANONICAL_HOST}. + +@table @samp +@item target +The canonical configuration name of the target. +@item target_alias +The argument to the @samp{--target} option. If the user did not specify +a @samp{--target} option, this will be the same as @samp{host_alias}. +@item target_cpu +@itemx target_vendor +@itemx target_os +The first three parts of the canonical target configuration name. +@end table + +Note that if @samp{host} and @samp{target} are the same string, you can +assume a native configuration. If they are different, you can assume a +cross configuration. + +It is arguably possible for @samp{host} and @samp{target} to represent +the same system, but for the strings to not be identical. For example, +if @samp{config.guess} returns @samp{sparc-sun-sunos4.1.4}, and somebody +configures with @samp{--target sparc-sun-sunos4.1}, then the slight +differences between the two versions of SunOS may be unimportant for +your tool. However, in the general case it can be quite difficult to +determine whether the differences between two configuration names are +significant or not. Therefore, by convention, if the user specifies a +@samp{--target} option without specifying a @samp{--host} option, it is +assumed that the user wants to configure a cross compilation tool. + +The variables @samp{target} and @samp{target_alias} should be handled +differently. + +In general, whenever the user may actually see a string, +@samp{target_alias} should be used. This includes anything which may +appear in the file system, such as a directory name or part of a tool +name. It also includes any tool output, unless it is clearly labelled +as the canonical target configuration name. This permits the user to +use the @samp{--target} option to specify how the tool will appear to +the outside world. + +On the other hand, when checking for characteristics of the target +system, @samp{target} should be used. This is because a wide variety of +@samp{--target} options may map into the same canonical configuration +name. You should not attempt to duplicate the canonicalization done by +@samp{config.sub} in your own code. + +By convention, cross tools are installed with a prefix of the argument +used with the @samp{--target} option, also known as @samp{target_alias} +(@pxref{Using the Target Type}). If the user does not use the +@samp{--target} option, and thus is building a native tool, no prefix is +used. + +For example, if gcc is configured with @samp{--target mips-elf}, then +the installed binary will be named @samp{mips-elf-gcc}. If gcc is +configured without a @samp{--target} option, then the installed binary +will be named @samp{gcc}. + +The autoconf macro @samp{AC_ARG_PROGRAM} will handle this for you. If +you are using automake, no more need be done; the programs will +automatically be installed with the correct prefixes. Otherwise, see +the autoconf documentation for @samp{AC_ARG_PROGRAM}. + +@node Cross Tools in the Cygnus Tree +@section Cross Tools in the Cygnus Tree + +The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. + +In the Cygnus tree, the top level @file{configure} script uses the old +Cygnus configure system, not autoconf. The top level @file{Makefile.in} +is written to build packages based on what is in the source tree, and +supports building a large number of tools in a single +@samp{configure}/@samp{make} step. + +The Cygnus tree may be configured with a @samp{--target} option. The +@samp{--target} option applies recursively to every subdirectory, and +permits building an entire set of cross tools at once. + +@menu +* Host and Target Libraries:: Host and Target Libraries. +* Target Library Configure Scripts:: Target Library Configure Scripts. +* Make Targets in Cygnus Tree:: Make Targets in Cygnus Tree. +* Target libiberty:: Target libiberty +@end menu + +@node Host and Target Libraries +@subsection Host and Target Libraries + +The Cygnus tree distinguishes host libraries from target libraries. + +Host libraries are built with the compiler used to build the programs +which run on the host, which is called the host compiler. This includes +libraries such as @samp{bfd} and @samp{tcl}. These libraries are built +with the host compiler, and are linked into programs like the binutils +or gcc which run on the host. + +Target libraries are built with the target compiler. If gcc is present +in the source tree, then the target compiler is the gcc that is built +using the host compiler. Target libraries are libraries such as +@samp{newlib} and @samp{libstdc++}. These libraries are not linked into +the host programs, but are instead made available for use with programs +built with the target compiler. + +For the rest of this section, assume that gcc is present in the source +tree, so that it will be used to build the target libraries. + +There is a complication here. The configure process needs to know which +compiler you are going to use to build a tool; otherwise, the feature +tests will not work correctly. The Cygnus tree handles this by not +configuring the target libraries until the target compiler is built. In +order to permit everything to build using a single +@samp{configure}/@samp{make}, the configuration of the target libraries +is actually triggered during the make step. + +When the target libraries are configured, the @samp{--target} option is +not used. Instead, the @samp{--host} option is used with the argument +of the @samp{--target} option for the overall configuration. If no +@samp{--target} option was used for the overall configuration, the +@samp{--host} option will be passed with the output of the +@file{config.guess} shell script. Any @samp{--build} option is passed +down unchanged. + +This translation of configuration options is done because since the +target libraries are compiled with the target compiler, they are being +built in order to run on the target of the overall configuration. By +the definition of host, this means that their host system is the same as +the target system of the overall configuration. + +The same process is used for both a native configuration and a cross +configuration. Even when using a native configuration, the target +libraries will be configured and built using the newly built compiler. +This is particularly important for the C++ libraries, since there is no +reason to assume that the C++ compiler used to build the host tools (if +there even is one) uses the same ABI as the g++ compiler which will be +used to build the target libraries. + +There is one difference between a native configuration and a cross +configuration. In a native configuration, the target libraries are +normally configured and built as siblings of the host tools. In a cross +configuration, the target libraries are normally built in a subdirectory +whose name is the argument to @samp{--target}. This is mainly for +historical reasons. + +To summarize, running @samp{configure} in the Cygnus tree configures all +the host libraries and tools, but does not configure any of the target +libraries. Running @samp{make} then does the following steps: + +@itemize @bullet +@item +Build the host libraries. +@item +Build the host programs, including gcc. Note that we call gcc both a +host program (since it runs on the host) and a target compiler (since it +generates code for the target). +@item +Using the newly built target compiler, configure the target libraries. +@item +Build the target libraries. +@end itemize + +The steps need not be done in precisely this order, since they are +actually controlled by @file{Makefile} targets. + +@node Target Library Configure Scripts +@subsection Target Library Configure Scripts + +There are a few things you must know in order to write a configure +script for a target library. This is just a quick sketch, and beginners +shouldn't worry if they don't follow everything here. + +The target libraries are configured and built using a newly built target +compiler. There may not be any startup files or libraries for this +target compiler. In fact, those files will probably be built as part of +some target library, which naturally means that they will not exist when +your target library is configured. + +This means that the configure script for a target library may not use +any test which requires doing a link. This unfortunately includes many +useful autoconf macros, such as @samp{AC_CHECK_FUNCS}. autoconf macros +which do a compile but not a link, such as @samp{AC_CHECK_HEADERS}, may +be used. + +This is a severe restriction, but normally not a fatal one, as target +libraries can often assume the presence of other target libraries, and +thus know which functions will be available. + +As of this writing, the autoconf macro @samp{AC_PROG_CC} does a link to +make sure that the compiler works. This may fail in a target library, +so target libraries must use a different set of macros to locate the +compiler. See the @file{configure.in} file in a directory like +@file{libiberty} or @file{libgloss} for an example. + +As noted in the previous section, target libraries are sometimes built +in directories which are siblings to the host tools, and are sometimes +built in a subdirectory. The @samp{--with-target-subdir} configure +option will be passed when the library is configured. Its value will be +an empty string if the target library is a sibling. Its value will be +the name of the subdirectory if the target library is in a subdirectory. + +If the overall build is not a native build (i.e., the overall configure +used the @samp{--target} option), then the library will be configured +with the @samp{--with-cross-host} option. The value of this option will +be the host system of the overall build. Recall that the host system of +the library will be the target of the overall build. If the overall +build is a native build, the @samp{--with-cross-host} option will not be +used. + +A library which can be built both standalone and as a target library may +want to install itself into different directories depending upon the +case. When built standalone, or when built native, the library should +be installed in @samp{$(libdir)}. When built as a target library which +is not native, the library should be installed in @samp{$(tooldir)/lib}. +The @samp{--with-cross-host} option may be used to distinguish these +cases. + +This same test of @samp{--with-cross-host} may be used to see whether it +is OK to use link tests in the configure script. If the +@samp{--with-cross-host} option is not used, then the library is being +built either standalone or native, and a link should work. + +@node Make Targets in Cygnus Tree +@subsection Make Targets in Cygnus Tree + +The top level @file{Makefile} in the Cygnus tree defines targets for +every known subdirectory. + +For every subdirectory @var{dir} which holds a host library or program, +the @file{Makefile} target @samp{all-@var{dir}} will build that library +or program. + +There are dependencies among host tools. For example, building gcc +requires first building gas, because the gcc build process invokes the +target assembler. These dependencies are reflected in the top level +@file{Makefile}. + +For every subdirectory @var{dir} which holds a target library, the +@file{Makefile} target @samp{configure-target-@var{dir}} will configure +that library. The @file{Makefile} target @samp{all-target-@var{dir}} +will build that library. + +Every @samp{configure-target-@var{dir}} target depends upon +@samp{all-gcc}, since gcc, the target compiler, is required to configure +the tool. Every @samp{all-target-@var{dir}} target depends upon the +corresponding @samp{configure-target-@var{dir}} target. + +There are several other targets which may be of interest for each +directory: @samp{install-@var{dir}}, @samp{clean-@var{dir}}, and +@samp{check-@var{dir}}. There are also corresponding @samp{target} +versions of these for the target libraries , such as +@samp{install-target-@var{dir}}. + +@node Target libiberty +@subsection Target libiberty + +The @file{libiberty} subdirectory is currently a special case, in that +it is the only directory which is built both using the host compiler and +using the target compiler. + +This is because the files in @file{libiberty} are used when building the +host tools, and they are also incorporated into the @file{libstdc++} +target library as support code. + +This duality does not pose any particular difficulties. It means that +there are targets for both @samp{all-libiberty} and +@samp{all-target-libiberty}. + +In a native configuration, when target libraries are not built in a +subdirectory, the same objects are normally used as both the host build +and the target build. This is normally OK, since libiberty contains +only C code, and in a native configuration the results of the host +compiler and the target compiler are normally interoperable. + +Irix 6 is again an exception here, since the SGI native compiler +defaults to using the @samp{O32} ABI, and gcc defaults to using the +@samp{N32} ABI. On Irix 6, the target libraries are built in a +subdirectory even for a native configuration, avoiding this problem. + +There are currently no other libraries built for both the host and the +target, but there is no conceptual problem with adding more. + +@node Canadian Cross +@chapter Canadian Cross +@cindex canadian cross +@cindex building with a cross compiler +@cindex cross compiler, building with + +It is possible to use the GNU configure and build system to build a +program which will run on a system which is different from the system on +which the tools are built. In other words, it is possible to build +programs using a cross compiler. + +This is referred to as a @dfn{Canadian Cross}. + +@menu +* Canadian Cross Example:: Canadian Cross Example. +* Canadian Cross Concepts:: Canadian Cross Concepts. +* Build Cross Host Tools:: Build Cross Host Tools. +* Build and Host Options:: Build and Host Options. +* CCross not in Cygnus Tree:: Canadian Cross not in Cygnus Tree. +* CCross in Cygnus Tree:: Canadian Cross in Cygnus Tree. +* Supporting Canadian Cross:: Supporting Canadian Cross. +@end menu + +@node Canadian Cross Example +@section Canadian Cross Example + +Here is an example of a Canadian Cross. + +While running on a GNU/Linux, you can build a program which will run on +a Solaris system. You would use a GNU/Linux cross Solaris compiler to +build the program. + +Of course, you could not run the resulting program on your GNU/Linux +system. You would have to copy it over to a Solaris system before you +would run it. + +Of course, you could also simply build the programs on the Solaris +system in the first place. However, perhaps the Solaris system is not +available for some reason; perhaps you actually don't have one, but you +want to build the tools for somebody else to use. Or perhaps your +GNU/Linux system is much faster than your Solaris system. + +A Canadian Cross build is most frequently used when building programs to +run on a non-Unix system, such as DOS or Windows. It may be simpler to +configure and build on a Unix system than to support the configuration +machinery on a non-Unix system. + +@node Canadian Cross Concepts +@section Canadian Cross Concepts + +When building a Canadian Cross, there are at least two different systems +involved: the system on which the tools are being built, and the system +on which the tools will run. + +The system on which the tools are being built is called the @dfn{build} +system. + +The system on which the tools will run is called the host system. + +For example, if you are building a Solaris program on a GNU/Linux +system, as in the previous section, the build system would be GNU/Linux, +and the host system would be Solaris. + +It is, of course, possible to build a cross compiler using a Canadian +Cross (i.e., build a cross compiler using a cross compiler). In this +case, the system for which the resulting cross compiler generates code +is called the target system. (For a more complete discussion of host +and target systems, @pxref{Host and Target}). + +An example of building a cross compiler using a Canadian Cross would be +building a Windows cross MIPS ELF compiler on a GNU/Linux system. In +this case the build system would be GNU/Linux, the host system would be +Windows, and the target system would be MIPS ELF. + +The name Canadian Cross comes from the case when the build, host, and +target systems are all different. At the time that these issues were +all being hashed out, Canada had three national political parties. + +@node Build Cross Host Tools +@section Build Cross Host Tools + +In order to configure a program for a Canadian Cross build, you must +first build and install the set of cross tools you will use to build the +program. + +These tools will be build cross host tools. That is, they will run on +the build system, and will produce code that runs on the host system. + +It is easy to confuse the meaning of build and host here. Always +remember that the build system is where you are doing the build, and the +host system is where the resulting program will run. Therefore, you +need a build cross host compiler. + +In general, you must have a complete cross environment in order to do +the build. This normally means a cross compiler, cross assembler, and +so forth, as well as libraries and include files for the host system. + +@node Build and Host Options +@section Build and Host Options +@cindex configuring a canadian cross +@cindex canadian cross, configuring + +When you run @file{configure}, you must use both the @samp{--build} and +@samp{--host} options. + +@cindex @samp{--build} option +@cindex build option +@cindex configure build system +The @samp{--build} option is used to specify the configuration name of +the build system. This can normally be the result of running the +@file{config.guess} shell script, and it is reasonable to use +@samp{--build=`config.guess`}. + +@cindex @samp{--host} option +@cindex host option +@cindex configure host +The @samp{--host} option is used to specify the configuration name of +the host system. + +As we explained earlier, @file{config.guess} is used to set the default +value for the @samp{--host} option (@pxref{Using the Host Type}). We +can now see that since @file{config.guess} returns the type of system on +which it is run, it really identifies the build system. Since the host +system is normally the same as the build system (i.e., people do not +normally build using a cross compiler), it is reasonable to use the +result of @file{config.guess} as the default for the host system when +the @samp{--host} option is not used. + +It might seem that if the @samp{--host} option were used without the +@samp{--build} option that the configure script could run +@file{config.guess} to determine the build system, and presume a +Canadian Cross if the result of @file{config.guess} differed from the +@samp{--host} option. However, for historical reasons, some configure +scripts are routinely run using an explicit @samp{--host} option, rather +than using the default from @file{config.guess}. As noted earlier, it +is difficult or impossible to reliably compare configuration names +(@pxref{Using the Target Type}). Therefore, by convention, if the +@samp{--host} option is used, but the @samp{--build} option is not used, +then the build system defaults to the host system. + +@node CCross not in Cygnus Tree +@section Canadian Cross not in Cygnus Tree. + +If you are not using the Cygnus tree, you must explicitly specify the +cross tools which you want to use to build the program. This is done by +setting environment variables before running the @file{configure} +script. + +You must normally set at least the environment variables @samp{CC}, +@samp{AR}, and @samp{RANLIB} to the cross tools which you want to use to +build. + +For some programs, you must set additional cross tools as well, such as +@samp{AS}, @samp{LD}, or @samp{NM}. + +You would set these environment variables to the build cross tools which +you are going to use. + +For example, if you are building a Solaris program on a GNU/Linux +system, and your GNU/Linux cross Solaris compiler were named +@samp{solaris-gcc}, then you would set the environment variable +@samp{CC} to @samp{solaris-gcc}. + +@node CCross in Cygnus Tree +@section Canadian Cross in Cygnus Tree +@cindex canadian cross in cygnus tree + +This section describes configuring and building a Canadian Cross when +using the Cygnus tree. + +@menu +* Standard Cygnus CCross:: Building a Normal Program. +* Cross Cygnus CCross:: Building a Cross Program. +@end menu + +@node Standard Cygnus CCross +@subsection Building a Normal Program + +When configuring a Canadian Cross in the Cygnus tree, all the +appropriate environment variables are automatically set to +@samp{@var{host}-@var{tool}}, where @var{host} is the value used for the +@samp{--host} option, and @var{tool} is the name of the tool (e.g., +@samp{gcc}, @samp{as}, etc.). These tools must be on your @samp{PATH}. + +Adding a prefix of @var{host} will give the usual name for the build +cross host tools. To see this, consider that when these cross tools +were built, they were configured to run on the build system and to +produce code for the host system. That is, they were configured with a +@samp{--target} option that is the same as the system which we are now +calling the host. Recall that the default name for installed cross +tools uses the target system as a prefix (@pxref{Using the Target +Type}). Since that is the system which we are now calling the host, +@var{host} is the right prefix to use. + +For example, if you configure with @samp{--build=i386-linux-gnu} and +@samp{--host=solaris}, then the Cygnus tree will automatically default +to using the compiler @samp{solaris-gcc}. You must have previously +built and installed this compiler, probably by doing a build with no +@samp{--host} option and with a @samp{--target} option of +@samp{solaris}. + +@node Cross Cygnus CCross +@subsection Building a Cross Program + +There are additional considerations if you want to build a cross +compiler, rather than a native compiler, in the Cygnus tree using a +Canadian Cross. + +When you build a cross compiler using the Cygnus tree, then the target +libraries will normally be built with the newly built target compiler +(@pxref{Host and Target Libraries}). However, this will not work when +building with a Canadian Cross. This is because the newly built target +compiler will be a program which runs on the host system, and therefore +will not be able to run on the build system. + +Therefore, when building a cross compiler with the Cygnus tree, you must +first install a set of build cross target tools. These tools will be +used when building the target libraries. + +Note that this is not a requirement of a Canadian Cross in general. For +example, it would be possible to build just the host cross target tools +on the build system, to copy the tools to the host system, and to build +the target libraries on the host system. The requirement for build +cross target tools is imposed by the Cygnus tree, which expects to be +able to build both host programs and target libraries in a single +@samp{configure}/@samp{make} step. Because it builds these in a single +step, it expects to be able to build the target libraries on the build +system, which means that it must use a build cross target toolchain. + +For example, suppose you want to build a Windows cross MIPS ELF compiler +on a GNU/Linux system. You must have previously installed both a +GNU/Linux cross Windows compiler and a GNU/Linux cross MIPS ELF +compiler. + +In order to build the Windows (configuration name @samp{i386-cygwin32}) +cross MIPS ELF (configure name @samp{mips-elf}) compiler, you might +execute the following commands (long command lines are broken across +lines with a trailing backslash as a continuation character). + +@example +mkdir linux-x-cygwin32 +cd linux-x-cygwin32 +@var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} \ + --exec-prefix=@var{installdir}/H-i386-linux +make +make install +cd .. +mkdir linux-x-mips-elf +cd linux-x-mips-elf +@var{srcdir}/configure --target mips-elf --prefix=@var{installdir} \ + --exec-prefix=@var{installdir}/H-i386-linux +make +make install +cd .. +mkdir cygwin32-x-mips-elf +cd cygwin32-x-mips-elf +@var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \ + --target=mips-elf --prefix=@var{wininstalldir} \ + --exec-prefix=@var{wininstalldir}/H-i386-cygwin32 +make +make install +@end example + +You would then copy the contents of @var{wininstalldir} over to the +Windows machine, and run the resulting programs. + +@node Supporting Canadian Cross +@section Supporting Canadian Cross + +If you want to make it possible to build a program you are developing +using a Canadian Cross, you must take some care when writing your +configure and make rules. Simple cases will normally work correctly. +However, it is not hard to write configure and make tests which will +fail in a Canadian Cross. + +@menu +* CCross in Configure:: Supporting Canadian Cross in Configure Scripts. +* CCross in Make:: Supporting Canadian Cross in Makefiles. +@end menu + +@node CCross in Configure +@subsection Supporting Canadian Cross in Configure Scripts +@cindex canadian cross in configure + +In a @file{configure.in} file, after calling @samp{AC_PROG_CC}, you can +find out whether this is a Canadian Cross configure by examining the +shell variable @samp{cross_compiling}. In a Canadian Cross, which means +that the compiler is a cross compiler, @samp{cross_compiling} will be +@samp{yes}. In a normal configuration, @samp{cross_compiling} will be +@samp{no}. + +You ordinarily do not need to know the type of the build system in a +configure script. However, if you do need that information, you can get +it by using the macro @samp{AC_CANONICAL_SYSTEM}, the same macro that is +used to determine the target system. This macro will set the variables +@samp{build}, @samp{build_alias}, @samp{build_cpu}, @samp{build_vendor}, +and @samp{build_os}, which correspond to the similar @samp{target} and +@samp{host} variables, except that they describe the build system. + +When writing tests in @file{configure.in}, you must remember that you +want to test the host environment, not the build environment. + +Macros like @samp{AC_CHECK_FUNCS} which use the compiler will test the +host environment. That is because the tests will be done by running the +compiler, which is actually a build cross host compiler. If the +compiler can find the function, that means that the function is present +in the host environment. + +Tests like @samp{test -f /dev/ptyp0}, on the other hand, will test the +build environment. Remember that the configure script is running on the +build system, not the host system. If your configure scripts examines +files, those files will be on the build system. Whatever you determine +based on those files may or may not be the case on the host system. + +Most autoconf macros will work correctly for a Canadian Cross. The main +exception is @samp{AC_TRY_RUN}. This macro tries to compile and run a +test program. This will fail in a Canadian Cross, because the program +will be compiled for the host system, which means that it will not run +on the build system. + +The @samp{AC_TRY_RUN} macro provides an optional argument to tell the +configure script what to do in a Canadian Cross. If that argument is +not present, you will get a warning when you run @samp{autoconf}: +@smallexample +warning: AC_TRY_RUN called without default to allow cross compiling +@end smallexample +@noindent +This tells you that the resulting @file{configure} script will not work +with a Canadian Cross. + +In some cases while it may better to perform a test at configure time, +it is also possible to perform the test at run time. In such a case you +can use the cross compiling argument to @samp{AC_TRY_RUN} to tell your +program that the test could not be performed at configure time. + +There are a few other autoconf macros which will not work correctly with +a Canadian Cross: a partial list is @samp{AC_FUNC_GETPGRP}, +@samp{AC_FUNC_SETPGRP}, @samp{AC_FUNC_SETVBUF_REVERSED}, and +@samp{AC_SYS_RESTARTABLE_SYSCALLS}. The @samp{AC_CHECK_SIZEOF} macro is +generally not very useful with a Canadian Cross; it permits an optional +argument indicating the default size, but there is no way to know what +the correct default should be. + +@node CCross in Make +@subsection Supporting Canadian Cross in Makefiles. +@cindex canadian cross in makefile + +The main Canadian Cross issue in a @file{Makefile} arises when you want +to use a subsidiary program to generate code or data which you will then +include in your real program. + +If you compile this subsidiary program using @samp{$(CC)} in the usual +way, you will not be able to run it. This is because @samp{$(CC)} will +build a program for the host system, but the program is being built on +the build system. + +You must instead use a compiler for the build system, rather than the +host system. In the Cygnus tree, this make variable +@samp{$(CC_FOR_BUILD)} will hold a compiler for the build system. + +Note that you should not include @file{config.h} in a file you are +compiling with @samp{$(CC_FOR_BUILD)}. The @file{configure} script will +build @file{config.h} with information for the host system. However, +you are compiling the file using a compiler for the build system (a +native compiler). Subsidiary programs are normally simple filters which +do no user interaction, and it is normally possible to write them in a +highly portable fashion so that the absence of @file{config.h} is not +crucial. + +@cindex @samp{HOST_CC} +The gcc @file{Makefile.in} shows a complex situation in which certain +files, such as @file{rtl.c}, must be compiled into both subsidiary +programs run on the build system and into the final program. This +approach may be of interest for advanced build system hackers. Note +that the build system compiler is rather confusingly called +@samp{HOST_CC}. + +@node Cygnus Configure +@chapter Cygnus Configure +@cindex cygnus configure + +The Cygnus configure script predates autoconf. All of its interesting +features have been incorporated into autoconf. No new programs should +be written to use the Cygnus configure script. + +However, the Cygnus configure script is still used in a few places: at +the top of the Cygnus tree and in a few target libraries in the Cygnus +tree. Until those uses have been replaced with autoconf, some brief +notes are appropriate here. This is not complete documentation, but it +should be possible to use this as a guide while examining the scripts +themselves. + +@menu +* Cygnus Configure Basics:: Cygnus Configure Basics. +* Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries. +@end menu + +@node Cygnus Configure Basics +@section Cygnus Configure Basics + +Cygnus configure does not use any generated files; there is no program +corresponding to @samp{autoconf}. Instead, there is a single shell +script named @samp{configure} which may be found at the top of the +Cygnus tree. This shell script was written by hand; it was not +generated by autoconf, and it is incorrect, and indeed harmful, to run +@samp{autoconf} in the top level of a Cygnus tree. + +Cygnus configure works in a particular directory by examining the file +@file{configure.in} in that directory. That file is broken into four +separate shell scripts. + +The first is the contents of @file{configure.in} up to a line that +starts with @samp{# per-host:}. This is the common part. + +The second is the rest of @file{configure.in} up to a line that starts +with @samp{# per-target:}. This is the per host part. + +The third is the rest of @file{configure.in} up to a line that starts +with @samp{# post-target:}. This is the per target part. + +The fourth is the remainder of @file{configure.in}. This is the post +target part. + +If any of these comment lines are missing, the corresponding shell +script is empty. + +Cygnus configure will first execute the common part. This must set the +shell variable @samp{srctrigger} to the name of a source file, to +confirm that Cygnus configure is looking at the right directory. This +may set the shell variables @samp{package_makefile_frag} and +@samp{package_makefile_rules_frag}. + +Cygnus configure will next set the @samp{build} and @samp{host} shell +variables, and execute the per host part. This may set the shell +variable @samp{host_makefile_frag}. + +Cygnus configure will next set the @samp{target} variable, and execute +the per target part. This may set the shell variable +@samp{target_makefile_frag}. + +Any of these scripts may set the @samp{subdirs} shell variable. This +variable is a list of subdirectories where a @file{Makefile.in} file may +be found. Cygnus configure will automatically look for a +@file{Makefile.in} file in the current directory. The @samp{subdirs} +shell variable is not normally used, and I believe that the only +directory which uses it at present is @file{newlib}. + +For each @file{Makefile.in}, Cygnus configure will automatically create +a @file{Makefile} by adding definitions for @samp{make} variables such +as @samp{host} and @samp{target}, and automatically editing the values +of @samp{make} variables such as @samp{prefix} if they are present. + +Also, if any of the @samp{makefile_frag} shell variables are set, Cygnus +configure will interpret them as file names relative to either the +working directory or the source directory, and will read the contents of +the file into the generated @file{Makefile}. The file contents will be +read in after the first line in @file{Makefile.in} which starts with +@samp{####}. + +These @file{Makefile} fragments are used to customize behaviour for a +particular host or target. They serve to select particular files to +compile, and to define particular preprocessor macros by providing +values for @samp{make} variables which are then used during compilation. +Cygnus configure, unlike autoconf, normally does not do feature tests, +and normally requires support to be added manually for each new host. + +The @file{Makefile} fragment support is similar to the autoconf +@samp{AC_SUBST_FILE} macro. + +After creating each @file{Makefile}, the post target script will be run +(i.e., it may be run several times). This script may further customize +the @file{Makefile}. When it is run, the shell variable @samp{Makefile} +will hold the name of the @file{Makefile}, including the appropriate +directory component. + +Like an autoconf generated @file{configure} script, Cygnus configure +will create a file named @file{config.status} which, when run, will +automatically recreate the configuration. The @file{config.status} file +will simply execute the Cygnus configure script again with the +appropriate arguments. + +Any of the parts of @file{configure.in} may set the shell variables +@samp{files} and @samp{links}. Cygnus configure will set up symlinks +from the names in @samp{links} to the files named in @samp{files}. This +is similar to the autoconf @samp{AC_LINK_FILES} macro. + +Finally, any of the parts of @file{configure.in} may set the shell +variable @samp{configdirs} to a set of subdirectories. If it is set, +Cygnus configure will recursively run the configure process in each +subdirectory. If the subdirectory uses Cygnus configure, it will +contain a @file{configure.in} file but no @file{configure} file, in +which case Cygnus configure will invoke itself recursively. If the +subdirectory has a @file{configure} file, Cygnus configure assumes that +it is an autoconf generated @file{configure} script, and simply invokes +it directly. + +@node Cygnus Configure in C++ Libraries +@section Cygnus Configure in C++ Libraries +@cindex @file{libstdc++} configure +@cindex @file{libio} configure +@cindex @file{libg++} configure + +The C++ library configure system, written by Per Bothner, deserves +special mention. It uses Cygnus configure, but it does feature testing +like that done by autoconf generated @file{configure} scripts. This +approach is used in the libraries @file{libio}, @file{libstdc++}, and +@file{libg++}. + +Most of the @file{Makefile} information is written out by the shell +script @file{libio/config.shared}. Each @file{configure.in} file sets +certain shell variables, and then invokes @file{config.shared} to create +two package @file{Makefile} fragments. These fragments are then +incorporated into the resulting @file{Makefile} by the Cygnus configure +script. + +The file @file{_G_config.h} is created in the @file{libio} object +directory by running the shell script @file{libio/gen-params}. This +shell script uses feature tests to define macros and typedefs in +@file{_G_config.h}. + +@node Multilibs +@chapter Multilibs +@cindex multilibs + +For some targets gcc may have different processor requirements depending +upon command line options. An obvious example is the +@samp{-msoft-float} option supported on several processors. This option +means that the floating point registers are not available, which means +that floating point operations must be done by calling an emulation +subroutine rather than by using machine instructions. + +For such options, gcc is often configured to compile target libraries +twice: once with @samp{-msoft-float} and once without. When gcc +compiles target libraries more than once, the resulting libraries are +called @dfn{multilibs}. + +Multilibs are not really part of the GNU configure and build system, but +we discuss them here since they require support in the @file{configure} +scripts and @file{Makefile}s used for target libraries. + +@menu +* Multilibs in gcc:: Multilibs in gcc. +* Multilibs in Target Libraries:: Multilibs in Target Libraries. +@end menu + +@node Multilibs in gcc +@section Multilibs in gcc + +In gcc, multilibs are defined by setting the variable +@samp{MULTILIB_OPTIONS} in the target @file{Makefile} fragment. Several +other @samp{MULTILIB} variables may also be defined there. @xref{Target +Fragment, , The Target Makefile Fragment, gcc, Using and Porting GNU +CC}. + +If you have built gcc, you can see what multilibs it uses by running it +with the @samp{-print-multi-lib} option. The output @samp{.;} means +that no multilibs are used. In general, the output is a sequence of +lines, one per multilib. The first part of each line, up to the +@samp{;}, is the name of the multilib directory. The second part is a +list of compiler options separated by @samp{@@} characters. + +Multilibs are built in a tree of directories. The top of the tree, +represented by @samp{.} in the list of multilib directories, is the +default library to use when no special compiler options are used. The +subdirectories of the tree hold versions of the library to use when +particular compiler options are used. + +@node Multilibs in Target Libraries +@section Multilibs in Target Libraries + +The target libraries in the Cygnus tree are automatically built with +multilibs. That means that each library is built multiple times. + +This default is set in the top level @file{configure.in} file, by adding +@samp{--enable-multilib} to the list of arguments passed to configure +when it is run for the target libraries (@pxref{Host and Target +Libraries}). + +Each target library uses the shell script @file{config-ml.in}, written +by Doug Evans, to prepare to build target libraries. This shell script +is invoked after the @file{Makefile} has been created by the +@file{configure} script. If multilibs are not enabled, it does nothing, +otherwise it modifies the @file{Makefile} to support multilibs. + +The @file{config-ml.in} script makes one copy of the @file{Makefile} for +each multilib in the appropriate subdirectory. When configuring in the +source directory (which is not recommended), it will build a symlink +tree of the sources in each subdirectory. + +The @file{config-ml.in} script sets several variables in the various +@file{Makefile}s. The @file{Makefile.in} must have definitions for +these variables already; @file{config-ml.in} simply changes the existing +values. The @file{Makefile} should use default values for these +variables which will do the right thing in the subdirectories. + +@table @samp +@item MULTISRCTOP +@file{config-ml.in} will set this to a sequence of @samp{../} strings, +where the number of strings is the number of multilib levels in the +source tree. The default value should be the empty string. +@item MULTIBUILDTOP +@file{config-ml.in} will set this to a sequence of @samp{../} strings, +where the number of strings is number of multilib levels in the object +directory. The default value should be the empty string. This will +differ from @samp{MULTISRCTOP} when configuring in the source tree +(which is not recommended). +@item MULTIDIRS +In the top level @file{Makefile} only, @file{config-ml.in} will set this +to the list of multilib subdirectories. The default value should be the +empty string. +@item MULTISUBDIR +@file{config-ml.in} will set this to the installed subdirectory name to +use for this subdirectory, with a leading @samp{/}. The default value +shold be the empty string. +@item MULTIDO +@itemx MULTICLEAN +In the top level @file{Makefile} only, @file{config-ml.in} will set +these variables to commands to use when doing a recursive make. These +variables should both default to the string @samp{true}, so that by +default nothing happens. +@end table + +All references to the parent of the source directory should use the +variable @samp{MULTISRCTOP}. Instead of writing @samp{$(srcdir)/..}, +you must write @samp{$(srcdir)/$(MULTISRCTOP)..}. + +Similarly, references to the parent of the object directory should use +the variable @samp{MULTIBUILDTOP}. + +In the installation target, the libraries should be installed in the +subdirectory @samp{MULTISUBDIR}. Instead of installing +@samp{$(libdir)/libfoo.a}, install +@samp{$(libdir)$(MULTISUBDIR)/libfoo.a}. + +The @file{config-ml.in} script also modifies the top level +@file{Makefile} to add @samp{multi-do} and @samp{multi-clean} targets +which are used when building multilibs. + +The default target of the @file{Makefile} should include the following +command: +@smallexample +@@$(MULTIDO) $(FLAGS_TO_PASS) DO=all multi-do +@end smallexample +@noindent +This assumes that @samp{$(FLAGS_TO_PASS)} is defined as a set of +variables to pass to a recursive invocation of @samp{make}. This will +build all the multilibs. Note that the default value of @samp{MULTIDO} +is @samp{true}, so by default this command will do nothing. It will +only do something in the top level @file{Makefile} if multilibs were +enabled. + +The @samp{install} target of the @file{Makefile} should include the +following command: +@smallexample +@@$(MULTIDO) $(FLAGS_TO_PASS) DO=install multi-do +@end smallexample + +In general, any operation, other than clean, which should be performed +on all the multilibs should use a @samp{$(MULTIDO)} line, setting the +variable @samp{DO} to the target of each recursive call to @samp{make}. + +The @samp{clean} targets (@samp{clean}, @samp{mostlyclean}, etc.) should +use @samp{$(MULTICLEAN)}. For example, the @samp{clean} target should +do this: +@smallexample +@@$(MULTICLEAN) DO=clean multi-clean +@end smallexample + +@node FAQ +@chapter Frequently Asked Questions + +@table @asis +@item Which do I run first, @samp{autoconf} or @samp{automake}? +Except when you first add autoconf or automake support to a package, you +shouldn't run either by hand. Instead, configure with the +@samp{--enable-maintainer-mode} option, and let @samp{make} take care of +it. + +@cindex undefined macros +@item @samp{autoconf} says something about undefined macros. +This means that you have macros in your @file{configure.in} which are +not defined by @samp{autoconf}. You may be using an old version of +@samp{autoconf}; try building and installing a newer one. Make sure the +newly installled @samp{autoconf} is first on your @samp{PATH}. Also, +see the next question. + +@cindex @samp{CY_GNU_GETTEXT} in @file{configure} +@cindex @samp{AM_PROG_LIBTOOL} in @file{configure} +@item My @file{configure} script has stuff like @samp{CY_GNU_GETTEXT} in it. +This means that you have macros in your @file{configure.in} which should +be defined in your @file{aclocal.m4} file, but aren't. This usually +means that @samp{aclocal} was not able to appropriate definitions of the +macros. Make sure that you have installed all the packages you need. +In particular, make sure that you have installed libtool (this is where +@samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where +@samp{CY_GNU_GETTEXT} is defined, at least in the Cygnus version of +gettext). + +@cindex @file{Makefile}, garbage characters +@item My @file{Makefile} has @samp{@@} characters in it. +This may mean that you tried to use an autoconf substitution in your +@file{Makefile.in} without adding the appropriate @samp{AC_SUBST} call +to your @file{configure} script. Or it may just mean that you need to +rebuild @file{Makefile} in your build directory. To rebuild +@file{Makefile} from @file{Makefile.in}, run the shell script +@file{config.status} with no arguments. If you need to force +@file{configure} to run again, first run @samp{config.status --recheck}. +These runs are normally done automatically by @file{Makefile} targets, +but if your @file{Makefile} has gotten messed up you'll need to help +them along. + +@cindex @samp{config.status --recheck} +@item Why do I have to run both @samp{config.status --recheck} and @samp{config.status}? +Normally, you don't; they will be run automatically by @file{Makefile} +targets. If you do need to run them, use @samp{config.status --recheck} +to run the @file{configure} script again with the same arguments as the +first time you ran it. Use @samp{config.status} (with no arguments) to +regenerate all files (@file{Makefile}, @file{config.h}, etc.) based on +the results of the configure script. The two cases are separate because +it isn't always necessary to regenerate all the files after running +@samp{config.status --recheck}. The @file{Makefile} targets generated +by automake will use the environment variables @samp{CONFIG_FILES} and +@samp{CONFIG_HEADERS} to only regenerate files as they are needed. + +@item What is the Cygnus tree? +The Cygnus tree is used for various packages including gdb, the GNU +binutils, and egcs. It is also, of course, used for Cygnus releases. +It is the build system which was developed at Cygnus, using the Cygnus +configure script. It permits building many different packages with a +single configure and make. The configure scripts in the tree are being +converted to autoconf, but the general build structure remains intact. + +@item Why do I have to keep rebuilding and reinstalling the tools? +I know, it's a pain. Unfortunately, there are bugs in the tools +themselves which need to be fixed, and each time that happens everybody +who uses the tools need to reinstall new versions of them. I don't know +if there is going to be a clever fix until the tools stabilize. + +@item Why not just have a Cygnus tree @samp{make} target to update the tools? +The tools unfortunately need to be installed before they can be used. +That means that they must be built using an appropriate prefix, and it +seems unwise to assume that every configuration uses an appropriate +prefix. It might be possible to make them work in place, or it might be +possible to install them in some subdirectory; so far these approaches +have not been implemented. +@end table + +@node Index +@unnumbered Index + +@printindex cp + +@contents +@bye diff -uprN binutils-2.10/gas/ChangeLog binutils-2.10.1/gas/ChangeLog --- binutils-2.10/gas/ChangeLog Fri Jun 9 18:31:06 2000 +++ binutils-2.10.1/gas/ChangeLog Fri Nov 3 17:16:39 2000 @@ -1,3 +1,40 @@ +2000-11-02 Theo Honohan + + * config/tc-arm.c (do_msr): Improve error message. + +2000-11-01 Philip Blundell + + From 2000-08-01 Nick Clifton + * config/tc-arm.c (do_mrs): Fix skip of 'cpsr_all' flag. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-14 Philip Blundell + + From 2000-06-17 Mark Elbrecht + + * config/obj-coff.c (obj_coff_weak): Typo fix: Change BFD_ASSEMLER + to BFD_ASSEMBLER. + +2000-09-08 Philip Blundell + + * config/tc-arm.c (md_apply_fix3): Correct handling of ADRL when + offset is negative. + +2000-08-30 Matthew Jacob + + * config/tc-alpha.c (md_undefined_symbol): Properly understand that + $at is the integer register $r28, vs. both $r28 and the floating + point register $f28. + +2000-04-14 Matthew Green + + * configure.in: Add NetBSD/sparc ELF and NetBSD/sparc64 support. + * configure: Regenerate. + 2000-06-09 Nick Clifton * config/tc-arm.c (cons_fix_new_arm): Assign correct reloc value diff -uprN binutils-2.10/gas/config/obj-coff.c binutils-2.10.1/gas/config/obj-coff.c --- binutils-2.10/gas/config/obj-coff.c Tue Feb 22 07:50:13 2000 +++ binutils-2.10.1/gas/config/obj-coff.c Sat Oct 14 22:05:59 2000 @@ -213,7 +213,7 @@ obj_coff_weak (ignore) *input_line_pointer = c; SKIP_WHITESPACE (); -#ifdef BFD_ASSEMLER +#ifdef BFD_ASSEMBLER S_SET_WEAK (symbolP); #endif diff -uprN binutils-2.10/gas/config/tc-alpha.c binutils-2.10.1/gas/config/tc-alpha.c --- binutils-2.10/gas/config/tc-alpha.c Mon Feb 28 03:25:35 2000 +++ binutils-2.10.1/gas/config/tc-alpha.c Thu Aug 31 00:39:17 2000 @@ -1372,7 +1372,7 @@ md_undefined_symbol(name) else break; - if (!alpha_noat_on && num == AXP_REG_AT) + if (!alpha_noat_on && (num + is_float) == AXP_REG_AT) as_warn(_("Used $at without \".set noat\"")); return alpha_register_table[num + is_float]; diff -uprN binutils-2.10/gas/config/tc-arm.c binutils-2.10.1/gas/config/tc-arm.c --- binutils-2.10/gas/config/tc-arm.c Fri Jun 9 18:31:07 2000 +++ binutils-2.10.1/gas/config/tc-arm.c Fri Nov 3 17:16:09 2000 @@ -1943,7 +1943,7 @@ do_mrs (str, flags) /* This is for backwards compatability with older toolchains. */ else if (strcmp (str, "cpsr_all") == 0 || strcmp (str, "spsr_all") == 0) - skip = 7; + skip = 8; else { inst.error = _("{C|S}PSR expected"); @@ -2004,7 +2004,7 @@ do_msr (str, flags) if (inst.instruction & ((PSR_c | PSR_x | PSR_s) << PSR_SHIFT)) { - inst.error = _("can only set flag field with immediate value"); + inst.error = _("only flag field of psr can be set with immediate value"); return; } @@ -5450,7 +5450,7 @@ md_apply_fix3 (fixP, val, seg) if (newimm != (unsigned int) FAIL) newinsn = temp; /* Still No ? Try using a negated value. */ - else if (validate_immediate_twopart (- value, & highpart) != (unsigned int) FAIL) + else if ((newimm = validate_immediate_twopart (- value, & highpart)) != (unsigned int) FAIL) temp = newinsn = (temp & OPCODE_MASK) | OPCODE_SUB << DATA_OP_SHIFT; /* Otherwise - give up. */ else diff -uprN binutils-2.10/gas/configure binutils-2.10.1/gas/configure --- binutils-2.10/gas/configure Wed May 31 12:28:41 2000 +++ binutils-2.10.1/gas/configure Mon Oct 16 12:27:25 2000 @@ -805,7 +805,7 @@ fi PACKAGE=gas -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1877,7 +1877,15 @@ EOF sparc-fujitsu-none) fmt=aout ;; sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) fmt=elf ;; - sparc-*-netbsd*) fmt=aout em=nbsd ;; + sparc-*-netbsd*) em=nbsd bfd_gas=yes + case ${cpu} in + sparc) case ${os} in + *elf*) fmt=elf ;; + *) fmt=aout ;; + esac ;; + sparc64) fmt=elf ;; + esac + ;; sparc-*-openbsd*) fmt=aout em=nbsd ;; strongarm-*-coff) fmt=coff ;; @@ -2381,7 +2389,7 @@ 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:2385: checking for $ac_word" >&5 +echo "configure:2393: 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 @@ -2411,7 +2419,7 @@ 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:2415: checking for $ac_word" >&5 +echo "configure:2423: 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 @@ -2462,7 +2470,7 @@ fi # 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:2466: checking for $ac_word" >&5 +echo "configure:2474: 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 @@ -2494,7 +2502,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2498: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2506: 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. @@ -2505,12 +2513,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2509 "configure" +#line 2517 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2522: \"$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 @@ -2536,12 +2544,12 @@ 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:2540: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2548: 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:2545: checking whether we are using GNU C" >&5 +echo "configure:2553: 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 @@ -2550,7 +2558,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2554: \"$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:2562: \"$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 @@ -2569,7 +2577,7 @@ 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:2573: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2581: 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 @@ -2606,7 +2614,7 @@ 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:2610: checking for $ac_word" >&5 +echo "configure:2618: 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 @@ -2637,7 +2645,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2641: checking how to run the C preprocessor" >&5 +echo "configure:2649: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2652,13 +2660,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2670: \"$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 : @@ -2669,13 +2677,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2687: \"$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 : @@ -2686,13 +2694,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2704: \"$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 : @@ -2722,7 +2730,7 @@ 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:2726: checking for $ac_word" >&5 +echo "configure:2734: 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 @@ -2755,7 +2763,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # 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:2759: checking for $ac_word" >&5 +echo "configure:2767: 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 @@ -2789,7 +2797,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2793: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2801: 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 @@ -2797,7 +2805,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2820: \"$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 @@ -2831,7 +2839,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2835: checking lex output file root" >&5 +echo "configure:2843: 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 @@ -2852,7 +2860,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:2856: checking whether yytext is a pointer" >&5 +echo "configure:2864: 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 @@ -2864,14 +2872,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2883: \"$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 @@ -2895,7 +2903,7 @@ fi ALL_LINGUAS= echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:2899: checking for POSIXized ISC" >&5 +echo "configure:2907: 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 @@ -2916,12 +2924,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2920: checking for ANSI C header files" >&5 +echo "configure:2928: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2929,7 +2937,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2941: \"$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* @@ -2946,7 +2954,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2964,7 +2972,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2985,7 +2993,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2996,7 +3004,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:3000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3020,12 +3028,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3024: checking for working const" >&5 +echo "configure:3032: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3095,21 +3103,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3099: checking for inline" >&5 +echo "configure:3107: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3135,12 +3143,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3139: checking for off_t" >&5 +echo "configure:3147: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3168,12 +3176,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3172: checking for size_t" >&5 +echo "configure:3180: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3203,19 +3211,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:3207: checking for working alloca.h" >&5 +echo "configure:3215: 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 < int main() { void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3227: \"$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 @@ -3236,12 +3244,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3240: checking for alloca" >&5 +echo "configure:3248: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3281: \"$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 @@ -3301,12 +3309,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3305: checking whether alloca needs Cray hooks" >&5 +echo "configure:3313: 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 <&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:3335: checking for $ac_func" >&5 +echo "configure:3343: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3371: \"$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 @@ -3386,7 +3394,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3390: checking stack direction for C alloca" >&5 +echo "configure:3398: 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 @@ -3394,7 +3402,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3425: \"$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 @@ -3438,17 +3446,17 @@ 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:3442: checking for $ac_hdr" >&5 +echo "configure:3450: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3460: \"$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* @@ -3477,12 +3485,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3481: checking for $ac_func" >&5 +echo "configure:3489: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3517: \"$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 @@ -3530,7 +3538,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3534: checking for working mmap" >&5 +echo "configure:3542: 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 @@ -3538,7 +3546,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3693: \"$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 @@ -3709,17 +3717,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3713: checking for $ac_hdr" >&5 +echo "configure:3721: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3731: \"$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* @@ -3749,12 +3757,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3753: checking for $ac_func" >&5 +echo "configure:3761: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3789: \"$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 @@ -3806,12 +3814,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3810: checking for $ac_func" >&5 +echo "configure:3818: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3846: \"$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 @@ -3868,19 +3876,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3872: checking for LC_MESSAGES" >&5 +echo "configure:3880: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3901,7 +3909,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3905: checking whether NLS is requested" >&5 +echo "configure:3913: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3921,7 +3929,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3925: checking whether included gettext is requested" >&5 +echo "configure:3933: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3940,17 +3948,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3944: checking for libintl.h" >&5 +echo "configure:3952: checking for libintl.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3962: \"$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* @@ -3967,19 +3975,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3971: checking for gettext in libc" >&5 +echo "configure:3979: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3995,7 +4003,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3999: checking for bindtextdomain in -lintl" >&5 +echo "configure:4007: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4003,7 +4011,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4026: \"$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 @@ -4030,19 +4038,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4034: checking for gettext in libintl" >&5 +echo "configure:4042: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -4070,7 +4078,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4074: checking for $ac_word" >&5 +echo "configure:4082: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4104,12 +4112,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4108: checking for $ac_func" >&5 +echo "configure:4116: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4144: \"$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 @@ -4159,7 +4167,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4163: checking for $ac_word" >&5 +echo "configure:4171: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4195,7 +4203,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4199: checking for $ac_word" >&5 +echo "configure:4207: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4227,7 +4235,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4267,7 +4275,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4271: checking for $ac_word" >&5 +echo "configure:4279: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4301,7 +4309,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4305: checking for $ac_word" >&5 +echo "configure:4313: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4337,7 +4345,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4341: checking for $ac_word" >&5 +echo "configure:4349: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4427,7 +4435,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4431: checking for catalogs to be installed" >&5 +echo "configure:4439: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4455,17 +4463,17 @@ echo "configure:4431: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4459: checking for linux/version.h" >&5 +echo "configure:4467: checking for linux/version.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4477: \"$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* @@ -4528,7 +4536,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4532: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4540: 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" @@ -4551,12 +4559,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:4555: checking for Cygwin environment" >&5 +echo "configure:4563: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -4584,19 +4592,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:4588: checking for mingw32 environment" >&5 +echo "configure:4596: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -4615,7 +4623,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4619: checking for executable suffix" >&5 +echo "configure:4627: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4625,7 +4633,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -4650,17 +4658,17 @@ 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:4654: checking for $ac_hdr" >&5 +echo "configure:4662: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4672: \"$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* @@ -4690,7 +4698,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:4694: checking whether compiling a cross-assembler" >&5 +echo "configure:4702: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -4705,19 +4713,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:4709: checking for working alloca.h" >&5 +echo "configure:4717: 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 < int main() { void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4729: \"$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 @@ -4738,12 +4746,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4742: checking for alloca" >&5 +echo "configure:4750: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4783: \"$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 @@ -4803,12 +4811,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4807: checking whether alloca needs Cray hooks" >&5 +echo "configure:4815: 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 <&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:4837: checking for $ac_func" >&5 +echo "configure:4845: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4873: \"$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 @@ -4888,7 +4896,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4892: checking stack direction for C alloca" >&5 +echo "configure:4900: 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 @@ -4896,7 +4904,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4927: \"$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 @@ -4937,21 +4945,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4941: checking for inline" >&5 +echo "configure:4949: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -4981,12 +4989,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4985: checking for $ac_func" >&5 +echo "configure:4993: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5021: \"$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 @@ -5038,12 +5046,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5042: checking for $ac_func" >&5 +echo "configure:5050: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5078: \"$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 @@ -5095,12 +5103,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:5099: checking for working assert macro" >&5 +echo "configure:5107: 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 < #include @@ -5116,7 +5124,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5157,12 +5165,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5161: checking whether declaration is required for strstr" >&5 +echo "configure:5169: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5185: \"$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 @@ -5194,12 +5202,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5198: checking whether declaration is required for malloc" >&5 +echo "configure:5206: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5222: \"$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 @@ -5231,12 +5239,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:5235: checking whether declaration is required for free" >&5 +echo "configure:5243: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5259: \"$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 @@ -5268,12 +5276,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:5272: checking whether declaration is required for sbrk" >&5 +echo "configure:5280: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5296: \"$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 @@ -5305,12 +5313,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:5309: checking whether declaration is required for environ" >&5 +echo "configure:5317: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -5345,12 +5353,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:5349: checking whether declaration is required for errno" >&5 +echo "configure:5357: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5377: \"$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 diff -uprN binutils-2.10/gas/configure.in binutils-2.10.1/gas/configure.in --- binutils-2.10/gas/configure.in Wed May 31 12:28:42 2000 +++ binutils-2.10.1/gas/configure.in Mon Oct 16 12:27:28 2000 @@ -10,7 +10,7 @@ AC_INIT(as.h) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gas, 2.10) +AM_INIT_AUTOMAKE(gas, 2.10.1) AM_PROG_LIBTOOL @@ -351,7 +351,15 @@ changequote([,])dnl sparc-fujitsu-none) fmt=aout ;; sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) fmt=elf ;; - sparc-*-netbsd*) fmt=aout em=nbsd ;; + sparc-*-netbsd*) em=nbsd bfd_gas=yes + case ${cpu} in + sparc) case ${os} in + *elf*) fmt=elf ;; + *) fmt=aout ;; + esac ;; + sparc64) fmt=elf ;; + esac + ;; sparc-*-openbsd*) fmt=aout em=nbsd ;; strongarm-*-coff) fmt=coff ;; diff -uprN binutils-2.10/gas/doc/as.info binutils-2.10.1/gas/doc/as.info --- binutils-2.10/gas/doc/as.info Sat Jun 10 13:40:06 2000 +++ binutils-2.10.1/gas/doc/as.info Tue Nov 7 10:26:19 2000 @@ -25,319 +25,319 @@ versions.  Indirect: as.info-1: 866 -as.info-2: 50538 -as.info-3: 100405 -as.info-4: 149817 -as.info-5: 198317 -as.info-6: 244878 -as.info-7: 294771 -as.info-8: 315443 +as.info-2: 50540 +as.info-3: 100407 +as.info-4: 149819 +as.info-5: 198319 +as.info-6: 244880 +as.info-7: 294773 +as.info-8: 315445  Tag Table: (Indirect) Node: Top866 -Node: Overview1538 -Node: Manual13605 -Node: GNU Assembler14544 -Node: Object Formats15710 -Node: Command Line16157 -Node: Input Files17239 -Node: Object19218 -Node: Errors20165 -Node: Invoking21355 -Node: a23201 -Node: D24535 -Node: f24755 -Node: I25258 -Node: K25797 -Node: L26096 -Node: M26922 -Node: MD31312 -Node: o31731 -Node: R32179 -Node: statistics33195 -Node: traditional-format33595 -Node: v34061 -Node: W34329 -Node: Z35229 -Node: Syntax35744 -Node: Preprocessing36334 -Node: Whitespace37894 -Node: Comments38284 -Node: Symbol Intro40304 -Node: Statements40987 -Node: Constants42901 -Node: Characters43527 -Node: Strings44020 -Node: Chars46173 -Node: Numbers46914 -Node: Integers47445 -Node: Bignums48088 -Node: Flonums48431 -Node: Sections50164 -Node: Secs Background50538 -Node: Ld Sections55564 -Node: As Sections57958 -Node: Sub-Sections58863 -Node: bss61862 -Node: Symbols62807 -Node: Labels63454 -Node: Setting Symbols64180 -Node: Symbol Names64545 -Node: Dot67507 -Node: Symbol Attributes67949 -Node: Symbol Value68681 -Node: Symbol Type69717 -Node: a.out Symbols70096 -Node: Symbol Desc70346 -Node: Symbol Other70628 -Node: COFF Symbols70784 -Node: SOM Symbols71413 -Node: Expressions71846 -Node: Empty Exprs72594 -Node: Integer Exprs72936 -Node: Arguments73326 -Node: Operators74423 -Node: Prefix Ops74749 -Node: Infix Ops75068 -Node: Pseudo Ops76560 -Node: Abort80777 -Node: ABORT81178 -Node: Align81440 -Node: Ascii83629 -Node: Asciz83930 -Node: Balign84170 -Node: Byte86028 -Node: Comm86261 -Node: Data87620 -Node: Def87930 -Node: Desc88298 -Node: Dim88791 -Node: Double89182 -Node: Eject89513 -Node: Else89681 -Node: Elseif89971 -Node: End90255 -Node: Endef90463 -Node: Endfunc90786 -Node: Endif90954 -Node: Equ91207 -Node: Equiv91510 -Node: Err91906 -Node: Exitm92209 -Node: Extern92369 -Node: Fail92623 -Node: File93061 -Node: Fill93670 -Node: Float94627 -Node: Func94961 -Node: Global95541 -Node: hword96283 -Node: Ident96604 -Node: If96904 -Node: Include99496 -Node: Int100036 -Node: Irp100405 -Node: Irpc101199 -Node: Lcomm102018 -Node: Lflags102759 -Node: Line102946 -Node: Linkonce103969 -Node: Ln105189 -Node: MRI105337 -Node: List105664 -Node: Long106267 -Node: Macro106437 -Node: Nolist108821 -Node: Octa109237 -Node: Org109563 -Node: P2align110838 -Node: Print112754 -Node: Psize112971 -Node: Purgem113644 -Node: Quad113851 -Node: Rept114292 -Node: Sbttl114698 -Node: Scl115056 -Node: Section115552 -Node: Set117953 -Node: Short118505 -Node: Single118818 -Node: Size119155 -Node: Sleb128119550 -Node: Skip119865 -Node: Space120180 -Node: Stab121065 -Node: String123060 -Node: Struct123479 -Node: Symver124191 -Node: Tag125776 -Node: Text126284 -Node: Title126596 -Node: Type126968 -Node: Val127344 -Node: Uleb128127705 -Node: Visibility128027 -Node: Word129070 -Node: Deprecated130906 -Node: Machine Dependencies131131 -Node: ARC-Dependent133009 -Node: ARC-Opts133323 -Node: ARC-Float134057 -Node: ARC-Directives134355 -Node: AMD29K-Dependent134748 -Node: AMD29K Options135129 -Node: AMD29K Syntax135303 -Node: AMD29K-Macros135567 -Node: AMD29K-Chars135818 -Node: AMD29K-Regs136081 -Node: AMD29K Floating Point137345 -Node: AMD29K Directives137551 -Node: AMD29K Opcodes138959 -Node: ARM-Dependent139295 -Node: ARM Options139669 -Node: ARM Syntax142169 -Node: ARM-Chars142389 -Node: ARM-Regs142941 -Node: ARM Floating Point143113 -Node: ARM Directives143303 -Node: ARM Opcodes145309 -Node: D10V-Dependent147362 -Node: D10V-Opts147704 -Node: D10V-Syntax148337 -Node: D10V-Size148857 -Node: D10V-Subs149817 -Node: D10V-Chars150839 -Node: D10V-Regs152425 -Node: D10V-Addressing153456 -Node: D10V-Word154129 -Node: D10V-Float154630 -Node: D10V-Opcodes154932 -Node: D30V-Dependent155316 -Node: D30V-Opts155661 -Node: D30V-Syntax156327 -Node: D30V-Size156850 -Node: D30V-Subs157808 -Node: D30V-Chars158830 -Node: D30V-Guarded161115 -Node: D30V-Regs161783 -Node: D30V-Addressing162909 -Node: D30V-Float163564 -Node: D30V-Opcodes163866 -Node: H8/300-Dependent164250 -Node: H8/300 Options164654 -Node: H8/300 Syntax164835 -Node: H8/300-Chars165122 -Node: H8/300-Regs165406 -Node: H8/300-Addressing166310 -Node: H8/300 Floating Point167336 -Node: H8/300 Directives167652 -Node: H8/300 Opcodes168172 -Node: H8/500-Dependent176525 -Node: H8/500 Options176929 -Node: H8/500 Syntax177110 -Node: H8/500-Chars177397 -Node: H8/500-Regs177688 -Node: H8/500-Addressing178444 -Node: H8/500 Floating Point179061 -Node: H8/500 Directives179377 -Node: H8/500 Opcodes179696 -Node: HPPA-Dependent184809 -Node: HPPA Notes185234 -Node: HPPA Options185981 -Node: HPPA Syntax186165 -Node: HPPA Floating Point187424 -Node: HPPA Directives187619 -Node: HPPA Opcodes194210 -Node: ESA/390-Dependent194458 -Node: ESA/390 Notes194908 -Node: ESA/390 Options195688 -Node: ESA/390 Syntax195887 -Node: ESA/390 Floating Point198048 -Node: ESA/390 Directives198317 -Node: ESA/390 Opcodes201594 -Node: i386-Dependent201845 -Node: i386-Options202653 -Node: i386-Syntax202797 -Node: i386-Mnemonics204910 -Node: i386-Regs207052 -Node: i386-Prefixes208195 -Node: i386-Memory210283 -Node: i386-jumps212592 -Node: i386-Float213682 -Node: i386-SIMD215500 -Node: i386-16bit216598 -Node: i386-Bugs218561 -Node: i386-Notes219301 -Node: i960-Dependent220141 -Node: Options-i960220533 -Node: Floating Point-i960224414 -Node: Directives-i960224671 -Node: Opcodes for i960226691 -Node: callj-i960227297 -Node: Compare-and-branch-i960227772 -Node: M68K-Dependent229661 -Node: M68K-Opts230115 -Node: M68K-Syntax235063 -Node: M68K-Moto-Syntax236891 -Node: M68K-Float239469 -Node: M68K-Directives239978 -Node: M68K-opcodes240573 -Node: M68K-Branch240785 -Node: M68K-Chars243600 -Node: MIPS-Dependent243998 -Node: MIPS Opts244878 -Node: MIPS Object248908 -Node: MIPS Stabs250463 -Node: MIPS ISA251174 -Node: MIPS autoextend252282 -Node: MIPS insn252993 -Node: MIPS option stack253479 -Node: PJ-Dependent254192 -Node: PJ Options254405 -Node: SH-Dependent254672 -Node: SH Options255052 -Node: SH Syntax255217 -Node: SH-Chars255476 -Node: SH-Regs255755 -Node: SH-Addressing256354 -Node: SH Floating Point257248 -Node: SH Directives257544 -Node: SH Opcodes257900 -Node: Sparc-Dependent262147 -Node: Sparc-Opts262519 -Node: Sparc-Aligned-Data264765 -Node: Sparc-Float265609 -Node: Sparc-Directives265799 -Node: Z8000-Dependent267748 -Node: Z8000 Options268707 -Node: Z8000 Syntax268882 -Node: Z8000-Chars269158 -Node: Z8000-Regs269376 -Node: Z8000-Addressing270166 -Node: Z8000 Directives271109 -Node: Z8000 Opcodes272707 -Node: Vax-Dependent282643 -Node: VAX-Opts283150 -Node: VAX-float286874 -Node: VAX-directives287495 -Node: VAX-opcodes288344 -Node: VAX-branch288722 -Node: VAX-operands291218 -Node: VAX-no291970 -Node: V850-Dependent292196 -Node: V850 Options292582 -Node: V850 Syntax294395 -Node: V850-Chars294621 -Node: V850-Regs294771 -Node: V850 Floating Point296308 -Node: V850 Directives296503 -Node: V850 Opcodes297403 -Node: Reporting Bugs302688 -Node: Bug Criteria303411 -Node: Bug Reporting304171 -Node: Acknowledgements310740 -Ref: Acknowledgements-Footnote-1315417 -Node: Index315443 +Node: Overview1540 +Node: Manual13607 +Node: GNU Assembler14546 +Node: Object Formats15712 +Node: Command Line16159 +Node: Input Files17241 +Node: Object19220 +Node: Errors20167 +Node: Invoking21357 +Node: a23203 +Node: D24537 +Node: f24757 +Node: I25260 +Node: K25799 +Node: L26098 +Node: M26924 +Node: MD31314 +Node: o31733 +Node: R32181 +Node: statistics33197 +Node: traditional-format33597 +Node: v34063 +Node: W34331 +Node: Z35231 +Node: Syntax35746 +Node: Preprocessing36336 +Node: Whitespace37896 +Node: Comments38286 +Node: Symbol Intro40306 +Node: Statements40989 +Node: Constants42903 +Node: Characters43529 +Node: Strings44022 +Node: Chars46175 +Node: Numbers46916 +Node: Integers47447 +Node: Bignums48090 +Node: Flonums48433 +Node: Sections50166 +Node: Secs Background50540 +Node: Ld Sections55566 +Node: As Sections57960 +Node: Sub-Sections58865 +Node: bss61864 +Node: Symbols62809 +Node: Labels63456 +Node: Setting Symbols64182 +Node: Symbol Names64547 +Node: Dot67509 +Node: Symbol Attributes67951 +Node: Symbol Value68683 +Node: Symbol Type69719 +Node: a.out Symbols70098 +Node: Symbol Desc70348 +Node: Symbol Other70630 +Node: COFF Symbols70786 +Node: SOM Symbols71415 +Node: Expressions71848 +Node: Empty Exprs72596 +Node: Integer Exprs72938 +Node: Arguments73328 +Node: Operators74425 +Node: Prefix Ops74751 +Node: Infix Ops75070 +Node: Pseudo Ops76562 +Node: Abort80779 +Node: ABORT81180 +Node: Align81442 +Node: Ascii83631 +Node: Asciz83932 +Node: Balign84172 +Node: Byte86030 +Node: Comm86263 +Node: Data87622 +Node: Def87932 +Node: Desc88300 +Node: Dim88793 +Node: Double89184 +Node: Eject89515 +Node: Else89683 +Node: Elseif89973 +Node: End90257 +Node: Endef90465 +Node: Endfunc90788 +Node: Endif90956 +Node: Equ91209 +Node: Equiv91512 +Node: Err91908 +Node: Exitm92211 +Node: Extern92371 +Node: Fail92625 +Node: File93063 +Node: Fill93672 +Node: Float94629 +Node: Func94963 +Node: Global95543 +Node: hword96285 +Node: Ident96606 +Node: If96906 +Node: Include99498 +Node: Int100038 +Node: Irp100407 +Node: Irpc101201 +Node: Lcomm102020 +Node: Lflags102761 +Node: Line102948 +Node: Linkonce103971 +Node: Ln105191 +Node: MRI105339 +Node: List105666 +Node: Long106269 +Node: Macro106439 +Node: Nolist108823 +Node: Octa109239 +Node: Org109565 +Node: P2align110840 +Node: Print112756 +Node: Psize112973 +Node: Purgem113646 +Node: Quad113853 +Node: Rept114294 +Node: Sbttl114700 +Node: Scl115058 +Node: Section115554 +Node: Set117955 +Node: Short118507 +Node: Single118820 +Node: Size119157 +Node: Sleb128119552 +Node: Skip119867 +Node: Space120182 +Node: Stab121067 +Node: String123062 +Node: Struct123481 +Node: Symver124193 +Node: Tag125778 +Node: Text126286 +Node: Title126598 +Node: Type126970 +Node: Val127346 +Node: Uleb128127707 +Node: Visibility128029 +Node: Word129072 +Node: Deprecated130908 +Node: Machine Dependencies131133 +Node: ARC-Dependent133011 +Node: ARC-Opts133325 +Node: ARC-Float134059 +Node: ARC-Directives134357 +Node: AMD29K-Dependent134750 +Node: AMD29K Options135131 +Node: AMD29K Syntax135305 +Node: AMD29K-Macros135569 +Node: AMD29K-Chars135820 +Node: AMD29K-Regs136083 +Node: AMD29K Floating Point137347 +Node: AMD29K Directives137553 +Node: AMD29K Opcodes138961 +Node: ARM-Dependent139297 +Node: ARM Options139671 +Node: ARM Syntax142171 +Node: ARM-Chars142391 +Node: ARM-Regs142943 +Node: ARM Floating Point143115 +Node: ARM Directives143305 +Node: ARM Opcodes145311 +Node: D10V-Dependent147364 +Node: D10V-Opts147706 +Node: D10V-Syntax148339 +Node: D10V-Size148859 +Node: D10V-Subs149819 +Node: D10V-Chars150841 +Node: D10V-Regs152427 +Node: D10V-Addressing153458 +Node: D10V-Word154131 +Node: D10V-Float154632 +Node: D10V-Opcodes154934 +Node: D30V-Dependent155318 +Node: D30V-Opts155663 +Node: D30V-Syntax156329 +Node: D30V-Size156852 +Node: D30V-Subs157810 +Node: D30V-Chars158832 +Node: D30V-Guarded161117 +Node: D30V-Regs161785 +Node: D30V-Addressing162911 +Node: D30V-Float163566 +Node: D30V-Opcodes163868 +Node: H8/300-Dependent164252 +Node: H8/300 Options164656 +Node: H8/300 Syntax164837 +Node: H8/300-Chars165124 +Node: H8/300-Regs165408 +Node: H8/300-Addressing166312 +Node: H8/300 Floating Point167338 +Node: H8/300 Directives167654 +Node: H8/300 Opcodes168174 +Node: H8/500-Dependent176527 +Node: H8/500 Options176931 +Node: H8/500 Syntax177112 +Node: H8/500-Chars177399 +Node: H8/500-Regs177690 +Node: H8/500-Addressing178446 +Node: H8/500 Floating Point179063 +Node: H8/500 Directives179379 +Node: H8/500 Opcodes179698 +Node: HPPA-Dependent184811 +Node: HPPA Notes185236 +Node: HPPA Options185983 +Node: HPPA Syntax186167 +Node: HPPA Floating Point187426 +Node: HPPA Directives187621 +Node: HPPA Opcodes194212 +Node: ESA/390-Dependent194460 +Node: ESA/390 Notes194910 +Node: ESA/390 Options195690 +Node: ESA/390 Syntax195889 +Node: ESA/390 Floating Point198050 +Node: ESA/390 Directives198319 +Node: ESA/390 Opcodes201596 +Node: i386-Dependent201847 +Node: i386-Options202655 +Node: i386-Syntax202799 +Node: i386-Mnemonics204912 +Node: i386-Regs207054 +Node: i386-Prefixes208197 +Node: i386-Memory210285 +Node: i386-jumps212594 +Node: i386-Float213684 +Node: i386-SIMD215502 +Node: i386-16bit216600 +Node: i386-Bugs218563 +Node: i386-Notes219303 +Node: i960-Dependent220143 +Node: Options-i960220535 +Node: Floating Point-i960224416 +Node: Directives-i960224673 +Node: Opcodes for i960226693 +Node: callj-i960227299 +Node: Compare-and-branch-i960227774 +Node: M68K-Dependent229663 +Node: M68K-Opts230117 +Node: M68K-Syntax235065 +Node: M68K-Moto-Syntax236893 +Node: M68K-Float239471 +Node: M68K-Directives239980 +Node: M68K-opcodes240575 +Node: M68K-Branch240787 +Node: M68K-Chars243602 +Node: MIPS-Dependent244000 +Node: MIPS Opts244880 +Node: MIPS Object248910 +Node: MIPS Stabs250465 +Node: MIPS ISA251176 +Node: MIPS autoextend252284 +Node: MIPS insn252995 +Node: MIPS option stack253481 +Node: PJ-Dependent254194 +Node: PJ Options254407 +Node: SH-Dependent254674 +Node: SH Options255054 +Node: SH Syntax255219 +Node: SH-Chars255478 +Node: SH-Regs255757 +Node: SH-Addressing256356 +Node: SH Floating Point257250 +Node: SH Directives257546 +Node: SH Opcodes257902 +Node: Sparc-Dependent262149 +Node: Sparc-Opts262521 +Node: Sparc-Aligned-Data264767 +Node: Sparc-Float265611 +Node: Sparc-Directives265801 +Node: Z8000-Dependent267750 +Node: Z8000 Options268709 +Node: Z8000 Syntax268884 +Node: Z8000-Chars269160 +Node: Z8000-Regs269378 +Node: Z8000-Addressing270168 +Node: Z8000 Directives271111 +Node: Z8000 Opcodes272709 +Node: Vax-Dependent282645 +Node: VAX-Opts283152 +Node: VAX-float286876 +Node: VAX-directives287497 +Node: VAX-opcodes288346 +Node: VAX-branch288724 +Node: VAX-operands291220 +Node: VAX-no291972 +Node: V850-Dependent292198 +Node: V850 Options292584 +Node: V850 Syntax294397 +Node: V850-Chars294623 +Node: V850-Regs294773 +Node: V850 Floating Point296310 +Node: V850 Directives296505 +Node: V850 Opcodes297405 +Node: Reporting Bugs302690 +Node: Bug Criteria303413 +Node: Bug Reporting304173 +Node: Acknowledgements310742 +Ref: Acknowledgements-Footnote-1315419 +Node: Index315445  End Tag Table diff -uprN binutils-2.10/gas/doc/as.info-1 binutils-2.10.1/gas/doc/as.info-1 --- binutils-2.10/gas/doc/as.info-1 Sat Jun 10 13:40:06 2000 +++ binutils-2.10.1/gas/doc/as.info-1 Tue Nov 7 10:26:19 2000 @@ -28,7 +28,7 @@ File: as.info, Node: Top, Next: Overvi Using as ******** - This file is a user guide to the GNU assembler `as' version 2.10. + This file is a user guide to the GNU assembler `as' version 2.10.1. * Menu: diff -uprN binutils-2.10/gas/doc/gasver.texi binutils-2.10.1/gas/doc/gasver.texi --- binutils-2.10/gas/doc/gasver.texi Sat Jun 10 13:40:05 2000 +++ binutils-2.10.1/gas/doc/gasver.texi Tue Nov 7 10:26:17 2000 @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff -uprN binutils-2.10/gprof/ChangeLog binutils-2.10.1/gprof/ChangeLog --- binutils-2.10/gprof/ChangeLog Wed Jun 7 21:11:19 2000 +++ binutils-2.10.1/gprof/ChangeLog Mon Oct 16 12:27:28 2000 @@ -1,3 +1,8 @@ +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + 2000-06-07 Philippe De Muyter * source.c: Remove direct inclusion of sys/stat.h. diff -uprN binutils-2.10/gprof/configure binutils-2.10.1/gprof/configure --- binutils-2.10/gprof/configure Sun May 28 11:57:50 2000 +++ binutils-2.10.1/gprof/configure Mon Oct 16 12:27:29 2000 @@ -45,7 +45,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -160,7 +159,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -331,11 +329,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -501,16 +494,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -597,7 +586,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:601: checking host system type" >&5 +echo "configure:590: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -618,7 +607,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:622: checking target system type" >&5 +echo "configure:611: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -636,7 +625,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:640: checking build system type" >&5 +echo "configure:629: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -671,7 +660,7 @@ test "$host_alias" != "$target_alias" && # 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:675: checking for a BSD compatible install" >&5 +echo "configure:664: 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 @@ -724,7 +713,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:728: checking whether build environment is sane" >&5 +echo "configure:717: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -781,7 +770,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:785: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:774: 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 @@ -810,7 +799,7 @@ fi PACKAGE=gprof -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -827,7 +816,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:831: checking for working aclocal" >&5 +echo "configure:820: 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. @@ -840,7 +829,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:844: checking for working autoconf" >&5 +echo "configure:833: 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. @@ -853,7 +842,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:857: checking for working automake" >&5 +echo "configure:846: 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. @@ -866,7 +855,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:870: checking for working autoheader" >&5 +echo "configure:859: 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. @@ -879,7 +868,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:883: checking for working makeinfo" >&5 +echo "configure:872: 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. @@ -965,7 +954,7 @@ 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:969: checking for $ac_word" >&5 +echo "configure:958: 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 @@ -995,7 +984,7 @@ 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:999: checking for $ac_word" >&5 +echo "configure:988: 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 @@ -1025,7 +1014,7 @@ 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:1029: checking for $ac_word" >&5 +echo "configure:1018: 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 @@ -1076,7 +1065,7 @@ fi # 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:1080: checking for $ac_word" >&5 +echo "configure:1069: 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 @@ -1108,7 +1097,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1101: 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. @@ -1119,12 +1108,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1123 "configure" +#line 1112 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1117: \"$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 @@ -1150,12 +1139,12 @@ 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:1154: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1143: 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:1159: checking whether we are using GNU C" >&5 +echo "configure:1148: 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 @@ -1164,7 +1153,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1168: \"$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:1157: \"$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 @@ -1183,7 +1172,7 @@ 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:1187: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1176: 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 @@ -1226,7 +1215,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:1230: checking for ld used by GCC" >&5 +echo "configure:1219: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1250,10 +1239,10 @@ echo "configure:1230: 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:1254: checking for GNU ld" >&5 +echo "configure:1243: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1257: checking for non-GNU ld" >&5 +echo "configure:1246: 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 @@ -1288,7 +1277,7 @@ else 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:1292: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1281: 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 @@ -1304,7 +1293,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:1308: checking for BSD-compatible nm" >&5 +echo "configure:1297: 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 @@ -1340,7 +1329,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1344: checking whether ln -s works" >&5 +echo "configure:1333: 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 @@ -1389,8 +1378,8 @@ test x"$silent" = xyes && libtool_flags= case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1393 "configure"' > conftest.$ac_ext - if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1382 "configure"' > conftest.$ac_ext + if { (eval echo configure:1383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1411,19 +1400,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1415: checking whether the C compiler needs -belf" >&5 +echo "configure:1404: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1532,7 +1521,7 @@ exec 5>>./config.log # 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:1536: checking for $ac_word" >&5 +echo "configure:1525: 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 @@ -1562,7 +1551,7 @@ 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:1566: checking for $ac_word" >&5 +echo "configure:1555: 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 @@ -1613,7 +1602,7 @@ fi # 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:1617: checking for $ac_word" >&5 +echo "configure:1606: 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 @@ -1645,7 +1634,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1649: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1638: 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. @@ -1656,12 +1645,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1660 "configure" +#line 1649 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1654: \"$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 @@ -1687,12 +1676,12 @@ 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:1691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1680: 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:1696: checking whether we are using GNU C" >&5 +echo "configure:1685: 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 @@ -1701,7 +1690,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1705: \"$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:1694: \"$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 @@ -1720,7 +1709,7 @@ 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 +echo "configure:1713: 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 @@ -1763,7 +1752,7 @@ fi # 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:1767: checking for a BSD compatible install" >&5 +echo "configure:1756: 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 @@ -1817,7 +1806,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA= echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1821: checking for POSIXized ISC" >&5 +echo "configure:1810: 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 @@ -1840,12 +1829,12 @@ fi for ac_func in setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1844: checking for $ac_func" >&5 +echo "configure:1833: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1861: \"$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 @@ -1895,7 +1884,7 @@ done ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1899: checking how to run the C preprocessor" >&5 +echo "configure:1888: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1910,13 +1899,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1909: \"$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 : @@ -1927,13 +1916,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1926: \"$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 : @@ -1944,13 +1933,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1943: \"$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 : @@ -1975,12 +1964,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1979: checking for ANSI C header files" >&5 +echo "configure:1968: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1988,7 +1977,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1981: \"$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* @@ -2005,7 +1994,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2023,7 +2012,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2044,7 +2033,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2055,7 +2044,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2079,18 +2068,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2083: checking for working const" >&5 +echo "configure:2072: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2154,21 +2143,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2158: checking for inline" >&5 +echo "configure:2147: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2194,12 +2183,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2198: checking for off_t" >&5 +echo "configure:2187: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2227,12 +2216,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2231: checking for size_t" >&5 +echo "configure:2220: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2262,19 +2251,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:2266: checking for working alloca.h" >&5 +echo "configure:2255: 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 < int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2267: \"$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 @@ -2295,12 +2284,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2299: checking for alloca" >&5 +echo "configure:2288: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2321: \"$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 @@ -2360,12 +2349,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2364: checking whether alloca needs Cray hooks" >&5 +echo "configure:2353: 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 <&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:2394: checking for $ac_func" >&5 +echo "configure:2383: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2411: \"$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 @@ -2445,7 +2434,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2449: checking stack direction for C alloca" >&5 +echo "configure:2438: 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 @@ -2453,7 +2442,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2465: \"$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 @@ -2497,17 +2486,17 @@ 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:2501: checking for $ac_hdr" >&5 +echo "configure:2490: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2500: \"$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* @@ -2536,12 +2525,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2540: checking for $ac_func" >&5 +echo "configure:2529: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2557: \"$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 @@ -2589,7 +2578,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2593: checking for working mmap" >&5 +echo "configure:2582: 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 @@ -2597,7 +2586,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2684,7 +2676,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2705,7 +2697,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2723,7 +2715,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2737,7 +2729,7 @@ main() } EOF -if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2733: \"$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 @@ -2765,17 +2757,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2769: checking for $ac_hdr" >&5 +echo "configure:2761: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2771: \"$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* @@ -2805,12 +2797,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2809: checking for $ac_func" >&5 +echo "configure:2801: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2829: \"$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 @@ -2862,12 +2854,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2866: checking for $ac_func" >&5 +echo "configure:2858: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2886: \"$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 @@ -2924,19 +2916,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2928: checking for LC_MESSAGES" >&5 +echo "configure:2920: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2957,7 +2949,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2961: checking whether NLS is requested" >&5 +echo "configure:2953: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2977,7 +2969,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2981: checking whether included gettext is requested" >&5 +echo "configure:2973: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2996,17 +2988,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3000: checking for libintl.h" >&5 +echo "configure:2992: checking for libintl.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3002: \"$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* @@ -3023,19 +3015,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3027: checking for gettext in libc" >&5 +echo "configure:3019: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3051,7 +3043,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3055: checking for bindtextdomain in -lintl" >&5 +echo "configure:3047: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3059,7 +3051,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3066: \"$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 @@ -3086,19 +3078,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3090: checking for gettext in libintl" >&5 +echo "configure:3082: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3126,7 +3118,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3130: checking for $ac_word" >&5 +echo "configure:3122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3160,12 +3152,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3164: checking for $ac_func" >&5 +echo "configure:3156: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3184: \"$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 @@ -3215,7 +3207,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3219: checking for $ac_word" >&5 +echo "configure:3211: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3251,7 +3243,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3255: checking for $ac_word" >&5 +echo "configure:3247: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3283,7 +3275,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3323,7 +3315,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3327: checking for $ac_word" >&5 +echo "configure:3319: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3357,7 +3349,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3361: checking for $ac_word" >&5 +echo "configure:3353: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3393,7 +3385,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3397: checking for $ac_word" >&5 +echo "configure:3389: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3483,7 +3475,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3487: checking for catalogs to be installed" >&5 +echo "configure:3479: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3511,17 +3503,17 @@ echo "configure:3487: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3515: checking for linux/version.h" >&5 +echo "configure:3507: checking for linux/version.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3517: \"$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* @@ -3584,7 +3576,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3588: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3580: 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" @@ -3607,12 +3599,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3611: checking for Cygwin environment" >&5 +echo "configure:3603: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3640,19 +3632,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3644: checking for mingw32 environment" >&5 +echo "configure:3636: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3671,7 +3663,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3675: checking for executable suffix" >&5 +echo "configure:3667: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3681,10 +3673,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done diff -uprN binutils-2.10/gprof/configure.in binutils-2.10.1/gprof/configure.in --- binutils-2.10/gprof/configure.in Sun May 28 11:57:51 2000 +++ binutils-2.10.1/gprof/configure.in Mon Oct 16 12:27:29 2000 @@ -4,7 +4,7 @@ AC_INIT(gprof.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gprof, 2.10) +AM_INIT_AUTOMAKE(gprof, 2.10.1) AM_PROG_LIBTOOL diff -uprN binutils-2.10/include/ChangeLog binutils-2.10.1/include/ChangeLog --- binutils-2.10/include/ChangeLog Sun May 28 11:57:51 2000 +++ binutils-2.10.1/include/ChangeLog Mon Oct 23 10:43:13 2000 @@ -1,3 +1,7 @@ +2000-10-23 Philip Blundell + + * demangle.h, dyn-string.h: Update from trunk version. + 2000-05-26 Eli Zaretskii * filenames.h: New file. diff -uprN binutils-2.10/include/demangle.h binutils-2.10.1/include/demangle.h --- binutils-2.10/include/demangle.h Mon May 3 08:29:01 1999 +++ binutils-2.10.1/include/demangle.h Mon Oct 23 10:43:13 2000 @@ -24,21 +24,23 @@ /* Options passed to cplus_demangle (in 2nd parameter). */ -#define DMGL_NO_OPTS 0 /* For readability... */ -#define DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ -#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ - -#define DMGL_AUTO (1 << 8) -#define DMGL_GNU (1 << 9) -#define DMGL_LUCID (1 << 10) -#define DMGL_ARM (1 << 11) -#define DMGL_HP (1 << 12) /* For the HP aCC compiler; same as ARM - except for template arguments, etc. */ -#define DMGL_EDG (1 << 13) +#define DMGL_NO_OPTS 0 /* For readability... */ +#define DMGL_PARAMS (1 << 0) /* Include function args */ +#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ +#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ + +#define DMGL_AUTO (1 << 8) +#define DMGL_GNU (1 << 9) +#define DMGL_LUCID (1 << 10) +#define DMGL_ARM (1 << 11) +#define DMGL_HP (1 << 12) /* For the HP aCC compiler; + same as ARM except for + template arguments, etc. */ +#define DMGL_EDG (1 << 13) +#define DMGL_GNU_NEW_ABI (1 << 14) /* If none of these are set, use 'current_demangling_style' as the default. */ -#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG) +#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_NEW_ABI) /* Enumeration of possible demangling styles. @@ -56,17 +58,19 @@ extern enum demangling_styles lucid_demangling = DMGL_LUCID, arm_demangling = DMGL_ARM, hp_demangling = DMGL_HP, - edg_demangling = DMGL_EDG + edg_demangling = DMGL_EDG, + gnu_new_abi_demangling = DMGL_GNU_NEW_ABI } current_demangling_style; /* Define string names for the various demangling styles. */ -#define AUTO_DEMANGLING_STYLE_STRING "auto" -#define GNU_DEMANGLING_STYLE_STRING "gnu" -#define LUCID_DEMANGLING_STYLE_STRING "lucid" -#define ARM_DEMANGLING_STYLE_STRING "arm" -#define HP_DEMANGLING_STYLE_STRING "hp" -#define EDG_DEMANGLING_STYLE_STRING "edg" +#define AUTO_DEMANGLING_STYLE_STRING "auto" +#define GNU_DEMANGLING_STYLE_STRING "gnu" +#define LUCID_DEMANGLING_STYLE_STRING "lucid" +#define ARM_DEMANGLING_STYLE_STRING "arm" +#define HP_DEMANGLING_STYLE_STRING "hp" +#define EDG_DEMANGLING_STYLE_STRING "edg" +#define GNU_NEW_ABI_DEMANGLING_STYLE_STRING "gnu-new-abi" /* Some macros to test what demangling style is active. */ @@ -77,6 +81,17 @@ extern enum demangling_styles #define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM) #define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP) #define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG) +#define GNU_NEW_ABI_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_NEW_ABI) + +/* Provide information about the available demangle styles. This code is + pulled from gdb into libiberty because it is useful to binutils also. */ + +extern struct demangler_engine +{ + const char *demangling_style_name; + enum demangling_styles demangling_style; + const char *demangling_style_doc; +} libiberty_demanglers[]; extern char * cplus_demangle PARAMS ((const char *mangled, int options)); @@ -91,5 +106,15 @@ cplus_mangle_opname PARAMS ((const char extern void set_cplus_marker_for_demangling PARAMS ((int ch)); + +extern enum demangling_styles +cplus_demangle_set_style PARAMS ((enum demangling_styles style)); + +extern enum demangling_styles +cplus_demangle_name_to_style PARAMS ((const char *name)); + +/* New-ABI demangling entry point, defined in cp-demangle.c. */ +extern char* +cplus_demangle_new_abi PARAMS ((const char* mangled)); #endif /* DEMANGLE_H */ diff -uprN binutils-2.10/include/dyn-string.h binutils-2.10.1/include/dyn-string.h --- binutils-2.10/include/dyn-string.h Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/include/dyn-string.h Mon Oct 23 10:43:13 2000 @@ -0,0 +1,92 @@ +/* An abstract string datatype. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Mark Mitchell (mark@markmitchell.com). + +This file is part of GNU CC. + +GNU CC 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. + +GNU CC 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 GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +typedef struct dyn_string +{ + int allocated; /* The amount of space allocated for the string. */ + int length; /* The actual length of the string. */ + char *s; /* The string itself, NUL-terminated. */ +}* dyn_string_t; + +/* The length STR, in bytes, not including the terminating NUL. */ +#define dyn_string_length(STR) \ + ((STR)->length) + +/* The NTBS in which the contents of STR are stored. */ +#define dyn_string_buf(STR) \ + ((STR)->s) + +/* Compare DS1 to DS2 with strcmp. */ +#define dyn_string_compare(DS1, DS2) \ + (strcmp ((DS1)->s, (DS2)->s)) + + +/* dyn_string functions are used in the demangling implementation + included in the G++ runtime library. To prevent collisions with + names in user programs, the functions that are used in the + demangler are given implementation-reserved names. */ + +#ifdef IN_LIBGCC2 + +#define dyn_string_init __cxa_dyn_string_init +#define dyn_string_new __cxa_dyn_string_new +#define dyn_string_delete __cxa_dyn_string_delete +#define dyn_string_release __cxa_dyn_string_release +#define dyn_string_resize __cxa_dyn_string_resize +#define dyn_string_clear __cxa_dyn_string_clear +#define dyn_string_copy __cxa_dyn_string_copy +#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr +#define dyn_string_prepend __cxa_dyn_string_prepend +#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr +#define dyn_string_insert __cxa_dyn_string_insert +#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr +#define dyn_string_insert_char __cxa_dyn_string_insert_char +#define dyn_string_append __cxa_dyn_string_append +#define dyn_string_append_cstr __cxa_dyn_string_append_cstr +#define dyn_string_append_char __cxa_dyn_string_append_char +#define dyn_string_substring __cxa_dyn_string_substring +#define dyn_string_eq __cxa_dyn_string_eq + +#endif /* IN_LIBGCC2 */ + + +extern int dyn_string_init PARAMS ((struct dyn_string *, int)); +extern dyn_string_t dyn_string_new PARAMS ((int)); +extern void dyn_string_delete PARAMS ((dyn_string_t)); +extern char *dyn_string_release PARAMS ((dyn_string_t)); +extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int)); +extern void dyn_string_clear PARAMS ((dyn_string_t)); +extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_insert PARAMS ((dyn_string_t, int, + dyn_string_t)); +extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int, + const char *)); +extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int)); +extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t)); +extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *)); +extern int dyn_string_append_char PARAMS ((dyn_string_t, int)); +extern int dyn_string_substring PARAMS ((dyn_string_t, + dyn_string_t, int, int)); +extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t)); diff -uprN binutils-2.10/include/elf/ChangeLog binutils-2.10.1/include/elf/ChangeLog --- binutils-2.10/include/elf/ChangeLog Tue May 23 09:39:07 2000 +++ binutils-2.10.1/include/elf/ChangeLog Sat Oct 14 21:39:20 2000 @@ -1,3 +1,32 @@ +2000-10-14 Philip Blundell + + From 2000-07-19 H.J. Lu + + * common.h (DF_1_NODEFLIB): Renamed from DF_1_NODEPLIB. + + From 2000-07-19 H.J. Lu + + * common.h (DT_CHECKSUM): Set to 0x6ffffdf8. + (DTF_1_CONFEXP): It is 0x00000002 as suspected. + + From 2000-07-19 H.J. Lu + + * common.h (DT_FEATURE): Renamed from DT_FEATURE_1. + (DT_CONFIG): New. From Solaris 8. + (DT_DEPAUDIT): Likewise. + (DT_AUDIT): Likewise. + (DT_PLTPAD): Likewise. + (DT_MOVETAB): Likewise. + (DF_1_NODEPLIB): Likewise. + (DF_1_NODUMP): Likewise. + (DF_1_CONLFAT): Likewise. + (DT_CHECKSUM): Likewise. FIXME. Check the value on Solaris 8. + (DTF_1_CONFEXP): Likewise. + + From 2000-07-18 H.J. Lu + + * common.h (DT_FLAGS_1): Renamed from DT_1_FLAGS. + 2000-05-02 H.J. Lu * common.h (ELFOSABI_NONE): Renamed from ELFOSABI_SYSV. diff -uprN binutils-2.10/include/elf/common.h binutils-2.10.1/include/elf/common.h --- binutils-2.10/include/elf/common.h Tue May 23 09:39:07 2000 +++ binutils-2.10.1/include/elf/common.h Sat Oct 14 21:39:20 2000 @@ -444,16 +444,22 @@ Foundation, Inc., 59 Temple Place - Suit OS specific values. This is a deliberate special case and we maintain it for backwards compatability. */ #define DT_VALRNGLO 0x6ffffd00 +#define DT_CHECKSUM 0x6ffffdf8 #define DT_PLTPADSZ 0x6ffffdf9 #define DT_MOVEENT 0x6ffffdfa #define DT_MOVESZ 0x6ffffdfb -#define DT_FEATURE_1 0x6ffffdfc +#define DT_FEATURE 0x6ffffdfc #define DT_POSFLAG_1 0x6ffffdfd #define DT_SYMINSZ 0x6ffffdfe #define DT_SYMINENT 0x6ffffdff #define DT_VALRNGHI 0x6ffffdff #define DT_ADDRRNGLO 0x6ffffe00 +#define DT_CONFIG 0x6ffffefa +#define DT_DEPAUDIT 0x6ffffefb +#define DT_AUDIT 0x6ffffefc +#define DT_PLTPAD 0x6ffffefd +#define DT_MOVETAB 0x6ffffefe #define DT_SYMINFO 0x6ffffeff #define DT_ADDRRNGHI 0x6ffffeff @@ -478,14 +484,22 @@ Foundation, Inc., 59 Temple Place - Suit #define DT_USED 0x7ffffffe #define DT_FILTER 0x7fffffff -/* Values used in DT_FEATURE_1 .dynamic entry. */ + +/* Values used in DT_FEATURE .dynamic entry. */ #define DTF_1_PARINIT 0x00000001 +/* From + + http://docs.sun.com:80/ab2/coll.45.13/LLM/@Ab2PageView/21165?Ab2Lang=C&Ab2Enc=iso-8859-1 + + DTF_1_CONFEXP is the same as DTF_1_PARINIT. It is a typo. The value + defined here is the same as the one in on Solaris 8. */ +#define DTF_1_CONFEXP 0x00000002 /* Flag values used in the DT_POSFLAG_1 .dynamic entry. */ #define DF_P1_LAZYLOAD 0x00000001 #define DF_P1_GROUPPERM 0x00000002 -/* Flag value in in the DT_1_FLAGS .dynamic entry. */ +/* Flag value in in the DT_FLAGS_1 .dynamic entry. */ #define DF_1_NOW 0x00000001 #define DF_1_GLOBAL 0x00000002 #define DF_1_GROUP 0x00000004 @@ -497,6 +511,9 @@ Foundation, Inc., 59 Temple Place - Suit #define DF_1_DIRECT 0x00000100 #define DF_1_TRANS 0x00000200 #define DF_1_INTERPOSE 0x00000400 +#define DF_1_NODEFLIB 0x00000800 +#define DF_1_NODUMP 0x00001000 +#define DF_1_CONLFAT 0x00002000 /* Flag values for the DT_FLAGS entry. */ #define DF_ORIGIN (1 << 0) diff -uprN binutils-2.10/ld/ChangeLog binutils-2.10.1/ld/ChangeLog --- binutils-2.10/ld/ChangeLog Sun May 28 12:32:33 2000 +++ binutils-2.10.1/ld/ChangeLog Tue Nov 7 08:44:12 2000 @@ -1,3 +1,105 @@ +2000-11-06 Alan Modra + + Merge most place_orphan changes from mainline. + 2000-09-07 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix + broken list handling. Create __start_SECNAME and __stop_SECNAME + when no place-holder. Add some comments. Test both SEC_CODE and + SEC_READONLY for hold_text to prevent .rodata orphan poisoning. + Handle case where no output section statement created. + + 2000-09-06 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't + try shuffling sections when the orphan happens to be the place + holder. Keep count of unique section names generated so we speed + the search for a new name. + + 2000-04-25 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete. + (output_rel_find): New function. + (hold_section, hold_use): Delete. + (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, + hold_interp): Make local to place_orphan. + (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find + rather than place_section to find possible previous use of orphan. + Similarly find the place-holder output sections. Use returned + value from lang_enter_output_section_statement rather than calling + lang_output_section_statement_lookup. + * ldlang.c (lang_enter_output_section_statement): Return output + section statement. + * ldlang.h (lang_enter_output_section_statement): Change + declaration too. + * ldlang.h (lang_output_section_statement): Export it. + * ldlang.c (lang_output_section_statement): Ditto. + + 2000-04-18 H.J. Lu + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call + lang_leave_output_section_statement () after calling + lang_enter_output_section_statement (). + + 2000-04-18 Alan Modra + * emultempl/elf32.em (struct orphan_save): Add section field. + (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in + better order, and place first orphan section as we did before the + 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place. + Don't call make_bfd_section here, let wild_doit do the job for us. + Don't build a statement list when we'll only throw it away. + + 2000-04-14 Alan Modra + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process + ~SEC_ALLOC sections too. Init start address of debug sections. + + 2000-04-12 Alan Modra + * emultempl/elf32.em (struct orphan_save): New. + (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, + hold_interp): Make them struct orphan_save. + (gld${EMULATION_NAME}_place_section): Modify for new hold_*. + (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to + the end of the relevant section list. Also add associated section + statements to the end of any previous orphan statements. + +2000-11-05 Alan Modra + + * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer, + yy_is_interactive, yy_at_bol, and yy_fill_buffer. + * ldlex.c: Regenerate. + + * Makefile.am (DISTCLEANFILES): Add stringify.sed. + * Makefile.in: Regenerate. + +2000-10-16 Philip Blundell + + * configure.in: Set version number to 2.10.1. + * configure: Regenerate. + +2000-10-12 Peter Jeremy + + From 2000-08-08 Peter Jeremy + * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath + in error message. + +2000-04-14 Matthew Green + + * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support. + +2000-06-07 Michael Sokolov + + * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all + input objects to be ECOFF. + (check_sections): einfo takes %B, not %P, to print a BFD name. + +2000-07-31 Rodney Brown + + * configure.tgt: Select targ_emul=elf_i386 for Unixware 7 + (i586-sco-sysv5uw7.1.0). + +2000-06-18 Alan Modra + + * NEWS: Update list of targets supporting --gc-sections. + + * scripttempl/elf.sc: KEEP .eh_frame contents. + * scripttempl/elfd30v.sc: Same here. + 2000-05-22 David O'Brien * configure.tgt: Recognize alpha-*-freebsd*. @@ -37,6 +139,10 @@ 2000-04-29 Andreas Jaeger * ld.h: Correctly check GCC version. + +2000-04-21 Richard Henderson + + * scripttempl/elfd30v.sc: Place .gcc_except_table. 2000-04-19 Alan Modra diff -uprN binutils-2.10/ld/Makefile.am binutils-2.10.1/ld/Makefile.am --- binutils-2.10/ld/Makefile.am Wed Apr 5 06:36:43 2000 +++ binutils-2.10.1/ld/Makefile.am Tue Nov 7 08:44:12 2000 @@ -837,7 +837,7 @@ install-data-local: LDDISTSTUFF = ldgram.c ldgram.h ldlex.c diststuff: $(LDDISTSTUFF) info -DISTCLEANFILES = tdirs site.exp site.bak +DISTCLEANFILES = tdirs site.exp site.bak stringify.sed distclean-local: rm -rf ldscripts diff -uprN binutils-2.10/ld/Makefile.in binutils-2.10.1/ld/Makefile.in --- binutils-2.10/ld/Makefile.in Wed Apr 5 06:36:43 2000 +++ binutils-2.10.1/ld/Makefile.in Tue Nov 7 08:44:12 2000 @@ -386,7 +386,7 @@ CLEANFILES = dep.sed DEP DEP1 DEP2 # target is run by the taz target in ../Makefile.in. LDDISTSTUFF = ldgram.c ldgram.h ldlex.c -DISTCLEANFILES = tdirs site.exp site.bak +DISTCLEANFILES = tdirs site.exp site.bak stringify.sed ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h diff -uprN binutils-2.10/ld/NEWS binutils-2.10.1/ld/NEWS --- binutils-2.10/ld/NEWS Thu Mar 2 01:26:27 2000 +++ binutils-2.10.1/ld/NEWS Mon Jun 19 03:31:27 2000 @@ -2,9 +2,14 @@ Changes in version 2.10: +* Added AT> to the linker script language to allow load-time allocation of + sections into regions. + * Added garbage collection of unused sections, enabled by --gc-sections. It does require a bit of backend support; currently implemented are - ppc-elf, mips-elf, and mn10300-elf. Others will ignore the option. + avr-elf, d10v-elf, fr30-elf, i386-elf, m32r-elf, m68k-elf, mcore-elf, + mips-elf, mn10300-elf, ppc-elf, sh-elf, sparc-elf, and v850-elf. + Others will ignore the option. * Added SORT to the linker script language to permit sorting sections by file name or section name. diff -uprN binutils-2.10/ld/configure binutils-2.10.1/ld/configure --- binutils-2.10/ld/configure Tue May 23 09:12:02 2000 +++ binutils-2.10.1/ld/configure Mon Oct 16 12:27:31 2000 @@ -803,7 +803,7 @@ fi PACKAGE=ld -VERSION=2.10 +VERSION=2.10.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -2133,7 +2133,7 @@ for ac_kw in inline __inline__ __inline; #include "confdefs.h" int main() { -} $ac_kw foo() { +} int $ac_kw foo() { ; return 0; } EOF if { (eval echo configure:2140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then @@ -2239,7 +2239,7 @@ else #include "confdefs.h" #include int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF if { (eval echo configure:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -2592,12 +2592,15 @@ else #include #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2652,7 +2655,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = malloc(pagesize); + data = (char*)malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2673,7 +2676,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = malloc(2 * pagesize); + data2 = (char*)malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2691,7 +2694,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); + data3 = (char*)malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2705,7 +2708,7 @@ main() } EOF -if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2712: \"$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 @@ -2733,17 +2736,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2737: checking for $ac_hdr" >&5 +echo "configure:2740: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2750: \"$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* @@ -2773,12 +2776,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2777: checking for $ac_func" >&5 +echo "configure:2780: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2808: \"$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 @@ -2830,12 +2833,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2834: checking for $ac_func" >&5 +echo "configure:2837: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2865: \"$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 @@ -2892,19 +2895,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2896: checking for LC_MESSAGES" >&5 +echo "configure:2899: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2925,7 +2928,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2929: checking whether NLS is requested" >&5 +echo "configure:2932: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2945,7 +2948,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2949: checking whether included gettext is requested" >&5 +echo "configure:2952: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2964,17 +2967,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2968: checking for libintl.h" >&5 +echo "configure:2971: checking for libintl.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2981: \"$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* @@ -2991,19 +2994,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2995: checking for gettext in libc" >&5 +echo "configure:2998: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3019,7 +3022,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3023: checking for bindtextdomain in -lintl" >&5 +echo "configure:3026: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3027,7 +3030,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3045: \"$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 @@ -3054,19 +3057,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3058: checking for gettext in libintl" >&5 +echo "configure:3061: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3094,7 +3097,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3098: checking for $ac_word" >&5 +echo "configure:3101: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3128,12 +3131,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3132: checking for $ac_func" >&5 +echo "configure:3135: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3163: \"$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 @@ -3183,7 +3186,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3187: checking for $ac_word" >&5 +echo "configure:3190: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3219,7 +3222,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3223: checking for $ac_word" >&5 +echo "configure:3226: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3251,7 +3254,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3291,7 +3294,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3295: checking for $ac_word" >&5 +echo "configure:3298: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3325,7 +3328,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3329: checking for $ac_word" >&5 +echo "configure:3332: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3361,7 +3364,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3365: checking for $ac_word" >&5 +echo "configure:3368: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3451,7 +3454,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3455: checking for catalogs to be installed" >&5 +echo "configure:3458: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3479,17 +3482,17 @@ echo "configure:3455: checking for catal if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:3483: checking for linux/version.h" >&5 +echo "configure:3486: checking for linux/version.h" >&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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3496: \"$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* @@ -3552,12 +3555,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3556: checking for Cygwin environment" >&5 +echo "configure:3559: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3585,19 +3588,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3589: checking for mingw32 environment" >&5 +echo "configure:3592: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3616,7 +3619,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3620: checking for executable suffix" >&5 +echo "configure:3623: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3626,7 +3629,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -3652,7 +3655,7 @@ 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:3656: checking for $ac_word" >&5 +echo "configure:3659: 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 @@ -3688,7 +3691,7 @@ 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:3692: checking for $ac_word" >&5 +echo "configure:3695: 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 @@ -3721,7 +3724,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # 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:3725: checking for $ac_word" >&5 +echo "configure:3728: 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 @@ -3755,7 +3758,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3759: checking for yywrap in -l$ac_lib" >&5 +echo "configure:3762: 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 @@ -3763,7 +3766,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3781: \"$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 @@ -3797,7 +3800,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3801: checking lex output file root" >&5 +echo "configure:3804: 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 @@ -3818,7 +3821,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:3822: checking whether yytext is a pointer" >&5 +echo "configure:3825: 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 @@ -3830,14 +3833,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3844: \"$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 @@ -3860,7 +3863,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3864: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:3867: 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" @@ -3894,17 +3897,17 @@ 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:3898: checking for $ac_hdr" >&5 +echo "configure:3901: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3911: \"$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* @@ -3933,12 +3936,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3937: checking for $ac_func" >&5 +echo "configure:3940: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3968: \"$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 @@ -3990,12 +3993,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:3994: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3997: 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 < #include <$ac_hdr> @@ -4003,7 +4006,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4028,7 +4031,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:4032: checking for opendir in -ldir" >&5 +echo "configure:4035: 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 @@ -4036,7 +4039,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4054: \"$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 @@ -4069,7 +4072,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4073: checking for opendir in -lx" >&5 +echo "configure:4076: 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 @@ -4077,7 +4080,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4095: \"$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 @@ -4121,12 +4124,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4125: checking whether strstr must be declared" >&5 +echo "configure:4128: 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 < @@ -4147,7 +4150,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4168,12 +4171,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4172: checking whether free must be declared" >&5 +echo "configure:4175: 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 < @@ -4194,7 +4197,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4215,12 +4218,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4219: checking whether sbrk must be declared" >&5 +echo "configure:4222: 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 < @@ -4241,7 +4244,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4262,12 +4265,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4266: checking whether getenv must be declared" >&5 +echo "configure:4269: 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 < @@ -4288,7 +4291,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4309,12 +4312,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4313: checking whether environ must be declared" >&5 +echo "configure:4316: checking whether environ must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4335,7 +4338,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -4363,19 +4366,19 @@ fi # constants, while still supporting pre-ANSI compilers which do not # support string concatenation. echo $ac_n "checking whether ANSI C string concatenation works""... $ac_c" 1>&6 -echo "configure:4367: checking whether ANSI C string concatenation works" >&5 +echo "configure:4370: checking whether ANSI C string concatenation works" >&5 if eval "test \"`echo '$''{'ld_cv_string_concatenation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ld_cv_string_concatenation=yes else diff -uprN binutils-2.10/ld/configure.in binutils-2.10.1/ld/configure.in --- binutils-2.10/ld/configure.in Tue May 23 09:12:02 2000 +++ binutils-2.10.1/ld/configure.in Mon Oct 16 12:27:31 2000 @@ -5,7 +5,7 @@ AC_INIT(ldmain.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(ld, 2.10) +AM_INIT_AUTOMAKE(ld, 2.10.1) AM_PROG_LIBTOOL diff -uprN binutils-2.10/ld/configure.tgt binutils-2.10.1/ld/configure.tgt --- binutils-2.10/ld/configure.tgt Sun May 28 12:32:34 2000 +++ binutils-2.10.1/ld/configure.tgt Sun Aug 6 16:22:07 2000 @@ -55,6 +55,8 @@ sparc*-*-linux-gnu*) targ_emul=elf32_spa tdir_sun4=sparc-sun-sunos4 ;; sparc*-*-lynxos*) targ_emul=sparclynx ;; +sparc64-*-netbsd*) targ_emul=elf64_sparc ;; +sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;; sparc*-*-netbsd*) targ_emul=sparcnbsd ;; sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) targ_emul=elf32_sparc ;; @@ -116,7 +118,7 @@ i[3456]86-*-linux-gnu*) targ_emul=elf_i3 targ_extra_emuls=i386linux tdir_i386linux=${targ_alias}aout ;; -i[3456]86-*-sysv4*) targ_emul=elf_i386 ;; +i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;; i[3456]86-*-solaris2*) targ_emul=elf_i386 ;; i[3456]86-*-unixware) targ_emul=elf_i386 ;; i[3456]86-*-solaris*) targ_emul=elf_i386 ;; diff -uprN binutils-2.10/ld/emultempl/elf32.em binutils-2.10.1/ld/emultempl/elf32.em --- binutils-2.10/ld/emultempl/elf32.em Tue Feb 29 05:53:53 2000 +++ binutils-2.10.1/ld/emultempl/elf32.em Tue Nov 7 08:44:16 2000 @@ -7,7 +7,7 @@ cat >e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -63,10 +63,9 @@ static void gld${EMULATION_NAME}_before_ static void gld${EMULATION_NAME}_find_statement_assignment PARAMS ((lang_statement_union_type *)); static void gld${EMULATION_NAME}_find_exp_assignment PARAMS ((etree_type *)); +static lang_output_section_statement_type *output_rel_find PARAMS ((void)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); -static void gld${EMULATION_NAME}_place_section - PARAMS ((lang_statement_union_type *)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); static void @@ -376,7 +375,7 @@ cat >>e${EMULATION_NAME}.c <name, l->by); } } @@ -862,58 +861,83 @@ gld${EMULATION_NAME}_find_exp_assignment } } +/* A variant of lang_output_section_find. Used by place_orphan. */ + +static lang_output_section_statement_type * +output_rel_find () +{ + lang_statement_union_type *u; + lang_output_section_statement_type *lookup; + + for (u = lang_output_section_statement.head; + u != (lang_statement_union_type *) NULL; + u = lookup->next) + { + lookup = &u->output_section_statement; + if (strncmp (".rel", lookup->name, 4) == 0 + && lookup->bfd_section != NULL + && (lookup->bfd_section->flags & SEC_ALLOC) != 0) + { + return lookup; + } + } + return (lang_output_section_statement_type *) NULL; +} + /* Place an orphan section. We use this to put random SHF_ALLOC sections in the right segment. */ -static asection *hold_section; -static lang_output_section_statement_type *hold_use; -static lang_output_section_statement_type *hold_text; -static lang_output_section_statement_type *hold_rodata; -static lang_output_section_statement_type *hold_data; -static lang_output_section_statement_type *hold_bss; -static lang_output_section_statement_type *hold_rel; -static lang_output_section_statement_type *hold_interp; +struct orphan_save { + lang_output_section_statement_type *os; + asection **section; + lang_statement_union_type **stmt; +}; -/*ARGSUSED*/ static boolean gld${EMULATION_NAME}_place_orphan (file, s) lang_input_statement_type *file; asection *s; { - lang_output_section_statement_type *place; - asection *snew, **pps; + static struct orphan_save hold_text; + static struct orphan_save hold_rodata; + static struct orphan_save hold_data; + static struct orphan_save hold_bss; + static struct orphan_save hold_rel; + static struct orphan_save hold_interp; + struct orphan_save *place; lang_statement_list_type *old; lang_statement_list_type add; etree_type *address; - const char *secname, *ps; + const char *secname; const char *outsecname; + const char *ps = NULL; lang_output_section_statement_type *os; - if ((s->flags & SEC_ALLOC) == 0) - return false; + secname = bfd_get_section_name (s->owner, s); - /* Look through the script to see where to place this section. */ - hold_section = s; - hold_use = NULL; - lang_for_each_statement (gld${EMULATION_NAME}_place_section); + /* Look through the script to see where to place this section. */ + os = lang_output_section_find (secname); - if (hold_use != NULL) + if (os != NULL + && os->bfd_section != NULL + && ((s->flags ^ os->bfd_section->flags) & (SEC_LOAD | SEC_ALLOC)) == 0) { /* We have already placed a section with this name. */ - wild_doit (&hold_use->children, s, hold_use, file); + wild_doit (&os->children, s, os, file); return true; } - secname = bfd_get_section_name (s->owner, s); + if (hold_text.os == NULL) + hold_text.os = lang_output_section_find (".text"); /* If this is a final link, then always put .gnu.warning.SYMBOL sections into the .text section to get them out of the way. */ if (! link_info.shared && ! link_info.relocateable && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0 - && hold_text != NULL) + && hold_text.os != NULL) { - wild_doit (&hold_text->children, s, hold_text, file); + wild_doit (&hold_text.os->children, s, hold_text.os, file); return true; } @@ -922,31 +946,37 @@ gld${EMULATION_NAME}_place_orphan (file, right after the .interp section, so that the PT_NOTE segment is stored right after the program headers where the OS can read it in the first page. */ - place = NULL; +#define HAVE_SECTION(hold, name) \ +(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL) + if (s->flags & SEC_EXCLUDE) return false; + + place = NULL; + if ((s->flags & SEC_ALLOC) == 0) + ; else if ((s->flags & SEC_LOAD) != 0 - && strncmp (secname, ".note", 4) == 0 - && hold_interp != NULL) - place = hold_interp; + && strncmp (secname, ".note", 4) == 0 + && HAVE_SECTION (hold_interp, ".interp")) + place = &hold_interp; else if ((s->flags & SEC_HAS_CONTENTS) == 0 - && hold_bss != NULL) - place = hold_bss; + && HAVE_SECTION (hold_bss, ".bss")) + place = &hold_bss; else if ((s->flags & SEC_READONLY) == 0 - && hold_data != NULL) - place = hold_data; + && HAVE_SECTION (hold_data, ".data")) + place = &hold_data; else if (strncmp (secname, ".rel", 4) == 0 - && hold_rel != NULL) - place = hold_rel; - else if ((s->flags & SEC_CODE) == 0 - && (s->flags & SEC_READONLY) != 0 - && hold_rodata != NULL) - place = hold_rodata; - else if ((s->flags & SEC_READONLY) != 0 - && hold_text != NULL) - place = hold_text; - if (place == NULL) - return false; + && (hold_rel.os != NULL + || (hold_rel.os = output_rel_find ()) != NULL)) + place = &hold_rel; + else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY + && HAVE_SECTION (hold_rodata, ".rodata")) + place = &hold_rodata; + else if ((s->flags & (SEC_CODE | SEC_READONLY)) == (SEC_CODE | SEC_READONLY) + && hold_text.os != NULL) + place = &hold_text; + +#undef HAVE_SECTION /* Choose a unique name for the section. This will be needed if the same section name appears in the input file with different @@ -972,113 +1002,142 @@ gld${EMULATION_NAME}_place_orphan (file, outsecname = newname; } - /* Create the section in the output file, and put it in the right - place. This shuffling is to make the output file look neater. */ - snew = bfd_make_section (output_bfd, outsecname); - if (snew == NULL) - einfo ("%P%F: output format %s cannot represent section called %s\n", - output_bfd->xvec->name, outsecname); - if (place->bfd_section != NULL) - { - for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) - ; - *pps = snew->next; - snew->next = place->bfd_section->next; - place->bfd_section->next = snew; - } - - /* Start building a list of statements for this section. */ + /* Start building a list of statements for this section. + First save the current statement pointer. */ old = stat_ptr; - stat_ptr = &add; - lang_list_init (stat_ptr); - /* If the name of the section is representable in C, then create - symbols to mark the start and the end of the section. */ - for (ps = outsecname; *ps != '\0'; ps++) - if (! isalnum ((unsigned char) *ps) && *ps != '_') - break; - if (*ps == '\0' && config.build_constructors) + /* If we have found an appropriate place for the output section + statements for this orphan, add them to our own private list, + inserting them later into the global statement list. */ + if (place != NULL) { - char *symname; + stat_ptr = &add; + lang_list_init (stat_ptr); + } - symname = (char *) xmalloc (ps - outsecname + sizeof "__start_"); - sprintf (symname, "__start_%s", outsecname); - lang_add_assignment (exp_assop ('=', symname, - exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 - << s->alignment_power)))); + if (config.build_constructors) + { + /* If the name of the section is representable in C, then create + symbols to mark the start and the end of the section. */ + for (ps = outsecname; *ps != '\0'; ps++) + if (! isalnum ((unsigned char) *ps) && *ps != '_') + break; + if (*ps == '\0') + { + char *symname; + etree_type *e_align; + + symname = (char *) xmalloc (ps - outsecname + sizeof "__start_"); + sprintf (symname, "__start_%s", outsecname); + e_align = exp_unop (ALIGN_K, + exp_intop ((bfd_vma) 1 << s->alignment_power)); + lang_add_assignment (exp_assop ('=', symname, e_align)); + } } - if (! link_info.relocateable) - address = NULL; - else + if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); + else + address = NULL; - lang_enter_output_section_statement (outsecname, address, 0, - (bfd_vma) 0, - (etree_type *) NULL, - (etree_type *) NULL, - (etree_type *) NULL); + os = lang_enter_output_section_statement (outsecname, address, 0, + (bfd_vma) 0, + (etree_type *) NULL, + (etree_type *) NULL, + (etree_type *) NULL); - os = lang_output_section_statement_lookup (outsecname); wild_doit (&os->children, s, os, file); lang_leave_output_section_statement - ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL, - "*default*"); - stat_ptr = &add; + ((bfd_vma) 0, "*default*", + (struct lang_output_section_phdr_list *) NULL, "*default*"); - if (*ps == '\0' && config.build_constructors) + if (config.build_constructors && *ps == '\0') { char *symname; + /* lang_leave_ouput_section_statement resets stat_ptr. Put + stat_ptr back where we want it. */ + if (place != NULL) + stat_ptr = &add; + symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_"); sprintf (symname, "__stop_%s", outsecname); lang_add_assignment (exp_assop ('=', symname, exp_nameop (NAME, "."))); } - /* Now stick the new statement list right after PLACE. */ - *add.tail = place->header.next; - place->header.next = add.head; - + /* Restore the global list pointer. */ stat_ptr = old; - return true; -} + if (place != NULL) + { + asection *snew, **pps; -static void -gld${EMULATION_NAME}_place_section (s) - lang_statement_union_type *s; -{ - lang_output_section_statement_type *os; + snew = os->bfd_section; + if (place->section != NULL + || (place->os->bfd_section != NULL + && place->os->bfd_section != snew)) + { + /* Shuffle the section to make the output file look neater. + This is really only cosmetic. */ + if (place->section == NULL) + { +#if 0 + /* Finding the end of the list is a little tricky. We + make a wild stab at it by comparing section flags. */ + flagword first_flags = place->os->bfd_section->flags; + for (pps = &place->os->bfd_section->next; + *pps != NULL && (*pps)->flags == first_flags; + pps = &(*pps)->next) + ; + place->section = pps; +#else + /* Put orphans after the first section on the list. */ + place->section = &place->os->bfd_section->next; +#endif + } - if (s->header.type != lang_output_section_statement_enum) - return; + /* Unlink the section. */ + for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) + ; + *pps = snew->next; + + /* Now tack it on to the "place->os" section list. */ + snew->next = *place->section; + *place->section = snew; + } + place->section = &snew->next; /* Save the end of this list. */ + + if (add.head != NULL) + { + /* We try to put the output statements in some sort of + reasonable order here, because they determine the final + load addresses of the orphan sections. */ + if (place->stmt == NULL) + { + /* Put the new statement list right at the head. */ + *add.tail = place->os->header.next; + place->os->header.next = add.head; + } + else + { + /* Put it after the last orphan statement we added. */ + *add.tail = *place->stmt; + *place->stmt = add.head; + } - os = &s->output_section_statement; + /* Fix the global list pointer if we happened to tack our + new list at the tail. */ + if (*old->tail == add.head) + old->tail = add.tail; - if (strcmp (os->name, hold_section->name) == 0 - && os->bfd_section != NULL - && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC)) - == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC)))) - hold_use = os; - - if (strcmp (os->name, ".text") == 0) - hold_text = os; - else if (strcmp (os->name, ".rodata") == 0) - hold_rodata = os; - else if (strcmp (os->name, ".data") == 0) - hold_data = os; - else if (strcmp (os->name, ".bss") == 0) - hold_bss = os; - else if (hold_rel == NULL - && os->bfd_section != NULL - && (os->bfd_section->flags & SEC_ALLOC) != 0 - && strncmp (os->name, ".rel", 4) == 0) - hold_rel = os; - else if (strcmp (os->name, ".interp") == 0) - hold_interp = os; + /* Save the end of this list. */ + place->stmt = add.tail; + } + } + + return true; } static char * diff -uprN binutils-2.10/ld/emultempl/mipsecoff.em binutils-2.10.1/ld/emultempl/mipsecoff.em --- binutils-2.10/ld/emultempl/mipsecoff.em Tue Feb 29 05:53:53 2000 +++ binutils-2.10.1/ld/emultempl/mipsecoff.em Fri Aug 4 22:17:36 2000 @@ -69,6 +69,11 @@ gld${EMULATION_NAME}_after_open () { asection *datasec; + /* As first-order business, make sure that each input BFD is ECOFF. It + better be, as we are directly calling an ECOFF backend function. */ + if (bfd_get_flavour (abfd) != bfd_target_ecoff_flavour) + einfo ("%F%B: all input objects must be ECOFF for --embedded-relocs\n"); + datasec = bfd_get_section_by_name (abfd, ".sdata"); /* Note that we assume that the reloc_count field has already @@ -113,7 +118,7 @@ check_sections (abfd, sec, sdatasec) if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0 && sec != (asection *) sdatasec && sec->reloc_count != 0) - einfo ("%P%X: section %s has relocs; can not use --embedded-relocs\n", + einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n", abfd, bfd_get_section_name (abfd, sec)); } diff -uprN binutils-2.10/ld/ld.info binutils-2.10.1/ld/ld.info --- binutils-2.10/ld/ld.info Sat Jun 10 13:40:08 2000 +++ binutils-2.10.1/ld/ld.info Tue Nov 7 10:26:21 2000 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. @@ -24,74 +24,74 @@ versions.  Indirect: -ld.info-1: 880 -ld.info-2: 50060 -ld.info-3: 98401 -ld.info-4: 146817 +ld.info-1: 882 +ld.info-2: 50064 +ld.info-3: 98405 +ld.info-4: 146821  Tag Table: (Indirect) -Node: Top880 -Node: Overview1397 -Node: Invocation2510 -Node: Options2917 -Node: Environment50060 -Node: Scripts51815 -Node: Basic Script Concepts53548 -Node: Script Format56250 -Node: Simple Example57108 -Node: Simple Commands60198 -Node: Entry Point60644 -Node: File Commands61394 -Node: Format Commands64447 -Node: Miscellaneous Commands66403 -Node: Assignments68394 -Node: Simple Assignments68726 -Node: PROVIDE70422 -Node: SECTIONS71595 -Node: Output Section Description73481 -Node: Output Section Name74466 -Node: Output Section Address75333 -Node: Input Section76967 -Node: Input Section Basics77759 -Node: Input Section Wildcards80027 -Node: Input Section Common82834 -Node: Input Section Keep84303 -Node: Input Section Example84772 -Node: Output Section Data85729 -Node: Output Section Keywords88174 -Node: Output Section Discarding91606 -Node: Output Section Attributes92551 -Node: Output Section Type93385 -Node: Output Section LMA94526 -Node: Output Section Region96630 -Node: Output Section Phdr97043 -Node: Output Section Fill97694 -Node: Overlay Description98401 -Node: MEMORY102640 -Node: PHDRS106717 -Node: VERSION111756 -Node: Expressions117834 -Node: Constants118668 -Node: Symbols119224 -Node: Location Counter119956 -Node: Operators122261 -Node: Evaluation123172 -Node: Expression Section124526 -Node: Builtin Functions126002 -Node: Implicit Linker Scripts131004 -Node: Machine Dependent131772 -Node: H8/300132226 -Node: i960133022 -Node: ARM134702 -Node: BFD135837 -Node: BFD outline137291 -Node: BFD information loss138576 -Node: Canonical format141084 -Node: Reporting Bugs145430 -Node: Bug Criteria146123 -Node: Bug Reporting146817 -Node: MRI153578 -Node: Index158177 +Node: Top882 +Node: Overview1401 +Node: Invocation2514 +Node: Options2921 +Node: Environment50064 +Node: Scripts51819 +Node: Basic Script Concepts53552 +Node: Script Format56254 +Node: Simple Example57112 +Node: Simple Commands60202 +Node: Entry Point60648 +Node: File Commands61398 +Node: Format Commands64451 +Node: Miscellaneous Commands66407 +Node: Assignments68398 +Node: Simple Assignments68730 +Node: PROVIDE70426 +Node: SECTIONS71599 +Node: Output Section Description73485 +Node: Output Section Name74470 +Node: Output Section Address75337 +Node: Input Section76971 +Node: Input Section Basics77763 +Node: Input Section Wildcards80031 +Node: Input Section Common82838 +Node: Input Section Keep84307 +Node: Input Section Example84776 +Node: Output Section Data85733 +Node: Output Section Keywords88178 +Node: Output Section Discarding91610 +Node: Output Section Attributes92555 +Node: Output Section Type93389 +Node: Output Section LMA94530 +Node: Output Section Region96634 +Node: Output Section Phdr97047 +Node: Output Section Fill97698 +Node: Overlay Description98405 +Node: MEMORY102644 +Node: PHDRS106721 +Node: VERSION111760 +Node: Expressions117838 +Node: Constants118672 +Node: Symbols119228 +Node: Location Counter119960 +Node: Operators122265 +Node: Evaluation123176 +Node: Expression Section124530 +Node: Builtin Functions126006 +Node: Implicit Linker Scripts131008 +Node: Machine Dependent131776 +Node: H8/300132230 +Node: i960133026 +Node: ARM134706 +Node: BFD135841 +Node: BFD outline137295 +Node: BFD information loss138580 +Node: Canonical format141088 +Node: Reporting Bugs145434 +Node: Bug Criteria146127 +Node: Bug Reporting146821 +Node: MRI153582 +Node: Index158181  End Tag Table diff -uprN binutils-2.10/ld/ld.info-1 binutils-2.10.1/ld/ld.info-1 --- binutils-2.10/ld/ld.info-1 Sat Jun 10 13:40:08 2000 +++ binutils-2.10.1/ld/ld.info-1 Tue Nov 7 10:26:21 2000 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. @@ -28,7 +28,7 @@ File: ld.info, Node: Top, Next: Overvi Using ld ******** - This file documents the GNU linker ld version 2.10. + This file documents the GNU linker ld version 2.10.1. * Menu: diff -uprN binutils-2.10/ld/ld.info-2 binutils-2.10.1/ld/ld.info-2 --- binutils-2.10/ld/ld.info-2 Sat Jun 10 13:40:08 2000 +++ binutils-2.10.1/ld/ld.info-2 Tue Nov 7 10:26:21 2000 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff -uprN binutils-2.10/ld/ld.info-3 binutils-2.10.1/ld/ld.info-3 --- binutils-2.10/ld/ld.info-3 Sat Jun 10 13:40:08 2000 +++ binutils-2.10.1/ld/ld.info-3 Tue Nov 7 10:26:21 2000 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff -uprN binutils-2.10/ld/ld.info-4 binutils-2.10.1/ld/ld.info-4 --- binutils-2.10/ld/ld.info-4 Sat Jun 10 13:40:08 2000 +++ binutils-2.10.1/ld/ld.info-4 Tue Nov 7 10:26:21 2000 @@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY * Ld: (ld). The GNU linker. END-INFO-DIR-ENTRY - This file documents the GNU linker LD version 2.10. + This file documents the GNU linker LD version 2.10.1. Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. diff -uprN binutils-2.10/ld/ldlang.c binutils-2.10.1/ld/ldlang.c --- binutils-2.10/ld/ldlang.c Mon Feb 21 12:01:27 2000 +++ binutils-2.10.1/ld/ldlang.c Tue Nov 7 08:44:12 2000 @@ -58,7 +58,6 @@ static lang_output_section_statement_typ static boolean map_option_f; static bfd_vma print_dot; static lang_input_statement_type *first_file; -static lang_statement_list_type lang_output_section_statement; static CONST char *current_target; static CONST char *output_target; static lang_statement_list_type statement_list; @@ -166,6 +165,7 @@ static char * get_first_input_target PAR /* EXPORTS */ lang_output_section_statement_type *abs_output_section; +lang_statement_list_type lang_output_section_statement; lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = { NULL, NULL }; const char *entry_symbol = NULL; @@ -3813,7 +3813,7 @@ topower (x) return 0; } -void +lang_output_section_statement_type * lang_enter_output_section_statement (output_section_statement_name, address_exp, sectype, block_value, align, subalign, ebase) @@ -3861,6 +3861,7 @@ lang_enter_output_section_statement (out "section alignment", 0)); os->load_base = ebase; + return os; } diff -uprN binutils-2.10/ld/ldlang.h binutils-2.10.1/ld/ldlang.h --- binutils-2.10/ld/ldlang.h Wed Feb 16 18:53:32 2000 +++ binutils-2.10.1/ld/ldlang.h Tue Nov 7 08:44:12 2000 @@ -371,6 +371,7 @@ struct lang_nocrossrefs extern struct lang_nocrossrefs *nocrossref_list; extern lang_output_section_statement_type *abs_output_section; +extern lang_statement_list_type lang_output_section_statement; extern boolean lang_has_input_file; extern etree_type *base; extern lang_statement_list_type *stat_ptr; @@ -388,7 +389,7 @@ extern void lang_map PARAMS ((void)); extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *, int)); extern void lang_add_output PARAMS ((const char *, int from_script)); -extern void lang_enter_output_section_statement +extern lang_output_section_statement_type *lang_enter_output_section_statement PARAMS ((const char *output_section_statement_name, etree_type * address_exp, enum section_type sectype, diff -uprN binutils-2.10/ld/ldlex.c binutils-2.10.1/ld/ldlex.c --- binutils-2.10/ld/ldlex.c Mon May 29 15:08:53 2000 +++ binutils-2.10.1/ld/ldlex.c Tue Nov 7 08:44:15 2000 @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/src/src/ld/Attic/ldlex.c,v 1.1.2.1 2000/05/29 14:08:53 pb Exp $ + * $Header: /cvs/src/src/ld/Attic/ldlex.c,v 1.1.2.2 2000/11/05 06:36:59 amodra Exp $ */ #define FLEX_SCANNER @@ -3408,6 +3408,11 @@ yy_create_string_buffer (string, size) b->yy_ch_buf[size+2] = YY_END_OF_BUFFER_CHAR; b->yy_n_chars = size+1; b->yy_buf_pos = &b->yy_ch_buf[1]; + + b->yy_is_our_buffer = 1; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; /* flex 2.4.7 changed the interface. FIXME: We should not be using a flex internal interface in the first place! */ diff -uprN binutils-2.10/ld/ldlex.l binutils-2.10.1/ld/ldlex.l --- binutils-2.10/ld/ldlex.l Mon May 3 08:29:06 1999 +++ binutils-2.10.1/ld/ldlex.l Tue Nov 7 08:44:15 2000 @@ -479,6 +479,11 @@ yy_create_string_buffer (string, size) b->yy_n_chars = size+1; b->yy_buf_pos = &b->yy_ch_buf[1]; + b->yy_is_our_buffer = 1; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + /* flex 2.4.7 changed the interface. FIXME: We should not be using a flex internal interface in the first place! */ #ifdef YY_BUFFER_NEW diff -uprN binutils-2.10/ld/ldver.texi binutils-2.10.1/ld/ldver.texi --- binutils-2.10/ld/ldver.texi Sat Jun 10 13:40:07 2000 +++ binutils-2.10.1/ld/ldver.texi Tue Nov 7 10:26:21 2000 @@ -1 +1 @@ -@set VERSION 2.10 +@set VERSION 2.10.1 diff -uprN binutils-2.10/ld/scripttempl/elf.sc binutils-2.10.1/ld/scripttempl/elf.sc --- binutils-2.10/ld/scripttempl/elf.sc Wed Feb 16 19:07:43 2000 +++ binutils-2.10.1/ld/scripttempl/elf.sc Mon Jun 19 03:31:27 2000 @@ -234,7 +234,7 @@ SECTIONS ${CONSTRUCTING+SORT(CONSTRUCTORS)} } .data1 ${RELOCATING-0} : { *(.data1) } - .eh_frame : { *(.eh_frame) } + .eh_frame : { KEEP (*(.eh_frame)) } .gcc_except_table : { *(.gcc_except_table) } ${WRITABLE_RODATA+${RODATA}} ${RELOCATING+${OTHER_READWRITE_SECTIONS}} @@ -242,7 +242,7 @@ SECTIONS ${RELOCATING+${DTOR}} ${DATA_PLT+${PLT}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} - .got ${RELOCATING-0} : { *(.got.plt) *(.got) } + .got ${RELOCATING-0} : { *(.got.plt) *(.got) } ${TEXT_DYNAMIC-${DYNAMIC}} /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so diff -uprN binutils-2.10/ld/scripttempl/elfd30v.sc binutils-2.10.1/ld/scripttempl/elfd30v.sc --- binutils-2.10/ld/scripttempl/elfd30v.sc Mon May 3 08:29:08 1999 +++ binutils-2.10.1/ld/scripttempl/elfd30v.sc Mon Jun 19 03:31:27 2000 @@ -121,7 +121,8 @@ SECTIONS .rodata ${RELOCATING-0} : { *(.rodata) } ${RELOCATING+ > ${DATA_MEMORY}} /* C++ exception support. */ - .eh_frame ${RELOCATING-0} : { *(.eh_frame) } ${RELOCATING+ > ${DATA_MEMORY}} + .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${DATA_MEMORY}} + .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${DATA_MEMORY}} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} @@ -213,7 +214,3 @@ SECTIONS PROVIDE (__stack = ${STACK_START_ADDR}); } EOF - - - - diff -uprN binutils-2.10/ld/testsuite/ChangeLog binutils-2.10.1/ld/testsuite/ChangeLog --- binutils-2.10/ld/testsuite/ChangeLog Wed Apr 12 00:04:03 2000 +++ binutils-2.10.1/ld/testsuite/ChangeLog Tue Nov 7 08:44:16 2000 @@ -1,3 +1,12 @@ +2000-11-06 Alan Modra + + * ld-elfvsb/main.c (PROTECTED_CHECK): Include stdio.h. + (main): Prune unused args. + +2000-10-17 Philip Blundell + + * lib/ld-lib.exp, ld-elfvsb: Update from trunk version. + 2000-04-12 Alan Modra * ld-selective/selective.exp (test4): Delete incorrect foo__1B test. diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/elf-offset.ld binutils-2.10.1/ld/testsuite/ld-elfvsb/elf-offset.ld --- binutils-2.10/ld/testsuite/ld-elfvsb/elf-offset.ld Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/elf-offset.ld Mon Oct 23 09:00:45 2000 @@ -0,0 +1,168 @@ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x100000; + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { KEEP (*(.init)) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } + _etext = .; + PROVIDE (etext = .); + .fini : { KEEP (*(.fini)) } =0x9090 + .rodata : + { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } + .rodata1 : { *(.rodata1) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(0x1000) + (. & (0x1000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : { *(.sdata) *(.sdata.*) } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : { *(.sbss) *(.scommon) } + .bss : + { + *(.dynbss) + *(.bss) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + _end = . ; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/elfvsb.dat binutils-2.10.1/ld/testsuite/ld-elfvsb/elfvsb.dat --- binutils-2.10/ld/testsuite/ld-elfvsb/elfvsb.dat Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/elfvsb.dat Mon Oct 23 09:00:45 2000 @@ -0,0 +1,22 @@ +mainvar == 1 +overriddenvar == 2 +shlibvar1 == 3 +shlib_mainvar () == 1 +shlib_overriddenvar () == 2 +shlib_shlibvar1 () == 3 +shlib_shlibvar2 () == 4 +shlib_shlibcall () == 5 +shlib_shlibcall2 () == 8 +shlib_maincall () == 6 +main_called () == 6 +shlib_checkfunptr1 (shlib_shlibvar1) == 1 +shlib_checkfunptr2 (main_called) == 1 +shlib_getfunptr1 () == shlib_shlibvar1 +shlib_getfunptr2 () == main_called +shlib_check () == 1 +visibility_check () == 1 +visibility_checkfunptr () == 1 +main_visibility_check () == 1 +visibility_checkvar () == 1 +visibility_checkvarptr () == 1 +main_visibility_checkvar () == 1 diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/elfvsb.exp binutils-2.10.1/ld/testsuite/ld-elfvsb/elfvsb.exp --- binutils-2.10/ld/testsuite/ld-elfvsb/elfvsb.exp Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/elfvsb.exp Mon Oct 23 09:00:45 2000 @@ -0,0 +1,359 @@ +# Expect script for ld-visibility tests +# Copyright (C) 2000 Free Software Foundation +# +# This file 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. +# +# Written by Ian Lance Taylor (ian@cygnus.com) +# and H.J. Lu (hjl@gnu.org) +# + +# Make sure that ld can generate ELF shared libraries with visibility. + +# This test can only be run if ld generates native executables. +if ![isnative] then {return} + +# This test can only be run on a couple of ELF platforms. +# Square bracket expressions seem to confuse istarget. +if { ![istarget i386-*-linux*] \ + && ![istarget i486-*-linux*] \ + && ![istarget i586-*-linux*] \ + && ![istarget i686-*-linux*] \ + && ![istarget m68k-*-linux*] \ + && ![istarget powerpc-*-linux*] \ + && ![istarget sparc*-*-linux*] } { + return +} + +if { [istarget *-*-linux*aout*] \ + || [istarget *-*-linux*oldld*] } { + return +} + +set tmpdir tmpdir +set SHCFLAG "" + +if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + + # AIX shared libraries do not seem to support useful features, + # like overriding the shared library function or letting the + # shared library refer to objects defined in the main program. We + # avoid testing those features. + set SHCFLAG "-DXCOFF_TEST" + + # The AIX 3.2.5 loader appears to randomly fail when loading + # shared libraries from NSF mounted partitions, so we avoid any + # potential problems by using a local directory. + catch {exec /bin/sh -c "echo $$"} pid + set tmpdir /usr/tmp/ld.$pid + catch "exec mkdir $tmpdir" exec_status + + # On AIX, we need to explicitly export the symbols the shared + # library is going to provide, and need. + set file [open $tmpdir/xcoff.exp w] + puts $file shlibvar1 + puts $file shlibvar2 + puts $file shlib_shlibvar1 + puts $file shlib_shlibvar2 + puts $file shlib_shlibcall + puts $file shlib_shlibcalled + puts $file shlib_checkfunptr1 + puts $file shlib_getfunptr1 + puts $file shlib_check + close $file +} + +set support_protected "no" + +if [istarget *-*-linux*] { + if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] { + if [ld_link $ld $tmpdir/main "$tmpdir/main.o"] { + catch "exec $tmpdir/main" support_protected + } + } +} + +# The test procedure. +proc visibility_test { visibility progname testname main sh1 sh2 dat args } { + global ld + global srcdir + global subdir + global exec_output + global link_output + global host_triplet + global tmpdir + + if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" } + + # Build the shared library. + # On AIX, we need to use an export file. + set shared -shared + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + set shared "-bM:SRE -bE:$tmpdir/xcoff.exp" + } + if {![ld_simple_link $ld $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} { + if { [ string match $visibility "hidden_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "protected_undef" ] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { + fail "$testname" + }} + return + } + + # Link against the shared library. Use -rpath so that the + # dynamic linker can locate the shared library at runtime. + # On AIX, we must include /lib in -rpath, as otherwise the loader + # can not find -lc. + set rpath $tmpdir + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + set rpath /lib:$tmpdir + } + if ![ld_link $ld $tmpdir/$progname "-rpath $rpath $tmpdir/$main $tmpdir/$progname.so"] { + if { [ string match $visibility "hidden" ] + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { if { [ string match $visibility "hidden_undef_def" ] + && [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output] + && [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } { + pass "$testname" + } else { + fail "$testname" + }} + return + } + + if { [ string match $visibility "hidden" ] + || [ string match $visibility "hidden_undef" ] + || [ string match $visibility "protected_undef" ] } { + fail "$testname" + } + + # Run the resulting program + send_log "$tmpdir/$progname >$tmpdir/$progname.out\n" + verbose "$tmpdir/$progname >$tmpdir/$progname.out" + catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output + if ![string match "" $exec_output] then { + send_log "$exec_output\n" + verbose "$exec_output" + fail "$testname" + return + } + + send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n" + verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" + catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output + set exec_output [prune_warnings $exec_output] + + if {![string match "" $exec_output]} then { + send_log "$exec_output\n" + verbose "$exec_output" + fail "$testname" + return + } + + pass "$testname" +} + +proc visibility_run {visibility} { + global CC + global CFLAGS + global SHCFLAG + global srcdir + global subdir + global tmpdir + global picflag + global target_triplet + global support_protected + + if [ string match $visibility "hidden" ] { + set VSBCFLAG "-DHIDDEN_TEST" + } else { if [ string match $visibility "hidden_normal" ] { + set VSBCFLAG "-DHIDDEN_NORMAL_TEST" + } else { if [ string match $visibility "hidden_undef" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST" + } else { if [ string match $visibility "hidden_undef_def" ] { + set VSBCFLAG "-DHIDDEN_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "hidden_weak" ] { + set VSBCFLAG "-DHIDDEN_WEAK_TEST" + } else { if [ string match $visibility "protected" ] { + set VSBCFLAG "-DPROTECTED_TEST" + } else { if [ string match $visibility "protected_undef" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST" + } else { if [ string match $visibility "protected_undef_def" ] { + set VSBCFLAG "-DPROTECTED_UNDEF_TEST -DDSO_DEFINE_TEST" + } else { if [ string match $visibility "protected_weak" ] { + set VSBCFLAG "-DPROTECTED_WEAK_TEST" + } else { + set VSBCFLAG "" + }}}}}}}}} + + # Compile the main program. + if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] { + unresolved "visibility ($visibility) (non PIC)" + unresolved "visibility ($visibility)" + } else { + # The shared library is composed of two files. First compile them + # without using -fpic. That should work on an ELF system, + # although it will be less efficient because the dynamic linker + # will need to do more relocation work. However, note that not + # using -fpic will cause some of the tests to return different + # results. + if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] + || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { + unresolved "visibility ($visibility) (non PIC)" + } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vnp "visibility ($visibility) (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff + } else { + # SunOS non PIC shared libraries don't permit some cases of + # overriding. + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + } + visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb + + # Test ELF shared library relocations with a non-zero load + # address for the library. Near as I can tell, the R_*_RELATIVE + # relocations for various targets are broken in the case where + # the load address is not zero (which is the default). + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + setup_xfail "*-*-linux*libc1" + } + visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o elfvsb \ + "-T $srcdir/$subdir/elf-offset.ld" + } } + + # Now compile the code using -fpic. + + if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o] + || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } { + unresolved "visibility ($visibility)" + } else { + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } + # SunOS can not compare function pointers correctly + if [istarget "*-*-sunos4*"] { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o sun4 + } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff + } else { + visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb + } } + } + } + + # Now do the same tests again, but this time compile main.c PIC. + if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] { + unresolved "visibility ($visibility) (PIC main, non PIC so)" + unresolved "visibility ($visibility) (PIC main)" + } else { + if { [file exists $tmpdir/sh1np.o ] && [ file exists $tmpdir/sh2np.o ] } { + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff + } else { + # SunOS non PIC shared libraries don't permit some cases of + # overriding. + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } else { + setup_xfail "*-*-sunos4*" + } + visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb + } + } else { + unresolved "visibility (PIC main, non PIC so)" + } + + if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } { + if { [ string match $visibility "protected" ] + || [ string match $visibility "protected_undef_def" ] } { + if [ string match $support_protected "no" ] { + setup_xfail $target_triplet + } + } + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff + } else { + visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb + } + } else { + unresolved "visibility ($visibility) (PIC main)" + } + } +} + +if [istarget mips*-*-*] { + set picflag "" +} else { + # Unfortunately, the gcc argument is -fpic and the cc argument is + # -KPIC. We have to try both. + set picflag "-fpic" + send_log "$CC $picflag\n" + verbose "$CC $picflag" + catch "exec $CC $picflag" exec_output + send_log "$exec_output\n" + verbose "--" "$exec_output" + if { [string match "*illegal option*" $exec_output] \ + || [string match "*option ignored*" $exec_output] \ + || [string match "*unrecognized option*" $exec_output] \ + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" + } + } +} +verbose "Using $picflag to compile PIC code" + +visibility_run hidden +visibility_run hidden_normal +visibility_run hidden_undef +visibility_run hidden_undef_def +visibility_run hidden_weak +visibility_run protected +visibility_run protected_undef +visibility_run protected_undef_def +visibility_run protected_weak +visibility_run normal + +if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + # Remove the temporary directory. + catch "exec rm -rf $tmpdir" exec_status +} diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/main.c binutils-2.10.1/ld/testsuite/ld-elfvsb/main.c --- binutils-2.10/ld/testsuite/ld-elfvsb/main.c Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/main.c Tue Nov 7 08:44:16 2000 @@ -0,0 +1,178 @@ +#ifdef PROTECTED_CHECK +#include +#include + +int +main (void) +{ +#if defined (__GLIBC__) && (__GLIBC__ > 2 \ + || (__GLIBC__ == 2 \ + && __GLIBC_MINOR__ >= 2)) + puts ("yes"); +#else + puts ("no"); +#endif + return 0; +} +#else +/* This is the main program for the shared library test. */ + +#include + +int mainvar = 1; +int overriddenvar = 2; +extern int shlibvar1; + +extern int shlib_mainvar (); +extern int shlib_overriddenvar (); +extern int shlib_shlibvar1 (); +extern int shlib_shlibvar2 (); +extern int shlib_shlibcall (); +extern int shlib_maincall (); +extern int shlib_checkfunptr1 (); +extern int shlib_checkfunptr2 (); +extern int (*shlib_getfunptr1 ()) (); +extern int (*shlib_getfunptr2 ()) (); +extern int shlib_check (); +extern int shlib_shlibcall2 (); +extern int visibility_check (); +extern int visibility_checkfunptr (); +extern void *visibility_funptr (); +extern int visibility_checkvar (); +extern int visibility_checkvarptr (); +extern int visibility_varval (); +extern void *visibility_varptr (); + +#ifdef HIDDEN_WEAK_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_WEAK_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_UNDEF_TEST +#define PROTECTED_TEST +#endif + +#ifndef WEAK_TEST +extern int visibility (); +extern int visibility_var; +#endif + +#if !defined (HIDDEN_TEST) && defined (PROTECTED_TEST) +int +visibility () +{ + return 1; +} + +static int +main_visibility_check () +{ + return visibility_funptr () != visibility; +} + +int visibility_var = 1; + +static int +main_visibility_checkvar () +{ + return visibility_varval () != visibility_var + && visibility_varptr () != &visibility_var; +} +#else +static int +main_visibility_check () +{ +#ifdef WEAK_TEST + return visibility_funptr () == NULL; +#else + return visibility_funptr () == visibility; +#endif +} + +static int +main_visibility_checkvar () +{ +#ifdef WEAK_TEST + return visibility_varval () == 0 + && visibility_varptr () == NULL; +#else + return visibility_varval () == visibility_var + && visibility_varptr () == &visibility_var; +#endif +} +#endif + +/* This function is called by the shared library. */ + +int +main_called () +{ + return 6; +} + +/* This function overrides a function in the shared library. */ + +int +shlib_overriddencall2 () +{ + return 8; +} + +int +main () +{ + int (*p) (); + + printf ("mainvar == %d\n", mainvar); + printf ("overriddenvar == %d\n", overriddenvar); + printf ("shlibvar1 == %d\n", shlibvar1); +#ifndef XCOFF_TEST + printf ("shlib_mainvar () == %d\n", shlib_mainvar ()); + printf ("shlib_overriddenvar () == %d\n", shlib_overriddenvar ()); +#endif + printf ("shlib_shlibvar1 () == %d\n", shlib_shlibvar1 ()); + printf ("shlib_shlibvar2 () == %d\n", shlib_shlibvar2 ()); + printf ("shlib_shlibcall () == %d\n", shlib_shlibcall ()); +#ifndef XCOFF_TEST + printf ("shlib_shlibcall2 () == %d\n", shlib_shlibcall2 ()); + printf ("shlib_maincall () == %d\n", shlib_maincall ()); +#endif + printf ("main_called () == %d\n", main_called ()); + printf ("shlib_checkfunptr1 (shlib_shlibvar1) == %d\n", + shlib_checkfunptr1 (shlib_shlibvar1)); +#ifndef XCOFF_TEST + printf ("shlib_checkfunptr2 (main_called) == %d\n", + shlib_checkfunptr2 (main_called)); +#endif + p = shlib_getfunptr1 (); + printf ("shlib_getfunptr1 () "); + if (p == shlib_shlibvar1) + printf ("=="); + else + printf ("!="); + printf (" shlib_shlibvar1\n"); +#ifndef XCOFF_TEST + p = shlib_getfunptr2 (); + printf ("shlib_getfunptr2 () "); + if (p == main_called) + printf ("=="); + else + printf ("!="); + printf (" main_called\n"); +#endif + printf ("shlib_check () == %d\n", shlib_check ()); + printf ("visibility_check () == %d\n", visibility_check ()); + printf ("visibility_checkfunptr () == %d\n", + visibility_checkfunptr ()); + printf ("main_visibility_check () == %d\n", main_visibility_check ()); + printf ("visibility_checkvar () == %d\n", visibility_checkvar ()); + printf ("visibility_checkvarptr () == %d\n", + visibility_checkvarptr ()); + printf ("main_visibility_checkvar () == %d\n", + main_visibility_checkvar ()); + return 0; +} +#endif diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/sh1.c binutils-2.10.1/ld/testsuite/ld-elfvsb/sh1.c --- binutils-2.10/ld/testsuite/ld-elfvsb/sh1.c Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/sh1.c Mon Oct 23 09:00:45 2000 @@ -0,0 +1,324 @@ +#ifndef NULL +#define NULL ((void *) 0) +#endif + +/* This is part of the shared library ld test. This file becomes part + of a shared library. */ + +/* This variable is supplied by the main program. */ +#ifndef XCOFF_TEST +extern int mainvar; +#endif + +/* This variable is defined in the shared library, and overridden by + the main program. */ +#ifndef XCOFF_TEST +int overriddenvar = -1; +#endif + +/* This variable is defined in the shared library. */ +int shlibvar1 = 3; + +/* This variable is defined by another object in the shared library. */ +extern int shlibvar2; + +/* These functions return the values of the above variables as seen in + the shared library. */ + +#ifndef XCOFF_TEST +int +shlib_mainvar () +{ + return mainvar; +} +#endif + +#ifndef XCOFF_TEST +int +shlib_overriddenvar () +{ + return overriddenvar; +} +#endif + +int +shlib_shlibvar1 () +{ + return shlibvar1; +} + +int +shlib_shlibvar2 () +{ + return shlibvar2; +} + +/* This function calls a function defined by another object in the + shared library. */ + +extern int shlib_shlibcalled (); + +int +shlib_shlibcall () +{ + return shlib_shlibcalled (); +} + +#ifndef XCOFF_TEST +/* This function calls a function defined in this object in the shared + library. The main program will override the called function. */ + +extern int shlib_overriddencall2 (); + +int +shlib_shlibcall2 () +{ + return shlib_overriddencall2 (); +} + +int +shlib_overriddencall2 () +{ + return 7; +} +#endif + +/* This function calls a function defined by the main program. */ + +#ifndef XCOFF_TEST +extern int main_called (); + +int +shlib_maincall () +{ + return main_called (); +} +#endif + +/* This function is passed a function pointer to shlib_mainvar. It + confirms that the pointer compares equally. */ + +int +shlib_checkfunptr1 (p) + int (*p) (); +{ + return p == shlib_shlibvar1; +} + +/* This function is passed a function pointer to main_called. It + confirms that the pointer compares equally. */ + +#ifndef XCOFF_TEST +int +shlib_checkfunptr2 (p) + int (*p) (); +{ + return p == main_called; +} +#endif + +/* This function returns a pointer to shlib_mainvar. */ + +int +(*shlib_getfunptr1 ()) () +{ + return shlib_shlibvar1; +} + +/* This function returns a pointer to main_called. */ + +#ifndef XCOFF_TEST +int +(*shlib_getfunptr2 ()) () +{ + return main_called; +} +#endif + +/* This function makes sure that constant data and local functions + work. */ + +#ifndef __STDC__ +#define const +#endif + +static int i = 6; +static const char *str = "Hello, world\n"; + +int +shlib_check () +{ + const char *s1, *s2; + + if (i != 6) + return 0; + + /* To isolate the test, don't rely on any external functions, such + as strcmp. */ + s1 = "Hello, world\n"; + s2 = str; + while (*s1 != '\0') + if (*s1++ != *s2++) + return 0; + if (*s2 != '\0') + return 0; + + if (shlib_shlibvar1 () != 3) + return 0; + + return 1; +} + +#ifdef HIDDEN_WEAK_TEST +#define HIDDEN_UNDEF_TEST +#define WEAK_TEST +#endif + +#ifdef PROTECTED_WEAK_TEST +#define PROTECTED_UNDEF_TEST +#define WEAK_TEST +#endif + +#if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST) +extern int visibility (); +#else +int +visibility () +{ + return 2; +} +#endif + +#ifdef HIDDEN_NORMAL_TEST +asm (".hidden visibility_normal"); + +int +visibility_normal () +{ + return 2; +} +#endif + +int +visibility_checkfunptr () +{ +#ifdef WEAK_TEST + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + int (*v) () = visibility_normal; +#else + int (*v) () = visibility; +#endif + return (*v) () == 2; +#endif +} + +int +visibility_check () +{ +#ifdef WEAK_TEST + if (&visibility) + return visibility () == 1; + else + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + return visibility_normal () == 2; +#else + return visibility () == 2; +#endif +#endif +} + +void * +visibility_funptr () +{ +#ifdef WEAK_TEST + if (&visibility == NULL) + return NULL; + else +#endif + return visibility; +} + +#if defined (HIDDEN_UNDEF_TEST) || defined (PROTECTED_UNDEF_TEST) +extern int visibility_var; +#else +int visibility_var = 2; +#endif + +#ifdef HIDDEN_NORMAL_TEST +asm (".hidden visibility_var_normal"); + +int visibility_var_normal = 2; +#endif + +int +visibility_checkvarptr () +{ +#ifdef WEAK_TEST + if (&visibility_var) + return visibility_var == 1; + else + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + int *v = &visibility_var_normal; +#else + int *v = &visibility_var; +#endif + return *v == 2; +#endif +} + +int +visibility_checkvar () +{ +#ifdef WEAK_TEST + return 1; +#else +#ifdef HIDDEN_NORMAL_TEST + return visibility_var_normal == 2; +#else + return visibility_var == 2; +#endif +#endif +} + +void * +visibility_varptr () +{ +#ifdef WEAK_TEST + if (&visibility_var == NULL) + return NULL; + else +#endif + return &visibility_var; +} + +int +visibility_varval () +{ +#ifdef WEAK_TEST + if (&visibility_var == NULL) + return 0; + else +#endif + return visibility_var; +} + +#if defined (HIDDEN_TEST) || defined (HIDDEN_UNDEF_TEST) +asm (".hidden visibility"); +asm (".hidden visibility_var"); +#else +#if defined (PROTECTED_TEST) || defined (PROTECTED_UNDEF_TEST) || defined (PROTECTED_WEAK_TEST) +asm (".protected visibility"); +asm (".protected visibility_var"); +#endif +#endif + +#ifdef WEAK_TEST +asm (".weak visibility"); +asm (".weak visibility_var"); +#endif diff -uprN binutils-2.10/ld/testsuite/ld-elfvsb/sh2.c binutils-2.10.1/ld/testsuite/ld-elfvsb/sh2.c --- binutils-2.10/ld/testsuite/ld-elfvsb/sh2.c Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/ld/testsuite/ld-elfvsb/sh2.c Mon Oct 23 09:00:45 2000 @@ -0,0 +1,24 @@ +/* This is part of the shared library ld test. This file becomes part + of a shared library. */ + +/* This variable is defined here, and referenced by another file in + the shared library. */ +int shlibvar2 = 4; + +/* This function is called by another file in the shared library. */ + +int +shlib_shlibcalled () +{ + return 5; +} + +#ifdef DSO_DEFINE_TEST +int +visibility () +{ + return 2; +} + +int visibility_var = 2; +#endif diff -uprN binutils-2.10/ld/testsuite/lib/ld-lib.exp binutils-2.10.1/ld/testsuite/lib/ld-lib.exp --- binutils-2.10/ld/testsuite/lib/ld-lib.exp Sun Feb 27 18:59:40 2000 +++ binutils-2.10.1/ld/testsuite/lib/ld-lib.exp Mon Oct 23 09:00:46 2000 @@ -85,6 +85,7 @@ proc default_ld_link { ld target objects global HOSTING_LIBS global LIBS global host_triplet + global link_output set objs "$HOSTING_CRT0 $objects" set libs "$LIBS $HOSTING_LIBS" @@ -98,12 +99,12 @@ proc default_ld_link { ld target objects verbose -log "$ld $HOSTING_EMU $flags -o $target $objs $libs" - catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" exec_output - set exec_output [prune_warnings $exec_output] - if [string match "" $exec_output] then { + catch "exec $ld $HOSTING_EMU $flags -o $target $objs $libs" link_output + set exec_output [prune_warnings $link_output] + if [string match "" $link_output] then { return 1 } else { - verbose -log "$exec_output" + verbose -log "$link_output" return 0 } } @@ -114,7 +115,8 @@ proc default_ld_link { ld target objects # proc default_ld_simple_link { ld target objects } { global host_triplet - + global link_output + if { [which $ld] == 0 } then { perror "$ld does not exist" return 0 @@ -124,8 +126,8 @@ proc default_ld_simple_link { ld target verbose -log "$ld $flags -o $target $objects" - catch "exec $ld $flags -o $target $objects" exec_output - set exec_output [prune_warnings $exec_output] + catch "exec $ld $flags -o $target $objects" link_output + set exec_output [prune_warnings $link_output] # We don't care if we get a warning about a non-existent start # symbol, since the default linker script might use ENTRY. diff -uprN binutils-2.10/libiberty/ChangeLog binutils-2.10.1/libiberty/ChangeLog --- binutils-2.10/libiberty/ChangeLog Fri Mar 24 21:31:22 2000 +++ binutils-2.10.1/libiberty/ChangeLog Mon Oct 23 10:43:14 2000 @@ -1,3 +1,16 @@ +2000-10-17 Philip Blundell + + * cp-demangle.c, dyn-string.c, cplus-dem.c: Update from trunk + version. + * testsuite/demangle-expected, testsuite/regress-demangle: + Likewise. + + From 2000-06-04 Alex Samuel + * Makefile.in (CFILES): Add cp-demangle.c and dyn-string.c. + (REQUIRED_OFILES): Add cp-demangle.o and dyn-string.o. + (cp-demangle.o): New dependency. + (dyn-string.o): Likewise. + Thu Mar 16 01:33:58 2000 Jeffrey A Law (law@cygnus.com) * Makefile.in (partition.o): Depend on config.h diff -uprN binutils-2.10/libiberty/Makefile.in binutils-2.10.1/libiberty/Makefile.in --- binutils-2.10/libiberty/Makefile.in Fri Mar 24 21:31:22 2000 +++ binutils-2.10.1/libiberty/Makefile.in Mon Oct 23 10:43:14 2000 @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91 - 99, 2000 +# Copyright (C) 1990, 91, 00 - 99, 2000 # Free Software Foundation # # This file is part of the libiberty library. @@ -124,7 +124,8 @@ HFILES = alloca-conf.h # (alphabetical), and add them to REQUIRED_OFILES or funcs in # configure.in. CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ - bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \ + bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \ + cp-demangle.c dyn-string.c fdmatch.c \ fnmatch.c getcwd.c getpwd.c getopt.c getopt1.c getpagesize.c \ getruntime.c floatformat.c hashtab.c hex.c index.c insque.c memchr.c \ memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ @@ -136,10 +137,10 @@ CFILES = asprintf.c alloca.c argv.c atex xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c # These are always included in the library. -REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \ - fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o \ - hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o spaces.o \ - splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ +REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \ + dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o \ + hashtab.o hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o \ + spaces.o splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ xmemdup.o xstrdup.o xstrerror.o $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) @@ -259,6 +260,8 @@ choose-temp.o: config.h clock.o: config.h concat.o: $(INCDIR)/libiberty.h cplus-dem.o: config.h $(INCDIR)/demangle.h +cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h +dyn-string.o: config.h $(INCDIR)/dyn-string.h fdmatch.o: $(INCDIR)/libiberty.h fnmatch.o: config.h $(INCDIR)/fnmatch.h getcwd.o: config.h diff -uprN binutils-2.10/libiberty/cp-demangle.c binutils-2.10.1/libiberty/cp-demangle.c --- binutils-2.10/libiberty/cp-demangle.c Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/libiberty/cp-demangle.c Mon Oct 23 10:43:14 2000 @@ -0,0 +1,3409 @@ +/* Demangler for IA64 / g++ standard C++ ABI. + Copyright (C) 2000 CodeSourcery LLC. + Written by Alex Samuel . + + 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. +*/ + +/* This file implements demangling of C++ names mangled according to + the IA64 / g++ standard C++ ABI. Use the cp_demangle function to + demangle a mangled name, or compile with the preprocessor macro + STANDALONE_DEMANGLER defined to create a demangling filter + executable. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include + +#ifdef HAVE_STRING_H +#include +#endif + +#include "ansidecl.h" +#include "libiberty.h" +#include "dyn-string.h" +#include "demangle.h" + +/* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation, + and other debugging output, will be generated. */ +#ifdef CP_DEMANGLE_DEBUG +#define DEMANGLE_TRACE(PRODUCTION, DM) \ + fprintf (stderr, " -> %-24s at position %3d\n", \ + (PRODUCTION), current_position (DM)); +#else +#define DEMANGLE_TRACE(PRODUCTION, DM) +#endif + +/* Don't include , to prevent additional unresolved symbols + from being dragged into the C++ runtime library. */ +#define IS_DIGIT(CHAR) ((CHAR) >= '0' && (CHAR) <= '9') +#define IS_ALPHA(CHAR) \ + (((CHAR) >= 'a' && (CHAR) <= 'z') \ + || ((CHAR) >= 'A' && (CHAR) <= 'Z')) + +/* If flag_verbose is zero, some simplifications will be made to the + output to make it easier to read and supress details that are + generally not of interest to the average C++ programmer. + Otherwise, the demangled representation will attempt to convey as + much information as the mangled form. */ +static int flag_verbose; + +/* If flag_strict is non-zero, demangle strictly according to the + specification -- don't demangle special g++ manglings. */ +static int flag_strict; + +/* String_list_t is an extended form of dyn_string_t which provides a link + field. A string_list_t may safely be cast to and used as a + dyn_string_t. */ + +struct string_list_def +{ + struct dyn_string string; + struct string_list_def *next; +}; + +typedef struct string_list_def *string_list_t; + +/* Data structure representing a potential substitution. */ + +struct substitution_def +{ + /* The demangled text of the substitution. */ + dyn_string_t text; + + /* The template parameter that this represents, indexed from zero. + If this is not a template paramter number, the value is + NOT_TEMPLATE_PARM. */ + int template_parm_number; + + /* Whether this substitution represents a template item. */ + int template_p : 1; +}; + +#define NOT_TEMPLATE_PARM (-1) + +/* Data structure representing a template argument list. */ + +struct template_arg_list_def +{ + /* The next (lower) template argument list in the stack of currently + active template arguments. */ + struct template_arg_list_def *next; + + /* The first element in the list of template arguments in + left-to-right order. */ + string_list_t first_argument; + + /* The last element in the arguments lists. */ + string_list_t last_argument; +}; + +typedef struct template_arg_list_def *template_arg_list_t; + +/* Data structure to maintain the state of the current demangling. */ + +struct demangling_def +{ + /* The full mangled name being mangled. */ + const char *name; + + /* Pointer into name at the current position. */ + const char *next; + + /* Stack for strings containing demangled result generated so far. + Text is emitted to the topmost (first) string. */ + string_list_t result; + + /* The number of presently available substitutions. */ + int num_substitutions; + + /* The allocated size of the substitutions array. */ + int substitutions_allocated; + + /* An array of available substitutions. The number of elements in + the array is given by num_substitions, and the allocated array + size in substitutions_size. + + The most recent substition is at the end, so + + - `S_' corresponds to substititutions[num_substitutions - 1] + - `S0_' corresponds to substititutions[num_substitutions - 2] + + etc. */ + struct substitution_def *substitutions; + + /* The stack of template argument lists. */ + template_arg_list_t template_arg_lists; + + /* The most recently demangled source-name. */ + dyn_string_t last_source_name; +}; + +typedef struct demangling_def *demangling_t; + +/* This type is the standard return code from most functions. Values + other than STATUS_OK contain descriptive messages. */ +typedef const char *status_t; + +/* Special values that can be used as a status_t. */ +#define STATUS_OK NULL +#define STATUS_ERROR "Error." +#define STATUS_UNIMPLEMENTED "Unimplemented." +#define STATUS_INTERNAL_ERROR "Internal error." + +/* This status code indicates a failure in malloc or realloc. */ +static const char* const status_allocation_failed = "Allocation failed."; +#define STATUS_ALLOCATION_FAILED status_allocation_failed + +/* Non-zero if STATUS indicates that no error has occurred. */ +#define STATUS_NO_ERROR(STATUS) ((STATUS) == STATUS_OK) + +/* Evaluate EXPR, which must produce a status_t. If the status code + indicates an error, return from the current function with that + status code. */ +#define RETURN_IF_ERROR(EXPR) \ + do \ + { \ + status_t s = EXPR; \ + if (!STATUS_NO_ERROR (s)) \ + return s; \ + } \ + while (0) + +static status_t int_to_dyn_string + PARAMS ((int, dyn_string_t)); +static string_list_t string_list_new + PARAMS ((int)); +static void string_list_delete + PARAMS ((string_list_t)); +static status_t result_close_template_list + PARAMS ((demangling_t)); +static status_t result_push + PARAMS ((demangling_t)); +static string_list_t result_pop + PARAMS ((demangling_t)); +static int substitution_start + PARAMS ((demangling_t)); +static status_t substitution_add + PARAMS ((demangling_t, int, int, int)); +static dyn_string_t substitution_get + PARAMS ((demangling_t, int, int *)); +#ifdef CP_DEMANGLE_DEBUG +static void substitutions_print + PARAMS ((demangling_t, FILE *)); +#endif +static template_arg_list_t template_arg_list_new + PARAMS ((void)); +static void template_arg_list_delete + PARAMS ((template_arg_list_t)); +static void template_arg_list_add_arg + PARAMS ((template_arg_list_t, string_list_t)); +static string_list_t template_arg_list_get_arg + PARAMS ((template_arg_list_t, int)); +static void push_template_arg_list + PARAMS ((demangling_t, template_arg_list_t)); +static void pop_to_template_arg_list + PARAMS ((demangling_t, template_arg_list_t)); +#ifdef CP_DEMANGLE_DEBUG +static void template_arg_list_print + PARAMS ((template_arg_list_t, FILE *)); +#endif +static template_arg_list_t current_template_arg_list + PARAMS ((demangling_t)); +static demangling_t demangling_new + PARAMS ((const char *)); +static void demangling_delete + PARAMS ((demangling_t)); + +/* The last character of DS. Warning: DS is evaluated twice. */ +#define dyn_string_last_char(DS) \ + (dyn_string_buf (DS)[dyn_string_length (DS) - 1]) + +/* Append a space character (` ') to DS if it does not already end + with one. Evaluates to 1 on success, or 0 on allocation failure. */ +#define dyn_string_append_space(DS) \ + ((dyn_string_length (DS) > 0 \ + && dyn_string_last_char (DS) != ' ') \ + ? dyn_string_append_char ((DS), ' ') \ + : 1) + +/* Returns the index of the current position in the mangled name. */ +#define current_position(DM) ((DM)->next - (DM)->name) + +/* Returns the character at the current position of the mangled name. */ +#define peek_char(DM) (*((DM)->next)) + +/* Returns the character one past the current position of the mangled + name. */ +#define peek_char_next(DM) \ + (peek_char (DM) == '\0' ? '\0' : (*((DM)->next + 1))) + +/* Returns the character at the current position, and advances the + current position to the next character. */ +#define next_char(DM) (*((DM)->next)++) + +/* Returns non-zero if the current position is the end of the mangled + name, i.e. one past the last character. */ +#define end_of_name_p(DM) (peek_char (DM) == '\0') + +/* Advances the current position by one character. */ +#define advance_char(DM) (++(DM)->next) + +/* Returns the string containing the current demangled result. */ +#define result_string(DM) (&(DM)->result->string) + +/* Appends a dyn_string_t to the demangled result. */ +#define result_append_string(DM, STRING) \ + (dyn_string_append (&(DM)->result->string, (STRING)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends NUL-terminated string CSTR to the demangled result. */ +#define result_append(DM, CSTR) \ + (dyn_string_append_cstr (&(DM)->result->string, (CSTR)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends character CHAR to the demangled result. */ +#define result_append_char(DM, CHAR) \ + (dyn_string_append_char (&(DM)->result->string, (CHAR)) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* The length of the current demangled result. */ +#define result_length(DM) \ + dyn_string_length (&(DM)->result->string) + +/* Appends a space to the demangled result if the last character is + not a space. */ +#define result_append_space(DM) \ + (dyn_string_append_space (&(DM)->result->string) \ + ? STATUS_OK : STATUS_ALLOCATION_FAILED) + +/* Appends a base 10 representation of VALUE to DS. STATUS_OK on + success. On failure, deletes DS and returns an error code. */ + +static status_t +int_to_dyn_string (value, ds) + int value; + dyn_string_t ds; +{ + int i; + int mask = 1; + + /* Handle zero up front. */ + if (value == 0) + { + if (!dyn_string_append_char (ds, '0')) + return STATUS_ALLOCATION_FAILED; + return STATUS_OK; + } + + /* For negative numbers, emit a minus sign. */ + if (value < 0) + { + if (!dyn_string_append_char (ds, '-')) + return STATUS_ALLOCATION_FAILED; + value = -value; + } + + /* Find the power of 10 of the first digit. */ + i = value; + while (i > 9) + { + mask *= 10; + i /= 10; + } + + /* Write the digits. */ + while (mask > 0) + { + int digit = value / mask; + + if (!dyn_string_append_char (ds, '0' + digit)) + return STATUS_ALLOCATION_FAILED; + + value -= digit * mask; + mask /= 10; + } + + return STATUS_OK; +} + +/* Creates a new string list node. The contents of the string are + empty, but the initial buffer allocation is LENGTH. The string + list node should be deleted with string_list_delete. Returns NULL + if allocation fails. */ + +static string_list_t +string_list_new (length) + int length; +{ + string_list_t s = (string_list_t) malloc (sizeof (struct string_list_def)); + if (s == NULL) + return NULL; + if (!dyn_string_init ((dyn_string_t) s, length)) + return NULL; + return s; +} + +/* Deletes the entire string list starting at NODE. */ + +static void +string_list_delete (node) + string_list_t node; +{ + while (node != NULL) + { + string_list_t next = node->next; + free (node); + node = next; + } +} + +/* Appends a greater-than character to the demangled result. If the + last character is a greater-than character, a space is inserted + first, so that the two greater-than characters don't look like a + right shift token. */ + +static status_t +result_close_template_list (dm) + demangling_t dm; +{ + dyn_string_t s = &dm->result->string; + + /* Add a space if the last character is already a closing angle + bracket, so that a nested template arg list doesn't look like + it's closed with a right-shift operator. */ + if (dyn_string_last_char (s) == '>') + { + if (!dyn_string_append_char (s, ' ')) + return STATUS_ALLOCATION_FAILED; + } + + /* Add closing angle brackets. */ + if (!dyn_string_append_char (s, '>')) + return STATUS_ALLOCATION_FAILED; + + return STATUS_OK; +} + +/* Allocates and pushes a new string onto the demangled results stack + for DM. Subsequent demangling with DM will emit to the new string. + Returns STATUS_OK on success, STATUS_ALLOCATION_FAILED on + allocation failure. */ + +static status_t +result_push (dm) + demangling_t dm; +{ + string_list_t new_string = string_list_new (0); + if (new_string == NULL) + /* Allocation failed. */ + return STATUS_ALLOCATION_FAILED; + + /* Link the new string to the front of the list of result strings. */ + new_string->next = (string_list_t) dm->result; + dm->result = new_string; + return STATUS_OK; +} + +/* Removes and returns the topmost element on the demangled results + stack for DM. The caller assumes ownership for the returned + string. */ + +static string_list_t +result_pop (dm) + demangling_t dm; +{ + string_list_t top = dm->result; + dm->result = top->next; + return top; +} + +/* Returns the start position of a fragment of the demangled result + that will be a substitution candidate. Should be called at the + start of productions that can add substitutions. */ + +static int +substitution_start (dm) + demangling_t dm; +{ + return result_length (dm); +} + +/* Adds the suffix of the current demangled result of DM starting at + START_POSITION as a potential substitution. If TEMPLATE_P is + non-zero, this potential substitution is a template-id. + + If TEMPLATE_PARM_NUMBER is not NOT_TEMPLATE_PARM, the substitution + is for that particular , and is distinct from other + otherwise-identical types and other s with + different indices. */ + +static status_t +substitution_add (dm, start_position, template_p, template_parm_number) + demangling_t dm; + int start_position; + int template_p; + int template_parm_number; +{ + dyn_string_t result = result_string (dm); + dyn_string_t substitution = dyn_string_new (0); + int i; + + if (substitution == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Extract the substring of the current demangling result that + represents the subsitution candidate. */ + if (!dyn_string_substring (substitution, + result, start_position, result_length (dm))) + { + dyn_string_delete (substitution); + return STATUS_ALLOCATION_FAILED; + } + + /* Check whether SUBSTITUTION already occurs. */ + for (i = 0; i < dm->num_substitutions; ++i) + if (dyn_string_eq (dm->substitutions[i].text, substitution) + && dm->substitutions[i].template_parm_number == template_parm_number) + /* Found SUBSTITUTION already present. */ + { + /* Callers expect this function to take ownership of + SUBSTITUTION, so delete it. */ + dyn_string_delete (substitution); + return STATUS_OK; + } + + /* If there's no room for the new entry, grow the array. */ + if (dm->substitutions_allocated == dm->num_substitutions) + { + size_t new_array_size; + dm->substitutions_allocated *= 2; + new_array_size = + sizeof (struct substitution_def) * dm->substitutions_allocated; + + dm->substitutions = (struct substitution_def *) + realloc (dm->substitutions, new_array_size); + if (dm->substitutions == NULL) + /* Realloc failed. */ + { + dyn_string_delete (substitution); + return STATUS_ALLOCATION_FAILED; + } + } + + /* Add the substitution to the array. */ + dm->substitutions[i].text = substitution; + dm->substitutions[i].template_p = template_p; + dm->substitutions[i].template_parm_number = template_parm_number; + ++dm->num_substitutions; + +#ifdef CP_DEMANGLE_DEBUG + substitutions_print (dm, stderr); +#endif + + return STATUS_OK; +} + +/* Returns the Nth-most-recent substitution. Sets *TEMPLATE_P to + non-zero if the substitution is a template-id, zero otherwise. + N is numbered from zero. DM retains ownership of the returned + string. If N is negative, or equal to or greater than the current + number of substitution candidates, returns NULL. */ + +static dyn_string_t +substitution_get (dm, n, template_p) + demangling_t dm; + int n; + int *template_p; +{ + struct substitution_def *sub; + + /* Make sure N is in the valid range. */ + if (n < 0 || n >= dm->num_substitutions) + return NULL; + + sub = &(dm->substitutions[n]); + *template_p = sub->template_p; + return sub->text; +} + +#ifdef CP_DEMANGLE_DEBUG +/* Debugging routine to print the current substitutions to FP. */ + +static void +substitutions_print (dm, fp) + demangling_t dm; + FILE *fp; +{ + int seq_id; + int num = dm->num_substitutions; + + fprintf (fp, "SUBSTITUTIONS:\n"); + for (seq_id = -1; seq_id < num - 1; ++seq_id) + { + int template_p; + dyn_string_t text = substitution_get (dm, seq_id + 1, &template_p); + + if (seq_id == -1) + fprintf (fp, " S_ "); + else + fprintf (fp, " S%d_", seq_id); + fprintf (fp, " %c: %s\n", template_p ? '*' : ' ', dyn_string_buf (text)); + } +} + +#endif /* CP_DEMANGLE_DEBUG */ + +/* Creates a new template argument list. Returns NULL if allocation + fails. */ + +static template_arg_list_t +template_arg_list_new () +{ + template_arg_list_t new_list = + (template_arg_list_t) malloc (sizeof (struct template_arg_list_def)); + if (new_list == NULL) + return NULL; + /* Initialize the new list to have no arguments. */ + new_list->first_argument = NULL; + new_list->last_argument = NULL; + /* Return the new list. */ + return new_list; +} + +/* Deletes a template argument list and the template arguments it + contains. */ + +static void +template_arg_list_delete (list) + template_arg_list_t list; +{ + /* If there are any arguments on LIST, delete them. */ + if (list->first_argument != NULL) + string_list_delete (list->first_argument); + /* Delete LIST. */ + free (list); +} + +/* Adds ARG to the template argument list ARG_LIST. */ + +static void +template_arg_list_add_arg (arg_list, arg) + template_arg_list_t arg_list; + string_list_t arg; +{ + if (arg_list->first_argument == NULL) + /* If there were no arguments before, ARG is the first one. */ + arg_list->first_argument = arg; + else + /* Make ARG the last argument on the list. */ + arg_list->last_argument->next = arg; + /* Make ARG the last on the list. */ + arg_list->last_argument = arg; + arg->next = NULL; +} + +/* Returns the template arugment at position INDEX in template + argument list ARG_LIST. */ + +static string_list_t +template_arg_list_get_arg (arg_list, index) + template_arg_list_t arg_list; + int index; +{ + string_list_t arg = arg_list->first_argument; + /* Scan down the list of arguments to find the one at position + INDEX. */ + while (index--) + { + arg = arg->next; + if (arg == NULL) + /* Ran out of arguments before INDEX hit zero. That's an + error. */ + return NULL; + } + /* Return the argument at position INDEX. */ + return arg; +} + +/* Pushes ARG_LIST onto the top of the template argument list stack. */ + +static void +push_template_arg_list (dm, arg_list) + demangling_t dm; + template_arg_list_t arg_list; +{ + arg_list->next = dm->template_arg_lists; + dm->template_arg_lists = arg_list; +#ifdef CP_DEMANGLE_DEBUG + fprintf (stderr, " ** pushing template arg list\n"); + template_arg_list_print (arg_list, stderr); +#endif +} + +/* Pops and deletes elements on the template argument list stack until + arg_list is the topmost element. If arg_list is NULL, all elements + are popped and deleted. */ + +static void +pop_to_template_arg_list (dm, arg_list) + demangling_t dm; + template_arg_list_t arg_list; +{ + while (dm->template_arg_lists != arg_list) + { + template_arg_list_t top = dm->template_arg_lists; + /* Disconnect the topmost element from the list. */ + dm->template_arg_lists = top->next; + /* Delete the popped element. */ + template_arg_list_delete (top); +#ifdef CP_DEMANGLE_DEBUG + fprintf (stderr, " ** removing template arg list\n"); +#endif + } +} + +#ifdef CP_DEMANGLE_DEBUG + +/* Prints the contents of ARG_LIST to FP. */ + +static void +template_arg_list_print (arg_list, fp) + template_arg_list_t arg_list; + FILE *fp; +{ + string_list_t arg; + int index = -1; + + fprintf (fp, "TEMPLATE ARGUMENT LIST:\n"); + for (arg = arg_list->first_argument; arg != NULL; arg = arg->next) + { + if (index == -1) + fprintf (fp, " T_ : "); + else + fprintf (fp, " T%d_ : ", index); + ++index; + fprintf (fp, "%s\n", dyn_string_buf ((dyn_string_t) arg)); + } +} + +#endif /* CP_DEMANGLE_DEBUG */ + +/* Returns the topmost element on the stack of template argument + lists. If there is no list of template arguments, returns NULL. */ + +static template_arg_list_t +current_template_arg_list (dm) + demangling_t dm; +{ + return dm->template_arg_lists; +} + +/* Allocates a demangling_t object for demangling mangled NAME. A new + result must be pushed before the returned object can be used. + Returns NULL if allocation fails. */ + +static demangling_t +demangling_new (name) + const char *name; +{ + demangling_t dm; + dm = (demangling_t) malloc (sizeof (struct demangling_def)); + if (dm == NULL) + return NULL; + + dm->name = name; + dm->next = name; + dm->result = NULL; + dm->num_substitutions = 0; + dm->substitutions_allocated = 10; + dm->template_arg_lists = NULL; + dm->last_source_name = dyn_string_new (0); + if (dm->last_source_name == NULL) + return NULL; + dm->substitutions = (struct substitution_def *) + malloc (dm->substitutions_allocated * sizeof (struct substitution_def)); + if (dm->substitutions == NULL) + { + dyn_string_delete (dm->last_source_name); + return NULL; + } + + return dm; +} + +/* Deallocates a demangling_t object and all memory associated with + it. */ + +static void +demangling_delete (dm) + demangling_t dm; +{ + int i; + template_arg_list_t arg_list = dm->template_arg_lists; + + /* Delete the stack of template argument lists. */ + while (arg_list != NULL) + { + template_arg_list_t next = arg_list->next; + template_arg_list_delete (arg_list); + arg_list = next; + } + /* Delete the list of substitutions. */ + for (i = dm->num_substitutions; --i >= 0; ) + dyn_string_delete (dm->substitutions[i].text); + free (dm->substitutions); + /* Delete the demangled result. */ + string_list_delete (dm->result); + /* Delete the stored identifier name. */ + dyn_string_delete (dm->last_source_name); + /* Delete the context object itself. */ + free (dm); +} + +/* These functions demangle an alternative of the corresponding + production in the mangling spec. The first argument of each is a + demangling context structure for the current demangling + operation. Most emit demangled text directly to the topmost result + string on the result string stack in the demangling context + structure. */ + +static status_t demangle_char + PARAMS ((demangling_t, int)); +static status_t demangle_mangled_name + PARAMS ((demangling_t)); +static status_t demangle_encoding + PARAMS ((demangling_t)); +static status_t demangle_name + PARAMS ((demangling_t, int *)); +static status_t demangle_nested_name + PARAMS ((demangling_t, int *)); +static status_t demangle_prefix + PARAMS ((demangling_t, int *)); +static status_t demangle_unqualified_name + PARAMS ((demangling_t)); +static status_t demangle_source_name + PARAMS ((demangling_t)); +static status_t demangle_number + PARAMS ((demangling_t, int *, int, int)); +static status_t demangle_number_literally + PARAMS ((demangling_t, dyn_string_t, int, int)); +static status_t demangle_identifier + PARAMS ((demangling_t, int, dyn_string_t)); +static status_t demangle_operator_name + PARAMS ((demangling_t, int, int *)); +static status_t demangle_special_name + PARAMS ((demangling_t)); +static status_t demangle_ctor_dtor_name + PARAMS ((demangling_t)); +static status_t demangle_type_ptr + PARAMS ((demangling_t)); +static status_t demangle_type + PARAMS ((demangling_t)); +static status_t demangle_CV_qualifiers + PARAMS ((demangling_t, dyn_string_t)); +static status_t demangle_builtin_type + PARAMS ((demangling_t)); +static status_t demangle_function_type + PARAMS ((demangling_t, int)); +static status_t demangle_bare_function_type + PARAMS ((demangling_t, int)); +static status_t demangle_class_enum_type + PARAMS ((demangling_t, int *)); +static status_t demangle_array_type + PARAMS ((demangling_t)); +static status_t demangle_template_param + PARAMS ((demangling_t, int *)); +static status_t demangle_template_args + PARAMS ((demangling_t)); +static status_t demangle_literal + PARAMS ((demangling_t)); +static status_t demangle_template_arg + PARAMS ((demangling_t)); +static status_t demangle_expression + PARAMS ((demangling_t)); +static status_t demangle_scope_expression + PARAMS ((demangling_t)); +static status_t demangle_expr_primary + PARAMS ((demangling_t)); +static status_t demangle_substitution + PARAMS ((demangling_t, int *, int *)); +static status_t demangle_local_name + PARAMS ((demangling_t)); +static status_t demangle_discriminator + PARAMS ((demangling_t, int)); +static status_t cp_demangle + PARAMS ((const char *, dyn_string_t)); +static status_t cp_demangle_type + PARAMS ((const char*, dyn_string_t)); + +/* When passed to demangle_bare_function_type, indicates that the + function's return type is not encoded before its parameter types. */ +#define BFT_NO_RETURN_TYPE -1 + +/* Check that the next character is C. If so, consume it. If not, + return an error. */ + +static status_t +demangle_char (dm, c) + demangling_t dm; + int c; +{ + static char *error_message = NULL; + + if (peek_char (dm) == c) + { + advance_char (dm); + return STATUS_OK; + } + else + { + if (error_message == NULL) + error_message = strdup ("Expected ?"); + error_message[9] = c; + return error_message; + } +} + +/* Demangles and emits a . + + ::= _Z */ + +static status_t +demangle_mangled_name (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("mangled-name", dm); + RETURN_IF_ERROR (demangle_char (dm, '_')); + RETURN_IF_ERROR (demangle_char (dm, 'Z')); + RETURN_IF_ERROR (demangle_encoding (dm)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= + ::= */ + +static status_t +demangle_encoding (dm) + demangling_t dm; +{ + int template_p; + int start_position; + template_arg_list_t old_arg_list = current_template_arg_list (dm); + char peek = peek_char (dm); + + DEMANGLE_TRACE ("encoding", dm); + + /* Remember where the name starts. If it turns out to be a template + function, we'll have to insert the return type here. */ + start_position = result_length (dm); + + if (peek == 'G' || peek == 'T') + RETURN_IF_ERROR (demangle_special_name (dm)); + else + { + /* Now demangle the name. */ + RETURN_IF_ERROR (demangle_name (dm, &template_p)); + + /* If there's anything left, the name was a function name, with + maybe its return type, and its parameters types, following. */ + if (!end_of_name_p (dm) + && peek_char (dm) != 'E') + { + if (template_p) + /* Template functions have their return type encoded. The + return type should be inserted at start_position. */ + RETURN_IF_ERROR + (demangle_bare_function_type (dm, start_position)); + else + /* Non-template functions don't have their return type + encoded. */ + RETURN_IF_ERROR + (demangle_bare_function_type (dm, BFT_NO_RETURN_TYPE)); + } + } + + /* Pop off template argument lists that were built during the + mangling of this name, to restore the old template context. */ + pop_to_template_arg_list (dm, old_arg_list); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= + ::= + ::= + ::= + + ::= + ::= St # ::std:: + + + ::= + ::= */ + +static status_t +demangle_name (dm, template_p) + demangling_t dm; + int *template_p; +{ + int special_std_substitution; + int start = substitution_start (dm); + + DEMANGLE_TRACE ("name", dm); + + switch (peek_char (dm)) + { + case 'N': + /* This is a . */ + RETURN_IF_ERROR (demangle_nested_name (dm, template_p)); + break; + + case 'Z': + RETURN_IF_ERROR (demangle_local_name (dm)); + break; + + case 'S': + /* The `St' substitution allows a name nested in std:: to appear + without being enclosed in a nested name. */ + if (peek_char_next (dm) == 't') + { + (void) next_char (dm); + (void) next_char (dm); + RETURN_IF_ERROR (result_append (dm, "std::")); + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + } + else + { + RETURN_IF_ERROR (demangle_substitution (dm, template_p, + &special_std_substitution)); + if (special_std_substitution) + { + /* This was the magic `std::' substitution. We can have + a or one of the unscoped names + following. */ + RETURN_IF_ERROR (result_append (dm, "::")); + RETURN_IF_ERROR (demangle_name (dm, template_p)); + } + } + /* Check if a template argument list immediately follows. + If so, then we just demangled an . */ + if (peek_char (dm) == 'I') + { + RETURN_IF_ERROR (substitution_add (dm, start, 0, + NOT_TEMPLATE_PARM)); + RETURN_IF_ERROR (demangle_template_args (dm)); + } + break; + + default: + /* This is an or . */ + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + + /* If the is followed by template args, this + is an . */ + if (peek_char (dm) == 'I') + { + /* Add a substitution for the unqualified template name. */ + RETURN_IF_ERROR (substitution_add (dm, start, 0, + NOT_TEMPLATE_PARM)); + + RETURN_IF_ERROR (demangle_template_args (dm)); + *template_p = 1; + } + else + *template_p = 0; + + break; + } + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= N [] E */ + +static status_t +demangle_nested_name (dm, template_p) + demangling_t dm; + int *template_p; +{ + char peek; + + DEMANGLE_TRACE ("nested-name", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'N')); + + peek = peek_char (dm); + if (peek == 'r' || peek == 'V' || peek == 'K') + { + status_t status; + + /* Snarf up and emit CV qualifiers. */ + dyn_string_t cv_qualifiers = dyn_string_new (24); + if (cv_qualifiers == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_CV_qualifiers (dm, cv_qualifiers); + status = result_append_string (dm, cv_qualifiers); + dyn_string_delete (cv_qualifiers); + RETURN_IF_ERROR (status); + RETURN_IF_ERROR (result_append_space (dm)); + } + + RETURN_IF_ERROR (demangle_prefix (dm, template_p)); + /* No need to demangle the final ; demangle_prefix will + handle it. */ + RETURN_IF_ERROR (demangle_char (dm, 'E')); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= + ::= + ::= # empty + ::= + + ::= + ::= + + ::= + ::= */ + +static status_t +demangle_prefix (dm, template_p) + demangling_t dm; + int *template_p; +{ + int start = substitution_start (dm); + int nested = 0; + + /* TEMPLATE_P is updated as we decend the nesting chain. After + , it is set to non-zero; after everything else it + is set to zero. */ + + DEMANGLE_TRACE ("prefix", dm); + + while (1) + { + char peek; + int unused; + + if (end_of_name_p (dm)) + return "Unexpected end of name in ."; + + peek = peek_char (dm); + + if (IS_DIGIT ((unsigned char) peek) + || (peek >= 'a' && peek <= 'z') + || peek == 'C' || peek == 'D' + || peek == 'S') + { + /* We have another level of scope qualification. */ + if (nested) + RETURN_IF_ERROR (result_append (dm, "::")); + else + nested = 1; + + if (peek == 'S') + /* The substitution determines whether this is a + template-id. */ + RETURN_IF_ERROR (demangle_substitution (dm, template_p, + &unused)); + else + { + RETURN_IF_ERROR (demangle_unqualified_name (dm)); + *template_p = 0; + } + } + else if (peek == 'Z') + RETURN_IF_ERROR (demangle_local_name (dm)); + else if (peek == 'I') + { + if (*template_p) + return STATUS_INTERNAL_ERROR; + /* The template name is a substitution candidate. */ + RETURN_IF_ERROR (substitution_add (dm, start, 0, NOT_TEMPLATE_PARM)); + RETURN_IF_ERROR (demangle_template_args (dm)); + *template_p = 1; + } + else if (peek == 'E') + /* All done. */ + return STATUS_OK; + else + return "Unexpected character in ."; + + /* Add a new substitution for the prefix thus far. */ + RETURN_IF_ERROR (substitution_add (dm, start, *template_p, + NOT_TEMPLATE_PARM)); + } +} + +/* Demangles and emits an . If the + is a function and the first element in the + argument list should be taken to be its return type, + ENCODE_RETURN_TYPE is non-zero. + + ::= + ::= + ::= */ + +static status_t +demangle_unqualified_name (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + + DEMANGLE_TRACE ("unqualified-name", dm); + + if (IS_DIGIT ((unsigned char) peek)) + RETURN_IF_ERROR (demangle_source_name (dm)); + else if (peek >= 'a' && peek <= 'z') + { + int num_args; + RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args)); + } + else if (peek == 'C' || peek == 'D') + RETURN_IF_ERROR (demangle_ctor_dtor_name (dm)); + else + return "Unexpected character in ."; + + return STATUS_OK; +} + +/* Demangles and emits . + + ::= */ + +static status_t +demangle_source_name (dm) + demangling_t dm; +{ + int length; + + DEMANGLE_TRACE ("source-name", dm); + + /* Decode the length of the identifier. */ + RETURN_IF_ERROR (demangle_number (dm, &length, 10, 0)); + if (length == 0) + return "Zero length in ."; + + /* Now the identifier itself. It's placed into last_source_name, + where it can be used to build a constructor or destructor name. */ + RETURN_IF_ERROR (demangle_identifier (dm, length, + dm->last_source_name)); + + /* Emit it. */ + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + + return STATUS_OK; +} + +/* Demangles a number, either a or a at the + current position, consuming all consecutive digit characters. Sets + *VALUE to the resulting numberand returns STATUS_OK. The number is + interpreted as BASE, which must be either 10 or 36. If IS_SIGNED + is non-zero, negative numbers -- prefixed with `n' -- are accepted. + + ::= [n] + + ::= */ + +static status_t +demangle_number (dm, value, base, is_signed) + demangling_t dm; + int *value; + int base; + int is_signed; +{ + dyn_string_t number = dyn_string_new (10); + + DEMANGLE_TRACE ("number", dm); + + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_number_literally (dm, number, base, is_signed); + *value = strtol (dyn_string_buf (number), NULL, base); + dyn_string_delete (number); + + return STATUS_OK; +} + +/* Demangles a number at the current position. The digits (and minus + sign, if present) that make up the number are appended to STR. + Only base-BASE digits are accepted; BASE must be either 10 or 36. + If IS_SIGNED, negative numbers -- prefixed with `n' -- are + accepted. Does not consume a trailing underscore or other + terminating character. */ + +static status_t +demangle_number_literally (dm, str, base, is_signed) + demangling_t dm; + dyn_string_t str; + int base; + int is_signed; +{ + DEMANGLE_TRACE ("number*", dm); + + if (base != 10 && base != 36) + return STATUS_INTERNAL_ERROR; + + /* An `n' denotes a negative number. */ + if (is_signed && peek_char (dm) == 'n') + { + /* Skip past the n. */ + advance_char (dm); + /* The normal way to write a negative number is with a minus + sign. */ + if (!dyn_string_append_char (str, '-')) + return STATUS_ALLOCATION_FAILED; + } + + /* Loop until we hit a non-digit. */ + while (1) + { + char peek = peek_char (dm); + if (IS_DIGIT ((unsigned char) peek) + || (base == 36 && peek >= 'A' && peek <= 'Z')) + { + /* Accumulate digits. */ + if (!dyn_string_append_char (str, next_char (dm))) + return STATUS_ALLOCATION_FAILED; + } + else + /* Not a digit? All done. */ + break; + } + + return STATUS_OK; +} + +/* Demangles an identifier at the current position of LENGTH + characters and places it in IDENTIFIER. */ + +static status_t +demangle_identifier (dm, length, identifier) + demangling_t dm; + int length; + dyn_string_t identifier; +{ + DEMANGLE_TRACE ("identifier", dm); + + dyn_string_clear (identifier); + if (!dyn_string_resize (identifier, length)) + return STATUS_ALLOCATION_FAILED; + + while (length-- > 0) + { + if (end_of_name_p (dm)) + return "Unexpected end of name in ."; + if (!dyn_string_append_char (identifier, next_char (dm))) + return STATUS_ALLOCATION_FAILED; + } + + return STATUS_OK; +} + +/* Demangles and emits an . If SHORT_NAME is non-zero, + the short form is emitted; otherwise the full source form + (`operator +' etc.) is emitted. *NUM_ARGS is set to the number of + operands that the operator takes. + + + ::= nw # new + ::= na # new[] + ::= dl # delete + ::= da # delete[] + ::= ps # + (unary) + ::= ng # - (unary) + ::= ad # & (unary) + ::= de # * (unary) + ::= co # ~ + ::= pl # + + ::= mi # - + ::= ml # * + ::= dv # / + ::= rm # % + ::= an # & + ::= or # | + ::= eo # ^ + ::= aS # = + ::= pL # += + ::= mI # -= + ::= mL # *= + ::= dV # /= + ::= rM # %= + ::= aN # &= + ::= oR # |= + ::= eO # ^= + ::= ls # << + ::= rs # >> + ::= lS # <<= + ::= rS # >>= + ::= eq # == + ::= ne # != + ::= lt # < + ::= gt # > + ::= le # <= + ::= ge # >= + ::= nt # ! + ::= aa # && + ::= oo # || + ::= pp # ++ + ::= mm # -- + ::= cm # , + ::= pm # ->* + ::= pt # -> + ::= cl # () + ::= ix # [] + ::= qu # ? + ::= sz # sizeof + ::= cv # cast + ::= vx # vendor extended operator */ + +static status_t +demangle_operator_name (dm, short_name, num_args) + demangling_t dm; + int short_name; + int *num_args; +{ + struct operator_code + { + /* The mangled code for this operator. */ + const char *code; + /* The source name of this operator. */ + const char *name; + /* The number of arguments this operator takes. */ + int num_args; + }; + + static const struct operator_code operators[] = + { + { "aN", "&=" , 2 }, + { "aS", "=" , 2 }, + { "aa", "&&" , 2 }, + { "ad", "&" , 1 }, + { "an", "&" , 2 }, + { "cl", "()" , 0 }, + { "cm", "," , 2 }, + { "co", "~" , 1 }, + { "dV", "/=" , 2 }, + { "da", " delete[]", 1 }, + { "de", "*" , 1 }, + { "dl", " delete" , 1 }, + { "dv", "/" , 2 }, + { "eO", "^=" , 2 }, + { "eo", "^" , 2 }, + { "eq", "==" , 2 }, + { "ge", ">=" , 2 }, + { "gt", ">" , 2 }, + { "ix", "[]" , 2 }, + { "lS", "<<=" , 2 }, + { "le", "<=" , 2 }, + { "ls", "<<" , 2 }, + { "lt", "<" , 2 }, + { "mI", "-=" , 2 }, + { "mL", "*=" , 2 }, + { "mi", "-" , 2 }, + { "ml", "*" , 2 }, + { "mm", "--" , 1 }, + { "na", " new[]" , 1 }, + { "ne", "!=" , 2 }, + { "ng", "-" , 1 }, + { "nt", "!" , 1 }, + { "nw", " new" , 1 }, + { "oR", "|=" , 2 }, + { "oo", "||" , 2 }, + { "or", "|" , 2 }, + { "pL", "+=" , 2 }, + { "pl", "+" , 2 }, + { "pm", "->*" , 2 }, + { "pp", "++" , 1 }, + { "ps", "+" , 1 }, + { "qu", "?" , 3 }, + { "rM", "%=" , 2 }, + { "rS", ">>=" , 2 }, + { "rm", "%" , 2 }, + { "rs", ">>" , 2 }, + { "sz", " sizeof" , 1 } + }; + + const int num_operators = + sizeof (operators) / sizeof (struct operator_code); + + int c0 = next_char (dm); + int c1 = next_char (dm); + const struct operator_code* p1 = operators; + const struct operator_code* p2 = operators + num_operators; + + DEMANGLE_TRACE ("operator-name", dm); + + /* Is this a vendor extended operator? */ + if (c0 == 'v' && c1 == 'x') + { + RETURN_IF_ERROR (result_append (dm, "operator")); + RETURN_IF_ERROR (demangle_source_name (dm)); + *num_args = 0; + return STATUS_OK; + } + + /* Is this a conversion operator? */ + if (c0 == 'c' && c1 == 'v') + { + RETURN_IF_ERROR (result_append (dm, "operator ")); + /* Demangle the converted-to type. */ + RETURN_IF_ERROR (demangle_type (dm)); + *num_args = 0; + return STATUS_OK; + } + + /* Perform a binary search for the operator code. */ + while (1) + { + const struct operator_code* p = p1 + (p2 - p1) / 2; + char match0 = p->code[0]; + char match1 = p->code[1]; + + if (c0 == match0 && c1 == match1) + /* Found it. */ + { + if (!short_name) + RETURN_IF_ERROR (result_append (dm, "operator")); + RETURN_IF_ERROR (result_append (dm, p->name)); + *num_args = p->num_args; + + return STATUS_OK; + } + + if (p == p1) + /* Couldn't find it. */ + return "Unknown code in ."; + + /* Try again. */ + if (c0 < match0 || (c0 == match0 && c1 < match1)) + p2 = p; + else + p1 = p; + } +} + +/* Demangles and emits a . + + ::= GV # Guard variable + ::= Th[n] _ + # non-virtual base override thunk + ::= Tv[n] _ + _ + # virtual base override thunk + ::= TV # virtual table + ::= TT # VTT + ::= TI # typeinfo structure + ::= TS # typeinfo name + + Also demangles the special g++ manglings, + + ::= CT _ + # construction vtable + ::= TF # typeinfo function (old ABI only) + ::= TJ # java Class structure */ + +static status_t +demangle_special_name (dm) + demangling_t dm; +{ + dyn_string_t number; + int unused; + char peek = peek_char (dm); + + DEMANGLE_TRACE ("special-name", dm); + + if (peek == 'G') + { + /* A guard variable name. Consume the G. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_char (dm, 'V')); + RETURN_IF_ERROR (result_append (dm, "guard variable for ")); + RETURN_IF_ERROR (demangle_name (dm, &unused)); + } + else if (peek == 'T') + { + status_t status = STATUS_OK; + + /* Other C++ implementation miscellania. Consume the T. */ + advance_char (dm); + + switch (peek_char (dm)) + { + case 'V': + /* Virtual table. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "vtable for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'T': + /* VTT structure. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "VTT for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'I': + /* Typeinfo structure. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'F': + /* Typeinfo function. Used only in old ABI with new mangling. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo fn for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'S': + /* Character string containing type name, used in typeinfo. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "typeinfo name for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'J': + /* The java Class variable corresponding to a C++ class. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "java Class for ")); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'h': + /* Non-virtual thunk. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "non-virtual thunk")); + /* Demangle and emit the offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_char (dm, ' '); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, number); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the target name and function type. */ + RETURN_IF_ERROR (result_append (dm, " to ")); + RETURN_IF_ERROR (demangle_encoding (dm)); + break; + + case 'v': + /* Virtual thunk. */ + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "virtual thunk ")); + /* Demangle and emit the offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_string (dm, number); + if (STATUS_NO_ERROR (status)) + result_append_char (dm, ' '); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the vcall offset. */ + number = dyn_string_new (4); + if (number == NULL) + return STATUS_ALLOCATION_FAILED; + demangle_number_literally (dm, number, 10, 1); + /* Don't display the vcall offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_string (dm, number); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ' '); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + /* Demangle the separator. */ + RETURN_IF_ERROR (demangle_char (dm, '_')); + /* Demangle and emit the target function. */ + RETURN_IF_ERROR (result_append (dm, "to ")); + RETURN_IF_ERROR (demangle_encoding (dm)); + break; + + case 'C': + /* TC is a special g++ mangling for a construction vtable. */ + if (!flag_strict) + { + dyn_string_t derived_type; + + advance_char (dm); + RETURN_IF_ERROR (result_append (dm, "construction vtable for ")); + + /* Demangle the derived type off to the side. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + derived_type = (dyn_string_t) result_pop (dm); + + /* Demangle the offset. */ + number = dyn_string_new (4); + if (number == NULL) + { + dyn_string_delete (derived_type); + return STATUS_ALLOCATION_FAILED; + } + demangle_number_literally (dm, number, 10, 1); + /* Demangle the underscore separator. */ + status = demangle_char (dm, '_'); + + /* Demangle the base type. */ + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + + /* Emit the derived type. */ + if (STATUS_NO_ERROR (status)) + status = result_append (dm, "-in-"); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, derived_type); + dyn_string_delete (derived_type); + + /* Don't display the offset unless in verbose mode. */ + if (flag_verbose) + { + status = result_append_char (dm, ' '); + if (STATUS_NO_ERROR (status)) + result_append_string (dm, number); + } + dyn_string_delete (number); + RETURN_IF_ERROR (status); + break; + } + /* If flag_strict, fall through. */ + + default: + return "Unrecognized ."; + } + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Demangles and emits a . + + + ::= C1 # complete object (in-charge) ctor + ::= C2 # base object (not-in-charge) ctor + ::= C3 # complete object (in-charge) allocating ctor + ::= C4 # base object (not-in-charge) allocating ctor + ::= D0 # deleting (in-charge) dtor + ::= D1 # complete object (in-charge) dtor + ::= D2 # base object (not-in-charge) dtor */ + +static status_t +demangle_ctor_dtor_name (dm) + demangling_t dm; +{ + static const char *const ctor_flavors[] = + { + "in-charge", + "not-in-charge", + "in-charge allocating", + "not-in-charge allocating" + }; + static const char *const dtor_flavors[] = + { + "in-charge deleting", + "in-charge", + "not-in-charge" + }; + + int flavor; + char peek = peek_char (dm); + + DEMANGLE_TRACE ("ctor-dtor-name", dm); + + if (peek == 'C') + { + /* A constructor name. Consume the C. */ + advance_char (dm); + if (peek_char (dm) < '1' || peek_char (dm) > '4') + return "Unrecognized constructor."; + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + /* Print the flavor of the constructor if in verbose mode. */ + flavor = next_char (dm) - '1'; + if (flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "[")); + RETURN_IF_ERROR (result_append (dm, ctor_flavors[flavor])); + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + } + else if (peek == 'D') + { + /* A destructor name. Consume the D. */ + advance_char (dm); + if (peek_char (dm) < '0' || peek_char (dm) > '2') + return "Unrecognized destructor."; + RETURN_IF_ERROR (result_append_char (dm, '~')); + RETURN_IF_ERROR (result_append_string (dm, dm->last_source_name)); + /* Print the flavor of the destructor if in verbose mode. */ + flavor = next_char (dm) - '0'; + if (flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, " [")); + RETURN_IF_ERROR (result_append (dm, dtor_flavors[flavor])); + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Handle pointer, reference, and pointer-to-member cases for + demangle_type. All consecutive `P's, `R's, and 'M's are joined to + build a pointer/reference type. We snarf all these, plus the + following , all at once since we need to know whether we have + a pointer to data or pointer to function to construct the right + output syntax. C++'s pointer syntax is hairy. + + ::= P + ::= R + ::= + + ::= M */ + +static status_t +demangle_type_ptr (dm) + demangling_t dm; +{ + char next; + status_t status; + + /* Collect pointer symbols into this string. */ + dyn_string_t symbols = dyn_string_new (10); + + DEMANGLE_TRACE ("type*", dm); + + if (symbols == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Scan forward, collecting pointers and references into symbols, + until we hit something else. Then emit the type. */ + while (1) + { + next = peek_char (dm); + if (next == 'P') + { + if (!dyn_string_append_char (symbols, '*')) + return STATUS_ALLOCATION_FAILED; + advance_char (dm); + } + else if (next == 'R') + { + if (!dyn_string_append_char (symbols, '&')) + return STATUS_ALLOCATION_FAILED; + advance_char (dm); + } + else if (next == 'M') + { + /* Pointer-to-member. */ + dyn_string_t class_type; + + /* Eat the 'M'. */ + advance_char (dm); + + /* Capture the type of which this is a pointer-to-member. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + class_type = (dyn_string_t) result_pop (dm); + + /* Build the pointer-to-member notation. It comes before + other pointer and reference qualifiers -- */ + if (!dyn_string_prepend_cstr (symbols, "::*")) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_prepend (symbols, class_type)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (class_type); + + if (peek_char (dm) == 'F') + continue; + + /* Demangle the type of the pointed-to member. */ + status = demangle_type (dm); + /* Make it pretty. */ + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + /* Add the pointer-to-member syntax, and other pointer and + reference symbols. */ + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + /* Clean up. */ + dyn_string_delete (symbols); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + else if (next == 'F') + { + /* Ooh, tricky, a pointer-to-function. */ + int position = result_length (dm); + status = result_append_char (dm, '('); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ')'); + dyn_string_delete (symbols); + RETURN_IF_ERROR (status); + + RETURN_IF_ERROR (demangle_function_type (dm, position)); + return STATUS_OK; + } + else + { + /* No more pointe or reference tokens. Finish up. */ + status = demangle_type (dm); + + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, symbols); + dyn_string_delete (symbols); + RETURN_IF_ERROR (status); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + } +} + +/* Demangles and emits a . + + ::= + ::= + ::= + ::= + ::= + ::= + ::= + ::= P # pointer-to + ::= R # reference-to + ::= C # complex pair (C 2000) + ::= G # imaginary (C 2000) + ::= U # vendor extended type qualifier + ::= */ + +static status_t +demangle_type (dm) + demangling_t dm; +{ + int start = substitution_start (dm); + char peek = peek_char (dm); + char peek_next; + int template_p = 0; + int special_std_substitution; + int is_builtin_type = 0; + template_arg_list_t old_arg_list = current_template_arg_list (dm); + int template_parm = NOT_TEMPLATE_PARM; + + DEMANGLE_TRACE ("type", dm); + + /* A can start with a digit (a ), an + N (a ), or a Z (a ). */ + if (IS_DIGIT ((unsigned char) peek) || peek == 'N' || peek == 'Z') + RETURN_IF_ERROR (demangle_class_enum_type (dm, &template_p)); + else if (peek >= 'a' && peek <= 'z') + { + RETURN_IF_ERROR (demangle_builtin_type (dm)); + is_builtin_type = 1; + } + else + switch (peek) + { + case 'r': + case 'V': + case 'K': + { + status_t status; + dyn_string_t cv_qualifiers = dyn_string_new (24); + + if (cv_qualifiers == NULL) + return STATUS_ALLOCATION_FAILED; + + demangle_CV_qualifiers (dm, cv_qualifiers); + + /* If the qualifiers apply to a pointer or reference, they + need to come after the whole qualified type. */ + if (peek_char (dm) == 'P' || peek_char (dm) == 'R') + { + status = demangle_type (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, cv_qualifiers); + } + /* Otherwise, the qualifiers come first. */ + else + { + status = result_append_string (dm, cv_qualifiers); + if (STATUS_NO_ERROR (status)) + status = result_append_space (dm); + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + } + + dyn_string_delete (cv_qualifiers); + RETURN_IF_ERROR (status); + } + break; + + case 'F': + return "Non-pointer or -reference function type."; + + case 'A': + RETURN_IF_ERROR (demangle_array_type (dm)); + break; + + case 'T': + RETURN_IF_ERROR (demangle_template_param (dm, &template_parm)); + break; + + case 'S': + /* First check if this is a special substitution. If it is, + this is a . Special substitutions have a + letter following the `S'; other substitutions have a digit + or underscore. */ + peek_next = peek_char_next (dm); + if (IS_DIGIT (peek_next) || peek_next == '_') + RETURN_IF_ERROR (demangle_substitution (dm, &template_p, + &special_std_substitution)); + else + demangle_class_enum_type (dm, &template_p); + break; + + case 'P': + case 'R': + case 'M': + RETURN_IF_ERROR (demangle_type_ptr (dm)); + break; + + case 'C': + /* A C99 complex type. */ + RETURN_IF_ERROR (result_append (dm, "complex ")); + advance_char (dm); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'G': + /* A C99 imaginary type. */ + RETURN_IF_ERROR (result_append (dm, "imaginary ")); + advance_char (dm); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + case 'U': + /* Vendor extended type qualifier. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_source_name (dm)); + RETURN_IF_ERROR (result_append_char (dm, ' ')); + RETURN_IF_ERROR (demangle_type (dm)); + break; + + default: + return "Unexpected character in ."; + } + + /* Unqualified builin types are not substitution candidates. */ + if (!is_builtin_type) + /* Add a new substitution for the type. If this type was a + , pass its index since from the point of + substitutions, a token is a substitution + candidate distinct from the type that is substituted for it. */ + RETURN_IF_ERROR (substitution_add (dm, start, template_p, template_parm)); + + /* Pop off template argument lists added during mangling of this + type. */ + pop_to_template_arg_list (dm, old_arg_list); + + return STATUS_OK; +} + +/* C++ source names of builtin types, indexed by the mangled code + letter's position in the alphabet ('a' -> 0, 'b' -> 1, etc). */ +static const char *const builtin_type_names[26] = +{ + "signed char", /* a */ + "bool", /* b */ + "char", /* c */ + "double", /* d */ + "long double", /* e */ + "float", /* f */ + "__float128", /* g */ + "unsigned char", /* h */ + "int", /* i */ + "unsigned", /* j */ + NULL, /* k */ + "long", /* l */ + "unsigned long", /* m */ + "__int128", /* n */ + "unsigned __int128", /* o */ + NULL, /* p */ + NULL, /* q */ + NULL, /* r */ + "short", /* s */ + "unsigned short", /* t */ + NULL, /* u */ + "void", /* v */ + "wchar_t", /* w */ + "long long", /* x */ + "unsigned long long", /* y */ + "..." /* z */ +}; + +/* Demangles and emits a . + + ::= v # void + ::= w # wchar_t + ::= b # bool + ::= c # char + ::= a # signed char + ::= h # unsigned char + ::= s # short + ::= t # unsigned short + ::= i # int + ::= j # unsigned int + ::= l # long + ::= m # unsigned long + ::= x # long long, __int64 + ::= y # unsigned long long, __int64 + ::= n # __int128 + ::= o # unsigned __int128 + ::= f # float + ::= d # double + ::= e # long double, __float80 + ::= g # __float128 + ::= z # ellipsis + ::= u # vendor extended type */ + +static status_t +demangle_builtin_type (dm) + demangling_t dm; +{ + + char code = peek_char (dm); + + DEMANGLE_TRACE ("builtin-type", dm); + + if (code == 'u') + { + advance_char (dm); + RETURN_IF_ERROR (demangle_source_name (dm)); + return STATUS_OK; + } + else if (code >= 'a' && code <= 'z') + { + const char *type_name = builtin_type_names[code - 'a']; + if (type_name == NULL) + return "Unrecognized code."; + + RETURN_IF_ERROR (result_append (dm, type_name)); + advance_char (dm); + return STATUS_OK; + } + else + return "Non-alphabetic code."; +} + +/* Demangles all consecutive CV-qualifiers (const, volatile, and + restrict) at the current position. The qualifiers are appended to + QUALIFIERS. Returns STATUS_OK. */ + +static status_t +demangle_CV_qualifiers (dm, qualifiers) + demangling_t dm; + dyn_string_t qualifiers; +{ + DEMANGLE_TRACE ("CV-qualifiers", dm); + + while (1) + { + switch (peek_char (dm)) + { + case 'r': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "restrict")) + return STATUS_ALLOCATION_FAILED; + break; + + case 'V': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "volatile")) + return STATUS_ALLOCATION_FAILED; + break; + + case 'K': + if (!dyn_string_append_space (qualifiers)) + return STATUS_ALLOCATION_FAILED; + if (!dyn_string_append_cstr (qualifiers, "const")) + return STATUS_ALLOCATION_FAILED; + break; + + default: + return STATUS_OK; + } + + advance_char (dm); + } +} + +/* Demangles and emits a FUNCTION_NAME_POS is the + position in the result string of the start of the function + identifier, at which the function's return type will be inserted. + + ::= F [Y] E */ + +static status_t +demangle_function_type (dm, function_name_pos) + demangling_t dm; + int function_name_pos; +{ + DEMANGLE_TRACE ("function-type", dm); + RETURN_IF_ERROR (demangle_char (dm, 'F')); + if (peek_char (dm) == 'Y') + { + /* Indicate this function has C linkage if in verbose mode. */ + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [extern \"C\"] ")); + advance_char (dm); + } + RETURN_IF_ERROR (demangle_bare_function_type (dm, function_name_pos)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + return STATUS_OK; +} + +/* Demangles and emits a . RETURN_TYPE_POS is the + position in the result string at which the function return type + should be inserted. If RETURN_TYPE_POS is BFT_NO_RETURN_TYPE, the + function's return type is assumed not to be encoded. + + ::= + */ + +static status_t +demangle_bare_function_type (dm, return_type_pos) + demangling_t dm; + int return_type_pos; +{ + /* Sequence is the index of the current function parameter, counting + from zero. The value -1 denotes the return type. */ + int sequence = + (return_type_pos == BFT_NO_RETURN_TYPE ? 0 : -1); + + DEMANGLE_TRACE ("bare-function-type", dm); + + RETURN_IF_ERROR (result_append_char (dm, '(')); + while (!end_of_name_p (dm) && peek_char (dm) != 'E') + { + if (sequence == -1) + /* We're decoding the function's return type. */ + { + dyn_string_t return_type; + status_t status = STATUS_OK; + + /* Decode the return type off to the side. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_type (dm)); + return_type = (dyn_string_t) result_pop (dm); + + /* Add a space to the end of the type. Insert the return + type where we've been asked to. */ + if (!dyn_string_append_space (return_type) + || !dyn_string_insert (result_string (dm), return_type_pos, + return_type)) + status = STATUS_ALLOCATION_FAILED; + + dyn_string_delete (return_type); + RETURN_IF_ERROR (status); + } + else + { + /* Skip `void' parameter types. One should only occur as + the only type in a parameter list; in that case, we want + to print `foo ()' instead of `foo (void)'. */ + if (peek_char (dm) == 'v') + { + /* Consume the v. */ + advance_char (dm); + continue; + } + /* Separate parameter types by commas. */ + if (sequence > 0) + RETURN_IF_ERROR (result_append (dm, ", ")); + /* Demangle the type. */ + RETURN_IF_ERROR (demangle_type (dm)); + } + + ++sequence; + } + RETURN_IF_ERROR (result_append_char (dm, ')')); + + return STATUS_OK; +} + +/* Demangles and emits a . *TEMPLATE_P is set to + non-zero if the type is a template-id, zero otherwise. + + ::= */ + +static status_t +demangle_class_enum_type (dm, template_p) + demangling_t dm; + int *template_p; +{ + DEMANGLE_TRACE ("class-enum-type", dm); + + RETURN_IF_ERROR (demangle_name (dm, template_p)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= A [] _ */ + +static status_t +demangle_array_type (dm) + demangling_t dm; +{ + status_t status; + dyn_string_t array_size = dyn_string_new (10); + + if (array_size == NULL) + return STATUS_ALLOCATION_FAILED; + + status = demangle_char (dm, 'A'); + + /* Demangle the array size into array_size. */ + if (STATUS_NO_ERROR (status)) + status = demangle_number_literally (dm, array_size, 10, 0); + + /* Demangle the base type of the array. */ + if (STATUS_NO_ERROR (status)) + status = demangle_char (dm, '_'); + if (STATUS_NO_ERROR (status)) + status = demangle_type (dm); + + /* Emit the array dimension syntax. */ + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, '['); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, array_size); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ']'); + dyn_string_delete (array_size); + + RETURN_IF_ERROR (status); + + return STATUS_OK; +} + +/* Demangles and emits a . The zero-indexed position + in the parameter list is placed in *TEMPLATE_PARM_NUMBER. + + ::= T_ # first template parameter + ::= T _ */ + +static status_t +demangle_template_param (dm, template_parm_number) + demangling_t dm; + int *template_parm_number; +{ + int parm_number; + template_arg_list_t current_arg_list = current_template_arg_list (dm); + string_list_t arg; + + DEMANGLE_TRACE ("template-param", dm); + + /* Make sure there is a template argmust list in which to look up + this parameter reference. */ + if (current_arg_list == NULL) + return "Template parameter outside of template."; + + RETURN_IF_ERROR (demangle_char (dm, 'T')); + if (peek_char (dm) == '_') + parm_number = 0; + else + { + RETURN_IF_ERROR (demangle_number (dm, &parm_number, 10, 0)); + ++parm_number; + } + RETURN_IF_ERROR (demangle_char (dm, '_')); + + arg = template_arg_list_get_arg (current_arg_list, parm_number); + if (arg == NULL) + /* parm_number exceeded the number of arguments in the current + template argument list. */ + return "Template parameter number out of bounds."; + RETURN_IF_ERROR (result_append_string (dm, (dyn_string_t) arg)); + + if (peek_char (dm) == 'I') + RETURN_IF_ERROR (demangle_template_args (dm)); + + *template_parm_number = parm_number; + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= I + E */ + +static status_t +demangle_template_args (dm) + demangling_t dm; +{ + int first = 1; + dyn_string_t old_last_source_name; + template_arg_list_t arg_list = template_arg_list_new (); + + if (arg_list == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Preserve the most recently demangled source name. */ + old_last_source_name = dm->last_source_name; + dm->last_source_name = dyn_string_new (0); + + DEMANGLE_TRACE ("template-args", dm); + + if (dm->last_source_name == NULL) + return STATUS_ALLOCATION_FAILED; + + RETURN_IF_ERROR (demangle_char (dm, 'I')); + RETURN_IF_ERROR (result_append_char (dm, '<')); + do + { + string_list_t arg; + + if (first) + first = 0; + else + RETURN_IF_ERROR (result_append (dm, ", ")); + + /* Capture the template arg. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_template_arg (dm)); + arg = result_pop (dm); + + /* Emit it in the demangled name. */ + RETURN_IF_ERROR (result_append_string (dm, (dyn_string_t) arg)); + + /* Save it for use in expanding s. */ + template_arg_list_add_arg (arg_list, arg); + } + while (peek_char (dm) != 'E'); + /* Append the '>'. */ + RETURN_IF_ERROR (result_close_template_list (dm)); + + /* Consume the 'E'. */ + advance_char (dm); + + /* Restore the most recent demangled source name. */ + dyn_string_delete (dm->last_source_name); + dm->last_source_name = old_last_source_name; + + /* Push the list onto the top of the stack of template argument + lists, so that arguments from it are used from now on when + expanding s. */ + push_template_arg_list (dm, arg_list); + + return STATUS_OK; +} + +/* This function, which does not correspond to a production in the + mangling spec, handles the `literal' production for both + and . It does not expect or consume + the initial `L' or final `E'. The demangling is given by: + + ::= + + and the emitted output is `(type)number'. */ + +static status_t +demangle_literal (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + dyn_string_t value_string; + status_t status; + + DEMANGLE_TRACE ("literal", dm); + + if (!flag_verbose && peek >= 'a' && peek <= 'z') + { + /* If not in verbose mode and this is a builtin type, see if we + can produce simpler numerical output. In particular, for + integer types shorter than `long', just write the number + without type information; for bools, write `true' or `false'. + Other refinements could be made here too. */ + + /* This constant string is used to map from codes + (26 letters of the alphabet) to codes that determine how the + value will be displayed. The codes are: + b: display as bool + i: display as int + l: display as long + A space means the value will be represented using cast + notation. */ + static const char *const code_map = "ibi iii ll ii i "; + + char code = code_map[peek - 'a']; + /* FIXME: Implement demangling of floats and doubles. */ + if (code == 'u') + return STATUS_UNIMPLEMENTED; + if (code == 'b') + { + /* It's a boolean. */ + char value; + + /* Consume the b. */ + advance_char (dm); + /* Look at the next character. It should be 0 or 1, + corresponding to false or true, respectively. */ + value = peek_char (dm); + if (value == '0') + RETURN_IF_ERROR (result_append (dm, "false")); + else if (value == '1') + RETURN_IF_ERROR (result_append (dm, "true")); + else + return "Unrecognized bool constant."; + /* Consume the 0 or 1. */ + advance_char (dm); + return STATUS_OK; + } + else if (code == 'i' || code == 'l') + { + /* It's an integer or long. */ + + /* Consume the type character. */ + advance_char (dm); + + /* Demangle the number and write it out. */ + value_string = dyn_string_new (0); + status = demangle_number_literally (dm, value_string, 10, 1); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, value_string); + /* For long integers, append an l. */ + if (code == 'l' && STATUS_NO_ERROR (status)) + status = result_append_char (dm, code); + dyn_string_delete (value_string); + + RETURN_IF_ERROR (status); + return STATUS_OK; + } + /* ...else code == ' ', so fall through to represent this + literal's type explicitly using cast syntax. */ + } + + RETURN_IF_ERROR (result_append_char (dm, '(')); + RETURN_IF_ERROR (demangle_type (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + + value_string = dyn_string_new (0); + if (value_string == NULL) + return STATUS_ALLOCATION_FAILED; + + status = demangle_number_literally (dm, value_string, 10, 1); + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, value_string); + dyn_string_delete (value_string); + RETURN_IF_ERROR (status); + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= # type + ::= L E # literal + ::= LZ E # external name + ::= X E # expression */ + +static status_t +demangle_template_arg (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("template-arg", dm); + + switch (peek_char (dm)) + { + case 'L': + advance_char (dm); + + if (peek_char (dm) == 'Z') + { + /* External name. */ + advance_char (dm); + /* FIXME: Standard is contradictory here. */ + RETURN_IF_ERROR (demangle_encoding (dm)); + } + else + RETURN_IF_ERROR (demangle_literal (dm)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + break; + + case 'X': + /* Expression. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_expression (dm)); + break; + + default: + RETURN_IF_ERROR (demangle_type (dm)); + break; + } + + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= + ::= + ::= */ + +static status_t +demangle_expression (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + + DEMANGLE_TRACE ("expression", dm); + + if (peek == 'L' || peek == 'T') + RETURN_IF_ERROR (demangle_expr_primary (dm)); + else if (peek == 's' && peek_char_next (dm) == 'r') + RETURN_IF_ERROR (demangle_scope_expression (dm)); + else + /* An operator expression. */ + { + int num_args; + status_t status = STATUS_OK; + dyn_string_t operator_name; + + /* We have an operator name. Since we want to output binary + operations in infix notation, capture the operator name + first. */ + RETURN_IF_ERROR (result_push (dm)); + RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args)); + operator_name = (dyn_string_t) result_pop (dm); + + /* If it's binary, do an operand first. */ + if (num_args > 1) + { + status = result_append_char (dm, '('); + if (STATUS_NO_ERROR (status)) + status = demangle_expression (dm); + if (STATUS_NO_ERROR (status)) + status = result_append_char (dm, ')'); + } + + /* Emit the operator. */ + if (STATUS_NO_ERROR (status)) + status = result_append_string (dm, operator_name); + dyn_string_delete (operator_name); + RETURN_IF_ERROR (status); + + /* Emit its second (if binary) or only (if unary) operand. */ + RETURN_IF_ERROR (result_append_char (dm, '(')); + RETURN_IF_ERROR (demangle_expression (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + + /* The ternary operator takes a third operand. */ + if (num_args == 3) + { + RETURN_IF_ERROR (result_append (dm, ":(")); + RETURN_IF_ERROR (demangle_expression (dm)); + RETURN_IF_ERROR (result_append_char (dm, ')')); + } + } + + return STATUS_OK; +} + +/* Demangles and emits a . + + ::= sr + ::= sr */ + +static status_t +demangle_scope_expression (dm) + demangling_t dm; +{ + RETURN_IF_ERROR (demangle_char (dm, 's')); + RETURN_IF_ERROR (demangle_char (dm, 'r')); + RETURN_IF_ERROR (demangle_type (dm)); + RETURN_IF_ERROR (result_append (dm, "::")); + RETURN_IF_ERROR (demangle_encoding (dm)); + return STATUS_OK; +} + +/* Demangles and emits an . + + ::= + ::= L E # literal + ::= L E # external name */ + +static status_t +demangle_expr_primary (dm) + demangling_t dm; +{ + char peek = peek_char (dm); + int unused; + + DEMANGLE_TRACE ("expr-primary", dm); + + if (peek == 'T') + RETURN_IF_ERROR (demangle_template_param (dm, &unused)); + else if (peek == 'L') + { + /* Consume the `L'. */ + advance_char (dm); + peek = peek_char (dm); + + if (peek == '_') + RETURN_IF_ERROR (demangle_mangled_name (dm)); + else + RETURN_IF_ERROR (demangle_literal (dm)); + + RETURN_IF_ERROR (demangle_char (dm, 'E')); + } + else + return STATUS_ERROR; + + return STATUS_OK; +} + +/* Demangles and emits a . Sets *TEMPLATE_P to non-zero + if the substitution is the name of a template, zero otherwise. If + the substitution token is St, which corresponds to the `::std::' + namespace and can appear in a non-nested name, sets + *SPECIAL_STD_SUBSTITUTION to non-zero; zero otherwise. + + ::= S _ + ::= S_ + + ::= St # ::std:: + ::= Sa # ::std::allocator + ::= Sb # ::std::basic_string + ::= Ss # ::std::basic_string, + ::std::allocator > + ::= Si # ::std::basic_istream > + ::= So # ::std::basic_ostream > + ::= Sd # ::std::basic_iostream > +*/ + +static status_t +demangle_substitution (dm, template_p, special_std_substitution) + demangling_t dm; + int *template_p; + int *special_std_substitution; +{ + int seq_id; + int peek; + dyn_string_t text; + + DEMANGLE_TRACE ("substitution", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'S')); + *special_std_substitution = 0; + + /* Scan the substitution sequence index. A missing number denotes + the first index. */ + peek = peek_char (dm); + if (peek == '_') + seq_id = -1; + /* If the following character is 0-9 or a capital letter, interpret + the sequence up to the next underscore as a base-36 substitution + index. */ + else if (IS_DIGIT ((unsigned char) peek) + || (peek >= 'A' && peek <= 'Z')) + RETURN_IF_ERROR (demangle_number (dm, &seq_id, 36, 0)); + else + { + const char *new_last_source_name = NULL; + + switch (peek) + { + case 't': + RETURN_IF_ERROR (result_append (dm, "std")); + *special_std_substitution = 1; + break; + + case 'a': + RETURN_IF_ERROR (result_append (dm, "std::allocator")); + new_last_source_name = "allocator"; + *template_p = 1; + break; + + case 'b': + RETURN_IF_ERROR (result_append (dm, "std::basic_string")); + new_last_source_name = "basic_string"; + *template_p = 1; + break; + + case 's': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::string")); + new_last_source_name = "string"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_string, std::allocator >")); + new_last_source_name = "basic_string"; + } + *template_p = 0; + break; + + case 'i': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::istream")); + new_last_source_name = "istream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_istream >")); + new_last_source_name = "basic_istream"; + } + *template_p = 0; + break; + + case 'o': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::ostream")); + new_last_source_name = "ostream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_ostream >")); + new_last_source_name = "basic_ostream"; + } + *template_p = 0; + break; + + case 'd': + if (!flag_verbose) + { + RETURN_IF_ERROR (result_append (dm, "std::iostream")); + new_last_source_name = "iostream"; + } + else + { + RETURN_IF_ERROR (result_append (dm, "std::basic_iostream >")); + new_last_source_name = "basic_iostream"; + } + *template_p = 0; + break; + + default: + return "Unrecognized ."; + } + + /* Consume the character we just processed. */ + advance_char (dm); + + if (new_last_source_name != NULL) + { + if (!dyn_string_copy_cstr (dm->last_source_name, + new_last_source_name)) + return STATUS_ALLOCATION_FAILED; + } + + return STATUS_OK; + } + + /* Look up the substitution text. Since `S_' is the most recent + substitution, `S0_' is the second-most-recent, etc., shift the + numbering by one. */ + text = substitution_get (dm, seq_id + 1, template_p); + if (text == NULL) + return "Substitution number out of range."; + + /* Emit the substitution text. */ + RETURN_IF_ERROR (result_append_string (dm, text)); + + RETURN_IF_ERROR (demangle_char (dm, '_')); + return STATUS_OK; +} + +/* Demangles and emits a . + + := Z E [] + := Z E s [] */ + +static status_t +demangle_local_name (dm) + demangling_t dm; +{ + DEMANGLE_TRACE ("local-name", dm); + + RETURN_IF_ERROR (demangle_char (dm, 'Z')); + RETURN_IF_ERROR (demangle_encoding (dm)); + RETURN_IF_ERROR (demangle_char (dm, 'E')); + RETURN_IF_ERROR (result_append (dm, "'s ")); + + if (peek_char (dm) == 's') + { + /* Local character string literal. */ + RETURN_IF_ERROR (result_append (dm, "string literal")); + /* Consume the s. */ + advance_char (dm); + RETURN_IF_ERROR (demangle_discriminator (dm, 0)); + } + else + { + int unused; + RETURN_IF_ERROR (result_append (dm, "local ")); + /* Local name for some other entity. Demangle its name. */ + RETURN_IF_ERROR (demangle_name (dm, &unused)); + RETURN_IF_ERROR (demangle_discriminator (dm, 1)); + } + + return STATUS_OK; + } + + /* Optimonally demangles and emits a . If there is no + at the current position in the mangled string, the + descriminator is assumed to be zero. Emit the discriminator number + in parentheses, unless SUPPRESS_FIRST is non-zero and the + discriminator is zero. + + ::= _ */ + +static status_t +demangle_discriminator (dm, suppress_first) + demangling_t dm; + int suppress_first; +{ + /* Output for s to the demangled name is completely + supressed if not in verbose mode. */ + + if (peek_char (dm) == '_') + { + /* Consume the underscore. */ + advance_char (dm); + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [#")); + /* Check if there's a number following the underscore. */ + if (IS_DIGIT ((unsigned char) peek_char (dm))) + { + int discriminator; + /* Demangle the number. */ + RETURN_IF_ERROR (demangle_number (dm, &discriminator, 10, 0)); + if (flag_verbose) + /* Write the discriminator. The mangled number is two + less than the discriminator ordinal, counting from + zero. */ + RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2, + (dyn_string_t) dm->result)); + } + else + { + if (flag_verbose) + /* A missing digit correspond to one. */ + RETURN_IF_ERROR (result_append_char (dm, '1')); + } + if (flag_verbose) + RETURN_IF_ERROR (result_append_char (dm, ']')); + } + else if (!suppress_first) + { + if (flag_verbose) + RETURN_IF_ERROR (result_append (dm, " [#0]")); + } + + return STATUS_OK; +} + +/* Demangle NAME into RESULT, which must be an initialized + dyn_string_t. On success, returns STATUS_OK. On failure, returns + an error message, and the contents of RESULT are unchanged. */ + +static status_t +cp_demangle (name, result) + const char *name; + dyn_string_t result; +{ + status_t status; + int length = strlen (name); + + if (length > 2 && name[0] == '_' && name[1] == 'Z') + { + demangling_t dm = demangling_new (name); + if (dm == NULL) + return STATUS_ALLOCATION_FAILED; + + status = result_push (dm); + if (status != STATUS_OK) + { + demangling_delete (dm); + return status; + } + + status = demangle_mangled_name (dm); + if (STATUS_NO_ERROR (status)) + { + dyn_string_t demangled = (dyn_string_t) result_pop (dm); + if (!dyn_string_copy (result, demangled)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (demangled); + } + + demangling_delete (dm); + } + else + { + /* It's evidently not a mangled C++ name. It could be the name + of something with C linkage, though, so just copy NAME into + RESULT. */ + if (!dyn_string_copy_cstr (result, name)) + return STATUS_ALLOCATION_FAILED; + status = STATUS_OK; + } + + return status; +} + +/* Demangle TYPE_NAME into RESULT, which must be an initialized + dyn_string_t. On success, returns STATUS_OK. On failiure, returns + an error message, and the contents of RESULT are unchanged. */ + +static status_t +cp_demangle_type (type_name, result) + const char* type_name; + dyn_string_t result; +{ + status_t status; + demangling_t dm = demangling_new (type_name); + + if (dm == NULL) + return STATUS_ALLOCATION_FAILED; + + /* Demangle the type name. The demangled name is stored in dm. */ + status = result_push (dm); + if (status != STATUS_OK) + { + demangling_delete (dm); + return status; + } + + status = demangle_type (dm); + + if (STATUS_NO_ERROR (status)) + { + /* The demangling succeeded. Pop the result out of dm and copy + it into RESULT. */ + dyn_string_t demangled = (dyn_string_t) result_pop (dm); + if (!dyn_string_copy (result, demangled)) + return STATUS_ALLOCATION_FAILED; + dyn_string_delete (demangled); + } + + /* Clean up. */ + demangling_delete (dm); + + return status; +} + + +#ifdef IN_LIBGCC2 + +extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *)); + +/* ABI-mandated entry point in the C++ runtime library for performing + demangling. MANGLED_NAME is a NUL-terminated character string + containing the name to be demangled. + + OUTPUT_BUFFER is a region of memory, allocated with malloc, of + *LENGTH bytes, into which the demangled name is stored. If + OUTPUT_BUFFER is not long enough, it is expanded using realloc. + OUTPUT_BUFFER may instead be NULL; in that case, the demangled name + is placed in a region of memory allocated with malloc. + + If LENGTH is non-NULL, the length of the buffer conaining the + demangled name, is placed in *LENGTH. + + The return value is a pointer to the start of the NUL-terminated + demangled name, or NULL if the demangling fails. The caller is + responsible for deallocating this memory using free. + + *STATUS is set to one of the following values: + 0: The demangling operation succeeded. + -1: A memory allocation failiure occurred. + -2: MANGLED_NAME is not a valid name under the C++ ABI mangling rules. + -3: One of the arguments is invalid. + + The demagling is performed using the C++ ABI mangling rules, with + GNU extensions. */ + +char * +__cxa_demangle (mangled_name, output_buffer, length, status) + const char *mangled_name; + char *output_buffer; + size_t *length; + int *status; +{ + struct dyn_string demangled_name; + status_t result; + + if (status == NULL) + return NULL; + + if (mangled_name == NULL) { + *status = -3; + return NULL; + } + + /* Did the caller provide a buffer for the demangled name? */ + if (output_buffer == NULL) { + /* No; dyn_string will malloc a buffer for us. */ + if (!dyn_string_init (&demangled_name, 0)) + { + *status = -1; + return NULL; + } + } + else { + /* Yes. Check that the length was provided. */ + if (length == NULL) { + *status = -3; + return NULL; + } + /* Install the buffer into a dyn_string. */ + demangled_name.allocated = *length; + demangled_name.length = 0; + demangled_name.s = output_buffer; + } + + if (mangled_name[0] == '_' && mangled_name[1] == 'Z') + /* MANGLED_NAME apprears to be a function or variable name. + Demangle it accordingly. */ + result = cp_demangle (mangled_name, &demangled_name); + else + /* Try to demangled MANGLED_NAME as the name of a type. */ + result = cp_demangle_type (mangled_name, &demangled_name); + + if (result == STATUS_OK) + /* The demangling succeeded. */ + { + /* If LENGTH isn't NULL, store the allocated buffer length + there; the buffer may have been realloced by dyn_string + functions. */ + if (length != NULL) + *length = demangled_name.allocated; + /* The operation was a success. */ + *status = 0; + return dyn_string_buf (&demangled_name); + } + else if (result == STATUS_ALLOCATION_FAILED) + /* A call to malloc or realloc failed during the demangling + operation. */ + { + *status = -1; + return NULL; + } + else + /* The demangling failed for another reason, most probably because + MANGLED_NAME isn't a valid mangled name. */ + { + /* If the buffer containing the demangled name wasn't provided + by the caller, free it. */ + if (output_buffer == NULL) + free (dyn_string_buf (&demangled_name)); + *status = -2; + return NULL; + } +} + +#else /* !IN_LIBGCC2 */ + +/* Variant entry point for integration with the existing cplus-dem + demangler. Attempts to demangle MANGLED. If the demangling + succeeds, returns a buffer, allocated with malloc, containing the + demangled name. The caller must deallocate the buffer using free. + If the demangling failes, returns NULL. */ + +char * +cplus_demangle_new_abi (mangled) + const char* mangled; +{ + /* Create a dyn_string to hold the demangled name. */ + dyn_string_t demangled = dyn_string_new (0); + /* Attempt the demangling. */ + status_t status = cp_demangle ((char *) mangled, demangled); + if (STATUS_NO_ERROR (status)) + /* Demangling succeeded. */ + { + /* Grab the demangled result from the dyn_string. It was + allocated with malloc, so we can return it directly. */ + char *return_value = dyn_string_release (demangled); + /* Hand back the demangled name. */ + return return_value; + } + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocation failed.\n"); + abort (); + } + else + /* Demangling failed. */ + { + dyn_string_delete (demangled); + return NULL; + } +} + +#endif /* IN_LIBGCC2 */ + +#ifdef STANDALONE_DEMANGLER + +#include "getopt.h" + +static void print_usage + PARAMS ((FILE* fp, int exit_value)); + +/* Non-zero if CHAR is a character than can occur in a mangled name. */ +#define is_mangled_char(CHAR) \ + (IS_ALPHA (CHAR) || IS_DIGIT (CHAR) || (CHAR) == '_') + +/* The name of this program, as invoked. */ +const char* program_name; + +/* Prints usage summary to FP and then exits with EXIT_VALUE. */ + +static void +print_usage (fp, exit_value) + FILE* fp; + int exit_value; +{ + fprintf (fp, "Usage: %s [options] [names ...]\n", program_name); + fprintf (fp, "Options:\n", program_name); + fprintf (fp, " -h,--help Display this message.\n"); + fprintf (fp, " -s,--strict Demangle standard names only.\n"); + fprintf (fp, " -v,--verbose Produce verbose demanglings.\n"); + fprintf (fp, "If names are provided, they are demangled. Otherwise filters standard input.\n"); + + exit (exit_value); +} + +/* Option specification for getopt_long. */ +static struct option long_options[] = +{ + { "help", no_argument, NULL, 'h' }, + { "strict", no_argument, NULL, 's' }, + { "verbose", no_argument, NULL, 'v' }, + { NULL, no_argument, NULL, 0 }, +}; + +/* Main entry for a demangling filter executable. It will demangle + its command line arguments, if any. If none are provided, it will + filter stdin to stdout, replacing any recognized mangled C++ names + with their demangled equivalents. */ + +int +main (argc, argv) + int argc; + char *argv[]; +{ + status_t status; + int i; + int opt_char; + + /* Use the program name of this program, as invoked. */ + program_name = argv[0]; + + /* Parse options. */ + do + { + opt_char = getopt_long (argc, argv, "hsv", long_options, NULL); + switch (opt_char) + { + case '?': /* Unrecognized option. */ + print_usage (stderr, 1); + break; + + case 'h': + print_usage (stdout, 0); + break; + + case 's': + flag_strict = 1; + break; + + case 'v': + flag_verbose = 1; + break; + } + } + while (opt_char != -1); + + if (optind == argc) + /* No command line arguments were provided. Filter stdin. */ + { + dyn_string_t mangled = dyn_string_new (3); + dyn_string_t demangled = dyn_string_new (0); + status_t status; + + /* Read all of input. */ + while (!feof (stdin)) + { + char c = getchar (); + + /* The first character of a mangled name is an underscore. */ + if (feof (stdin)) + break; + if (c != '_') + { + /* It's not a mangled name. Print the character and go + on. */ + putchar (c); + continue; + } + c = getchar (); + + /* The second character of a mangled name is a capital `Z'. */ + if (feof (stdin)) + break; + if (c != 'Z') + { + /* It's not a mangled name. Print the previous + underscore, the `Z', and go on. */ + putchar ('_'); + putchar (c); + continue; + } + + /* Start keeping track of the candidate mangled name. */ + dyn_string_append_char (mangled, '_'); + dyn_string_append_char (mangled, 'Z'); + + /* Pile characters into mangled until we hit one that can't + occur in a mangled name. */ + c = getchar (); + while (!feof (stdin) && is_mangled_char (c)) + { + dyn_string_append_char (mangled, c); + if (feof (stdin)) + break; + c = getchar (); + } + + /* Attempt to demangle the name. */ + status = cp_demangle (dyn_string_buf (mangled), demangled); + + /* If the demangling succeeded, great! Print out the + demangled version. */ + if (STATUS_NO_ERROR (status)) + fputs (dyn_string_buf (demangled), stdout); + /* Abort on allocation failures. */ + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocation failed.\n"); + abort (); + } + /* Otherwise, it might not have been a mangled name. Just + print out the original text. */ + else + fputs (dyn_string_buf (mangled), stdout); + + /* If we haven't hit EOF yet, we've read one character that + can't occur in a mangled name, so print it out. */ + if (!feof (stdin)) + putchar (c); + + /* Clear the candidate mangled name, to start afresh next + time we hit a `_Z'. */ + dyn_string_clear (mangled); + } + + dyn_string_delete (mangled); + dyn_string_delete (demangled); + } + else + /* Demangle command line arguments. */ + { + dyn_string_t result = dyn_string_new (0); + + /* Loop over command line arguments. */ + for (i = optind; i < argc; ++i) + { + /* Attempt to demangle. */ + status = cp_demangle (argv[i], result); + + /* If it worked, print the demangled name. */ + if (STATUS_NO_ERROR (status)) + printf ("%s\n", dyn_string_buf (result)); + /* Abort on allocaiton failures. */ + else if (status == STATUS_ALLOCATION_FAILED) + { + fprintf (stderr, "Memory allocaiton failed.\n"); + abort (); + } + /* If not, print the error message to stderr instead. */ + else + fprintf (stderr, "%s\n", status); + } + dyn_string_delete (result); + } + + return 0; +} + +#endif /* STANDALONE_DEMANGLER */ diff -uprN binutils-2.10/libiberty/cplus-dem.c binutils-2.10.1/libiberty/cplus-dem.c --- binutils-2.10/libiberty/cplus-dem.c Tue Feb 22 16:14:35 2000 +++ binutils-2.10.1/libiberty/cplus-dem.c Mon Oct 23 10:43:14 2000 @@ -252,6 +252,55 @@ typedef enum type_kind_t tk_real } type_kind_t; +struct demangler_engine libiberty_demanglers[] = +{ + { + AUTO_DEMANGLING_STYLE_STRING, + auto_demangling, + "Automatic selection based on executable" + } + , + { + GNU_DEMANGLING_STYLE_STRING, + gnu_demangling, + "GNU (g++) style demangling" + } + , + { + LUCID_DEMANGLING_STYLE_STRING, + lucid_demangling, + "Lucid (lcc) style demangling" + } + , + { + ARM_DEMANGLING_STYLE_STRING, + arm_demangling, + "ARM style demangling" + } + , + { + HP_DEMANGLING_STYLE_STRING, + hp_demangling, + "HP (aCC) style demangling" + } + , + { + EDG_DEMANGLING_STYLE_STRING, + edg_demangling, + "EDG style demangling" + } + , + { + GNU_NEW_ABI_DEMANGLING_STYLE_STRING, + gnu_new_abi_demangling, + "GNU (g++) new-ABI-style demangling" + } + , + { + NULL, unknown_demangling, NULL + } +}; + #define STRING_EMPTY(str) ((str) -> b == (str) -> p) #define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ string_prepend(str, " ");} @@ -268,12 +317,21 @@ typedef enum type_kind_t /* Prototypes for local functions */ +static void +delete_work_stuff PARAMS ((struct work_stuff *)); + +static void +delete_non_B_K_work_stuff PARAMS ((struct work_stuff *)); + static char * mop_up PARAMS ((struct work_stuff *, string *, int)); static void squangle_mop_up PARAMS ((struct work_stuff *)); +static void +work_stuff_copy_to_from PARAMS ((struct work_stuff *, struct work_stuff *)); + #if 0 static int demangle_method_args PARAMS ((struct work_stuff *, const char **, string *)); @@ -379,6 +437,10 @@ static void demangle_function_name PARAMS ((struct work_stuff *, const char **, string *, const char *)); +static int +iterate_demangle_function PARAMS ((struct work_stuff *, + const char **, string *, const char *)); + static void remember_type PARAMS ((struct work_stuff *, const char *, int)); @@ -636,8 +698,8 @@ cplus_demangle_opname (opname, result, o } } else if (opname[0] == '_' && opname[1] == '_' - && opname[2] >= 'a' && opname[2] <= 'z' - && opname[3] >= 'a' && opname[3] <= 'z') + && islower((unsigned char)opname[2]) + && islower((unsigned char)opname[3])) { if (opname[4] == '\0') { @@ -733,6 +795,7 @@ cplus_demangle_opname (opname, result, o return ret; } + /* Takes operator name as e.g. "++" and returns mangled operator name (e.g. "postincrement_expr"), or NULL if not found. @@ -758,6 +821,40 @@ cplus_mangle_opname (opname, options) return (0); } +/* Add a routine to set the demangling style to be sure it is valid and + allow for any demangler initialization that maybe necessary. */ + +enum demangling_styles +cplus_demangle_set_style (style) + enum demangling_styles style; +{ + struct demangler_engine *demangler = libiberty_demanglers; + + for (; demangler->demangling_style != unknown_demangling; ++demangler) + if (style == demangler->demangling_style) + { + current_demangling_style = style; + return current_demangling_style; + } + + return unknown_demangling; +} + +/* Do string name to style translation */ + +enum demangling_styles +cplus_demangle_name_to_style (name) + const char *name; +{ + struct demangler_engine *demangler = libiberty_demanglers; + + for (; demangler->demangling_style != unknown_demangling; ++demangler) + if (strcmp (name, demangler->demangling_style_name) == 0) + return demangler->demangling_style; + + return unknown_demangling; +} + /* char *cplus_demangle (const char *mangled, int options) If MANGLED is a mangled function name produced by GNU C++, then @@ -798,6 +895,10 @@ cplus_demangle (mangled, options) if ((work -> options & DMGL_STYLE_MASK) == 0) work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK; + /* The new-ABI demangling is implemented elsewhere. */ + if (GNU_NEW_ABI_DEMANGLING) + return cplus_demangle_new_abi (mangled); + ret = internal_cplus_demangle (work, mangled); squangle_mop_up (work); return (ret); @@ -893,16 +994,85 @@ squangle_mop_up (work) } } -/* Clear out any mangled storage */ -static char * -mop_up (work, declp, success) - struct work_stuff *work; - string *declp; - int success; +/* Copy the work state and storage. */ + +static void +work_stuff_copy_to_from (to, from) + struct work_stuff *to; + struct work_stuff *from; { - char *demangled = NULL; + int i; + + delete_work_stuff (to); + + /* Shallow-copy scalars. */ + memcpy (to, from, sizeof (*to)); + + /* Deep-copy dynamic storage. */ + if (from->typevec_size) + to->typevec + = (char **) xmalloc (from->typevec_size * sizeof (to->typevec[0])); + + for (i = 0; i < from->ntypes; i++) + { + int len = strlen (from->typevec[i]) + 1; + + to->typevec[i] = xmalloc (len); + memcpy (to->typevec[i], from->typevec[i], len); + } + + if (from->ksize) + to->ktypevec + = (char **) xmalloc (from->ksize * sizeof (to->ktypevec[0])); + + for (i = 0; i < from->numk; i++) + { + int len = strlen (from->ktypevec[i]) + 1; + + to->ktypevec[i] = xmalloc (len); + memcpy (to->ktypevec[i], from->ktypevec[i], len); + } + + if (from->bsize) + to->btypevec + = (char **) xmalloc (from->bsize * sizeof (to->btypevec[0])); + + for (i = 0; i < from->numb; i++) + { + int len = strlen (from->btypevec[i]) + 1; + + to->btypevec[i] = xmalloc (len); + memcpy (to->btypevec[i], from->btypevec[i], len); + } + + if (from->ntmpl_args) + to->tmpl_argvec + = xmalloc (from->ntmpl_args * sizeof (to->tmpl_argvec[0])); + + for (i = 0; i < from->ntmpl_args; i++) + { + int len = strlen (from->tmpl_argvec[i]) + 1; + to->tmpl_argvec[i] = xmalloc (len); + memcpy (to->tmpl_argvec[i], from->tmpl_argvec[i], len); + } + + if (from->previous_argument) + { + to->previous_argument = (string*) xmalloc (sizeof (string)); + string_init (to->previous_argument); + string_appends (to->previous_argument, from->previous_argument); + } +} + + +/* Delete dynamic stuff in work_stuff that is not to be re-used. */ + +static void +delete_non_B_K_work_stuff (work) + struct work_stuff *work; +{ /* Discard the remembered types, if any. */ forget_types (work); @@ -929,6 +1099,30 @@ mop_up (work, declp, success) free ((char*) work->previous_argument); work->previous_argument = NULL; } +} + + +/* Delete all dynamic storage in work_stuff. */ +static void +delete_work_stuff (work) + struct work_stuff *work; +{ + delete_non_B_K_work_stuff (work); + squangle_mop_up (work); +} + + +/* Clear out any mangled storage */ + +static char * +mop_up (work, declp, success) + struct work_stuff *work; + string *declp; + int success; +{ + char *demangled = NULL; + + delete_non_B_K_work_stuff (work); /* If demangling was successful, ensure that the demangled string is null terminated and return it. Otherwise, free the demangling decl. */ @@ -1154,7 +1348,7 @@ demangle_signature (work, mangled, declp break; case '_': - if (GNU_DEMANGLING && expect_return_type) + if ((AUTO_DEMANGLING || GNU_DEMANGLING) && expect_return_type) { /* Read the return type. */ string return_type; @@ -1188,7 +1382,7 @@ demangle_signature (work, mangled, declp break; case 'H': - if (GNU_DEMANGLING) + if (AUTO_DEMANGLING || GNU_DEMANGLING) { /* A G++ template function. Read the template arguments. */ success = demangle_template (work, mangled, declp, 0, 0, @@ -1433,6 +1627,11 @@ demangle_integral_value (work, mangled, { int value; + /* By default, we let the number decide whether we shall consume an + underscore. */ + int consume_following_underscore = 0; + int leave_following_underscore = 0; + success = 0; /* Negative numbers are indicated with a leading `m'. */ @@ -1441,17 +1640,49 @@ demangle_integral_value (work, mangled, string_appendn (s, "-", 1); (*mangled)++; } + else if (mangled[0][0] == '_' && mangled[0][1] == 'm') + { + /* Since consume_count_with_underscores does not handle the + `m'-prefix we must do it here, using consume_count and + adjusting underscores: we have to consume the underscore + matching the prepended one. */ + consume_following_underscore = 1; + string_appendn (s, "-", 1); + (*mangled) += 2; + } + else if (**mangled == '_') + { + /* Do not consume a following underscore; + consume_following_underscore will consume what should be + consumed. */ + leave_following_underscore = 1; + } + + /* We must call consume_count if we expect to remove a trailing + underscore, since consume_count_with_underscores expects + the leading underscore (that we consumed) if it is to handle + multi-digit numbers. */ + if (consume_following_underscore) + value = consume_count (mangled); + else + value = consume_count_with_underscores (mangled); - /* Read the rest of the number. */ - value = consume_count_with_underscores (mangled); if (value != -1) { char buf[INTBUF_SIZE]; sprintf (buf, "%d", value); string_append (s, buf); - /* If the next character is an underscore, skip it. */ - if (**mangled == '_') + /* Numbers not otherwise delimited, might have an underscore + appended as a delimeter, which we should skip. + + ??? This used to always remove a following underscore, which + is wrong. If other (arbitrary) cases are followed by an + underscore, we need to do something more radical. */ + + if ((value > 9 || consume_following_underscore) + && ! leave_following_underscore + && **mangled == '_') (*mangled)++; /* All is well. */ @@ -1616,7 +1847,7 @@ demangle_template_value_parm (work, mang template parameters (e.g. S) is placed in TRAWNAME if TRAWNAME is non-NULL. If IS_TYPE is nonzero, this template is a type template, not a function template. If both IS_TYPE and REMEMBER are nonzero, - the tmeplate is remembered in the list of back-referenceable + the template is remembered in the list of back-referenceable types. */ static int @@ -2148,6 +2379,86 @@ demangle_class (work, mangled, declp) return (success); } + +/* Called when there's a "__" in the mangled name, with `scan' pointing to + the rightmost guess. + + Find the correct "__"-sequence where the function name ends and the + signature starts, which is ambiguous with GNU mangling. + Call demangle_signature here, so we can make sure we found the right + one; *mangled will be consumed so caller will not make further calls to + demangle_signature. */ + +static int +iterate_demangle_function (work, mangled, declp, scan) + struct work_stuff *work; + const char **mangled; + string *declp; + const char *scan; +{ + const char *mangle_init = *mangled; + int success = 0; + string decl_init; + struct work_stuff work_init; + + if (*(scan + 2) == '\0') + return 0; + + /* Do not iterate for some demangling modes, or if there's only one + "__"-sequence. This is the normal case. */ + if (ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING + || mystrstr (scan + 2, "__") == NULL) + { + demangle_function_name (work, mangled, declp, scan); + return 1; + } + + /* Save state so we can restart if the guess at the correct "__" was + wrong. */ + string_init (&decl_init); + string_appends (&decl_init, declp); + memset (&work_init, 0, sizeof work_init); + work_stuff_copy_to_from (&work_init, work); + + /* Iterate over occurrences of __, allowing names and types to have a + "__" sequence in them. We must start with the first (not the last) + occurrence, since "__" most often occur between independent mangled + parts, hence starting at the last occurence inside a signature + might get us a "successful" demangling of the signature. */ + + while (scan[2]) + { + demangle_function_name (work, mangled, declp, scan); + success = demangle_signature (work, mangled, declp); + if (success) + break; + + /* Reset demangle state for the next round. */ + *mangled = mangle_init; + string_clear (declp); + string_appends (declp, &decl_init); + work_stuff_copy_to_from (work, &work_init); + + /* Leave this underscore-sequence. */ + scan += 2; + + /* Scan for the next "__" sequence. */ + while (*scan && (scan[0] != '_' || scan[1] != '_')) + scan++; + + /* Move to last "__" in this sequence. */ + while (*scan && *scan == '_') + scan++; + scan -= 2; + } + + /* Delete saved state. */ + delete_work_stuff (&work_init); + string_delete (&decl_init); + + return success; +} + /* LOCAL FUNCTION @@ -2163,6 +2474,8 @@ SYNOPSIS DESCRIPTION Consume and demangle the prefix of the mangled name. + While processing the function name root, arrange to call + demangle_signature if the root is ambiguous. DECLP points to the string buffer into which demangled output is placed. On entry, the buffer is empty. On exit it contains @@ -2336,29 +2649,16 @@ demangle_prefix (work, mangled, declp) success = 0; } else - { - const char *tmp; - - /* Look for the LAST occurrence of __, allowing names to - have the '__' sequence embedded in them. */ - if (!(ARM_DEMANGLING || HP_DEMANGLING)) - { - while ((tmp = mystrstr (scan + 2, "__")) != NULL) - scan = tmp; - } - if (*(scan + 2) == '\0') - success = 0; - else - demangle_function_name (work, mangled, declp, scan); - } + return iterate_demangle_function (work, mangled, declp, scan); } } else if (*(scan + 2) != '\0') { /* Mangled name does not start with "__" but does have one somewhere in there with non empty stuff after it. Looks like a global - function name. */ - demangle_function_name (work, mangled, declp, scan); + function name. Iterate over all "__":s until the right + one is found. */ + return iterate_demangle_function (work, mangled, declp, scan); } else { @@ -2512,6 +2812,25 @@ gnu_special (work, mangled, declp) success = 0; break; } + + if (n > 10 && strncmp (*mangled, "_GLOBAL_", 8) == 0 + && (*mangled)[9] == 'N' + && (*mangled)[8] == (*mangled)[10] + && strchr (cplus_markers, (*mangled)[8])) + { + /* A member of the anonymous namespace. There's information + about what identifier or filename it was keyed to, but + it's just there to make the mangled name unique; we just + step over it. */ + string_append (declp, "{anonymous}"); + (*mangled) += n; + + /* Now p points to the marker before the N, so we need to + update it to the first marker after what we consumed. */ + p = strpbrk (*mangled, cplus_markers); + break; + } + string_appendn (declp, *mangled, n); (*mangled) += n; } @@ -2573,7 +2892,7 @@ gnu_special (work, mangled, declp) success = demangle_template (work, mangled, declp, 0, 1, 1); break; default: - success = demangle_fund_type (work, mangled, declp); + success = do_type (work, mangled, declp); break; } if (success && **mangled != '\0') @@ -3311,7 +3630,7 @@ demangle_fund_type (work, mangled, resul int done = 0; int success = 1; char buf[10]; - int dec = 0; + unsigned int dec = 0; string btype; type_kind_t tk = tk_integral; @@ -3455,7 +3774,7 @@ demangle_fund_type (work, mangled, resul *mangled += min (strlen (*mangled), 2); } sscanf (buf, "%x", &dec); - sprintf (buf, "int%i_t", dec); + sprintf (buf, "int%u_t", dec); APPEND_BLANK (result); string_append (result, buf); break; @@ -4188,8 +4507,8 @@ demangle_function_name (work, mangled, d } } else if (declp->b[0] == '_' && declp->b[1] == '_' - && declp->b[2] >= 'a' && declp->b[2] <= 'z' - && declp->b[3] >= 'a' && declp->b[3] <= 'z') + && islower((unsigned char)declp->b[2]) + && islower((unsigned char)declp->b[3])) { if (declp->b[4] == '\0') { @@ -4402,6 +4721,7 @@ static int flags = DMGL_PARAMS | DMGL_AN static void demangle_it PARAMS ((char *)); static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN; +static void print_demangler_list PARAMS ((FILE *)); static void demangle_it (mangled_name) @@ -4421,16 +4741,43 @@ demangle_it (mangled_name) } } +static void +print_demangler_list (stream) + FILE *stream; +{ + struct demangler_engine *demangler; + + fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name); + + for (demangler = libiberty_demanglers + 1; + demangler->demangling_style != unknown_demangling; + ++demangler) + fprintf (stream, ",%s", demangler->demangling_style_name); + + fprintf (stream, "}"); +} + static void usage (stream, status) FILE *stream; int status; { fprintf (stream, "\ -Usage: %s [-_] [-n] [-s {gnu,lucid,arm,hp,edg}] [--strip-underscores]\n\ - [--no-strip-underscores] [--format={gnu,lucid,arm,hp,edg}]\n\ - [--help] [--version] [arg...]\n", +Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n", program_name); + + fprintf (stream, "\ + [-s "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--format "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--help] [--version] [arg...]\n"); exit (status); } @@ -4468,6 +4815,9 @@ standard_symbol_characters PARAMS ((void static const char * hp_symbol_characters PARAMS ((void)); +static const char * +gnu_new_abi_symbol_characters PARAMS ((void)); + /* Return the string of non-alnum characters that may occur as a valid symbol component, in the standard assembler symbol syntax. */ @@ -4516,6 +4866,17 @@ hp_symbol_characters () } +/* Return the string of non-alnum characters that may occur + as a valid symbol component in the GNU standard C++ ABI mangling + scheme. */ + +static const char * +gnu_new_abi_symbol_characters () +{ + return "_"; +} + + extern int main PARAMS ((int, char **)); int @@ -4553,32 +4914,19 @@ main (argc, argv) flags |= DMGL_JAVA; break; case 's': - if (strcmp (optarg, "gnu") == 0) - { - current_demangling_style = gnu_demangling; - } - else if (strcmp (optarg, "lucid") == 0) - { - current_demangling_style = lucid_demangling; - } - else if (strcmp (optarg, "arm") == 0) - { - current_demangling_style = arm_demangling; - } - else if (strcmp (optarg, "hp") == 0) - { - current_demangling_style = hp_demangling; - } - else if (strcmp (optarg, "edg") == 0) - { - current_demangling_style = edg_demangling; - } - else - { - fprintf (stderr, "%s: unknown demangling style `%s'\n", - program_name, optarg); - return (1); - } + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + { + fprintf (stderr, "%s: unknown demangling style `%s'\n", + program_name, optarg); + return (1); + } + else + cplus_demangle_set_style (style); + } break; } } @@ -4603,6 +4951,9 @@ main (argc, argv) case hp_demangling: valid_symbols = hp_symbol_characters (); break; + case gnu_new_abi_demangling: + valid_symbols = gnu_new_abi_symbol_characters (); + break; default: /* Folks should explicitly indicate the appropriate alphabet for each demangling. Providing a default would allow the @@ -4652,6 +5003,7 @@ main (argc, argv) if (c == EOF) break; putchar (c); + fflush (stdout); } } diff -uprN binutils-2.10/libiberty/dyn-string.c binutils-2.10.1/libiberty/dyn-string.c --- binutils-2.10/libiberty/dyn-string.c Thu Jan 1 01:00:00 1970 +++ binutils-2.10.1/libiberty/dyn-string.c Mon Oct 23 10:43:14 2000 @@ -0,0 +1,409 @@ +/* An abstract string datatype. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Mark Mitchell (mark@markmitchell.com). + +This file is part of GNU CC. + +GNU CC 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. + +GNU CC 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 GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "libiberty.h" +#include "dyn-string.h" + +/* If this file is being compiled for inclusion in the C++ runtime + library, as part of the demangler implementation, we don't want to + abort if an allocation fails. Instead, percolate an error code up + through the call chain. */ + +#ifdef IN_LIBGCC2 +#define RETURN_ON_ALLOCATION_FAILURE +#endif + +/* Performs in-place initialization of a dyn_string struct. This + function can be used with a dyn_string struct on the stack or + embedded in another object. The contents of of the string itself + are still dynamically allocated. The string initially is capable + of holding at least SPACE characeters, including the terminating + NUL. If SPACE is 0, it will silently be increated to 1. + + If RETURN_ON_ALLOCATION_FAILURE is defined and memory allocation + fails, returns 0. Otherwise returns 1. */ + +int +dyn_string_init (ds_struct_ptr, space) + struct dyn_string *ds_struct_ptr; + int space; +{ + /* We need at least one byte in which to store the terminating NUL. */ + if (space == 0) + space = 1; + +#ifdef RETURN_ON_ALLOCATION_FAILURE + ds_struct_ptr->s = (char *) malloc (space); + if (ds_struct_ptr->s == NULL) + return 0; +#else + ds_struct_ptr->s = (char *) xmalloc (space); +#endif + ds_struct_ptr->allocated = space; + ds_struct_ptr->length = 0; + ds_struct_ptr->s[0] = '\0'; + + return 1; +} + +/* Create a new dynamic string capable of holding at least SPACE + characters, including the terminating NUL. If SPACE is 0, it will + be silently increased to 1. If RETURN_ON_ALLOCATION_FAILURE is + defined and memory allocation fails, returns NULL. Otherwise + returns the newly allocated string. */ + +dyn_string_t +dyn_string_new (space) + int space; +{ + dyn_string_t result; +#ifdef RETURN_ON_ALLOCATION_FAILURE + result = (dyn_string_t) malloc (sizeof (struct dyn_string)); + if (result == NULL) + return NULL; + if (!dyn_string_init (result, space)) + { + free (result); + return NULL; + } +#else + result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); + dyn_string_init (result, space); +#endif + return result; +} + +/* Free the memory used by DS. */ + +void +dyn_string_delete (ds) + dyn_string_t ds; +{ + free (ds->s); + free (ds); +} + +/* Returns the contents of DS in a buffer allocated with malloc. It + is the caller's responsibility to deallocate the buffer using free. + DS is then set to the empty string. Deletes DS itself. */ + +char* +dyn_string_release (ds) + dyn_string_t ds; +{ + /* Store the old buffer. */ + char* result = ds->s; + /* The buffer is no longer owned by DS. */ + ds->s = NULL; + /* Delete DS. */ + free (ds); + /* Return the old buffer. */ + return result; +} + +/* Increase the capacity of DS so it can hold at least SPACE + characters, plus the terminating NUL. This function will not (at + present) reduce the capacity of DS. Returns DS on success. + + If RETURN_ON_ALLOCATION_FAILURE is defined and a memory allocation + operation fails, deletes DS and returns NULL. */ + +dyn_string_t +dyn_string_resize (ds, space) + dyn_string_t ds; + int space; +{ + int new_allocated = ds->allocated; + + /* Increase SPACE to hold the NUL termination. */ + ++space; + + /* Increase allocation by factors of two. */ + while (space > new_allocated) + new_allocated *= 2; + + if (new_allocated != ds->allocated) + { + ds->allocated = new_allocated; + /* We actually need more space. */ +#ifdef RETURN_ON_ALLOCATION_FAILURE + ds->s = (char *) realloc (ds->s, ds->allocated); + if (ds->s == NULL) + { + free (ds); + return NULL; + } +#else + ds->s = (char *) xrealloc (ds->s, ds->allocated); +#endif + } + + return ds; +} + +/* Sets the contents of DS to the empty string. */ + +void +dyn_string_clear (ds) + dyn_string_t ds; +{ + /* A dyn_string always has room for at least the NUL terminator. */ + ds->s[0] = '\0'; + ds->length = 0; +} + +/* Makes the contents of DEST the same as the contents of SRC. DEST + and SRC must be distinct. Returns 1 on success. On failure, if + RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_copy (dest, src) + dyn_string_t dest; + dyn_string_t src; +{ + if (dest == src) + abort (); + + /* Make room in DEST. */ + if (dyn_string_resize (dest, src->length) == NULL) + return 0; + /* Copy DEST into SRC. */ + strcpy (dest->s, src->s); + /* Update the size of DEST. */ + dest->length = src->length; + return 1; +} + +/* Copies SRC, a NUL-terminated string, into DEST. Returns 1 on + success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_copy_cstr (dest, src) + dyn_string_t dest; + const char *src; +{ + int length = strlen (src); + /* Make room in DEST. */ + if (dyn_string_resize (dest, length) == NULL) + return 0; + /* Copy DEST into SRC. */ + strcpy (dest->s, src); + /* Update the size of DEST. */ + dest->length = length; + return 1; +} + +/* Inserts SRC at the beginning of DEST. DEST is expanded as + necessary. SRC and DEST must be distinct. Returns 1 on success. + On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and + returns 0. */ + +int +dyn_string_prepend (dest, src) + dyn_string_t dest; + dyn_string_t src; +{ + return dyn_string_insert (dest, 0, src); +} + +/* Inserts SRC, a NUL-terminated string, at the beginning of DEST. + DEST is expanded as necessary. Returns 1 on success. On failure, + if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_prepend_cstr (dest, src) + dyn_string_t dest; + const char *src; +{ + return dyn_string_insert_cstr (dest, 0, src); +} + +/* Inserts SRC into DEST starting at position POS. DEST is expanded + as necessary. SRC and DEST must be distinct. Returns 1 on + success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_insert (dest, pos, src) + dyn_string_t dest; + int pos; + dyn_string_t src; +{ + int i; + + if (src == dest) + abort (); + + if (dyn_string_resize (dest, dest->length + src->length) == NULL) + return 0; + /* Make room for the insertion. Be sure to copy the NUL. */ + for (i = dest->length; i >= pos; --i) + dest->s[i + src->length] = dest->s[i]; + /* Splice in the new stuff. */ + strncpy (dest->s + pos, src->s, src->length); + /* Compute the new length. */ + dest->length += src->length; + return 1; +} + +/* Inserts SRC, a NUL-terminated string, into DEST starting at + position POS. DEST is expanded as necessary. Returns 1 on + success. On failure, RETURN_ON_ALLOCATION_FAILURE, deletes DEST + and returns 0. */ + +int +dyn_string_insert_cstr (dest, pos, src) + dyn_string_t dest; + int pos; + const char *src; +{ + int i; + int length = strlen (src); + + if (dyn_string_resize (dest, dest->length + length) == NULL) + return 0; + /* Make room for the insertion. Be sure to copy the NUL. */ + for (i = dest->length; i >= pos; --i) + dest->s[i + length] = dest->s[i]; + /* Splice in the new stuff. */ + strncpy (dest->s + pos, src, length); + /* Compute the new length. */ + dest->length += length; + return 1; +} + +/* Append S to DS, resizing DS if necessary. Returns 1 on success. + On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and + returns 0. */ + +int +dyn_string_append (dest, s) + dyn_string_t dest; + dyn_string_t s; +{ + if (dyn_string_resize (dest, dest->length + s->length) == 0) + return 0; + strcpy (dest->s + dest->length, s->s); + dest->length += s->length; + return 1; +} + +/* Append the NUL-terminated string S to DS, resizing DS if necessary. + Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, + deletes DEST and returns 0. */ + +int +dyn_string_append_cstr (dest, s) + dyn_string_t dest; + const char *s; +{ + int len = strlen (s); + + /* The new length is the old length plus the size of our string, plus + one for the null at the end. */ + if (dyn_string_resize (dest, dest->length + len) == NULL) + return 0; + strcpy (dest->s + dest->length, s); + dest->length += len; + return 1; +} + +/* Appends C to the end of DEST. Returns 1 on success. On failiure, + if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ + +int +dyn_string_append_char (dest, c) + dyn_string_t dest; + int c; +{ + /* Make room for the extra character. */ + if (dyn_string_resize (dest, dest->length + 1) == NULL) + return 0; + /* Append the character; it will overwrite the old NUL. */ + dest->s[dest->length] = c; + /* Add a new NUL at the end. */ + dest->s[dest->length + 1] = '\0'; + /* Update the length. */ + ++(dest->length); + return 1; +} + +/* Sets the contents of DEST to the substring of SRC starting at START + and ending before END. START must be less than or equal to END, + and both must be between zero and the length of SRC, inclusive. + Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, + deletes DEST and returns 0. */ + +int +dyn_string_substring (dest, src, start, end) + dyn_string_t dest; + dyn_string_t src; + int start; + int end; +{ + int i; + int length = end - start; + + if (start > end || start > src->length || end > src->length) + abort (); + + /* Make room for the substring. */ + if (dyn_string_resize (dest, length) == NULL) + return 0; + /* Copy the characters in the substring, */ + for (i = length; --i >= 0; ) + dest->s[i] = src->s[start + i]; + /* NUL-terimate the result. */ + dest->s[length] = '\0'; + /* Record the length of the substring. */ + dest->length = length; + + return 1; +} + +/* Returns non-zero if DS1 and DS2 have the same contents. */ + +int +dyn_string_eq (ds1, ds2) + dyn_string_t ds1; + dyn_string_t ds2; +{ + /* If DS1 and DS2 have different lengths, they must not be the same. */ + if (ds1->length != ds2->length) + return 0; + else + return !strcmp (ds1->s, ds2->s); +} diff -uprN binutils-2.10/libiberty/testsuite/demangle-expected binutils-2.10.1/libiberty/testsuite/demangle-expected --- binutils-2.10/libiberty/testsuite/demangle-expected Tue Feb 22 15:59:20 2000 +++ binutils-2.10.1/libiberty/testsuite/demangle-expected Mon Oct 23 10:43:14 2000 @@ -2486,3 +2486,83 @@ f(Bar<21>, int) --format=gnu f__FGt3Bar1i24XY_t f(Bar<2>, XY_t) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1Ui9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1Ui_20__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt8N___A___1Ui_99__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1im1_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZRCiZt2NA1im9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1i_m20__X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZcZt2NA1im1_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt4N__A1im9_X01_i +int foo > >(TA >) +# +--format=gnu +foo__H1Zt2TA2ZiZt4N__A1i_m99__X01_i +int foo > >(TA >) +# +--format=gnu +__opi__t2TA2ZiZt4N__A1i9 +TA >::operator int(void) +# +--format=gnu +__opi__t2TA2ZiZt8N___A___1i_m99_ +TA >::operator int(void) +# +--format=gnu +foo___bar__baz_____H1Zt2TA2ZiZt8N___A___1i_99__X01_i +int foo___bar__baz___ > >(TA >) +# +--format=gnu +foo__bar___foobar_____t2TA2ZiZt8N___A___1i_m99_ +TA >::foo__bar___foobar___(void) +# +--format=gnu +foo__bar___foobar_____t2TA2ZiZt4N__A1i9 +TA >::foo__bar___foobar___(void) +# +--format=gnu +__tfP8sockaddr +sockaddr * type_info function +# +--format=gnu +__tfPQ25libcwt16option_event_tct1Z12burst_app_ct +libcw::option_event_tct * type_info function +# +--format=gnu +__tiP8sockaddr +sockaddr * type_info node +# +--format=gnu +__tiPQ25libcwt16option_event_tct1Z12burst_app_ct +libcw::option_event_tct * type_info node +# +--format=gnu +_27_GLOBAL_.N.__12burst_app_ct.app_instance +{anonymous}::app_instance +# +--format=gnu +_26_GLOBAL_\$N\$_tmp_n.iilg4Gya\$app_instance +{anonymous}::app_instance diff -uprN binutils-2.10/libiberty/testsuite/regress-demangle binutils-2.10.1/libiberty/testsuite/regress-demangle --- binutils-2.10/libiberty/testsuite/regress-demangle Tue Feb 22 15:59:20 2000 +++ binutils-2.10.1/libiberty/testsuite/regress-demangle Mon Oct 23 10:43:14 2000 @@ -15,6 +15,8 @@ sed -e '/^#/ d' "$1" | ( if test "x$x" != "x$demangled"; then failures=`expr $failures + 1` echo "FAIL: $type $mangled" + echo " result: $x" + echo " expected: $demangled" fi done