mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
49e4877c54
I tried building gdb with G++ 4.7 and CXX="g++ -std=gnu+11", and that tripped on a build error: In file included from build-gnulib/import/stdio.h:53:0, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20: build-gnulib/import/stddef.h:104:3: error: conflicting declaration ‘typedef union max_align_t max_align_t’ In file included from build-gnulib/import/stddef.h:55:0, from build-gnulib/import/stdio.h:53, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20: /opt/gcc-4.7/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/include/stddef.h:426:3: error: ‘max_align_t’ has a previous declaration as ‘typedef struct max_align_t max_align_t’ Updating gnulib to current master fixes it, since it brings in this fix: http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00000.html Our last update was in August 2015. This doesn't bring in much added baggage, it's mostly bug fixes. It pulled in the "limits-h" module as automatic dependency, and given that looks potentially useful I added it to the set of modules we require. Tested on x86_64 Fedora 23, with g++ 4.7 and g++ 5.3, native and gdbserver. gdb/ChangeLog: 2016-10-18 Pedro Alves <palves@redhat.com> * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to 2692e23a48e21f6daa029e8af9f1a143b7532f47. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate. * gnulib/import/Makefile: Update. * gnulib/import/alloca: Update. * gnulib/import/basename-lgpl: Update. * gnulib/import/canonicalize-lgpl: Update. * gnulib/import/config: Update. * gnulib/import/dirent: Update. * gnulib/import/dirfd: Update. * gnulib/import/dirname-lgpl: Update. * gnulib/import/dirname.h: Update. * gnulib/import/dosname.h: Update. * gnulib/import/errno: Update. * gnulib/import/extra/snippet/arg-nonnull.h: Update. * gnulib/import/extra/snippet/c++defs.h: Update. * gnulib/import/extra/snippet/warn-on-use.h: Update. * gnulib/import/extra/update-copyright: Update. * gnulib/import/flexmember.h: Update. * gnulib/import/float+.h: Update. * gnulib/import/float: Update. * gnulib/import/float: Update. * gnulib/import/fnmatch: Update. * gnulib/import/fnmatch: Update. * gnulib/import/fnmatch_loop: Update. * gnulib/import/fpucw.h: Update. * gnulib/import/frexp: Update. * gnulib/import/frexpl: Update. * gnulib/import/gettimeofday: Update. * gnulib/import/hard-locale: Update. * gnulib/import/hard-locale.h: Update. * gnulib/import/inttypes: Update. * gnulib/import/isnan: Update. * gnulib/import/isnand-nolibm.h: Update. * gnulib/import/isnand: Update. * gnulib/import/isnanl-nolibm.h: Update. * gnulib/import/isnanl: Update. * gnulib/import/itold: Update. * gnulib/import/limits: Update. * gnulib/import/localcharset: Update. * gnulib/import/localcharset.h: Update. * gnulib/import/lstat: Update. * gnulib/import/m4/00gnulib: Update. * gnulib/import/m4/absolute-header: Update. * gnulib/import/m4/alloca: Update. * gnulib/import/m4/canonicalize: Update. * gnulib/import/m4/codeset: Update. * gnulib/import/m4/configmake: Update. * gnulib/import/m4/dirent_h: Update. * gnulib/import/m4/dirfd: Update. * gnulib/import/m4/dirname: Update. * gnulib/import/m4/double-slash-root: Update. * gnulib/import/m4/eealloc: Update. * gnulib/import/m4/errno_h: Update. * gnulib/import/m4/exponentd: Update. * gnulib/import/m4/exponentl: Update. * gnulib/import/m4/extensions: Update. * gnulib/import/m4/extern-inline: Update. * gnulib/import/m4/fcntl-o: Update. * gnulib/import/m4/flexmember: Update. * gnulib/import/m4/float_h: Update. * gnulib/import/m4/fnmatch: Update. * gnulib/import/m4/fpieee: Update. * gnulib/import/m4/frexp: Update. * gnulib/import/m4/frexpl: Update. * gnulib/import/m4/gettimeofday: Update. * gnulib/import/m4/glibc21: Update. * gnulib/import/m4/gnulib-cache: Update. * gnulib/import/m4/gnulib-common: Update. * gnulib/import/m4/gnulib-comp: Update. * gnulib/import/m4/gnulib-tool: Update. * gnulib/import/m4/hard-locale: Update. * gnulib/import/m4/include_next: Update. * gnulib/import/m4/inttypes-pri: Update. * gnulib/import/m4/inttypes: Update. * gnulib/import/m4/isnand: Update. * gnulib/import/m4/isnanl: Update. * gnulib/import/m4/largefile: Update. * gnulib/import/m4/limits-h: Update. * gnulib/import/m4/localcharset: Update. * gnulib/import/m4/locale-fr: Update. * gnulib/import/m4/locale-ja: Update. * gnulib/import/m4/locale-zh: Update. * gnulib/import/m4/longlong: Update. * gnulib/import/m4/lstat: Update. * gnulib/import/m4/malloc: Update. * gnulib/import/m4/malloca: Update. * gnulib/import/m4/math_h: Update. * gnulib/import/m4/mbrtowc: Update. * gnulib/import/m4/mbsinit: Update. * gnulib/import/m4/mbsrtowcs: Update. * gnulib/import/m4/mbstate_t: Update. * gnulib/import/m4/memchr: Update. * gnulib/import/m4/memmem: Update. * gnulib/import/m4/mmap-anon: Update. * gnulib/import/m4/multiarch: Update. * gnulib/import/m4/nocrash: Update. * gnulib/import/m4/off_t: Update. * gnulib/import/m4/pathmax: Update. * gnulib/import/m4/rawmemchr: Update. * gnulib/import/m4/readlink: Update. * gnulib/import/m4/rename: Update. * gnulib/import/m4/rmdir: Update. * gnulib/import/m4/signal_h: Update. * gnulib/import/m4/ssize_t: Update. * gnulib/import/m4/stat: Update. * gnulib/import/m4/stdbool: Update. * gnulib/import/m4/stddef_h: Update. * gnulib/import/m4/stdint: Update. * gnulib/import/m4/stdio_h: Update. * gnulib/import/m4/stdlib_h: Update. * gnulib/import/m4/strchrnul: Update. * gnulib/import/m4/string_h: Update. * gnulib/import/m4/strstr: Update. * gnulib/import/m4/strtok_r: Update. * gnulib/import/m4/sys_socket_h: Update. * gnulib/import/m4/sys_stat_h: Update. * gnulib/import/m4/sys_time_h: Update. * gnulib/import/m4/sys_types_h: Update. * gnulib/import/m4/time_h: Update. * gnulib/import/m4/unistd_h: Update. * gnulib/import/m4/warn-on-use: Update. * gnulib/import/m4/wchar_h: Update. * gnulib/import/m4/wchar_t: Update. * gnulib/import/m4/wctype_h: Update. * gnulib/import/m4/wint_t: Update. * gnulib/import/malloc: Update. * gnulib/import/malloca: Update. * gnulib/import/malloca.h: Update. * gnulib/import/math: Update. * gnulib/import/math: Update. * gnulib/import/mbrtowc: Update. * gnulib/import/mbsinit: Update. * gnulib/import/mbsrtowcs-impl.h: Update. * gnulib/import/mbsrtowcs-state: Update. * gnulib/import/mbsrtowcs: Update. * gnulib/import/memchr: Update. * gnulib/import/memmem: Update. * gnulib/import/pathmax.h: Update. * gnulib/import/rawmemchr: Update. * gnulib/import/readlink: Update. * gnulib/import/ref-add.sin: Update. * gnulib/import/ref-del.sin: Update. * gnulib/import/rename: Update. * gnulib/import/rmdir: Update. * gnulib/import/same-inode.h: Update. * gnulib/import/signal: Update. * gnulib/import/stat: Update. * gnulib/import/stdbool: Update. * gnulib/import/stddef: Update. * gnulib/import/stdint: Update. * gnulib/import/stdio: Update. * gnulib/import/stdlib: Update. * gnulib/import/str-two-way.h: Update. * gnulib/import/strchrnul: Update. * gnulib/import/streq.h: Update. * gnulib/import/string: Update. * gnulib/import/stripslash: Update. * gnulib/import/strnlen1: Update. * gnulib/import/strnlen1.h: Update. * gnulib/import/strstr: Update. * gnulib/import/strtok_r: Update. * gnulib/import/sys_stat: Update. * gnulib/import/sys_time: Update. * gnulib/import/sys_types: Update. * gnulib/import/time: Update. * gnulib/import/unistd: Update. * gnulib/import/unistd: Update. * gnulib/import/verify.h: Update. * gnulib/import/wchar: Update. * gnulib/import/wctype: Update. * gnulib/import/flexmember.h: New file. * gnulib/import/hard-locale.c: New file. * gnulib/import/hard-locale.h: New file. * gnulib/import/limits.in.h: New file. * gnulib/import/m4/flexmember.m4: New file. * gnulib/import/m4/hard-locale.m4: New file. * gnulib/import/m4/limits-h.m4: New file.
275 lines
9.3 KiB
Plaintext
Executable File
275 lines
9.3 KiB
Plaintext
Executable File
eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
|
|
& eval 'exec perl -wS -0777 -pi "$0" $argv:q'
|
|
if 0;
|
|
# Update an FSF copyright year list to include the current year.
|
|
|
|
my $VERSION = '2016-01-12.23:13'; # UTC
|
|
|
|
# Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3, 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
# Written by Jim Meyering and Joel E. Denny
|
|
|
|
# The arguments to this script should be names of files that contain
|
|
# copyright statements to be updated. The copyright holder's name
|
|
# defaults to "Free Software Foundation, Inc." but may be changed to
|
|
# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
|
|
# variable.
|
|
#
|
|
# For example, you might wish to use the update-copyright target rule
|
|
# in maint.mk from gnulib's maintainer-makefile module.
|
|
#
|
|
# Iff a copyright statement is recognized in a file and the final
|
|
# year is not the current year, then the statement is updated for the
|
|
# new year and it is reformatted to:
|
|
#
|
|
# 1. Fit within 72 columns.
|
|
# 2. Convert 2-digit years to 4-digit years by prepending "19".
|
|
# 3. Expand copyright year intervals. (See "Environment variables"
|
|
# below.)
|
|
#
|
|
# A warning is printed for every file for which no copyright
|
|
# statement is recognized.
|
|
#
|
|
# Each file's copyright statement must be formatted correctly in
|
|
# order to be recognized. For example, each of these is fine:
|
|
#
|
|
# Copyright @copyright{} 1990-2005, 2007-2009 Free Software
|
|
# Foundation, Inc.
|
|
#
|
|
# # Copyright (C) 1990-2005, 2007-2009 Free Software
|
|
# # Foundation, Inc.
|
|
#
|
|
# /*
|
|
# * Copyright © 90,2005,2007-2009
|
|
# * Free Software Foundation, Inc.
|
|
# */
|
|
#
|
|
# However, the following format is not recognized because the line
|
|
# prefix changes after the first line:
|
|
#
|
|
# ## Copyright (C) 1990-2005, 2007-2009 Free Software
|
|
# # Foundation, Inc.
|
|
#
|
|
# However, any correctly formatted copyright statement following
|
|
# a non-matching copyright statements would be recognized.
|
|
#
|
|
# The exact conditions that a file's copyright statement must meet
|
|
# to be recognized are:
|
|
#
|
|
# 1. It is the first copyright statement that meets all of the
|
|
# following conditions. Subsequent copyright statements are
|
|
# ignored.
|
|
# 2. Its format is "Copyright (C)", then a list of copyright years,
|
|
# and then the name of the copyright holder.
|
|
# 3. The "(C)" takes one of the following forms or is omitted
|
|
# entirely:
|
|
#
|
|
# A. (C)
|
|
# B. (c)
|
|
# C. @copyright{}
|
|
# D. ©
|
|
#
|
|
# 4. The "Copyright" appears at the beginning of a line, except that it
|
|
# may be prefixed by any sequence (e.g., a comment) of no more than
|
|
# 5 characters -- including white space.
|
|
# 5. Iff such a prefix is present, the same prefix appears at the
|
|
# beginning of each remaining line within the FSF copyright
|
|
# statement. There is one exception in order to support C-style
|
|
# comments: if the first line's prefix contains nothing but
|
|
# whitespace surrounding a "/*", then the prefix for all subsequent
|
|
# lines is the same as the first line's prefix except with each of
|
|
# "/" and possibly "*" replaced by a " ". The replacement of "*"
|
|
# by " " is consistent throughout all subsequent lines.
|
|
# 6. Blank lines, even if preceded by the prefix, do not appear
|
|
# within the FSF copyright statement.
|
|
# 7. Each copyright year is 2 or 4 digits, and years are separated by
|
|
# commas or dashes. Whitespace may appear after commas.
|
|
#
|
|
# Environment variables:
|
|
#
|
|
# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement
|
|
# is reformatted even if it does not need updating for the new
|
|
# year. If unset or set to 0, only updated FSF copyright
|
|
# statements are reformatted.
|
|
# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
|
|
# copyright years (such as 90, 1991, 1992-2007, 2008) in a
|
|
# reformatted FSF copyright statement is collapsed to a single
|
|
# interval (such as 1990-2008). If unset or set to 0, all existing
|
|
# copyright year intervals in a reformatted FSF copyright statement
|
|
# are expanded instead.
|
|
# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
|
|
# to the minimal containing range. For example, convert
|
|
# 2000, 2004-2007, 2009 to 2000-2009.
|
|
# 3. For testing purposes, you can set the assumed current year in
|
|
# UPDATE_COPYRIGHT_YEAR.
|
|
# 4. The default maximum line length for a copyright line is 72.
|
|
# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
|
|
# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
|
|
# than "Free Software Foundation, Inc.".
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
my $copyright_re = 'Copyright';
|
|
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)';
|
|
my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
|
|
$holder ||= 'Free Software Foundation, Inc.';
|
|
my $prefix_max = 5;
|
|
my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
|
|
!$margin || $margin !~ m/^\d+$/
|
|
and $margin = 72;
|
|
|
|
my $tab_width = 8;
|
|
|
|
my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
|
|
if (!$this_year || $this_year !~ m/^\d{4}$/)
|
|
{
|
|
my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
|
|
$this_year = $year + 1900;
|
|
}
|
|
|
|
# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
|
|
my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
|
|
|
|
my $leading;
|
|
my $prefix;
|
|
my $ws_re;
|
|
my $stmt_re;
|
|
while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
|
|
{
|
|
$leading = "$1$2";
|
|
$prefix = $2;
|
|
if ($prefix =~ /^(\s*\/)\*(\s*)$/)
|
|
{
|
|
$prefix =~ s,/, ,;
|
|
my $prefix_ws = $prefix;
|
|
$prefix_ws =~ s/\*/ /; # Only whitespace.
|
|
if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/)
|
|
{
|
|
$prefix = $prefix_ws;
|
|
}
|
|
}
|
|
$ws_re = '[ \t\r\f]'; # \s without \n
|
|
$ws_re =
|
|
"(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
|
|
my $holder_re = $holder;
|
|
$holder_re =~ s/\s/$ws_re/g;
|
|
my $stmt_remainder_re =
|
|
"(?:$ws_re$circle_c_re)?"
|
|
. "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
|
|
. "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
|
|
if (/\G$stmt_remainder_re/)
|
|
{
|
|
$stmt_re =
|
|
quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
|
|
last;
|
|
}
|
|
}
|
|
if (defined $stmt_re)
|
|
{
|
|
/$stmt_re/ or die; # Should never die.
|
|
my $stmt = $1;
|
|
my $final_year_orig = $2;
|
|
|
|
# Handle two-digit year numbers like "98" and "99".
|
|
my $final_year = $final_year_orig;
|
|
$final_year <= 99
|
|
and $final_year += 1900;
|
|
|
|
if ($final_year != $this_year)
|
|
{
|
|
# Update the year.
|
|
$stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
|
|
}
|
|
if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
|
|
{
|
|
# Normalize all whitespace including newline-prefix sequences.
|
|
$stmt =~ s/$ws_re/ /g;
|
|
|
|
# Put spaces after commas.
|
|
$stmt =~ s/, ?/, /g;
|
|
|
|
# Convert 2-digit to 4-digit years.
|
|
$stmt =~ s/(\b\d\d\b)/19$1/g;
|
|
|
|
# Make the use of intervals consistent.
|
|
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
|
|
{
|
|
$stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
|
|
}
|
|
else
|
|
{
|
|
$stmt =~
|
|
s/
|
|
(\d{4})
|
|
(?:
|
|
(,\ |-)
|
|
((??{
|
|
if ($2 eq '-') { '\d{4}'; }
|
|
elsif (!$3) { $1 + 1; }
|
|
else { $3 + 1; }
|
|
}))
|
|
)+
|
|
/$1-$3/gx;
|
|
|
|
# When it's 2, emit a single range encompassing all year numbers.
|
|
$ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
|
|
and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
|
|
}
|
|
|
|
# Format within margin.
|
|
my $stmt_wrapped;
|
|
my $text_margin = $margin - length($prefix);
|
|
if ($prefix =~ /^(\t+)/)
|
|
{
|
|
$text_margin -= length($1) * ($tab_width - 1);
|
|
}
|
|
while (length $stmt)
|
|
{
|
|
if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
|
|
|| ($stmt =~ s/^([\S]+)(?: |$)//))
|
|
{
|
|
my $line = $1;
|
|
$stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
|
|
$stmt_wrapped .= $line;
|
|
}
|
|
else
|
|
{
|
|
# Should be unreachable, but we don't want an infinite
|
|
# loop if it can be reached.
|
|
die;
|
|
}
|
|
}
|
|
|
|
# Replace the old copyright statement.
|
|
s/$stmt_re/$stmt_wrapped/;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
print STDERR "$ARGV: warning: copyright statement not found\n";
|
|
}
|
|
|
|
# Local variables:
|
|
# mode: perl
|
|
# indent-tabs-mode: nil
|
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
# time-stamp-start: "my $VERSION = '"
|
|
# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
|
|
# time-stamp-time-zone: "UTC0"
|
|
# time-stamp-end: "'; # UTC"
|
|
# End:
|