From 97852f39f42a28abfcaf1c46b1f06920eae151c9 Mon Sep 17 00:00:00 2001 From: Edoardo Sanguineti Date: Fri, 4 Nov 2022 11:50:32 -0700 Subject: [PATCH 01/20] maint: remove unnecessary casts before using gnulib functions * src/parse-gram.y, src/scan-gram.l: Do not cast c-ctype.h function args to unsigned char unnecessarily. * src/parse-gram.c: Regenerate. Copyright-paperwork-exempt: yes --- src/parse-gram.c | 4 ++-- src/parse-gram.y | 4 ++-- src/scan-gram.l | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parse-gram.c b/src/parse-gram.c index b6ac083e7..97fbb9259 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -2945,11 +2945,11 @@ add_param (param_type type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ --p; - while (c_isspace ((unsigned char) *p)) + while (c_isspace (*p)) --p; p[1] = '\0'; ++decl; - while (c_isspace ((unsigned char) *decl)) + while (c_isspace (*decl)) ++decl; } diff --git a/src/parse-gram.y b/src/parse-gram.y index 3006f54c8..7e2299f1b 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -928,11 +928,11 @@ add_param (param_type type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ --p; - while (c_isspace ((unsigned char) *p)) + while (c_isspace (*p)) --p; p[1] = '\0'; ++decl; - while (c_isspace ((unsigned char) *decl)) + while (c_isspace (*decl)) ++decl; } diff --git a/src/scan-gram.l b/src/scan-gram.l index 3926a4aa2..64c2fe8d6 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -683,7 +683,7 @@ eqopt ({sp}=)? \\(.|{eol}) { char const *p = yytext + 1; /* Quote only if escaping won't make the character visible. */ - if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p)) + if (c_isspace (*p) && c_isprint (*p)) p = quote (p); else p = quotearg_style_mem (escape_quoting_style, p, 1); From 8b3df1a443dc77a6b4d4eb371554224410072ab1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 16:56:46 -0700 Subject: [PATCH 02/20] build: update gnulib and autoconf submodules to latest --- gnulib | 2 +- submodules/autoconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gnulib b/gnulib index 71b603702..ee27e9964 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 71b603702b8cf7977dedd5f6b71ea0ffc1669894 +Subproject commit ee27e996435f0daf0f8cd960285abb5859f50a4d diff --git a/submodules/autoconf b/submodules/autoconf index 66fdaea3c..2f64dcd04 160000 --- a/submodules/autoconf +++ b/submodules/autoconf @@ -1 +1 @@ -Subproject commit 66fdaea3cfb4e758212c1891913e9a59441d49af +Subproject commit 2f64dcd048b08bb90ec44b26f4cd6b729112a28e From 41a939eece717afbaed2704d2463b44523ceaa66 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 17:04:42 -0700 Subject: [PATCH 03/20] maint: ./bootstrap --- autogen.sh | 451 +------------------ autopull.sh | 240 +--------- bootstrap | 126 ++++-- bootstrap-funclib.sh | 974 ++++++++++++++++++++++++++++++++++++---- lib/.gitignore | 39 +- lib/glthread/.gitignore | 2 + lib/malloc/.gitignore | 1 - m4/.gitignore | 29 +- 8 files changed, 1026 insertions(+), 836 deletions(-) diff --git a/autogen.sh b/autogen.sh index 02028f272..0f3d8092e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -4,7 +4,7 @@ # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files # with new versions of autoconf or automake. -# Copyright (C) 2003-2022 Free Software Foundation, Inc. +# Copyright (C) 2003-2025 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 @@ -30,457 +30,10 @@ # Alternatively, you can use an autogen.sh script that is specific # to your package. -scriptversion=2022-07-24.15; # UTC - me="$0" medir=`dirname "$me"` # Read the function library and the configuration. . "$medir"/bootstrap-funclib.sh -# Ensure that CDPATH is not set. Otherwise, the output from cd -# would cause trouble in at least one use below. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Environment variables that may be set by the user. -: "${AUTOPOINT=autopoint}" -: "${AUTORECONF=autoreconf}" - -if test "$vc_ignore" = auto; then - vc_ignore= - test -d .git && vc_ignore=.gitignore - test -d CVS && vc_ignore="$vc_ignore .cvsignore" -fi - -usage() { - cat < /dev/null 2>&1 - elif test -d .svn; then - svn log -r HEAD "$file" > /dev/null 2>&1 - elif test -d CVS; then - grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null | - grep '^/[^/]*/[0-9]' > /dev/null - else - warn_ "no version control for $file?" - false - fi -} - -# Strip blank and comment lines to leave significant entries. -gitignore_entries() { - sed '/^#/d; /^$/d' "$@" -} - -# If $STR is not already on a line by itself in $FILE, insert it at the start. -# Entries are inserted at the start of the ignore list to ensure existing -# entries starting with ! are not overridden. Such entries support -# whitelisting exceptions after a more generic blacklist pattern. -insert_if_absent() { - file=$1 - str=$2 - test -f $file || touch $file - test -r $file || die "Error: failed to read ignore file: $file" - duplicate_entries=$(gitignore_entries $file | sort | uniq -d) - if [ "$duplicate_entries" ] ; then - die "Error: Duplicate entries in $file: " $duplicate_entries - fi - linesold=$(gitignore_entries $file | wc -l) - linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l) - if [ $linesold != $linesnew ] ; then - { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \ - || die "insert_if_absent $file $str: failed" - fi -} - -# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with -# insert_if_absent. -insert_vc_ignore() { - vc_ignore_file="$1" - pattern="$2" - case $vc_ignore_file in - *.gitignore) - # A .gitignore entry that does not start with '/' applies - # recursively to subdirectories, so prepend '/' to every - # .gitignore entry. - pattern=$(echo "$pattern" | sed s,^,/,);; - esac - insert_if_absent "$vc_ignore_file" "$pattern" -} - -symlink_to_dir() -{ - src=$1/$2 - dst=${3-$2} - - test -f "$src" && { - - # If the destination directory doesn't exist, create it. - # This is required at least for "lib/uniwidth/cjk.h". - dst_dir=$(dirname "$dst") - if ! test -d "$dst_dir"; then - mkdir -p "$dst_dir" - - # If we've just created a directory like lib/uniwidth, - # tell version control system(s) it's ignorable. - # FIXME: for now, this does only one level - parent=$(dirname "$dst_dir") - for dot_ig in x $vc_ignore; do - test $dot_ig = x && continue - ig=$parent/$dot_ig - insert_vc_ignore $ig "${dst_dir##*/}" - done - fi - - if $copy; then - { - test ! -h "$dst" || { - echo "$me: rm -f $dst" && - rm -f "$dst" - } - } && - test -f "$dst" && - cmp -s "$src" "$dst" || { - echo "$me: cp -fp $src $dst" && - cp -fp "$src" "$dst" - } - else - # Leave any existing symlink alone, if it already points to the source, - # so that broken build tools that care about symlink times - # aren't confused into doing unnecessary builds. Conversely, if the - # existing symlink's timestamp is older than the source, make it afresh, - # so that broken tools aren't confused into skipping needed builds. See - # . - test -h "$dst" && - src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && - dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && - test "$src_i" = "$dst_i" && - both_ls=$(ls -dt "$src" "$dst") && - test "X$both_ls" = "X$dst$nl$src" || { - dot_dots= - case $src in - /*) ;; - *) - case /$dst/ in - *//* | */../* | */./* | /*/*/*/*/*/) - die "invalid symlink calculation: $src -> $dst";; - /*/*/*/*/) dot_dots=../../../;; - /*/*/*/) dot_dots=../../;; - /*/*/) dot_dots=../;; - esac;; - esac - - echo "$me: ln -fs $dot_dots$src $dst" && - ln -fs "$dot_dots$src" "$dst" - } - fi - } -} - -# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac. -found_aux_dir=no -grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \ - >/dev/null && found_aux_dir=yes -grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \ - >/dev/null && found_aux_dir=yes -test $found_aux_dir = yes \ - || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it" - -# If $build_aux doesn't exist, create it now, otherwise some bits -# below will malfunction. If creating it, also mark it as ignored. -if test ! -d $build_aux; then - mkdir $build_aux - for dot_ig in x $vc_ignore; do - test $dot_ig = x && continue - insert_vc_ignore $dot_ig $build_aux - done -fi - -check_build_prerequisites false - -use_libtool=0 -# We'd like to use grep -E, to see if any of LT_INIT, -# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac, -# but that's not portable enough (e.g., for Solaris). -grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \ - && use_libtool=1 -grep '^[ ]*LT_INIT' configure.ac >/dev/null \ - && use_libtool=1 -if test $use_libtool = 1; then - find_tool LIBTOOLIZE glibtoolize libtoolize -fi - -if $use_gnulib; then - gnulib_tool=$GNULIB_SRCDIR/gnulib-tool - <$gnulib_tool || exit $? -fi - -# NOTE: we have to be careful to run both autopoint and libtoolize -# before gnulib-tool, since gnulib-tool is likely to provide newer -# versions of files "installed" by these two programs. -# Then, *after* gnulib-tool (see below), we have to be careful to -# run autoreconf in such a way that it does not run either of these -# two just-pre-run programs. - -# Import from gettext. -with_gettext=yes -grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ - with_gettext=no - -if test $with_gettext = yes || test $use_libtool = 1; then - - tempbase=.bootstrap$$ - trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15 - - > $tempbase.0 > $tempbase.1 && - find . ! -type d -print | sort > $tempbase.0 || exit - - if test $with_gettext = yes; then - # Released autopoint has the tendency to install macros that have been - # obsoleted in current gnulib, so run this before gnulib-tool. - echo "$0: $AUTOPOINT --force" - $AUTOPOINT --force || exit - fi - - # Autoreconf runs aclocal before libtoolize, which causes spurious - # warnings if the initial aclocal is confused by the libtoolized - # (or worse out-of-date) macro directory. - # libtoolize 1.9b added the --install option; but we support back - # to libtoolize 1.5.22, where the install action was default. - if test $use_libtool = 1; then - install= - case $($LIBTOOLIZE --help) in - *--install*) install=--install ;; - esac - echo "running: $LIBTOOLIZE $install --copy" - $LIBTOOLIZE $install --copy - fi - - find . ! -type d -print | sort >$tempbase.1 - old_IFS=$IFS - IFS=$nl - for file in $(comm -13 $tempbase.0 $tempbase.1); do - IFS=$old_IFS - parent=${file%/*} - version_controlled_file "$parent" "$file" || { - for dot_ig in x $vc_ignore; do - test $dot_ig = x && continue - ig=$parent/$dot_ig - insert_vc_ignore "$ig" "${file##*/}" - done - } - done - IFS=$old_IFS - - rm -f $tempbase.0 $tempbase.1 - trap - 1 2 13 15 -fi - -# Import from gnulib. - -if $use_gnulib; then - gnulib_tool_options="\ - --no-changelog\ - --aux-dir=$build_aux\ - --doc-base=$doc_base\ - --lib=$gnulib_name\ - --m4-base=$m4_base/\ - --source-base=$source_base/\ - --tests-base=$tests_base\ - --local-dir=$local_gl_dir\ - $gnulib_tool_option_extras\ - " - if test $use_libtool = 1; then - case "$gnulib_tool_options " in - *' --libtool '*) ;; - *) gnulib_tool_options="$gnulib_tool_options --libtool" ;; - esac - fi - echo "$0: $gnulib_tool $gnulib_tool_options --import ..." - $gnulib_tool $gnulib_tool_options --import $gnulib_modules \ - || die "gnulib-tool failed" - - for file in $gnulib_files; do - symlink_to_dir "$GNULIB_SRCDIR" $file \ - || die "failed to symlink $file" - done -fi - -bootstrap_post_import_hook \ - || die "bootstrap_post_import_hook failed" - -# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some -# gnulib-populated directories. Such .m4 files would cause aclocal to fail. -# The following requires GNU find 4.2.3 or newer. Considering the usual -# portability constraints of this script, that may seem a very demanding -# requirement, but it should be ok. Ignore any failure, which is fine, -# since this is only a convenience to help developers avoid the relatively -# unusual case in which a symlinked-to .m4 file is git-removed from gnulib -# between successive runs of this script. -find "$m4_base" "$source_base" \ - -depth \( -name '*.m4' -o -name '*.[ch]' \) \ - -type l -xtype l -delete > /dev/null 2>&1 - -# Invoke autoreconf with --force --install to ensure upgrades of tools -# such as ylwrap. -AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS" - -# Some systems (RHEL 5) are using ancient autotools, for which the -# --no-recursive option had not been invented. Detect that lack and -# omit the option when it's not supported. FIXME in 2017: remove this -# hack when RHEL 5 autotools are updated, or when they become irrelevant. -case $($AUTORECONF --help) in - *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";; -esac - -# Tell autoreconf not to invoke autopoint or libtoolize; they were run above. -echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS" -AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \ - || die "autoreconf failed" - -# Get some extra files from gnulib, overriding existing files. -for file in $gnulib_extra_files; do - case $file in - */INSTALL) dst=INSTALL;; - build-aux/*) dst=$build_aux/${file#build-aux/};; - *) dst=$file;; - esac - symlink_to_dir "$GNULIB_SRCDIR" $file $dst \ - || die "failed to symlink $file" -done - -if test $with_gettext = yes; then - # Create gettext configuration. - echo "$0: Creating po/Makevars from po/Makevars.template ..." - rm -f po/Makevars - sed ' - /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ - /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/ - /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'| - /^XGETTEXT_OPTIONS *=/{ - s/$/ \\/ - a\ - '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} - } - ' po/Makevars.template >po/Makevars \ - || die 'cannot generate po/Makevars' - - # If the 'gettext' module is in use, grab the latest Makefile.in.in. - # If only the 'gettext-h' module is in use, assume autopoint already - # put the correct version of this file into place. - case $gnulib_modules in - *gettext-h*) ;; - *gettext*) - cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \ - || die "cannot create po/Makefile.in.in" - ;; - esac - - if test -d runtime-po; then - # Similarly for runtime-po/Makevars, but not quite the same. - rm -f runtime-po/Makevars - sed ' - /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/ - /^subdir *=.*/s/=.*/= runtime-po/ - /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ - /^XGETTEXT_OPTIONS *=/{ - s/$/ \\/ - a\ - '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} - } - ' po/Makevars.template >runtime-po/Makevars \ - || die 'cannot generate runtime-po/Makevars' - - # Copy identical files from po to runtime-po. - (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po) - fi -fi - -bootstrap_epilogue - -echo "$0: done. Now you can run './configure'." - -# ---------------------------------------------------------------------------- - -# Local Variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: +autogen "$@" diff --git a/autopull.sh b/autopull.sh index ffb4ba7cb..04f606348 100755 --- a/autopull.sh +++ b/autopull.sh @@ -2,7 +2,7 @@ # Convenience script for fetching auxiliary files that are omitted from # the version control repository of this package. -# Copyright (C) 2003-2022 Free Software Foundation, Inc. +# Copyright (C) 2003-2025 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 @@ -28,246 +28,10 @@ # Alternatively, you can use an autopull.sh script that is specific # to your package. -scriptversion=2022-07-24.15; # UTC - me="$0" medir=`dirname "$me"` # Read the function library and the configuration. . "$medir"/bootstrap-funclib.sh -# Ensure that CDPATH is not set. Otherwise, the output from cd -# would cause trouble in at least one use below. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -usage() { - cat </dev/null ; then - : - elif check_exists git-merge-changelog; then - echo "$0: initializing git-merge-changelog driver" - git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' - git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' - else - echo "$0: consider installing git-merge-changelog from gnulib" - fi -fi - -# ----------------------------- Get translations. ----------------------------- - -download_po_files() { - subdir=$1 - domain=$2 - echo "$me: getting translations into $subdir for $domain..." - cmd=$(printf "$po_download_command_format" "$subdir" "$domain") - eval "$cmd" -} - -# Mirror .po files to $po_dir/.reference and copy only the new -# or modified ones into $po_dir. Also update $po_dir/LINGUAS. -# Note po files that exist locally only are left in $po_dir but will -# not be included in LINGUAS and hence will not be distributed. -update_po_files() { - # Directory containing primary .po files. - # Overwrite them only when we're sure a .po file is new. - po_dir=$1 - domain=$2 - - # Mirror *.po files into this dir. - # Usually contains *.s1 checksum files. - ref_po_dir="$po_dir/.reference" - - test -d $ref_po_dir || mkdir $ref_po_dir || return - download_po_files $ref_po_dir $domain \ - && ls "$ref_po_dir"/*.po 2>/dev/null | - sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return - - langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g') - test "$langs" = '*' && langs=x - for po in $langs; do - case $po in x) continue;; esac - new_po="$ref_po_dir/$po.po" - cksum_file="$ref_po_dir/$po.s1" - if ! test -f "$cksum_file" || - ! test -f "$po_dir/$po.po" || - ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then - echo "$me: updated $po_dir/$po.po..." - cp "$new_po" "$po_dir/$po.po" \ - && $SHA1SUM < "$new_po" > "$cksum_file" || return - fi - done -} - -case $SKIP_PO in -'') - if test -d po; then - update_po_files po $package || exit - fi - - if test -d runtime-po; then - update_po_files runtime-po $package-runtime || exit - fi;; -esac - -# ----------------------------------------------------------------------------- - -bootstrap_post_pull_hook \ - || die "bootstrap_post_pull_hook failed" - -# Don't proceed if there are uninitialized submodules. In particular, -# autogen.sh will remove dangling links, which might be links into -# uninitialized submodules. -# But it's OK if the 'gnulib' submodule is uninitialized, as long as -# GNULIB_SRCDIR is set. -if $use_git; then - # Uninitialized submodules are listed with an initial dash. - uninitialized=`git submodule | grep '^-' | awk '{ print $2 }'` - if test -n "$GNULIB_SRCDIR"; then - uninitialized=`echo "$uninitialized" | grep -v '^gnulib$'` - fi - if test -n "$uninitialized"; then - die "Some git submodules are not initialized: "`echo "$uninitialized" | tr '\n' ',' | sed -e 's|,$|.|'`" Either use option '--no-git', or run 'git submodule update --init' and bootstrap again." - fi -fi - -echo "$0: done. Now you can run './autogen.sh'." - -# ---------------------------------------------------------------------------- - -# Local Variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: +autopull "$@" diff --git a/bootstrap b/bootstrap index cf8d007f6..5780ae5a6 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,9 @@ #! /bin/sh # Bootstrap this package from checked-out sources. -# Copyright (C) 2003-2022 Free Software Foundation, Inc. +scriptversion=2024-07-04.10; # UTC + +# Copyright (C) 2003-2025 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 @@ -26,8 +28,6 @@ # Please report bugs or propose patches to bug-gnulib@gnu.org. -scriptversion=2022-07-29.23; # UTC - me="$0" medir=`dirname "$me"` @@ -43,35 +43,55 @@ Optional environment variables: GNULIB_SRCDIR Specifies the local directory where gnulib sources reside. Use this if you already have gnulib sources on your machine, and - do not want to waste your bandwidth downloading - them again. - GNULIB_URL Cloneable URL of the gnulib repository. + you want to use these sources. + GNULIB_REFDIR Specifies the local directory where a gnulib + repository (with a .git subdirectory) resides. + Use this if you already have gnulib sources + and history on your machine, and do not want + to waste your bandwidth downloading them again. + Only used for phase 1 (--pull). + GNULIB_URL URL of the gnulib repository. The default is + $default_gnulib_url, + which is Gnulib's upstream repository. + Only used for phase 1 (--pull). Options: - --gnulib-srcdir=DIRNAME specify the local directory where gnulib + + --pull Do phase 1: Pull files from the network. + --gen Do phase 2: Generate files from local files + (no network access). + (The default is to do both phases.) + + --gnulib-srcdir=DIRNAME Specifies the local directory where gnulib sources reside. Use this if you already have gnulib sources on your machine, and you want to use these sources. Defaults - to \$GNULIB_SRCDIR - --gnulib-refdir=DIRNAME specify the local directory where a gnulib + to \$GNULIB_SRCDIR. + --gnulib-refdir=DIRNAME Specifies the local directory where a gnulib repository (with a .git subdirectory) resides. Use this if you already have gnulib sources and history on your machine, and do not want to waste your bandwidth downloading them again. - Defaults to \$GNULIB_REFDIR - --bootstrap-sync if this bootstrap script is not identical to + Defaults to \$GNULIB_REFDIR. + Only used for phase 1 (--pull). + + --bootstrap-sync If this bootstrap script is not identical to the version in the local gnulib sources, update this script, and then restart it with - /bin/sh or the shell \$CONFIG_SHELL - --no-bootstrap-sync do not check whether bootstrap is out of sync - --copy copy files instead of creating symbolic links - --force attempt to bootstrap even if the sources seem - not to have been checked out - --no-git do not use git to update gnulib. Requires that + /bin/sh or the shell \$CONFIG_SHELL. + --no-bootstrap-sync Do not check whether bootstrap is out of sync. + + --copy Copy files instead of creating symbolic links. + Only used for phase 2 (--gen). + --force Attempt to bootstrap even if the sources seem + not to have been checked out. + --no-git Do not use git to update gnulib. Requires that \$GNULIB_SRCDIR or the --gnulib-srcdir option points to a gnulib repository with the correct - revision - --skip-po do not download po files + revision. + Only used for phase 1 (--pull). + --skip-po Do not download *.po files. + Only used for phase 1 (--pull). EOF bootstrap_print_option_usage_hook cat </dev/null) +normalize_package_name=' + s/^GNU // + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g +' +package=$(${AUTOCONF:-autoconf} --trace 'AC_INIT:$4' configure.ac 2>/dev/null) if test -z "$package"; then package=$(sed -n "$extract_package_name" configure.ac) \ || die 'cannot find package name in configure.ac' fi +package=$(echo "$package" | sed "$normalize_package_name") gnulib_name=lib$package build_aux=build-aux @@ -303,7 +307,7 @@ check_versions() { # Handle the still-experimental Automake-NG programs specially. # They remain named as the mainstream Automake programs ("automake", # and "aclocal") to avoid gratuitous incompatibilities with - # pre-existing usages (by, say, autoreconf, or custom autogen.sh + # preexisting usages (by, say, autoreconf, or custom autogen.sh # scripts), but correctly identify themselves (as being part of # "GNU automake-ng") when asked their version. case $app in @@ -441,10 +445,9 @@ find_tool () # --------------------- Preparing GNULIB_SRCDIR for use. --------------------- # This is part of autopull.sh, but bootstrap needs it too, for self-upgrading. +# cleanup_gnulib fails, removing the directory $gnulib_path first. cleanup_gnulib() { status=$? - # XXX It's a bad idea to erase the submodule directory if it contains local - # modifications. rm -fr "$gnulib_path" exit $status } @@ -460,92 +463,157 @@ prepare_GNULIB_SRCDIR () # We already checked that $GNULIB_SRCDIR references a directory. # Verify that it contains a gnulib checkout. test -f "$GNULIB_SRCDIR/gnulib-tool" \ - || die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified, but does not contain gnulib-tool" - elif $use_git; then + || die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified," \ + "but does not contain gnulib-tool" + if test -n "$GNULIB_REVISION" && $use_git; then + # The 'git checkout "$GNULIB_REVISION"' command succeeds if the + # GNULIB_REVISION is a commit hash that exists locally, or if it is + # branch name that can be fetched from origin. It fails, however, + # if the GNULIB_REVISION is a commit hash that only exists in + # origin. In this case, we need a 'git fetch' and then retry + # 'git checkout "$GNULIB_REVISION"'. + git -C "$GNULIB_SRCDIR" checkout "$GNULIB_REVISION" 2>/dev/null \ + || { git -C "$GNULIB_SRCDIR" fetch origin \ + && git -C "$GNULIB_SRCDIR" checkout "$GNULIB_REVISION"; } \ + || exit $? + fi + else + if ! $use_git; then + die "Error: --no-git is specified," \ + "but neither --gnulib-srcdir nor \$GNULIB_SRCDIR is specified" + fi + if git submodule -h | grep -- --reference > /dev/null; then + : + else + die "git version is too old, git >= 1.6.4 is required" + fi gnulib_path=$(git_modules_config submodule.gnulib.path) - test -z "$gnulib_path" && gnulib_path=gnulib - - # Get gnulib files. Populate $gnulib_path, possibly updating a - # submodule, for use in the rest of the script. - - if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git \ - && git_modules_config submodule.gnulib.url >/dev/null; then - # Use GNULIB_REFDIR as a reference. - echo "$0: getting gnulib files..." - if git submodule -h|grep -- --reference > /dev/null; then - # Prefer the one-liner available in git 1.6.4 or newer. - git submodule update --init --reference "$GNULIB_REFDIR" \ - "$gnulib_path" || exit $? + if test -n "$gnulib_path"; then + # A submodule 'gnulib' is configured. + # Get gnulib files. Populate $gnulib_path, updating the submodule. + if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git; then + # Use GNULIB_REFDIR as a reference. + echo "$0: getting gnulib files..." + git submodule update --init --reference "$GNULIB_REFDIR" "$gnulib_path"\ + || exit $? else - # This fallback allows at least git 1.5.5. - if test -f "$gnulib_path"/gnulib-tool; then - # Since file already exists, assume submodule init already complete. + # GNULIB_REFDIR is not set or not usable. Ignore it. + if git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + git submodule init -- "$gnulib_path" || exit $? git submodule update -- "$gnulib_path" || exit $? else - # Older git can't clone into an empty directory. - rmdir "$gnulib_path" 2>/dev/null - git clone --reference "$GNULIB_REFDIR" \ - "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \ - && git submodule init -- "$gnulib_path" \ - && git submodule update -- "$gnulib_path" \ - || exit $? + die "Error: submodule 'gnulib' has no configured url" fi fi else - # GNULIB_REFDIR is not set or not usable. Ignore it. - if git_modules_config submodule.gnulib.url >/dev/null; then - echo "$0: getting gnulib files..." - git submodule init -- "$gnulib_path" || exit $? - git submodule update -- "$gnulib_path" || exit $? - - elif [ ! -d "$gnulib_path" ]; then + gnulib_path='gnulib' + if test ! -d "$gnulib_path"; then + # The subdirectory 'gnulib' does not yet exist. Clone into it. echo "$0: getting gnulib files..." - - trap cleanup_gnulib 1 2 13 15 - - shallow= - if test -z "$GNULIB_REVISION"; then - if git clone -h 2>&1 | grep -- --depth > /dev/null; then - shallow='--depth 2' - fi - git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \ - || cleanup_gnulib + trap cleanup_gnulib HUP INT PIPE TERM + gnulib_url=${GNULIB_URL:-$default_gnulib_url} + if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git; then + # Use GNULIB_REFDIR as a reference. + git clone "$GNULIB_REFDIR" "$gnulib_path" \ + && git -C "$gnulib_path" remote set-url origin "$gnulib_url" \ + && if test -z "$GNULIB_REVISION"; then + git -C "$gnulib_path" pull origin \ + && { + # We want the default branch of "$gnulib_url" (since that's + # the behaviour if GNULIB_REFDIR is not specified), not the + # current branch of "$GNULIB_REFDIR". + default_branch=`LC_ALL=C git -C "$gnulib_path" \ + remote show origin \ + | sed -n -e 's/^ *HEAD branch: //p'` + test -n "$default_branch" || default_branch='master' + git -C "$gnulib_path" checkout "$default_branch" + } + else + # The 'git checkout "$GNULIB_REVISION"' command succeeds if the + # GNULIB_REVISION is a commit hash that exists locally, or if it + # is a branch name that can be fetched from origin. It fails, + # however, if the GNULIB_REVISION is a commit hash that only + # exists in origin. In this case, we need a 'git fetch' and then + # retry 'git checkout "$GNULIB_REVISION"'. + git -C "$gnulib_path" checkout "$GNULIB_REVISION" 2>/dev/null \ + || { git -C "$gnulib_path" fetch origin \ + && git -C "$gnulib_path" checkout "$GNULIB_REVISION"; } + fi \ + || cleanup_gnulib else - if git fetch -h 2>&1 | grep -- --depth > /dev/null; then - shallow='--depth 2' + # GNULIB_REFDIR is not set or not usable. Ignore it. + shallow='--depth 2' + if test -z "$GNULIB_REVISION"; then + git clone $shallow "$gnulib_url" "$gnulib_path" \ + || cleanup_gnulib + else + # Only want a shallow checkout of $GNULIB_REVISION, but git does not + # support cloning by commit hash. So attempt a shallow fetch by + # commit hash to minimize the amount of data downloaded and changes + # needed to be processed, which can drastically reduce download and + # processing time for checkout. If the fetch by commit fails, a + # shallow fetch cannot be performed because we do not know what the + # depth of the commit is without fetching all commits. So fall back + # to fetching all commits. + # $GNULIB_REVISION can be a commit id, a tag name, or a branch name. + mkdir -p "$gnulib_path" + # Use a -c option to silence an annoying message + # "hint: Using 'master' as the name for the initial branch." + # (cf. ). + git -C "$gnulib_path" -c init.defaultBranch=master init + git -C "$gnulib_path" remote add origin "$gnulib_url" + if git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" + then + # "git fetch" of the specific commit succeeded. + git -C "$gnulib_path" reset --hard FETCH_HEAD \ + || cleanup_gnulib + # "git fetch" does not fetch tags (at least in git version 2.43). + # If $GNULIB_REVISION is a tag (not a commit id or branch name), + # add the tag explicitly. + revision=`git -C "$gnulib_path" log -1 --pretty=format:%H` + branch=`LC_ALL=C git -C "$gnulib_path" remote show origin \ + | sed -n -e 's/^ \([^ ]*\) * tracked$/\1/p'` + test "$revision" = "$GNULIB_REVISION" \ + || test "$branch" = "$GNULIB_REVISION" \ + || git -C "$gnulib_path" tag "$GNULIB_REVISION" + else + # Fetch the entire repository. + git -C "$gnulib_path" fetch origin \ + || cleanup_gnulib + git -C "$gnulib_path" checkout "$GNULIB_REVISION" \ + || cleanup_gnulib + fi + fi + fi + trap - HUP INT PIPE TERM + else + # The subdirectory 'gnulib' already exists. + if test -n "$GNULIB_REVISION"; then + if test -d "$gnulib_path/.git"; then + # The 'git checkout "$GNULIB_REVISION"' command succeeds if the + # GNULIB_REVISION is a commit hash that exists locally, or if it + # is a branch name that can be fetched from origin. It fails, + # however, if the GNULIB_REVISION is a commit hash that only + # exists in origin. In this case, we need a 'git fetch' and then + # retry 'git checkout "$GNULIB_REVISION"'. + git -C "$gnulib_path" checkout "$GNULIB_REVISION" 2>/dev/null \ + || { git -C "$gnulib_path" fetch origin \ + && git -C "$gnulib_path" checkout "$GNULIB_REVISION"; } \ + || exit $? + else + die "Error: GNULIB_REVISION is specified in bootstrap.conf," \ + "but '$gnulib_path' contains no git history" fi - mkdir -p "$gnulib_path" - # Only want a shallow checkout of $GNULIB_REVISION, but git does not - # support cloning by commit hash. So attempt a shallow fetch by commit - # hash to minimize the amount of data downloaded and changes needed to - # be processed, which can drastically reduce download and processing - # time for checkout. If the fetch by commit fails, a shallow fetch can - # not be performed because we do not know what the depth of the commit - # is without fetching all commits. So fallback to fetching all commits. - git -C "$gnulib_path" init - git -C "$gnulib_path" remote add origin \ - ${GNULIB_URL:-$default_gnulib_url} - git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \ - || git -C "$gnulib_path" fetch origin \ - || cleanup_gnulib - git -C "$gnulib_path" reset --hard FETCH_HEAD fi - - trap - 1 2 13 15 fi fi - GNULIB_SRCDIR=$gnulib_path - # Verify that the submodule contains a gnulib checkout. + # Verify that $gnulib_path contains a gnulib checkout. test -f "$gnulib_path/gnulib-tool" \ - || die "Error: $gnulib_path is supposed to contain a gnulib checkout, but does not contain gnulib-tool" - fi - - # XXX Should this be done if $use_git is false? - if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \ - && ! git_modules_config submodule.gnulib.url >/dev/null; then - (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib + || die "Error: '$gnulib_path' is supposed to contain a gnulib checkout," \ + "but does not contain gnulib-tool" + GNULIB_SRCDIR=$gnulib_path fi - # $GNULIB_SRCDIR now points to the version of gnulib to use, and # we no longer need to use git or $gnulib_path below here. } @@ -554,20 +622,39 @@ prepare_GNULIB_SRCDIR () upgrade_bootstrap () { - { cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \ - && cmp -s "$medir"/bootstrap-funclib.sh "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \ - && cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \ - && cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \ - } || { - echo "$0: updating bootstrap & companions and restarting..." + if test -f "$medir"/bootstrap-funclib.sh; then + update_lib=true + { cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \ + && cmp -s "$medir"/bootstrap-funclib.sh \ + "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \ + && cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \ + && cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \ + } + else + update_lib=false + cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/build-aux/bootstrap" + fi || { + if $update_lib; then + echo "$0: updating bootstrap & companions and restarting..." + else + echo "$0: updating bootstrap and restarting..." + fi case $(sh -c 'echo "$1"' -- a) in a) ignored=--;; *) ignored=ignored;; esac + u=$update_lib exec sh -c \ - '{ if test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && { if test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && { if test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && { if test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && shift && shift && shift && shift && shift && shift && shift && shift && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \ + '{ if '$u' && test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && + { if '$u' && test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && + { if '$u' && test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && + { if '$u' && test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && + shift && shift && shift && shift && shift && + shift && shift && shift && shift && + exec "${CONFIG_SHELL-/bin/sh}" "$@"' \ $ignored \ - "$GNULIB_SRCDIR/top/bootstrap" "$GNULIB_SRCDIR/build-aux/bootstrap" "$medir/bootstrap" \ + "$GNULIB_SRCDIR/top/bootstrap" "$GNULIB_SRCDIR/build-aux/bootstrap" \ + "$medir/bootstrap" \ "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" "$medir/bootstrap-funclib.sh" \ "$GNULIB_SRCDIR/top/autopull.sh" "$medir/autopull.sh" \ "$GNULIB_SRCDIR/top/autogen.sh" "$medir/autogen.sh" \ @@ -583,11 +670,712 @@ else use_gnulib=true fi +# -------- Fetch auxiliary files from the network. -------------------------- + +autopull_usage() { + cat </dev/null 2>&1 && unset CDPATH + + # Parse options. + + # Use git to update gnulib sources + use_git=true + + for option + do + case $option in + --help) + autopull_usage + return;; + --version) + set -e + echo "autopull.sh $scriptlibversion" + echo "$copyright" + return 0 + ;; + --skip-po) + SKIP_PO=t;; + --force) + checkout_only_file=;; + --bootstrap-sync) + bootstrap_sync=true;; + --no-bootstrap-sync) + bootstrap_sync=false;; + --no-git) + use_git=false;; + *) + bootstrap_option_hook $option || die "$option: unknown option";; + esac + done + + $use_git || test -n "$GNULIB_SRCDIR" \ + || die "Error: --no-git requires \$GNULIB_SRCDIR environment variable" \ + "or --gnulib-srcdir option" + test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \ + || die "Error: \$GNULIB_SRCDIR environment variable" \ + "or --gnulib-srcdir option is specified," \ + "but does not denote a directory" + + if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then + die "Running this script from a non-checked-out distribution is risky." + fi + + check_build_prerequisites $use_git + + if $use_gnulib || $bootstrap_sync; then + prepare_GNULIB_SRCDIR + if $bootstrap_sync; then + upgrade_bootstrap "$@" + fi + fi + + # Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6. + # Also find the compatible sha1 utility on the BSDs + if test x"$SKIP_PO" = x; then + find_tool SHA1SUM sha1sum gsha1sum shasum sha1 + fi + + # See if we can use gnulib's git-merge-changelog merge driver. + if $use_git && test -d .git && check_exists git; then + if git config merge.merge-changelog.driver >/dev/null ; then + : + elif check_exists git-merge-changelog; then + echo "$0: initializing git-merge-changelog driver" + git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + echo "$0: consider installing git-merge-changelog from gnulib" + fi + fi + + case $SKIP_PO in + '') + if test -d po; then + update_po_files po $package || return + fi + + if test -d runtime-po; then + update_po_files runtime-po $package-runtime || return + fi;; + esac + + # --------------------------------------------------------------------------- + + bootstrap_post_pull_hook \ + || die "bootstrap_post_pull_hook failed" + + # Don't proceed if there are uninitialized submodules. In particular, + # autogen.sh will remove dangling links, which might be links into + # uninitialized submodules. + # But it's OK if the 'gnulib' submodule is uninitialized, as long as + # GNULIB_SRCDIR is set. + if $use_git; then + # Uninitialized submodules are listed with an initial dash. + uninitialized=`git submodule | grep '^-' | awk '{ print $2 }'` + if test -n "$GNULIB_SRCDIR"; then + uninitialized=`echo "$uninitialized" | grep -v '^gnulib$'` + fi + if test -n "$uninitialized"; then + uninit_comma=`echo "$uninitialized" | tr '\n' ',' | sed -e 's|,$|.|'` + die "Some git submodules are not initialized: "$uninit_comma \ + "Either use option '--no-git'," \ + "or run 'git submodule update --init' and bootstrap again." + fi + fi + + if test -f "$medir"/autogen.sh; then + echo "$0: done. Now you can run '$medir/autogen.sh'." + fi +} + +# ----------------------------- Get translations. ----------------------------- + +download_po_files() { + subdir=$1 + domain=$2 + echo "$me: getting translations into $subdir for $domain..." + cmd=$(printf "$po_download_command_format" "$subdir" "$domain") + eval "$cmd" +} + +# Mirror .po files to $po_dir/.reference and copy only the new +# or modified ones into $po_dir. Also update $po_dir/LINGUAS. +# Note po files that exist locally only are left in $po_dir but will +# not be included in LINGUAS and hence will not be distributed. +update_po_files() { + # Directory containing primary .po files. + # Overwrite them only when we're sure a .po file is new. + po_dir=$1 + domain=$2 + + # Mirror *.po files into this dir. + # Usually contains *.s1 checksum files. + ref_po_dir="$po_dir/.reference" + + test -d $ref_po_dir || mkdir $ref_po_dir || return + download_po_files $ref_po_dir $domain \ + && ls "$ref_po_dir"/*.po 2>/dev/null | + sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return + + for po in x $(ls $ref_po_dir | sed -n 's/\.po$//p'); do + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then + echo "$me: updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" \ + && $SHA1SUM < "$new_po" > "$cksum_file" || return + fi + done +} + +# -------- Generate files automatically from existing sources. -------------- + +autogen_usage() { + cat < /dev/null 2>&1 + elif test -d .svn; then + svn log -r HEAD "$file" > /dev/null 2>&1 + elif test -d CVS; then + grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null | + grep '^/[^/]*/[0-9]' > /dev/null + else + warn_ "no version control for $file?" + false + fi +} + +# Strip blank and comment lines to leave significant entries. +gitignore_entries() { + sed '/^#/d; /^$/d' "$@" +} + +# If $STR is not already on a line by itself in $FILE, insert it at the start. +# Entries are inserted at the start of the ignore list to ensure existing +# entries starting with ! are not overridden. Such entries support +# whitelisting exceptions after a more generic blacklist pattern. +insert_if_absent() { + file=$1 + str=$2 + test -f $file || touch $file + test -r $file || die "Error: failed to read ignore file: $file" + duplicate_entries=$(gitignore_entries $file | sort | uniq -d) + if [ "$duplicate_entries" ] ; then + die "Error: Duplicate entries in $file: " $duplicate_entries + fi + linesold=$(gitignore_entries $file | wc -l) + linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l) + if [ $linesold != $linesnew ] ; then + { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \ + || die "insert_if_absent $file $str: failed" + fi +} + +# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with +# insert_if_absent. +insert_vc_ignore() { + vc_ignore_file="$1" + pattern="$2" + case $vc_ignore_file in + *.gitignore) + # A .gitignore entry that does not start with '/' applies + # recursively to subdirectories, so prepend '/' to every + # .gitignore entry. + pattern=$(echo "$pattern" | sed s,^,/,);; + esac + insert_if_absent "$vc_ignore_file" "$pattern" +} + +symlink_to_dir() +{ + src=$1/$2 + dst=${3-$2} + + test -f "$src" && { + + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=$(dirname "$dst") + if ! test -d "$dst_dir"; then + mkdir -p "$dst_dir" + + # If we've just created a directory like lib/uniwidth, + # tell version control system(s) it's ignorable. + # FIXME: for now, this does only one level + parent=$(dirname "$dst_dir") + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_vc_ignore $ig "${dst_dir##*/}/" + done + fi + + if $copy; then + { + test ! -h "$dst" || { + echo "$me: rm -f $dst" && + rm -f "$dst" + } + } && + test -f "$dst" && + cmp -s "$src" "$dst" || { + echo "$me: cp -fp $src $dst" && + cp -fp "$src" "$dst" + } + else + # Leave any existing symlink alone, if it already points to the source, + # so that broken build tools that care about symlink times + # aren't confused into doing unnecessary builds. Conversely, if the + # existing symlink's timestamp is older than the source, make it afresh, + # so that broken tools aren't confused into skipping needed builds. See + # . + test -h "$dst" && + src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && + dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && + test "$src_i" = "$dst_i" && + both_ls=$(ls -dt "$src" "$dst") && + test "X$both_ls" = "X$dst$nl$src" || { + dot_dots= + case $src in + /*) ;; + *) + case /$dst/ in + *//* | */../* | */./* | /*/*/*/*/*/) + die "invalid symlink calculation: $src -> $dst";; + /*/*/*/*/) dot_dots=../../../;; + /*/*/*/) dot_dots=../../;; + /*/*/) dot_dots=../;; + esac;; + esac + + echo "$me: ln -fs $dot_dots$src $dst" && + ln -fs "$dot_dots$src" "$dst" + } + fi + } +} + +# Regenerate all autogeneratable files that are omitted from the +# version control repository. In particular, regenerate all +# aclocal.m4, config.h.in, Makefile.in, configure files with new +# versions of autoconf or automake. +autogen() +{ + # Ensure that CDPATH is not set. Otherwise, the output from cd + # would cause trouble in at least one use below. + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + # Environment variables that may be set by the user. + : "${AUTOPOINT=autopoint}" + : "${AUTORECONF=autoreconf}" + + if test "$vc_ignore" = auto; then + vc_ignore= + test -d .git && vc_ignore=.gitignore + test -d CVS && vc_ignore="$vc_ignore .cvsignore" + fi + + + # Parse options. + + # Whether to use copies instead of symlinks. + copy=false + + for option + do + case $option in + --help) + autogen_usage + return;; + --version) + set -e + echo "autogen.sh $scriptlibversion" + echo "$copyright" + return 0 + ;; + --force) + checkout_only_file=;; + --copy) + copy=true;; + *) + bootstrap_option_hook $option || die "$option: unknown option";; + esac + done + + test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \ + || die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir" \ + "option is specified, but does not denote a directory" + + if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then + die "Running this script from a non-checked-out distribution is risky." + fi + + if $use_gnulib; then + if test -z "$GNULIB_SRCDIR"; then + gnulib_path=$(test -f .gitmodules && + git config --file .gitmodules submodule.gnulib.path) + test -z "$gnulib_path" && gnulib_path=gnulib + GNULIB_SRCDIR=$gnulib_path + fi + fi + + # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac. + found_aux_dir=no + grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \ + >/dev/null && found_aux_dir=yes + grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \ + >/dev/null && found_aux_dir=yes + test $found_aux_dir = yes \ + || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it" + + # If $build_aux doesn't exist, create it now, otherwise some bits + # below will malfunction. If creating it, also mark it as ignored. + if test ! -d $build_aux; then + mkdir $build_aux + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + insert_vc_ignore $dot_ig $build_aux/ + done + fi + + check_build_prerequisites false + + use_libtool=0 + # We'd like to use grep -E, to see if any of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac, + # but that's not portable enough (e.g., for Solaris). + grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \ + && use_libtool=1 + grep '^[ ]*LT_INIT' configure.ac >/dev/null \ + && use_libtool=1 + if test $use_libtool = 1; then + find_tool LIBTOOLIZE glibtoolize libtoolize + fi + + if $use_gnulib; then + gnulib_tool=$GNULIB_SRCDIR/gnulib-tool + <$gnulib_tool || return + fi + + # NOTE: we have to be careful to run both autopoint and libtoolize + # before gnulib-tool, since gnulib-tool is likely to provide newer + # versions of files "installed" by these two programs. + # Then, *after* gnulib-tool (see below), we have to be careful to + # run autoreconf in such a way that it does not run either of these + # two just-pre-run programs. + + # Import from gettext. + with_gettext=yes + grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ + with_gettext=no + + if test $with_gettext = yes || test $use_libtool = 1; then + + tempbase=.bootstrap$$ + trap "rm -f $tempbase.0 $tempbase.1" HUP INT PIPE TERM + + > $tempbase.0 > $tempbase.1 && + find . ! -type d -print | sort > $tempbase.0 || return + + if test $with_gettext = yes; then + # Released autopoint has the tendency to install macros that have been + # obsoleted in current gnulib, so run this before gnulib-tool. + echo "$0: $AUTOPOINT --force" + $AUTOPOINT --force || return + fi + + # Autoreconf runs aclocal before libtoolize, which causes spurious + # warnings if the initial aclocal is confused by the libtoolized + # (or worse out-of-date) macro directory. + # libtoolize 1.9b added the --install option; but we support back + # to libtoolize 1.5.22, where the install action was default. + if test $use_libtool = 1; then + install= + case $($LIBTOOLIZE --help) in + *--install*) install=--install ;; + esac + echo "running: $LIBTOOLIZE $install --copy" + $LIBTOOLIZE $install --copy + fi + + find . ! -type d -print | sort >$tempbase.1 + old_IFS=$IFS + IFS=$nl + for file in $(comm -13 $tempbase.0 $tempbase.1); do + IFS=$old_IFS + parent=${file%/*} + version_controlled_file "$parent" "$file" || { + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_vc_ignore "$ig" "${file##*/}" + done + } + done + IFS=$old_IFS + + rm -f $tempbase.0 $tempbase.1 + trap - HUP INT PIPE TERM + fi + + # Import from gnulib. + + if $use_gnulib; then + gnulib_tool_options="\ + --no-changelog\ + --aux-dir=$build_aux\ + --doc-base=$doc_base\ + --lib=$gnulib_name\ + --m4-base=$m4_base/\ + --source-base=$source_base/\ + --tests-base=$tests_base\ + --local-dir=$local_gl_dir\ + $gnulib_tool_option_extras\ + " + if test $use_libtool = 1; then + case "$gnulib_tool_options " in + *' --libtool '*) ;; + *) gnulib_tool_options="$gnulib_tool_options --libtool" ;; + esac + fi + echo "$0: $gnulib_tool $gnulib_tool_options --import ..." + $gnulib_tool $gnulib_tool_options --import $gnulib_modules \ + || die "gnulib-tool failed" + + if test $with_gettext = yes && test ! -f $m4_base/gettext.m4; then + # The gnulib-tool invocation has removed $m4_base/gettext.m4, that the + # AUTOPOINT invocation had installed. This can occur when the gnulib + # module 'gettext' was previously present but is now not present any more. + # Repeat the AUTOPOINT invocation and the gnulib-tool invocation. + + echo "$0: $AUTOPOINT --force" + $AUTOPOINT --force || return + + echo "$0: $gnulib_tool $gnulib_tool_options --import ..." + $gnulib_tool $gnulib_tool_options --import $gnulib_modules \ + || die "gnulib-tool failed" + fi + + for file in $gnulib_files; do + symlink_to_dir "$GNULIB_SRCDIR" $file \ + || die "failed to symlink $file" + done + fi + + bootstrap_post_import_hook \ + || die "bootstrap_post_import_hook failed" + + # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some + # gnulib-populated directories. Such .m4 files would cause aclocal to fail. + # The following requires GNU find 4.2.3 or newer. Considering the usual + # portability constraints of this script, that may seem a very demanding + # requirement, but it should be ok. Ignore any failure, which is fine, + # since this is only a convenience to help developers avoid the relatively + # unusual case in which a symlinked-to .m4 file is git-removed from gnulib + # between successive runs of this script. + find "$m4_base" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 + + # Invoke autoreconf with --force --install to ensure upgrades of tools + # such as ylwrap. + AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS" + AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive" + + # Tell autoreconf not to invoke autopoint or libtoolize; they were run above. + echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS" + AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \ + || die "autoreconf failed" + + # Get some extra files from gnulib, overriding existing files. + for file in $gnulib_extra_files; do + case $file in + */INSTALL) dst=INSTALL;; + build-aux/*) dst=$build_aux/${file#build-aux/};; + *) dst=$file;; + esac + symlink_to_dir "$GNULIB_SRCDIR" $file $dst \ + || die "failed to symlink $file" + done + + if test $with_gettext = yes; then + # Create gettext configuration. + echo "$0: Creating po/Makevars from po/Makevars.template ..." + rm -f po/Makevars + sed ' + /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ + /^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/ + /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'| + /^XGETTEXT_OPTIONS *=/{ + s/$/ \\/ + a\ + '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} + } + ' po/Makevars.template >po/Makevars \ + || die 'cannot generate po/Makevars' + + # If the 'gettext' module is in use, grab the latest Makefile.in.in. + # If only the 'gettext-h' module is in use, assume autopoint already + # put the correct version of this file into place. + case $gnulib_modules in + *gettext-h*) ;; + *gettext*) + cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \ + || die "cannot create po/Makefile.in.in" + ;; + esac + + if test -d runtime-po; then + # Similarly for runtime-po/Makevars, but not quite the same. + rm -f runtime-po/Makevars + sed ' + /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/ + /^subdir *=.*/s/=.*/= runtime-po/ + /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ + /^XGETTEXT_OPTIONS *=/{ + s/$/ \\/ + a\ + '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} + } + ' po/Makevars.template >runtime-po/Makevars \ + || die 'cannot generate runtime-po/Makevars' + + # Copy identical files from po to runtime-po. + cp -p po/Makefile.in.in po/*-quot po/*.header po/*.sed po/*.sin runtime-po + fi + fi + + bootstrap_epilogue + + echo "$0: done. Now you can run './configure'." +} + # ---------------------------------------------------------------------------- # Local Variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "scriptlibversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" diff --git a/lib/.gitignore b/lib/.gitignore index 9f15868f5..647025bc0 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -18,6 +18,7 @@ /argmatch.h /asnprintf.c /asprintf.c +/assert.in.h /assure.h /at-func.c /attribute.h @@ -42,6 +43,22 @@ /c-strncasecmp.c /c-strtod.c /c-strtod.h +/c32is-impl.h +/c32isalnum.c +/c32isalpha.c +/c32isblank.c +/c32iscntrl.c +/c32isdigit.c +/c32isgraph.c +/c32islower.c +/c32isprint.c +/c32ispunct.c +/c32isspace.c +/c32isupper.c +/c32isxdigit.c +/c32to-impl.h +/c32tolower.c +/c32width.c /calloc.c /canonicalize-lgpl.c /canonicalize.c @@ -81,6 +98,7 @@ /errno.in.h /error.c /error.h +/error.in.h /execute.c /execute.h /exitfail.c @@ -228,10 +246,12 @@ /isnanl.c /iswblank.c /iswdigit.c +/iswpunct.c /iswxdigit.c /itold.c /lc-charset-dispatch.c /lc-charset-dispatch.h +/ldexp.c /ldexpl.c /libc-config.h /limits.h @@ -251,12 +271,14 @@ /mbchar.h /mbfile.c /mbfile.h +/mbrtoc32.c /mbrtowc-impl-utf8.h /mbrtowc-impl.h /mbrtowc.c /mbsinit.c /mbswidth.c /mbswidth.h +/mbszero.c /mbtowc-lock.c /mbtowc-lock.h /memchr.c @@ -270,6 +292,7 @@ /msvc-nothrow.h /obstack.c /obstack.h +/obstack.in.h /obstack_printf.c /open.c /openat-die.c @@ -298,6 +321,8 @@ /progname.c /progname.h /progreloc.c +/pthread-once.c +/pthread.in.h /quote.h /quotearg.c /quotearg.h @@ -318,6 +343,7 @@ /rename.c /rewinddir.c /rmdir.c +/same-inode.c /same-inode.h /save-cwd.c /save-cwd.h @@ -326,6 +352,7 @@ /scratch_buffer.h /setenv.c /setlocale-lock.c +/setlocale_null-unlocked.c /setlocale_null.c /setlocale_null.h /sig-handler.c @@ -365,9 +392,7 @@ /stat-w32.c /stat-w32.h /stat.c -/stdalign.in.h /stdbool.h -/stdbool.in.h /stdckdint.in.h /stddef.h /stddef.in.h @@ -380,6 +405,7 @@ /stdio-write.c /stdio.h /stdio.in.h +/stdlib.c /stdlib.h /stdlib.in.h /stpcpy.c @@ -421,9 +447,13 @@ /timespec.h /timevar.c /timevar.h +/uchar.in.h +/unicase.in.h /unicodeio.c /unicodeio.h +/unictype.in.h /unictype/ +/uninorm.in.h /unistd--.h /unistd-safer.h /unistd.c @@ -445,8 +475,11 @@ /vasprintf.c /verify.h /vfprintf.c +/vfzprintf.c /vsnprintf.c +/vsnzprintf.c /vsprintf.c +/vszprintf.c /wait-process.c /wait-process.h /waitpid.c @@ -462,6 +495,8 @@ /windows-mutex.h /windows-once.c /windows-once.h +/windows-path.c +/windows-path.h /windows-recmutex.c /windows-recmutex.h /windows-rwlock.c diff --git a/lib/glthread/.gitignore b/lib/glthread/.gitignore index b854214e8..5515d7c12 100644 --- a/lib/glthread/.gitignore +++ b/lib/glthread/.gitignore @@ -1,5 +1,7 @@ /lock.c /lock.h +/once.c +/once.h /threadlib.c /tls.c /tls.h diff --git a/lib/malloc/.gitignore b/lib/malloc/.gitignore index 5f8866f90..7f4e020f7 100644 --- a/lib/malloc/.gitignore +++ b/lib/malloc/.gitignore @@ -1,6 +1,5 @@ /scratch_buffer.gl.h /scratch_buffer.h -/scratch_buffer_dupfree.c /scratch_buffer_grow.c /scratch_buffer_grow_preserve.c /scratch_buffer_set_array_size.c diff --git a/m4/.gitignore b/m4/.gitignore index 4748c6e07..627c845ac 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -6,8 +6,12 @@ /alloca.m4 /asm-underscore.m4 /assert.m4 +/assert_h.m4 +/build-to-host.m4 /builtin-expect.m4 +/c-bool.m4 /c-strtod.m4 +/c32rtomb.m4 /calloc.m4 /canonicalize.m4 /chdir-long.m4 @@ -24,23 +28,26 @@ /dup.m4 /dup2.m4 /eaccess.m4 -/eealloc.m4 /environ.m4 /errno_h.m4 /error.m4 +/error_h.m4 /execute.m4 /exponentd.m4 /exponentf.m4 /exponentl.m4 +/extensions-aix.m4 /extensions.m4 /extern-inline.m4 /extern-inline.m4~ /fatal-signal.m4 /fchdir.m4 +/fclose.m4 /fcntl-o.m4 /fcntl.m4 /fcntl_h.m4 /fdopendir.m4 +/fflush.m4 /ffs.m4 /ffsl.m4 /filenamecat.m4 @@ -65,7 +72,6 @@ /gethrxtime.m4 /getline.m4 /getopt.m4 -/getpagesize.m4 /getprogname.m4 /getrusage.m4 /gettext.m4 @@ -76,12 +82,14 @@ /gnulib-cache.m4 /gnulib-common.m4 /gnulib-comp.m4 +/gnulib-i18n.m4 /gnulib-tool.m4 /host-cpu-c-abi.m4 /iconv.m4 /iconv_h.m4 /iconv_open.m4 /include_next.m4 +/init-package-version.m4 /inline.m4 /intdiv0.m4 /intl-thread-locale.m4 @@ -99,6 +107,7 @@ /isnanl.m4 /iswblank.m4 /iswdigit.m4 +/iswpunct.m4 /iswxdigit.m4 /javacomp.m4 /javaexec.m4 @@ -116,6 +125,7 @@ /libunistring-base.m4 /limits-h.m4 /localcharset.m4 +/locale-en.m4 /locale-fr.m4 /locale-ja.m4 /locale-zh.m4 @@ -128,6 +138,7 @@ /math_h.m4 /mbchar.m4 /mbfile.m4 +/mbrtoc32.m4 /mbrtowc.m4 /mbsinit.m4 /mbstate_t.m4 @@ -146,7 +157,9 @@ /nocrash.m4 /obstack-printf.m4 /obstack.m4 +/off64_t.m4 /off_t.m4 +/once.m4 /open-cloexec.m4 /open-slash.m4 /open.m4 @@ -162,10 +175,12 @@ /posix_spawn_faction_addchdir.m4 /printf-frexp.m4 /printf-frexpl.m4 -/printf-posix-rpl.m4 /printf-posix.m4 /printf.m4 /progtest.m4 +/pthread-once.m4 +/pthread-spin.m4 +/pthread_h.m4 /pthread_rwlock_rdlock.m4 /quote.m4 /quotearg.m4 @@ -202,7 +217,6 @@ /stat.m4 /std-gnu11.m4 /stdalign.m4 -/stdbool.m4 /stddef_h.m4 /stdint.m4 /stdint_h.m4 @@ -220,6 +234,7 @@ /strnlen.m4 /strtod.m4 /strverscmp.m4 +/sys_cdefs_h.m4 /sys_ioctl_h.m4 /sys_resource_h.m4 /sys_socket_h.m4 @@ -233,8 +248,12 @@ /time_h.m4 /timespec.m4 /tls.m4 +/uchar_h.m4 /uintmax_t.m4 +/unicase_h.m4 /unicodeio.m4 +/unictype_h.m4 +/uninorm_h.m4 /unistd-safer.m4 /unistd_h.m4 /unlink.m4 @@ -253,12 +272,10 @@ /warn-on-use.m4 /warnings.m4 /wchar_h.m4 -/wchar_t.m4 /wctype_h.m4 /wcwidth.m4 /wint_t.m4 /xalloc.m4 /xsize.m4 /xstrndup.m4 -/year2038.m4 /zzgnulib.m4 From 3ad31c23f101dea23e98d1e277e24ff371cf4f09 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 17:28:03 -0700 Subject: [PATCH 04/20] doc: pacify texinfo 7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/bison.texi: Don’t put @anchor inside @item, as texinfo 7.1 complains. --- doc/bison.texi | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/doc/bison.texi b/doc/bison.texi index 5ffe21d02..a8e475807 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -11648,22 +11648,26 @@ Options controlling the diagnostics. Output warnings falling in @var{category}. @var{category} can be one of: @table @code -@item @anchor{Wconflicts-sr}conflicts-sr -@itemx @anchor{Wconflicts-rr}conflicts-rr +@item conflicts-sr +@itemx conflicts-rr +@anchor{Wconflicts-sr} +@anchor{Wconflicts-rr} S/R and R/R conflicts. These warnings are enabled by default. However, if the @code{%expect} or @code{%expect-rr} directive is specified, an unexpected number of conflicts is an error, and an expected number of conflicts is not reported, so @option{-W} and @option{--warning} then have no effect on the conflict report. -@item @anchor{Wcounterexamples}counterexamples +@item counterexamples @itemx cex +@anchor{Wcounterexamples} Provide counterexamples for conflicts. @xref{Counterexamples}. Counterexamples take time to compute. The option @option{-Wcex} should be used by the developer when working on the grammar; it hardly makes sense to use it in a CI. -@item @anchor{Wdangling-alias}dangling-alias +@item dangling-alias +@anchor{Wdangling-alias} Report string literals that are not bound to a token symbol. String literals, which allow for better error messages, are (too) liberally @@ -11709,16 +11713,19 @@ foo: "baz" @{@} | @dwarning{^~~~~} @end example -@item @anchor{Wdeprecated}deprecated +@item deprecated +@anchor{Wdeprecated} Deprecated constructs whose support will be removed in future versions of Bison. -@item @anchor{Wempty-rule}empty-rule +@item empty-rule +@anchor{Wempty-rule} Empty rules without @code{%empty}. @xref{Empty Rules}. Disabled by default, but enabled by uses of @code{%empty}, unless @option{-Wno-empty-rule} was specified. -@item @anchor{Wmidrule-values}midrule-values +@item midrule-values +@anchor{Wmidrule-values} Warn about midrule values that are set but not used within any of the actions of the parent rule. For example, warn about unused @code{$2} in: @@ -11738,7 +11745,8 @@ These warnings are not enabled by default since they sometimes prove to be false alarms in existing grammars employing the Yacc constructs @code{$0} or @code{$-@var{n}} (where @var{n} is some positive integer). -@item @anchor{Wprecedence}precedence +@item precedence +@anchor{Wprecedence} Useless precedence and associativity directives. Disabled by default. Consider for instance the following grammar: @@ -11799,21 +11807,24 @@ One would get the exact same parser with the following directives instead: @end group @end example -@item @anchor{Wyacc}yacc +@item yacc +@anchor{Wyacc} Incompatibilities with POSIX Yacc. -@item @anchor{Wother}other +@item other +@anchor{Wother} All warnings not categorized above. These warnings are enabled by default. This category is provided merely for the sake of completeness. Future releases of Bison may move warnings from this category to new, more specific categories. -@item @anchor{Wall}all +@item all All the warnings except @code{counterexamples}, @code{dangling-alias} and @code{yacc}. -@item @anchor{Wnone}none +@item none +@anchor{Wnone} Turn off all the warnings. @item error @@ -11824,7 +11835,8 @@ A category can be turned off by prefixing its name with @samp{no-}. For instance, @option{-Wno-yacc} will hide the warnings about POSIX Yacc incompatibilities. -@item @anchor{Werror}-Werror +@item -Werror +@anchor{Werror} Turn enabled warnings for every @var{category} into errors, unless they are explicitly disabled by @option{-Wno-error=@var{category}}. @@ -11972,7 +11984,8 @@ This is similar to how most shells resolve commands. Pretend that @code{%token-table} was specified. @xref{Decl Summary}. @item -y -@itemx @anchor{option-yacc} --yacc +@itemx --yacc +@anchor{option-yacc} Act more like the traditional @command{yacc} command: @itemize @item From aa0c96bf14d6ff4e6e05e28c440e42cedf72dd16 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 17:29:41 -0700 Subject: [PATCH 05/20] maint: adjust to Gnulib API changes * src/output.c (output_skeleton): * src/print-xml.c (print_html): Adjust to Gnulib API changes. --- src/output.c | 1 + src/print-xml.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/output.c b/src/output.c index 5e7ef15e5..cd332f266 100644 --- a/src/output.c +++ b/src/output.c @@ -808,6 +808,7 @@ output_skeleton (void) } pid = create_pipe_bidi ("m4", m4, argv, + /* dll_dirs */ NULL, /* directory */ NULL, /* null_stderr */ false, /* slave_process */ true, diff --git a/src/print-xml.c b/src/print-xml.c index 7db0f213f..e4f771430 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -565,6 +565,7 @@ print_html (void) int status = execute (argv[0], argv[0], argv, + /* dll_dirs */ NULL, /* directory */ NULL, /* ignore_sigpipe */ false, /* null_stdin, null_stdout, null_stderr */ true, true, true, From 6a4b3240cfc0065304c945abb755157aa44a3745 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Mar 2025 20:40:29 -0700 Subject: [PATCH 06/20] maint: pacify gcc 14.2 -Wmaybe-uninitialized * data/skeletons/lalr1.cc: * data/skeletons/yacc.c: Add YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN and YY_IGNORE_MAYBE_UNINITIALIZED_END to pacify GCC 14, apparently after inlining. --- data/skeletons/lalr1.cc | 2 ++ data/skeletons/yacc.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc index 4242b992d..464a23b8d 100644 --- a/data/skeletons/lalr1.cc +++ b/data/skeletons/lalr1.cc @@ -986,6 +986,7 @@ b4_dollar_popdef])[]dnl yyreduce: yylen = yyr2_[yyn]; { + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN stack_symbol_type yylhs; yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([[ /* Variants are always initialized to an empty instance of the @@ -1038,6 +1039,7 @@ b4_dollar_popdef])[]dnl // Shift the result of the reduction. yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + YY_IGNORE_MAYBE_UNINITIALIZED_END } goto yynewstate; diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c index 07a523b0a..8b3774753 100644 --- a/data/skeletons/yacc.c +++ b/data/skeletons/yacc.c @@ -1531,9 +1531,11 @@ yypull_parse (yypstate *yyps]b4_user_formals[) YYLTYPE yylloc = yyloc_default;]])])[ int yystatus; do { -]b4_pure_if([[ YYSTYPE yylval; +]b4_pure_if([[ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYSTYPE yylval; int ]])[yychar = ]b4_yylex[; - yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[); + yystatus = yypush_parse (yyps]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);]b4_pure_if([[ + YY_IGNORE_MAYBE_UNINITIALIZED_END]])[ } while (yystatus == YYPUSH_MORE); return yystatus; }]])[ From d7527048a81ed6997e96747cb93c590ff928c0e3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Mar 2025 13:38:21 -0700 Subject: [PATCH 07/20] maint: port to strict C function type checking Violation of C standard detected by clang -fsanitize=undefined with clang 19.1.7 on Fedora 41 x86-64. * src/counterexample.c (si_bfs_free): * src/files.c (prefix_map_free, add_prefix_map): * src/fixits.c (fixit_cmp, fixit_free, fixits_register): (expand_to_conflict, nonunifying_shift_path) (search_state_free_children, search_state_free, ssb_free) (ssb_hasher, ssb_comp, ssb_equals, visited_hasher) (visited_comparator, ssb_append, unifying_example): * src/lssi.c (lssi_free, lssi_hasher, lssi_comparator) (shortest_path_from_start): * src/parse-simulation.c (free_parse_state) (parse_state_list_new, parser_pop): * src/state-item.c (hash_pair_hasher, hash_pair_comparator) (hash_pair_free, hash_pair_table_create): Avoid undefined behavior in C, which does not allow you to cast a function pointer to some other function type and then call it via that other type. Instead, use functions with correct types according to the C standard, and cast their parameters. * src/getargs.c (xargmatch_fn): Return int const, not int, to match what ARGMATCH_DEFINE_GROUP does. In all uses of ARGMATCH_DEFINE_GROUP, say that they return int, to match xargmatch_fn. (FLAGS_ARGMATCH): Do not cast function pointer. * src/parse-simulation.c (vc_derivation_list_append): New function. * src/system.h (deconst): New static function. --- src/counterexample.c | 62 ++++++++++++++++++++++-------------------- src/files.c | 10 +++---- src/fixits.c | 16 +++++------ src/getargs.c | 12 ++++---- src/lssi.c | 17 ++++++------ src/parse-simulation.c | 15 +++++++--- src/parse-simulation.h | 2 +- src/state-item.c | 17 ++++++------ src/system.h | 9 ++++++ 9 files changed, 90 insertions(+), 70 deletions(-) diff --git a/src/counterexample.c b/src/counterexample.c index 82ee43da6..594849c1c 100644 --- a/src/counterexample.c +++ b/src/counterexample.c @@ -206,8 +206,9 @@ si_bfs_contains (const si_bfs_node *n, state_item_number sin) } static void -si_bfs_free (si_bfs_node *n) +si_bfs_free (void const *vn) { + si_bfs_node *n = deconst (vn); if (n == NULL) return; --n->reference_count; @@ -231,12 +232,10 @@ typedef gl_list_t si_bfs_node_list; static inline derivation_list expand_to_conflict (state_item_number start, symbol_number conflict_sym) { - si_bfs_node *init = si_bfs_new (start, NULL); - + void const *init = si_bfs_new (start, NULL); si_bfs_node_list queue = gl_list_create (GL_LINKED_LIST, NULL, NULL, - (gl_listelement_dispose_fn) si_bfs_free, - true, 1, (const void **) &init); + si_bfs_free, true, 1, &init); si_bfs_node *node = NULL; // breadth-first search for a path of productions to the conflict symbol while (gl_list_size (queue) > 0) @@ -471,11 +470,10 @@ nonunifying_shift_path (state_item_list reduce_path, state_item *shift_conflict) continue; // bfs to find a shift to the right state - si_bfs_node *init = si_bfs_new (si - state_items, NULL); + void const *init = si_bfs_new (si - state_items, NULL); si_bfs_node_list queue = gl_list_create (GL_LINKED_LIST, NULL, NULL, - (gl_listelement_dispose_fn) si_bfs_free, - true, 1, (const void **) &init); + si_bfs_free, true, 1, &init); si_bfs_node *sis = NULL; state_item *prevsi = NULL; while (gl_list_size (queue) > 0) @@ -604,15 +602,17 @@ copy_search_state (search_state *parent) } static void -search_state_free_children (search_state *ss) +search_state_free_children (void const *vss) { + search_state const *ss = vss; free_parse_state (ss->states[0]); free_parse_state (ss->states[1]); } static void -search_state_free (search_state *ss) +search_state_free (void *vss) { + search_state *ss = vss; if (ss == NULL) return; search_state_free_children (ss); @@ -691,42 +691,51 @@ typedef struct } search_state_bundle; static void -ssb_free (search_state_bundle *ssb) +ssb_free (void const *vssb) { + search_state_bundle *ssb = deconst (vssb); gl_list_free (ssb->states); free (ssb); } static size_t -ssb_hasher (search_state_bundle *ssb) +ssb_hasher (void const *vssb) { + search_state_bundle const *ssb = vssb; return ssb->complexity; } static int -ssb_comp (const search_state_bundle *s1, const search_state_bundle *s2) +ssb_comp (void const *vs1, void const *vs2) { + search_state_bundle const *s1 = vs1; + search_state_bundle const *s2 = vs2; return s1->complexity - s2->complexity; } static bool -ssb_equals (const search_state_bundle *s1, const search_state_bundle *s2) +ssb_equals (void const *vs1, void const *vs2) { + search_state_bundle const *s1 = vs1; + search_state_bundle const *s2 = vs2; return s1->complexity == s2->complexity; } typedef gl_list_t ssb_list; static size_t -visited_hasher (const search_state *ss, size_t max) +visited_hasher (void const *vss, size_t max) { + search_state const *ss = vss; return (parse_state_hasher (ss->states[0], max) + parse_state_hasher (ss->states[1], max)) % max; } static bool -visited_comparator (const search_state *ss1, const search_state *ss2) +visited_comparator (void const *vss1, void const *vss2) { + search_state const *ss1 = vss1; + search_state const *ss2 = vss2; return parse_state_comparator (ss1->states[0], ss2->states[0]) && parse_state_comparator (ss1->states[1], ss2->states[1]); } @@ -762,9 +771,8 @@ ssb_append (search_state *ss) { ssb->states = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, - (gl_listelement_dispose_fn)search_state_free_children, - true); - gl_sortedlist_add (ssb_queue, (gl_listelement_compar_fn) ssb_comp, ssb); + search_state_free_children, true); + gl_sortedlist_add (ssb_queue, ssb_comp, ssb); } else { @@ -1109,15 +1117,12 @@ unifying_example (state_item_number itm1, state_item *conflict1 = &state_items[itm1]; state_item *conflict2 = &state_items[itm2]; search_state *initial = initial_search_state (conflict1, conflict2); - ssb_queue = gl_list_create_empty (GL_RBTREEHASH_LIST, - (gl_listelement_equals_fn) ssb_equals, - (gl_listelement_hashcode_fn) ssb_hasher, - (gl_listelement_dispose_fn) ssb_free, - false); + ssb_queue = gl_list_create_empty (GL_RBTREEHASH_LIST, ssb_equals, + ssb_hasher, ssb_free, false); visited = - hash_initialize (32, NULL, (Hash_hasher) visited_hasher, - (Hash_comparator) visited_comparator, - (Hash_data_freer) search_state_free); + hash_initialize (32, NULL, visited_hasher, + visited_comparator, + search_state_free); ssb_append (initial); xtime_t start = gethrxtime (); bool assurance_printed = false; @@ -1181,8 +1186,7 @@ unifying_example (state_item_number itm1, } generate_next_states (ss, conflict1, conflict2); } - gl_sortedlist_remove (ssb_queue, - (gl_listelement_compar_fn) ssb_comp, ssb); + gl_sortedlist_remove (ssb_queue, ssb_comp, ssb); } cex_search_end:; if (!cex) diff --git a/src/files.c b/src/files.c index 52fb7bc82..32ea5e9e4 100644 --- a/src/files.c +++ b/src/files.c @@ -261,8 +261,9 @@ map_file_name (char const *filename) } static void -prefix_map_free (struct prefix_map *p) +prefix_map_free (void const *vp) { + struct prefix_map *p = deconst (vp); free (p->oldprefix); free (p->newprefix); free (p); @@ -273,11 +274,8 @@ add_prefix_map (char const *oldprefix, char const *newprefix) { if (!prefix_maps) prefix_maps - = gl_list_create_empty (GL_ARRAY_LIST, - /* equals */ NULL, - /* hashcode */ NULL, - (gl_listelement_dispose_fn) prefix_map_free, - true); + = gl_list_create_empty (GL_ARRAY_LIST, NULL, NULL, + prefix_map_free, true); struct prefix_map *p = xmalloc (sizeof (*p)); p->oldprefix = xstrdup (oldprefix); diff --git a/src/fixits.c b/src/fixits.c index 0605da418..0b58bb43b 100644 --- a/src/fixits.c +++ b/src/fixits.c @@ -53,14 +53,17 @@ fixit_new (location const *loc, char const* fix) } static int -fixit_cmp (const fixit *a, const fixit *b) +fixit_cmp (void const *va, void const *vb) { + fixit const *a = va; + fixit const *b = vb; return location_cmp (a->location, b->location); } static void -fixit_free (fixit *f) +fixit_free (void const *vf) { + fixit *f = deconst (vf); free (f->fix); free (f); } @@ -84,13 +87,10 @@ void fixits_register (location const *loc, char const* fix) { if (!fixits) - fixits = gl_list_create_empty (GL_ARRAY_LIST, - /* equals */ NULL, - /* hashcode */ NULL, - (gl_listelement_dispose_fn) fixit_free, - true); + fixits = gl_list_create_empty (GL_ARRAY_LIST, NULL, NULL, + fixit_free, true); fixit *f = fixit_new (loc, fix); - gl_sortedlist_add (fixits, (gl_listelement_compar_fn) fixit_cmp, f); + gl_sortedlist_add (fixits, fixit_cmp, f); if (feature_flag & feature_fixit) fixit_print (f, stderr); } diff --git a/src/getargs.c b/src/getargs.c index ad9ded9c6..dff57fe12 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -69,7 +69,7 @@ const char *skeleton = NULL; int language_prio = default_prio; struct bison_language const *language = &valid_languages[0]; -typedef int* (xargmatch_fn) (const char *context, const char *arg); +typedef int const *(xargmatch_fn) (char const *context, char const *arg); void set_yacc (location loc) @@ -164,7 +164,7 @@ flags_argmatch (const char *opt, */ #define FLAGS_ARGMATCH(FlagName, Args, All) \ flags_argmatch ("--" #FlagName, \ - (xargmatch_fn*) argmatch_## FlagName ## _value, \ + argmatch_ ## FlagName ## _value, \ argmatch_ ## FlagName ## _usage, \ All, &FlagName ## _flag, Args) @@ -179,7 +179,7 @@ enum color color_auto }; -ARGMATCH_DEFINE_GROUP (color, enum color) +ARGMATCH_DEFINE_GROUP (color, int) static const argmatch_color_doc argmatch_color_docs[] = { @@ -215,7 +215,7 @@ const argmatch_color_group_type argmatch_color_group = | --report's handling. | `----------------------*/ -ARGMATCH_DEFINE_GROUP (report, enum report) +ARGMATCH_DEFINE_GROUP (report, int) static const argmatch_report_doc argmatch_report_docs[] = { @@ -256,7 +256,7 @@ const argmatch_report_group_type argmatch_report_group = | --trace's handling. | `---------------------*/ -ARGMATCH_DEFINE_GROUP (trace, enum trace) +ARGMATCH_DEFINE_GROUP (trace, int) static const argmatch_trace_doc argmatch_trace_docs[] = { @@ -319,7 +319,7 @@ const argmatch_trace_group_type argmatch_trace_group = | --feature's handling. | `-----------------------*/ -ARGMATCH_DEFINE_GROUP (feature, enum feature) +ARGMATCH_DEFINE_GROUP (feature, int) static const argmatch_feature_doc argmatch_feature_docs[] = { diff --git a/src/lssi.c b/src/lssi.c index 79bbba182..2f35c53c1 100644 --- a/src/lssi.c +++ b/src/lssi.c @@ -50,8 +50,9 @@ new_lssi (state_item_number si, lssi *p, bitset l, bool free_l) } static void -lssi_free (lssi *sn) +lssi_free (void *vsn) { + lssi *sn = vsn; if (sn == NULL) return; if (sn->free_lookahead) @@ -60,8 +61,9 @@ lssi_free (lssi *sn) } static size_t -lssi_hasher (lssi *sn, size_t max) +lssi_hasher (void const *vsn, size_t max) { + lssi const *sn = vsn; size_t hash = sn->si; bitset_iterator biter; symbol_number syn; @@ -71,8 +73,10 @@ lssi_hasher (lssi *sn, size_t max) } static bool -lssi_comparator (lssi *s1, lssi *s2) +lssi_comparator (void const *vs1, void const *vs2) { + lssi const *s1 = vs1; + lssi const *s2 = vs2; if (s1->si == s2->si) { if (s1->lookahead == s2->lookahead) @@ -154,11 +158,8 @@ state_item_list shortest_path_from_start (state_item_number target, symbol_number next_sym) { bitset eligible = eligible_state_items (&state_items[target]); - Hash_table *visited = hash_initialize (32, - NULL, - (Hash_hasher) lssi_hasher, - (Hash_comparator) lssi_comparator, - (Hash_data_freer) lssi_free); + Hash_table *visited = hash_initialize (32, NULL, lssi_hasher, + lssi_comparator, lssi_free); bitset il = bitset_create (nsyms, BITSET_FIXED); bitset_set (il, 0); lssi *init = new_lssi (0, NULL, il, true); diff --git a/src/parse-simulation.c b/src/parse-simulation.c index 9e1f66dfa..7c9fe382a 100644 --- a/src/parse-simulation.c +++ b/src/parse-simulation.c @@ -194,8 +194,9 @@ parse_state_free_contents_early (parse_state *ps) } void -free_parse_state (parse_state *original_ps) +free_parse_state (void const *voriginal_ps) { + parse_state *original_ps = deconst (voriginal_ps); bool free_contents = true; parse_state *parent_ps = NULL; for (parse_state *ps = original_ps; ps && free_contents; ps = parent_ps) @@ -311,8 +312,7 @@ static parse_state_list parse_state_list_new (void) { return gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, - (gl_listelement_dispose_fn)free_parse_state, - true); + free_parse_state, true); } static void @@ -322,6 +322,13 @@ parse_state_list_append (parse_state_list pl, parse_state *ps) gl_list_add_last (pl, ps); } +static void +vc_derivation_list_append (derivation_list dl, void const *vcd) +{ + derivation *d = deconst (vcd); + return derivation_list_append (dl, d); +} + // Emulates a reduction on a parse state by popping some amount of // derivations and state_items off of the parse_state and returning // the result in ret. Returns the derivation of what's popped. @@ -351,7 +358,7 @@ parser_pop (parse_state *ps, int deriv_index, list_flatten_and_split (chunks, ret_chunks, si_index, 2, list_add_last); list_flatten_and_split (chunks + 2, ret_chunks + 2, deriv_index, 2, - (chunk_append_fn)derivation_list_append); + vc_derivation_list_append); size_t s_size = gl_list_size (ret->state_items.contents); ret->state_items.total_size = s_size; if (s_size > 0) diff --git a/src/parse-simulation.h b/src/parse-simulation.h index ac746cd63..7d66bd9b5 100644 --- a/src/parse-simulation.h +++ b/src/parse-simulation.h @@ -99,7 +99,7 @@ void parse_state_retain (parse_state *ps); * when its reference count reaches 1. This is used to * free memory while the parse state is in a hash set. */ void parse_state_free_contents_early (parse_state *ps); -void free_parse_state (parse_state *ps); +void free_parse_state (void const *ps); /* counts the amount of shift and production steps in this parse state */ void parse_state_completed_steps (const parse_state *ps, int *shifts, int *productions); diff --git a/src/state-item.c b/src/state-item.c index cc1602ccd..addf4dc3a 100644 --- a/src/state-item.c +++ b/src/state-item.c @@ -44,20 +44,24 @@ typedef struct } hash_pair; static size_t -hash_pair_hasher (const hash_pair *sl, size_t max) +hash_pair_hasher (void const *vsl, size_t max) { + hash_pair const *sl = vsl; return sl->key % max; } static bool -hash_pair_comparator (const hash_pair *l, const hash_pair *r) +hash_pair_comparator (void const *vl, void const *vr) { + hash_pair const *l = vl; + hash_pair const *r = vr; return l->key == r->key; } static void -hash_pair_free (hash_pair *hp) +hash_pair_free (void *vhp) { + hash_pair *hp = vhp; bitset_free (hp->l); free (hp); } @@ -65,11 +69,8 @@ hash_pair_free (hash_pair *hp) static Hash_table * hash_pair_table_create (int size) { - return hash_xinitialize (size, - NULL, - (Hash_hasher) hash_pair_hasher, - (Hash_comparator) hash_pair_comparator, - (Hash_data_freer) hash_pair_free); + return hash_xinitialize (size, NULL, hash_pair_hasher, + hash_pair_comparator, hash_pair_free); } static bitset diff --git a/src/system.h b/src/system.h index fd30926b4..8ff10c192 100644 --- a/src/system.h +++ b/src/system.h @@ -308,4 +308,13 @@ obstack_escape (struct obstack* obs, const char *cp) } \ } while (0) +/* Gnulib generic list functions sometimes want args to be void const *. + We sometimes want void *, for 'free', or possibly because we plan + to cheat and modify the storage. Cast to satisfy C's static checking. */ +static inline void * +deconst (void const *p) +{ + return (void *) p; +} + #endif /* ! BISON_SYSTEM_H */ From 4ff0741f580626861d45bcd6dcc460f838826d57 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Mar 2025 17:46:43 -0700 Subject: [PATCH 08/20] maint: make update-copyright --- AUTHORS | 2 +- ChangeLog-2012 | 4 +-- Makefile.am | 3 +- NEWS | 2 +- PACKAGING | 4 +-- README | 4 +-- README-alpha | 4 +-- README-hacking.md | 4 +-- THANKS | 2 +- TODO | 2 +- bootstrap.conf | 3 +- build-aux/Darwin.valgrind | 3 +- build-aux/Linux.valgrind | 3 +- build-aux/cross-options.pl | 2 +- build-aux/local.mk | 3 +- build-aux/update-b4-copyright | 3 +- build-aux/update-package-copyright-year | 3 +- build-aux/update-test | 2 +- cfg.mk | 3 +- configure.ac | 5 ++-- data/README.md | 3 +- data/bison-default.css | 2 +- data/local.mk | 4 +-- data/skeletons/bison.m4 | 4 +-- data/skeletons/c++-skel.m4 | 2 +- data/skeletons/c++.m4 | 2 +- data/skeletons/c-like.m4 | 3 +- data/skeletons/c-skel.m4 | 2 +- data/skeletons/c.m4 | 4 +-- data/skeletons/d-skel.m4 | 2 +- data/skeletons/d.m4 | 2 +- data/skeletons/glr.c | 7 +++-- data/skeletons/glr.cc | 5 ++-- data/skeletons/glr2.cc | 3 +- data/skeletons/java-skel.m4 | 4 +-- data/skeletons/java.m4 | 3 +- data/skeletons/lalr1.cc | 5 ++-- data/skeletons/lalr1.d | 5 ++-- data/skeletons/lalr1.java | 3 +- data/skeletons/location.cc | 5 ++-- data/skeletons/stack.hh | 3 +- data/skeletons/variant.hh | 3 +- data/skeletons/yacc.c | 6 ++-- data/xslt/bison.xsl | 3 +- data/xslt/xml2dot.xsl | 3 +- data/xslt/xml2text.xsl | 3 +- data/xslt/xml2xhtml.xsl | 3 +- doc/bison.texi | 34 +++++++++++++---------- doc/local.mk | 2 +- doc/refcard.tex | 2 +- etc/README.md | 3 +- etc/bench.pl.in | 4 +-- etc/local.mk | 4 +-- examples/README.md | 2 +- examples/c++/README.md | 2 +- examples/c++/calc++/README.md | 2 +- examples/c++/calc++/calc++.test | 3 +- examples/c++/calc++/local.mk | 2 +- examples/c++/glr/README.md | 2 +- examples/c++/glr/ast.hh | 2 +- examples/c++/glr/c++-types.test | 2 +- examples/c++/glr/c++-types.yy | 2 +- examples/c++/glr/local.mk | 2 +- examples/c++/local.mk | 2 +- examples/c++/variant-11.test | 2 +- examples/c++/variant-11.yy | 3 +- examples/c++/variant.test | 2 +- examples/c++/variant.yy | 3 +- examples/c/README.md | 2 +- examples/c/bistromathic/README.md | 2 +- examples/c/bistromathic/bistromathic.test | 2 +- examples/c/bistromathic/local.mk | 2 +- examples/c/bistromathic/parse.y | 2 +- examples/c/calc/README.md | 2 +- examples/c/calc/calc.test | 2 +- examples/c/calc/local.mk | 2 +- examples/c/glr/README.md | 2 +- examples/c/glr/c++-types.test | 2 +- examples/c/glr/c++-types.y | 2 +- examples/c/glr/local.mk | 2 +- examples/c/lexcalc/README.md | 2 +- examples/c/lexcalc/lexcalc.test | 2 +- examples/c/lexcalc/local.mk | 2 +- examples/c/lexcalc/parse.y | 2 +- examples/c/lexcalc/scan.l | 2 +- examples/c/local.mk | 2 +- examples/c/mfcalc/local.mk | 2 +- examples/c/mfcalc/mfcalc.test | 3 +- examples/c/pushcalc/README.md | 2 +- examples/c/pushcalc/calc.test | 2 +- examples/c/pushcalc/calc.y | 2 +- examples/c/pushcalc/local.mk | 2 +- examples/c/reccalc/README.md | 2 +- examples/c/reccalc/local.mk | 2 +- examples/c/reccalc/parse.y | 2 +- examples/c/reccalc/reccalc.test | 2 +- examples/c/reccalc/scan.l | 2 +- examples/c/rpcalc/local.mk | 2 +- examples/c/rpcalc/rpcalc.test | 3 +- examples/d/README.md | 2 +- examples/d/calc/calc.test | 2 +- examples/d/calc/calc.y | 2 +- examples/d/calc/local.mk | 2 +- examples/d/local.mk | 2 +- examples/d/simple/calc.test | 2 +- examples/d/simple/calc.y | 2 +- examples/d/simple/local.mk | 2 +- examples/extexi | 4 +-- examples/java/README.md | 2 +- examples/java/calc/Calc.test | 2 +- examples/java/calc/Calc.y | 2 +- examples/java/calc/local.mk | 2 +- examples/java/local.mk | 2 +- examples/java/simple/Calc.test | 2 +- examples/java/simple/Calc.y | 2 +- examples/java/simple/local.mk | 2 +- examples/local.mk | 4 +-- examples/test | 3 +- lib/get-errno.c | 2 +- lib/get-errno.h | 4 +-- lib/local.mk | 3 +- lib/main.c | 4 +-- lib/path-join.c | 2 +- lib/path-join.h | 2 +- lib/timevar.def | 2 +- lib/yyerror.c | 4 +-- m4/bison-check-compiler-flag.m4 | 2 +- m4/bison-cxx-std.m4 | 2 +- m4/bison-i18n.m4 | 2 +- m4/c-working.m4 | 4 +-- m4/cxx.m4 | 2 +- m4/flex.m4 | 3 +- src/AnnotationList.c | 3 +- src/AnnotationList.h | 3 +- src/InadequacyList.c | 3 +- src/InadequacyList.h | 3 +- src/Sbitset.c | 3 +- src/Sbitset.h | 3 +- src/assoc.c | 4 +-- src/assoc.h | 2 +- src/closure.c | 2 +- src/closure.h | 4 +-- src/complain.c | 2 +- src/complain.h | 4 +-- src/conflicts.c | 4 +-- src/conflicts.h | 2 +- src/counterexample.c | 2 +- src/counterexample.h | 2 +- src/derivation.c | 2 +- src/derivation.h | 2 +- src/derives.c | 4 +-- src/derives.h | 2 +- src/files.c | 2 +- src/files.h | 4 +-- src/fixits.c | 2 +- src/fixits.h | 2 +- src/flex-scanner.h | 4 +-- src/getargs.c | 2 +- src/getargs.h | 2 +- src/glyphs.c | 2 +- src/glyphs.h | 2 +- src/gram.c | 4 +-- src/gram.h | 4 +-- src/graphviz.c | 2 +- src/graphviz.h | 4 +-- src/ielr.c | 3 +- src/ielr.h | 3 +- src/lalr.c | 4 +-- src/lalr.h | 2 +- src/local.mk | 3 +- src/location.c | 4 +-- src/location.h | 4 +-- src/lr0.c | 4 +-- src/lr0.h | 4 +-- src/lssi.c | 2 +- src/lssi.h | 2 +- src/main.c | 2 +- src/muscle-tab.c | 3 +- src/muscle-tab.h | 2 +- src/named-ref.c | 3 +- src/named-ref.h | 3 +- src/nullable.c | 2 +- src/nullable.h | 2 +- src/output.c | 2 +- src/output.h | 2 +- src/parse-gram.c | 4 +-- src/parse-gram.y | 3 +- src/parse-simulation.c | 2 +- src/parse-simulation.h | 2 +- src/print-graph.c | 2 +- src/print-graph.h | 2 +- src/print-xml.c | 4 +-- src/print-xml.h | 4 +-- src/print.c | 4 +-- src/print.h | 4 +-- src/reader.c | 2 +- src/reader.h | 2 +- src/reduce.c | 2 +- src/reduce.h | 4 +-- src/relation.c | 4 +-- src/relation.h | 2 +- src/scan-code.h | 2 +- src/scan-code.l | 3 +- src/scan-gram.h | 2 +- src/scan-gram.l | 3 +- src/scan-skel.h | 2 +- src/scan-skel.l | 3 +- src/state-item.c | 2 +- src/state-item.h | 2 +- src/state.c | 2 +- src/state.h | 4 +-- src/strversion.c | 2 +- src/strversion.h | 2 +- src/symlist.c | 4 +-- src/symlist.h | 4 +-- src/symtab.c | 2 +- src/symtab.h | 4 +-- src/system.h | 2 +- src/tables.c | 4 +-- src/tables.h | 2 +- src/uniqstr.c | 2 +- src/uniqstr.h | 2 +- tests/actions.at | 3 +- tests/atlocal.in | 3 +- tests/bison.in | 3 +- tests/c++.at | 2 +- tests/calc.at | 3 +- tests/conflicts.at | 2 +- tests/counterexample.at | 2 +- tests/cxx-type.at | 3 +- tests/d.at | 2 +- tests/diagnostics.at | 2 +- tests/existing.at | 4 +-- tests/glr-regression.at | 4 +-- tests/headers.at | 4 +-- tests/input.at | 3 +- tests/java.at | 3 +- tests/javapush.at | 3 +- tests/linear | 2 +- tests/local.at | 3 +- tests/local.mk | 3 +- tests/m4.at | 2 +- tests/named-refs.at | 3 +- tests/output.at | 2 +- tests/push.at | 4 +-- tests/reduce.at | 2 +- tests/regression.at | 3 +- tests/report.at | 2 +- tests/scanner.at | 2 +- tests/sets.at | 2 +- tests/skeletons.at | 4 +-- tests/synclines.at | 2 +- tests/testsuite.at | 4 +-- tests/torture.at | 4 +-- tests/types.at | 3 +- 255 files changed, 397 insertions(+), 328 deletions(-) diff --git a/AUTHORS b/AUTHORS index 96f2e834b..d80d1ff92 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,7 +24,7 @@ and nasty bugs. ----- -Copyright (C) 1998-2015, 2018-2022 Free Software Foundation, Inc. +Copyright (C) 1998-2015, 2018-2022, 2025 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/ChangeLog-2012 b/ChangeLog-2012 index fc1b67ec7..cdfb6a3d6 100644 --- a/ChangeLog-2012 +++ b/ChangeLog-2012 @@ -26732,8 +26732,8 @@ ----- - Copyright (C) 1987-1988, 1991-2015, 2018-2022 Free Software - Foundation, Inc. + Copyright (C) 1987-1988, 1991-2015, 2018-2022, 2025 Free + Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this diff --git a/Makefile.am b/Makefile.am index fc774aaa2..7b3887b80 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2001-2015, 2018-2022 Free Software Foundation, Inc. +# Copyright (C) 2001-2015, 2018-2022, 2025 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 diff --git a/NEWS b/NEWS index 9784581ab..cdef3238c 100644 --- a/NEWS +++ b/NEWS @@ -4748,7 +4748,7 @@ mode: outline fill-column: 76 End: -Copyright (C) 1995-2015, 2018-2022 Free Software Foundation, Inc. +Copyright (C) 1995-2015, 2018-2022, 2025 Free Software Foundation, Inc. This file is part of Bison, the GNU Parser Generator. diff --git a/PACKAGING b/PACKAGING index 7c20caf23..c5194a422 100644 --- a/PACKAGING +++ b/PACKAGING @@ -36,8 +36,8 @@ to the bison package. ----- -Copyright (C) 2002, 2005, 2009-2015, 2018-2022 Free Software Foundation, -Inc. +Copyright (C) 2002, 2005, 2009-2015, 2018-2022, 2025 Free Software +Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. diff --git a/README b/README index 7a73bc68f..6a7cf7f95 100644 --- a/README +++ b/README @@ -120,8 +120,8 @@ fill-column: 76 ispell-dictionary: "american" End: -Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2022 Free -Software Foundation, Inc. +Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015, 2018-2022, 2025 +Free Software Foundation, Inc. This file is part of GNU bison, the GNU Compiler Compiler. diff --git a/README-alpha b/README-alpha index f8b3f614a..6488603da 100644 --- a/README-alpha +++ b/README-alpha @@ -12,8 +12,8 @@ the problems you encounter. ----- -Copyright (C) 2002, 2004, 2009-2015, 2018-2022 Free Software Foundation, -Inc. +Copyright (C) 2002, 2004, 2009-2015, 2018-2022, 2025 Free Software +Foundation, Inc. This file is part of GNU Bison. diff --git a/README-hacking.md b/README-hacking.md index b5647fff3..930eb691a 100644 --- a/README-hacking.md +++ b/README-hacking.md @@ -638,8 +638,8 @@ bootstrapped.