patch/bootstrap.conf
Paul Eggert 5f4edd389e Simplify memory allocation of files to delete
This pacifies ‘make sc_cast_of_argument_to_free’, which otherwise
complains about the ‘free ((void *) elt)’ in dispose_file_to_delete.
Rather than worry about pacifying that ‘make’ rule,
simplify memory allocation by doing the linked list by hand,
with a ‘next’ member the way our grandfathers did it.
This reduces the number of source code lines by 23,
removes the need for Gnulib’s linked-list and xlist modules,
and makes the code type-safer (as opposed to going through void *).
* bootstrap.conf (gnulib_modules): Remove linked-list, xlist.
* src/patch.c: Do not include gl_linked_list.h, gl_xlist.h.
(struct file_to_delete): New member ‘next’.
(files_to_delete): Now struct file_to_delete *, not gl_list_t.
(dispose_file_to_delete, init_files_to_delete):
Remove; no longer needed.
(files_to_delete_tail): New static var.
(delete_file_later): Append the new file by hand.
(delete_files): Iterate and free by hand.
2024-09-16 22:58:28 -07:00

103 lines
1.6 KiB
Bash

# Bootstrap configuration. -*- sh -*-
# Copyright 2006-2024 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# gnulib modules used by this package.
gnulib_modules="
argmatch
assert-h
attribute
backupfile
basename-lgpl
c-ctype
closeout
diffseq
dup2
errno
exitfail
extensions
faccessat
fchownat
fchmodat
fcntl-h
filename
fseeko
fstatat
ftello
futimens
getopt-gnu
gettime
gitlog-to-changelog
git-version-gen
gnupload
hash
idx
ignore-value
intprops
inttypes
largefile
maintainer-makefile
malloc-gnu
manywarnings
memchr
mempcpy
minmax
mkdirat
nullptr
openat
parse-datetime
progname
quotearg
raise
readlinkat
realloc-gnu
renameat
setenv
signal-h
ssize_t
stat-time
stdbool
stdckdint
stdlib
stpcpy
symlinkat
sys_stat
tempname
unistd
unlinkat
update-copyright
utimensat
verror
xalloc
xstdopen
year2038-recommended
"
# Build prerequisites
buildreq="\
autoconf 2.59
automake 1.9.6
git 1.5.5
tar -
"
bootstrap_post_import_hook ()
{
# Automake requires that ChangeLog exist.
touch ChangeLog || exit 1
}