57 Commits

Author SHA1 Message Date
Paul Eggert
95e0092f97 maint: make update-copyright 2025-01-05 13:33:00 -08:00
Andreas Gruenbacher
5d17ca0e5f Update more old copyright notices
* configure.ac: Replace the old copyright notice with the current
version from COPYING.
* ChangeLog-2011: Likewise.
2024-09-17 10:59:15 +02:00
Paul Eggert
33a7fd89ec Fix gl_gcc_warnings typo in ‘configure’
* configure.ac (gl_gcc_warnings): Always set before using,
fixing a typo I introduced Sat Aug 24 08:28:18 2024 -0700.
2024-09-16 14:11:43 -07:00
Paul Eggert
448ff9bc72 Defer signals by hand with sigatomic_t
Refactor by using a sig_atomic_t variable instead of a sigprocmask
call to defer signals.  This should be good enough for a
single-thread app where we write all the code that needs critical
sections, and where the signal handler merely cleans up and exits.
The resulting code should have the same behavior (including
signal-handling races!) as the original.
* bootstrap.conf (gnulib_modules): Remove sigaction, sigprocmask.
Instead, use sigaction only if it’s supported natively,
as the Gnulib emulation of sigaction drags in code we no longer need.
* configure.ac: Check for sigaction, sigfillset.
* src/patch.c (fatal_cleanup): New async-signal-safe function,
which does the cleanup that the old fatal_exit (SIG) did when SIG
was nonzero.
(fatal_exit): Do what the old fatal_exit (SIG) did when SIG was zero.
Omit SIG arg.  All callers changed.  This function is no longer
called from signal handlers, and so no longer needs to be
async-signal-safe under some circumstances.  However, it now
defers signals.
* src/util.c (signal_received): New static var.
(signal_deferring_level): Now sig_atomic_t.
(fatal_cleanup_and_terminate, handle_signal): New functions.
(defer_signals, undefer_signals): Reimplement by
using sigatomic_t volatile vars, not by using sigprocmask.
(init_signals): Don’t assume SIGPIPE since we don’t use the
Gnulib sigpipe module.  Use simple sigfillset signal mask
so that we needn’t use sigprocmask to inquire about the
current signal mask.  Have a fallback for old platforms
that lack sigaction and sigfillset, since we no longer use
Gnulib’s sigaction module.
(exit_with_signal): Remove; no longer needed.
2024-09-15 22:50:38 -07:00
Paul Eggert
d1a6847368 Simplify warning configuration
* configure.ac (WARN_CFLAGS): Simplify configuration
by not bothering to suppress warnings that don’t
need to be suppressed with GCC 14.2.1.
2024-08-28 23:13:44 -07:00
Paul Eggert
bc6899dc6f Pacify gcc -Wno-unused-parameter
* bootstrap.conf (gnulib_modules): Add ‘attribute’.
It’s already being used indirectly.
* configure.ac (WARN_CFLAGS): Omit -Wno-unused-parameter.
* src/common.h: Include attribute.h.
(FALLTHROUGH): Remove, as attribute.h does this now.
* src/util.c (copy_attr_error, copy_attr_quote, copy_attr_free):
Use MAYBE_UNUSED.
2024-08-28 23:13:44 -07:00
Paul Eggert
d18c05d5bd Update copyright notices
Switch to single intervals for FSF notices,
and consistently put them first.
Update copyright notices for 2024.
* cfg.mk (update-copyright-env): Use UPDATE_COPYRIGHT_FORCE=1,
UPDATE_COPYRIGHT_USE_INTERVALS=2.
* patch.man: Always use \(co, so that update-copyright
updates these dates.
* src/version.c: Correct Larry Wall copyright years.
2024-08-28 23:13:44 -07:00
Paul Eggert
1c087d6fcb Rely on Gnulib inttypes module
* bootstrap.conf (gnulib_modules): Add inttypes.  Remove size_max.
* configure.ac: Do not call gl_SIZE_MAX.
* src/common.h: Include inttypes.h unconditionally.
2024-08-28 23:13:44 -07:00
Paul Eggert
abf6fb176b Simplify by using Gnulib sigaction
* bootstrap.conf (gnulib_modules): Add raise, sigaction, signal-h,
sigprocmask.  Remove signal.
* configure.ac: Do not check for raise, sigaction, sigprocmask,
sigsetmask.
* src/patch.c (main): Do not block signals during dry runs; there's
no need.
* src/util.c (SIGCHLD, raise, sigset_t, sigemptyset, sigmask)
(sigaddset, sigismember, sigprocmask, sigblock, sigsetmask):
Remove substitutes; not needed now that we have Gnulib.
(sigs): Don’t worry about whether SIGHUP and SIGPIPE are present.
(NUM_SIGS): Now a constant, not a macro.
(signals_to_block): Remove.  All uses changed to fatal_act.sa_mask.
(fatal_exit_handler) [!HAVE_SIGACTION]: Remove.  All uses removed.
(init_signals): Rename from set_signals.  All uses changed.
Only do the true part; the false part is now done by unblock_signals.
(block_signals): Rename from ignore_signals, since it now blocks
instead of ignoring on all platforms.  All uses changed.
(init_signals, block_signals): Simplify by assuming
HAVE_SIGACTION, HAVE_SIGPROCMASK, HAVE_SIGSETMASK.
(setup_handler): Remove macro.
(unblock_signals): New function.
2024-08-25 18:14:30 -07:00
Paul Eggert
d46d729c0c Change manywarnings usage to be more like coreutils
* configure.ac: Treat --enable-gcc-warnings more like coreutils does.
This mostly just migrates coreutils changes into this file.
2024-08-25 18:14:30 -07:00
Paul Eggert
8f78b098c2 maint: pacify gcc -Winline
* configure.ac (nw): Add -Winline.
2024-08-25 18:14:30 -07:00
Paul Eggert
bb841fd7b0 maint: port _FORTIFY_SOURCE to Ubuntu
* configure.ac (_FORTIFY_SOURCE): Define only if not already defined,
so as to not collide with the builtin definition on Ubuntu 24.04 LTS.
2024-08-25 18:14:30 -07:00
Paul Eggert
009a424a74 maint: omit obsolete macro calls
* configure.ac: Remove gl_USE_SYSTEM_EXTENSIONS.
It is no longer needed, since Gnulib does this for us.
2024-08-25 18:14:30 -07:00
Andreas Gruenbacher
68cb5293f7 build: update gnulib submodule to latest
* bootstrap, bootstrap.conf: Update.
* configure.ac: Remove obsolete AC_PROG_CC_STDC macro (AC_PROG_CC is
already present). Remove obsolescent AC_HEADER_STDC macro.
* m4/xattr.m4: Replace obsolete AC_HELP_STRING by AS_HELP_STRING.
* m4/setmode.m4: Replace obsolete AC_TRY_LINK by AC_LINK_IFELSE.
* Makefile.am (EXTRA_DIST): Add missing m4/gnulib-cache.m4.
* lib/Makefile.am: Regenerate.
2024-08-23 22:37:40 +02:00
Collin Funk
f144b35425 build: Enable the 'subdir-objects' Automake option.
* configure.ac (AM_INIT_AUTOMAKE): Add 'subdir-objects'.
* src/safe.c (remove_cached_dirfd): Use hash_remove instead of the
deprecated hash_delete.
2024-03-02 00:17:51 +01:00
Bruno Haible
5bf48c87ca Don't use an undocumented Autoconf macro
* configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER.
2018-01-23 10:40:56 +01:00
Andreas Gruenbacher
6a55099e7a Use gnulib size_max module
* bootstrap.conf (gnulib_modules): Add size_max.
* configure.ac: Call gl_SIZE_MAX.
2015-03-08 14:55:48 -04:00
Stefano Lattarini
60c9d4838f build: don't use -Werror in AM_INIT_AUTOMAKE
Doing so prevents bootstrapping with bleeding-edge autotools,
because of harmless deprecation warnings (that are not planned
to become hard errors for at least a few years to come).  And
unfortunately, options in AM_INIT_AUTOMAKE take precedence over
those given on the command line (this is a long-time wart of
automake).

* configure.ac (AM_INIT_AUTOMAKE): Drop '-Werror' option.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-02 06:03:31 +02:00
Jim Meyering
b272c2d535 build: avoid gcc warnings from -Wsuggest-attribute=format
* configure.ac (WARN_CFLAGS): Disable -Wsuggest-attribute=format,
to avoid some warnings that are not worth working around.
2012-09-22 21:35:04 +02:00
Andreas Gruenbacher
a8699f834b Require automake-1.11.2
* configure.ac (AM_INIT_AUTOMAKE): Require version 1.11.2 which introduced the
AM_PROG_AR macro, used since commit 297f9e7d.
2012-04-06 13:29:46 +02:00
Jim Meyering
297f9e7dd6 build: update bootstrap from gnulib and adapt
* bootstrap: Update from gnulib.
* bootstrap.conf (gnulib_tool_option_extras): Define.
* lib/Makefile.am: Initialize numerous automake variables so that
generated code in gnulib.mk may use += to append to them.
* configure.ac: Add AM_PROG_AR, to placate newer automake.
2012-02-16 14:36:11 +01:00
Jim Meyering
2d38b11799 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:26:02 +01:00
Jim Meyering
5cb38ce390 build: update to latest gnulib and adapt
Mark functions as pure of const, per recommendations enabled by
new gcc -W options.  Apply _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
* src/common.h: Apply new function attributes.
* src/pch.c: Likewise.
* src/pch.h: Likewise.
* src/util.c: Likewise.
* src/util.h: Likewise.
* configure.ac: Use -Wno-format-nonliteral.
* m4/.gitignore: Update.
* gnulib: Update to latest.
* cfg.mk: Exempt src/util.c from two tests, to avoid new
"make syntax-check" failures.
2011-12-14 16:34:45 +01:00
Jim Meyering
46ad06707c build: use largefile module and update to latest gnulib
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
* gnulib: Update to latest.
This is useful to Mac OS X 10.5 users if/when configure
is generated using autoconf prior to v2.68-80-gdb2f2e0.
2011-08-11 14:18:57 +02:00
Jim Meyering
c9f9680fd1 build: don't turn off -Wmissing-declarations
* configure.ac (WERROR_CFLAGS): Don't turn off -Wmissing-declarations
and admit that it's not worth fixing the few warnings triggered
by -Wmissing-format-attribute.
2011-03-27 09:19:55 +02:00
Jim Meyering
d08c6262c7 build: don't turn off -Wmissing-prototypes
* configure.ac (WERROR_CFLAGS): Don't turn off -Wmissing-prototypes.
* src/pch.c (skip_hex_digits): Declare static.
* src/bestmatch.h (bestmatch): Likewise.
2011-03-27 09:19:55 +02:00
Jim Meyering
db2fb7cdba maint: update copyright date year ranges to include 2011
* bootstrap.conf (gnulib_modules): Add update-copyright.
Run "make update-copyright".
2011-03-27 09:16:46 +02:00
Jim Meyering
7db2653124 build: accept new configure-time option --enable-gcc-warnings
* configure.ac: Enable many options.
* bootstrap.conf (gnulib_modules): Add manywarnings.
* src/Makefile.am (AM_CFLAGS): Use $(WARN_CFLAGS) and $(WERROR_CFLAGS).
2011-03-26 14:20:28 +01:00
Andreas Gruenbacher
76d0e43140 Preserve extended attributes of patched files when possible
* src/patch.c (main): Set all file attributes of the temporary output
file before renaming it over the final output file (possibly replacing
the input file).  Pass the input file name to set_file_attributes().
* src/util.c (set_file_attributes): When enabled (USE_XATTR), also
copy extended attributes including attributes which define
permissions.
(copy_attr_error, copy_attr_quote, copy_attr_free, copy_attr_check,
copy_attr): Helper functions for copying extended attributes.
* m4/xattr.m4 (gl_FUNC_XATTR): Import from coreutils.
* src/Makefile.am (patch_LDADD): Add $(LIB_XATTR) here.
* bootstrap.conf: Use the gnulib verror module.
2010-10-27 02:53:42 +02:00
Andreas Gruenbacher
03f337dabc Remove obsolete checks for mktemp
* configure.ac: Remove obsolete checks for mktemp.
2010-10-26 14:08:50 +02:00
Andreas Gruenbacher
a78d3c405b Use the gnulib mkdir module
* bootstrap.conf: Use the gnulib mkdir module.
* m4/mkdir.m4: Delete.
2010-05-05 01:00:39 +02:00
Andreas Gruenbacher
80cfee88e6 Remove $(TEST_SHELL) and use $(SHELL) instead.
* configure.ac, tests/Makefile: Remove $(TEST_SHELL) and use $(SHELL)
instead.
2010-05-04 18:58:13 +02:00
Andreas Gruenbacher
cfe068672d Remove leftovers from when patch was still using utimbuf()
* configure.ac (gl_CHECK_TYPE_STRUCT_UTIMBUF), m4/utimbuf.m4: Remove;
utimbuf is no longer used.
2010-04-27 12:38:16 +02:00
Andreas Gruenbacher
69f5ebc2d2 Do not use grep -q 2010-04-27 12:38:15 +02:00
Andreas Gruenbacher
a11bfc85e5 Use the gnulib fcntl-h and sys_stat modules
* bootstrap.conf: Use the gnulib fcntl-h and sys_stat modules.
* src/common.h: Remove the declarations provided by gnulib sys_stat.
Always include fcntl.h (and depend on gnulib fcntl-h).
* src/util.h: Remove duplicate include of <timespec.h>.
* configure.ac: Remove obsolete checks for fcntl.h and utime.h.
2010-04-27 12:38:15 +02:00
Andreas Gruenbacher
65a8f0f278 Minimum versions required: automake-1.11.1, autoconf-2.65
* configure.ac: Minimum versions required: automake-1.11.1,
autoconf-2.65.
2010-04-12 19:13:53 +02:00
Andreas Gruenbacher
7fa8417c05 Convert to automake and use a git submodule for gnulib
* configure.ac: Add automake and gnulib macros, replace several
obsolete macros.
* Makefile.am, lib/Makefile.am, src/Makefile.am, tests/Makefile.am:
Add for automake.
* autogen.sh, INSTALL, Makefile.in, mkinstalldirs, update-version.sh:
Obsolete; remove.
* README-hacking: Import from diffutils, replace cvs with git.
* build-aux: Move gnulib auxiliary files here from the top-level
directory.
* gnulib: Add gnulib git submodule.
* bootstrap, bootstrap.conf: Import from gnulib and adjust.
* gl/lib: Remove gnulib files from the repository; they are now
imported into lib/ from gnulib as needed.
* tests/test-lib.sh: Use $abs_top_builddir exported from
tests/Makefile.am here instead of $PWD.
* m4/utimbuf.m4: This macro has been removed from gnulib. Add it here
for now; this will be replaced by gnulib's utimens module soon.
2010-04-12 16:27:55 +02:00
Andreas Gruenbacher
8d5ea52c7a Rename ed_PROGRAM to EDITOR_PROGRAM
* src/pch.c (EDITOR_PROGRAM): Rename from ed_PROGRAM.
* configure.ac (EDITOR_PROGRAM): Likewise.
2010-04-12 16:27:55 +02:00
Bert Wesarg
aa50fe4ff4 * configure.ac: It looks like the . command does not pass the
arguments to the update-version.sh script [on some platforms].  Invoke
with sh instead.
2009-12-28 17:54:56 +01:00
Andreas Gruenbacher
9336e93bda * configure.ac (gl_FUNC_STRNDUP, gl_FUNC_STRNLEN): Add here.
* gl/m4/strndup.m4 (gl_HEADER_STRING_H_DEFAULTS): Don't use gnulib's
strings.h replacement for now, it is too complicated to add right now.
* gl/lib/xstrndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS,
declare strndup here on systems which don't have it.
* gl/lib/strndup.c: Instead of using gl_HEADER_STRING_H_DEFAULTS,
declare strnlen here on systems which don't have it.
* gl/lib/strnlen.c: Import from gnulib.
2009-12-28 17:46:08 +01:00
Andreas Gruenbacher
8c8cf43e87 When copying files, use full_write() from gnulib instead of write() 2009-07-19 16:37:11 +02:00
Andreas Gruenbacher
e41a32b1d9 Portability improvements in update-version.sh 2009-04-11 13:50:24 +02:00
Andreas Gruenbacher
a03f22893c Copyright notice updates 2009-04-05 21:12:30 +02:00
Andreas Gruenbacher
b3fbd9a585 Update to the latest version of Gnulib 2009-04-05 08:18:21 +02:00
Andreas Gruenbacher
85cd8a4cfe Move all source and header files into src/ 2009-04-05 08:12:05 +02:00
Andreas Gruenbacher
b709d77ca8 Add a simple form of merge support 2009-04-02 06:25:22 +02:00
Andreas Gruenbacher
ddea3f3674 Fix the install target 2009-03-29 15:03:28 +02:00
Andreas Gruenbacher
df890caf03 Prepare for second alpha release
Update NEWS.
Packaging and various other minor fixes.
2009-03-29 00:59:26 +01:00
Andreas Gruenbacher
1818b03d6e Cross-platform compatibility improvements 2009-03-24 18:30:58 +01:00
Andreas Gruenbacher
2684e74048 Prepare for first alpha release
Update NEWS.
Don't make $(TESTS) a prerequisite of dist: this would run the tests.
Add reminder for myself how to upload.
2009-03-22 14:30:15 +01:00