]> git.donarmstrong.com Git - lilypond.git/commitdiff
resolve merge
authorDon Armstrong <don@donarmstrong.com>
Sat, 30 Jul 2011 01:21:36 +0000 (18:21 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 30 Jul 2011 01:21:36 +0000 (18:21 -0700)
1  2 
lily/midi-stream.cc
lily/piano-pedal-engraver.cc
lily/prob.cc
lily/relocate.cc
lily/source-file.cc
lily/translator.cc
scm/ps-to-png.scm
stepmake/bin/config.sub

diff --combined lily/midi-stream.cc
index ca7e24141c14a0d1615a145c4858dd652e2671e6,c7a48ad706d1ee04456b214e7bf65f7e6ac34b18..dc232cb085223e6339bc478359a7bb43710b9d3b
@@@ -1,13 -1,24 +1,24 @@@
  /*
-   midi-stream.cc -- implement Midi_stream
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
+   Copyright (C) 1997--2011 Jan Nieuwenhuizen <janneke@gnu.org>
  
-   (c) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #include "midi-stream.hh"
 -
 +#include <cstring>
  #include <cerrno>
  using namespace std;
  
index f30442db548a7fc8782055c4fce419a37dddfbbd,43666efbdd9346b0f18e3eabed675bbe68867227..4c1e52206d9d663b32d5b08358cad9378dc9dbd5
@@@ -1,13 -1,24 +1,24 @@@
  /*
-   piano-pedal-engraver.cc -- implement Piano_pedal_engraver
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
-   (c) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>,
+   Copyright (C) 2000--2011 Jan Nieuwenhuizen <janneke@gnu.org>,
                   Erik Sandberg <mandolaerik@gmail.com>
  
    Chris Jackson <chris@fluffhouse.org.uk> - extended to support
    bracketed pedals.
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #include "engraver.hh"
@@@ -27,7 -38,6 +38,7 @@@
  #include "item.hh"
  
  #include "translator.icc"
 +#include <cstring>
  
  #include <string.h>
  
@@@ -158,9 -168,9 +169,9 @@@ init_pedal_types (
        be careful, as we don't want to loose references to the _sym_ members.
         */
        Pedal_type_info info;
-       info.event_class_sym_ = scm_str2symbol ((base_ident + "-event").c_str ());
-       info.style_sym_ = scm_str2symbol (("pedal" + base_name + "Style").c_str ());
-       info.strings_sym_ = scm_str2symbol (("pedal" + base_name + "Strings").c_str ());
+       info.event_class_sym_ = scm_from_locale_symbol ((base_ident + "-event").c_str ());
+       info.style_sym_ = scm_from_locale_symbol (("pedal" + base_name + "Style").c_str ());
+       info.strings_sym_ = scm_from_locale_symbol (("pedal" + base_name + "Strings").c_str ());
        
        info.base_name_ = name;
        info.pedal_c_str_ = strdup ((base_name + "Pedal").c_str ());
diff --combined lily/prob.cc
index 53ce8f72be3e9ba257061a08ee71a4957cd15b90,233c5b6d5f0a604e5ff19d1805328114a4ee28f4..ba7cd5635c7be7275c27d7d61b915e27fab704d6
@@@ -1,9 -1,20 +1,20 @@@
  /*
-   prob.cc -- implement Prob
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
+   Copyright (C) 2004--2011 Jan Nieuwenhuizen <janneke@gnu.org>
  
-   (c) 2004--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #include "prob.hh"
@@@ -11,7 -22,7 +22,7 @@@
  #include "item.hh"
  #include "input.hh"
  #include "profile.hh"
 -
 +#include <cstring>
  #include "ly-smobs.icc"
  
  IMPLEMENT_SMOBS (Prob);
@@@ -24,7 -35,7 +35,7 @@@ Prob::equal_p (SCM sa, SCM sb
       constructor preserve equality.
  
       Perhaps it would be better to use a more strict definition of
-      equality; e.g., that that two probs are equal iff they can be
+      equality; e.g., that two probs are equal iff they can be
       distinguished by calls to ly:prob-property.
    */
    Prob *probs[2] = {unsmob_prob (sa), unsmob_prob (sb)};
@@@ -55,7 -66,7 +66,7 @@@
          if (scm_caar (aprop) != scm_caar (bprop) ||
              (
               !(unsmob_input (aval) && unsmob_input (bval))
-              &&                
+              &&
               !to_boolean (scm_equal_p (aval, bval))))
            return SCM_BOOL_F;
        }
@@@ -112,11 -123,11 +123,11 @@@ SC
  Prob::mark_smob (SCM smob)
  {
    ASSERT_LIVE_IS_ALLOWED ();
-   
    Prob *system = (Prob *) SCM_CELL_WORD_1 (smob);
    scm_gc_mark (system->mutable_property_alist_);
    system->derived_mark ();
-   
    return system->immutable_property_alist_;
  }
  
@@@ -131,7 -142,7 +142,7 @@@ Prob::print_smob (SCM smob, SCM port, s
    scm_puts (p->class_name (), port);
    scm_display (p->mutable_property_alist_, port);
    scm_display (p->immutable_property_alist_, port);
-   
    scm_puts (" >\n", port);
    return 1;
  }
@@@ -165,11 -176,11 +176,11 @@@ Prob::instrumented_set_property (SCM sy
  }
  
  void
- Prob::internal_set_property (SCM sym, SCM val) 
+ Prob::internal_set_property (SCM sym, SCM val)
  {
    if (do_internal_type_checking_global)
      type_check_assignment (sym, val);
-   
    mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, val);
  }
  
diff --combined lily/relocate.cc
index 67926e531cb552a5054138b5b2ed4626e652a600,628187363bd39aa8417064146bf779189f5cbfdd..e5f38d1f90d3d1fd8837c372aed545d89994b94d
@@@ -1,10 -1,20 +1,20 @@@
  /*
-   relocate.cc -- implement relocation based on argv0
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
+   Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
  
-   (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
  
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #include "relocate.hh"
  
  /* TODO: autoconf support */
  
 +#include <ctype.h>
  #include <sys/types.h>
  #include <dirent.h>
 +#include <cstring>
  
  #if HAVE_GETTEXT
  #include <libintl.h>
@@@ -193,17 -201,18 +203,18 @@@ setup_paths (char const *argv0_ptr
              File_path path;
              path.parse_path (getenv ("PATH"));
  
-             if (be_verbose_global)
-               warning (_f ("Relocation: from PATH=%s\nargv0=%s",
-                            path.to_string ().c_str (), argv0_ptr));
  #ifndef __MINGW32__
              argv0_abs = path.find (argv0_filename.to_string ());
  #else /* __MINGW32__ */
+             path.prepend (get_working_directory ());
              char const *ext[] = {"exe", "", 0 };
              argv0_abs = path.find (argv0_filename.to_string (), ext);
  #endif /* __MINGW32__ */
  
+             if (be_verbose_global)
+               warning (_f ("Relocation: from PATH=%s\nargv0=%s",
+                            path.to_string ().c_str (), argv0_ptr));
              if (argv0_abs.empty ())
                programming_error ("cannot find absolute argv0");
            }
diff --combined lily/source-file.cc
index d5e4bcf6764a015a6adc6b6725939407e821bde1,b01676355840a1877bacc3b9439809cb195ce496..82c13fc45b6911338d6996760de97e5ddf2b6f9f
@@@ -1,10 -1,21 +1,21 @@@
  /*
-   source-file.cc -- implement Source_file
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
-   (c) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+   Copyright (C) 1997--2011 Jan Nieuwenhuizen <janneke@gnu.org>
    Han-Wen Nienhuys <hanwen@xs4all.nl>
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #if GCC_MAJOR < 4
  #endif /* GCC_MAJOR < 4 */
  
  #include "source-file.hh"
 -
 +#include <cstring>
  #include "config.hh"
  
- #if HAVE_UTF8_WCHAR_H
- #include <utf8/wchar.h>  /* mbrtowc */
- #else /* !HAVE_UTF8_WCHAR_H */
- #include <cwchar> /* mbrtowc */
- #endif /* HAVE_UTF8_WCHAR_H */
  #include <cstdio>
  
  #if HAVE_SSTREAM
@@@ -34,6 -39,7 +39,7 @@@ using namespace std
  
  #include "file-name-map.hh"
  #include "international.hh"
+ #include "misc.hh"
  #include "warn.hh"
  
  void
@@@ -42,7 -48,7 +48,7 @@@ Source_file::load_stdin (
    characters_.clear ();
    int c;
    while ((c = fgetc (stdin)) != EOF)
-     characters_.push_back (c);
+     characters_.push_back ((char)c);
  }
  
  /*
@@@ -173,8 -179,8 +179,8 @@@ Source_file::file_line_column_string (c
      return " (" + _ ("position unknown") + ")";
    else
      {
-       int l, ch, col;
-       get_counts (context_str0, &l, &ch, &col);
+       int l, ch, col, offset;
+       get_counts (context_str0, &l, &ch, &col, &offset);
  
        return name_string () + ":" + to_string (l)
        + ":" + to_string (col);
@@@ -187,13 -193,13 +193,13 @@@ Source_file::quote_input (char const *p
    if (!contains (pos_str0))
      return " (" + _ ("position unknown") + ")";
  
-   int l, ch, col;
-   get_counts (pos_str0, &l, &ch, &col);
+   int l, ch, col, offset;
+   get_counts (pos_str0, &l, &ch, &col, &offset);
    string line = line_string (pos_str0);
-   string context = line.substr (0, ch)
+   string context = line.substr (0, offset)
      + to_string ('\n')
      + to_string (' ', col)
-     + line.substr (ch, line.length ()-ch);
+     + line.substr (offset, line.length () - offset);
    return context;
  }
  
@@@ -253,11 -259,10 +259,10 @@@ voi
  Source_file::get_counts (char const *pos_str0,
                         int *line_number,
                         int *line_char,
-                        int *column) const
+                        int *column,
+                        int *byte_offset) const
  {
    *line_number = 0;
-   *line_char = 0;
-   *column = 0;
      
    if (!contains (pos_str0))
      return;
    string line_begin (line_start, left);
    char const *line_chars = line_begin.c_str ();
  
-   *column = 0;
    *line_char = 0;
-   mbstate_t state;
-   /* Initialize the state.  */
-   memset (&state, '\0', sizeof (state));
+   *column = 0;
+   *byte_offset = 0;
  
    while (left > 0)
      {
-       /*
-       FIXME, this is apparently locale dependent.
-       */
- #if HAVE_MBRTOWC
-       wchar_t multibyte[2];
-       size_t thislen = mbrtowc (multibyte, line_chars, left, &state);
- #else
-       size_t thislen = 1;
- #endif /* !HAVE_MBRTOWC */
-       /* Stop converting at invalid character;
-        this can mean we have read just the first part
-        of a valid character.  */
-       if (thislen == (size_t) -1)
-       break;
-       /* We want to handle embedded NUL bytes
-        but the return value is 0.  Correct this.  */
-       if (thislen == 0)
-       thislen = 1;
+       size_t thislen = utf8_char_len (*line_chars);
  
        if (thislen == 1 && line_chars[0] == '\t')
        (*column) = (*column / 8 + 1) * 8;
        (*column)++;
  
        (*line_char)++;
+       /*
+       To have decent output in UTF-8 aware terminals,
+       we must keep track of the number of bytes from
+       the left edge of the terminal.
+       */
+       *byte_offset += thislen;
        /* Advance past this character. */
        line_chars += thislen;
        left -= thislen;
diff --combined lily/translator.cc
index 68320f1fe0c648084c479a2f740d192ca445f609,3020006f837e21e9edfac660a720a41bb80ca2f3..821705c8cf9d9af2abc10b8dfa9dd71995c7fb05
@@@ -1,13 -1,24 +1,24 @@@
  /*
-   translator.cc -- implement Translator
+   This file is part of LilyPond, the GNU music typesetter.
  
-   source file of the GNU LilyPond music typesetter
+   Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
  
-   (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+   LilyPond 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 3 of the License, or
+   (at your option) any later version.
+   LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  */
  
  #include "translator.hh"
 -
 +#include <cstring>
  #include "context-def.hh"
  #include "dispatcher.hh"
  #include "global-context.hh"
@@@ -25,7 -36,6 +36,6 @@@ Translator::~Translator (
  void
  Translator::init ()
  {
-   must_be_last_ = false;
    self_scm_ = SCM_EOL;
    daddy_context_ = 0;
    smobify_self ();
@@@ -48,8 -58,8 +58,8 @@@ Translator::Translator (
  
  Translator::Translator (Translator const &src)
  {
+   (void) src;
    init ();
-   must_be_last_ = src.must_be_last_;
  }
  
  Moment
@@@ -110,15 -120,17 +120,17 @@@ Translator::finalize (
  void
  Translator::connect_to_context (Context *c)
  {
-   for (translator_listener_record *r = get_listener_list (); r; r=r->next_)
-     c->events_below ()->add_listener (r->get_listener_ (this), r->event_class_);
+   for (translator_listener_record *r = get_listener_list (); r; r = r->next_)
+     c->events_below ()->add_listener (r->get_listener_ (this, r->event_class_),
+                                     r->event_class_);
  }
  
  void
  Translator::disconnect_from_context (Context *c)
  {
-   for (translator_listener_record *r = get_listener_list (); r; r=r->next_)
-     c->events_below ()->remove_listener (r->get_listener_ (this), r->event_class_);
+   for (translator_listener_record *r = get_listener_list (); r; r = r->next_)
+     c->events_below ()->remove_listener (r->get_listener_ (this, r->event_class_),
+                                        r->event_class_);
  }
  
  static SCM listened_event_class_table;
@@@ -166,7 -178,7 +178,7 @@@ add_listened_event_class (SCM sym
  void
  Translator::add_translator_listener (translator_listener_record **listener_list,
                                     translator_listener_record *r,
-                                    Listener (*get_listener) (void *), 
+                                    Listener (*get_listener) (void *, SCM), 
                                     const char *ev_class)
  {
    /* ev_class is the C++ identifier name. Convert to scm symbol */
    name = replace_all (&name, '_', '-');
    name += "-event";
    
-   SCM class_sym = scm_str2symbol (name.c_str ());
+   SCM class_sym = scm_from_locale_symbol (name.c_str ());
    
    add_listened_event_class (class_sym);
  
@@@ -247,7 -259,7 +259,7 @@@ IMPLEMENT_TYPE_P (Translator, "ly:trans
  bool
  Translator::must_be_last () const
  {
-   return must_be_last_;
+   return false;
  }
  
  void
diff --combined scm/ps-to-png.scm
index 6c53f07849ebb45e5cd5300796f38cd9c8cb864a,17f822247b763286137855573b7bbcc1b90ea658..1f567aae88340890a1dc412092701214c80df0d4
@@@ -1,8 -1,19 +1,19 @@@
- ;;;; ps-to-png.scm --
+ ;;;; This file is part of LilyPond, the GNU music typesetter.
  ;;;;
- ;;;;  source file of the GNU LilyPond music typesetter
- ;;;; 
- ;;;; (c) 2005--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+ ;;;; Copyright (C) 2005--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+ ;;;;
+ ;;;; LilyPond 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 3 of the License, or
+ ;;;; (at your option) any later version.
+ ;;;;
+ ;;;; LilyPond 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 LilyPond.  If not, see <http://www.gnu.org/licenses/>.
  
  (define-module (scm ps-to-png))
  
   (lily)
   )
  
- ;; gettext wrapper for guile < 1.7.2
- (if (defined? 'gettext)
-     (define-public _ gettext)
-     (define-public (_ x) x))
+ ;; FIXME: use backend-library for duplicates and stubs; lilypond-ps2png.scm is no more
+ (define-public _ gettext)
  
  (define PLATFORM
    (string->symbol
          (output-file (if multi-page? pngn png1))
  
          (gs-variable-options
-          (if multi-page?
-              (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
-                      page-width page-height)
-              "-dEPSCrop"))
-         (cmd (format #f "~a\
+           (if (string-suffix-ci? ".eps" ps-name)
+               "-dEPSCrop"
+               (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
+                       page-width page-height)))
+         (cmd (ly:format "~a\
   ~a\
   ~a\
   -dGraphicsAlphaBits=4\
 + -q\
   -dTextAlphaBits=4\
   -dNOPAUSE\
   -sDEVICE=~a\
   -sOutputFile=~S\
-  -r~S\
+  -r~a\
   ~S\
   -c quit"
                       (search-gs)
diff --combined stepmake/bin/config.sub
index 6759825a5b7fcf64476b4398dc0e30b3090b925c,204218c07382772bc2e9ad083f9dd766af90fb36..c5138c45abb8b2019a74c6eccaf5a439cf8d1a8c
@@@ -1,10 -1,10 +1,10 @@@
  #! /bin/sh
  # Configuration validation subroutine script.
  #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
  #   Free Software Foundation, Inc.
  
- timestamp='2008-01-16'
+ timestamp='2010-05-21'
  
  # This file is (in principle) common to ALL GNU software.
  # The presence of a machine in this file suggests that SOME GNU software
  
  
  # Please send patches to <config-patches@gnu.org>.  Submit a context
- # diff and a properly formatted ChangeLog entry.
+ # diff and a properly formatted GNU ChangeLog entry.
  #
  # Configuration subroutine to validate and canonicalize a configuration type.
  # Supply the specified configuration type as an argument.
  # If it is invalid, we print an error message on stderr and exit with code 1.
  # Otherwise, we print the canonical config type on stdout and succeed.
  
+ # You can get the latest version of this script from:
+ # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
  # This file is supposed to be the same for all GNU packages
  # and recognize all the CPU types, system types and aliases
  # that are meaningful with *any* GNU software.
@@@ -72,8 -75,9 +75,9 @@@ Report bugs and patches to <config-patc
  version="\
  GNU config.sub ($timestamp)
  
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+ Software Foundation, Inc.
  
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@@ -120,8 -124,10 +124,10 @@@ esa
  # Here we must recognize all the valid KERNEL-OS combinations.
  maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  case $maybe_os in
-   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+   knetbsd*-gnu* | netbsd*-gnu* | \
+   kopensolaris*-gnu* | \
    storm-chaos* | os2-emx* | rtmk-nova*)
      os=-$maybe_os
      basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@@ -148,10 -154,13 +154,13 @@@ case $os i
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray)
+       -apple | -axis | -knuth | -cray | -microblaze)
                os=
                basic_machine=$1
                ;;
+         -bluegene*)
+               os=-cnk
+               ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
                basic_machine=$1
@@@ -249,13 -258,16 +258,16 @@@ case $basic_machine i
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep \
+       | maxq | mb | microblaze | mcore | mep | metag \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64vr | mips64vrel \
+       | mips64octeon | mips64octeonel \
        | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | moxie \
        | mt \
        | msp430 \
        | nios | nios2 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
+       | rx \
        | score \
-       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
        | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
+       | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
        | v850 | v850e \
        | we32k \
        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k)
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
                # Motorola 68HC11/12.
                basic_machine=$basic_machine-unknown
                os=-none
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
        | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | mips64octeon-* | mips64octeonel-* \
        | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
        | tron-* \
+       | ubicom32-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
++      xtensa*)
++              basic_machine=$basic_machine-unknown
 +              ;;
 +      # Recognize the basic CPU types without company name, with glob match.
        xtensa*)
                basic_machine=$basic_machine-unknown
                ;;
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
                os=-linux
                ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
+         cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
                basic_machine=ns32k-utek
                os=-sysv
                ;;
+         microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
        mingw32)
                basic_machine=i386-pc
                os=-mingw32
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
+         # This must be matched before tile*.
+         tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
                ;;
 +      tic55x | c55x*)
 +              basic_machine=tic55x-unknown
 +              os=-coff
 +              ;;
 +      tic6x | c6x*)
 +              basic_machine=tic6x-unknown
 +              os=-coff
 +              ;;
 +      tile*)
 +              basic_machine=tile-unknown
 +              os=-linux-gnu
 +              ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@@ -1216,6 -1270,9 +1286,9 @@@ case $os i
          # First match some system type aliases
          # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
+         -auroraux)
+               os=-auroraux
+               ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
        # Each alternative MUST END IN A *, to match a version number.
        # -sysv* is not here because it comes later, after sysvr4.
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
        -zvmoe)
                os=-zvmoe
                ;;
+       -dicos*)
+               os=-dicos
+               ;;
+         -nacl*)
+               ;;
        -none)
                ;;
        *)
@@@ -1428,6 -1492,15 +1508,15 @@@ case $basic_machine i
          c4x-* | tic4x-*)
                os=-coff
                ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
+               ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@@ -1585,7 -1658,7 +1674,7 @@@ case $basic_machine i
                        -sunos*)
                                vendor=sun
                                ;;
-                       -aix*)
+                       -cnk*|-aix*)
                                vendor=ibm
                                ;;
                        -beos*)