summaryrefslogtreecommitdiff
path: root/m4
Commit message (Collapse)AuthorAgeFilesLines
* chmod: New module.Bruno Haible2022-06-222-2/+88
| | | | | | | | | | | | | | * lib/sys_stat.in.h (chmod): Declare when GNULIB_CHMOD is 1. * lib/chmod.c: New file, based on lib/lchmod.c. * m4/chmod.m4: New file, based on m4/fchmodat.m4. * m4/sys_stat_h.m4 (gl_SYS_STAT_H): Test whether chmod is declared. (gl_SYS_STAT_H_REQUIRE_DEFAULTS): Initialize GNULIB_CHMOD. (gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_CHMOD. * modules/sys_stat (Makefile.am): Substitute GNULIB_CHMOD, REPLACE_CHMOD. * modules/chmod: New file, based on modules/lchmod. * doc/posix-functions/chmod.texi: Mention the new module and the problems on IRIX and Windows.
* javacomp-script, javaexec-script: Add support for disabling Java.Bruno Haible2022-06-202-2/+34
| | | | | * m4/javacomp.m4 (gt_JAVACOMP_DISABLED): New macro. * m4/javaexec.m4 (gt_JAVAEXEC_DISABLED): New macro.
* lchmod: port back to AIX 7.2Paul Eggert2022-06-191-2/+1
| | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2022-06/msg00075.html * lib/lchmod.c: Include string.h, for strlen. (lchmod): Do not depend on HAVE_READLINK since we now depend on the readlink module. Check for AIX 7.2 bug. * m4/lchmod.m4 (gl_PREREQ_LCHMOD): Do not check for readlink since we now depend on the readlink module. * modules/lchmod (Depends-on): Depend on readlink.
* fchmodat: port better to MS-Windows etc.Paul Eggert2022-06-122-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | MS-Windows problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2022-06/msg00041.html Although I don’t use MS-Windows I see some related fstatat etc. problems and am trying to fix them with this further patch. * lib/fchmodat.c (fchmodat): * lib/lchmod.c (lchmod): * lib/lchown.c (lchown) [!HAVE_LCHOWN && HAVE_CHOWN && !CHOWN_MODIFIES_SYMLINK]: * lib/renameatu.c (renameatu) [HAVE_RENAME && RENAME_TRAILING_SLASH_SOURCE_BUG]: Use readlinkat/readlink instead of fstatat/lstat to test merely whether a string names a symlink, as this avoids problems with EOVERFLOW. Also, I hope it works around the MS-Windows issues that Bruno noted. * m4/fchmodat.m4 (gl_PREREQ_FCHMODAT): Check for readlinkat, not lchmod. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not require AC_CANONICAL_HOST or check for lstat. (gl_PREREQ_LCHMOD): Check for readlink. * modules/lchown (Depends-on): Add readlink. Do not depend on lstat merely because !HAVE_LCHOWN. * modules/renameatu (Depends-on): Add fstatat, readlinkat.
* termcap: Fix link error when no suitable library is found.Bruno Haible2022-05-141-1/+6
| | | | | * m4/termcap.m4 (gl_TERMCAP_BODY): If no suitable library is found, set LIBTERMCAP and LTLIBTERMCAP to empty.
* manywarnings: update C warnings for GCC 12Paul Eggert2022-05-121-0/+2
| | | | | | | | | Adjust for C programs compiled by GCC 12. (A C++ expert still needs to look at manywarnings-c++.m4.) * build-aux/gcc-warning.spec: Add warnings introduced in GCC 12. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add -Wbidi-chars=any,ucn and -Wuse-after-free=3. Although not enabled by -Wall or -Wextra they seem suitable for Gnulib-using C code.
* glob: improve config and test cleanupPaul Eggert2022-04-281-3/+3
| | | | | | | | | | Config problem reported by Benno Schulenberg in: https://lists.gnu.org/r/bug-gnulib/2022-04/msg00071.html * m4/glob.m4 (gl_GLOB): Clean up temporary file. Also, name it conf$$-file not conf-file, so it’s cleaned up on interrupt. * modules/glob-tests (MOSTLYCLEANFILES): Append test-glob.tglobfile, test-glob.tgloblink[123].
* Port _GL_HAS_C_ATTRIBUTE to pedantic gcc -std=c99Paul Eggert2022-04-191-1/+5
| | | | | * m4/gnulib-common.m4 (_GL_HAS_C_ATTRIBUTE): Disable -Wpedantic if using __has_c_attribute and this is not C2x.
* sigsegv: Fix compilation error on arceb CPUs.Bruno Haible2022-04-161-2/+2
| | | | | | | | Reported by Fabrice Fontaine <fontaine.fabrice@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00028.html>. * m4/stack-direction.m4 (SV_STACK_DIRECTION): Treat the 'arc' variants like 'arc'.
* glob: test for glibc bug 25659Paul Eggert2022-03-231-1/+40
| | | | | | https://sourceware.org/bugzilla/show_bug.cgi?id=25659 * m4/glob.m4 (gl_GLOB): Replace glob if it has bug 25659. * tests/test-glob.c (main): Test for glibc bug 25659.
* Port __has_attribute to Apple’s Clang renumberingPaul Eggert2022-02-251-1/+3
| | | | | | | | | Problem reported by Kirill A. Korinsky in: https://lists.gnu.org/r/bug-gnulib/2022-02/msg00034.html * config/srclist.txt: Comment out sys/cdefs.h for now. * lib/cdefs.h (__glibc_has_attribute): * m4/gnulib-common.m4 (gl_COMMON_BODY): Port to Apple’s renumbering of Clang versions.
* nanosleep: simplify by using pselectPaul Eggert2022-02-251-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | GNU Emacs avoids Gnulib’s ‘select’ module and uses only pselect, which it implements in a special way on MS-DOS. Unfortunately, though, nanosleep uses ‘select’; problem reported by Lars Ingebrigtsen (Bug#32452#74). As far as I can tell, Gnulib nanosleep's use of ‘select’ with signals is only for ancient platforms that Gnulib no longer cares about, so remove that use of ‘select’. I don’t know of any platforms that still need this fallback code, but just in case, fall back to pselect instead, while removing signal handling that it shouldn’t be needed nowadays. * lib/nanosleep.c: Do not include sig-handler.h, sys/time.h. (SIGCONT, suspended, sighandler, my_usleep): Remove. (nanosleep) [!HAVE_BUG_BIG_NANOSLEEP && !(_WIN32 && !__CYGWIN__)]: Just call pselect. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Do not check for sys/time.h or call gl_FUNC_SELECT. Do not include sys/time.h or worry about LIBSOCKET. (gl_PREREQ_NANOSLEEP): Remove as it’s no longer needed. All uses removed. * modules/nanosleep (Depends-on): Add pselect. Remove select, sigaction, sys_time.
* mktime: improve heuristic for ca-1986 Indiana DSTPaul Eggert2022-02-191-4/+25
| | | | | | | | | | | | | | | | Problem reported by Mark Krenz <https://bugs.gnu.org/48085>. * lib/mktime.c (__mktime_internal): Be more generous about accepting arguments with the wrong value of tm_isdst, by falling back to a one-hour DST difference if we find no nearby DST that is unusual. This fixes a problem where "1986-04-28 00:00 EDT" was rejected when TZ="America/Indianapolis" because the nearest DST timestamp occurred in 1970, a temporal distance too great for the old heuristic. This also also narrows the search a bit, which is a minor performance win. * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Check for putenv failures and for Bug#48085. * tests/test-parse-datetime.c (main): Test for setenv failures and for Bug#48085.
* terminfo, terminfo-h: New modules.Bruno Haible2022-01-301-0/+401
| | | | | | | * lib/terminfo.h: New file, from GNU gettext. * m4/terminfo.m4: New file, from GNU gettext. * modules/terminfo: New file, from GNU gettext. * modules/terminfo-h: New file, from GNU gettext.
* termcap, termcap-h: New modules.Bruno Haible2022-01-302-0/+238
| | | | | | | | | | * lib/termcap.h: New file, from GNU gettext. * lib/tparm.c: New file, from GNU gettext. * lib/tputs.c: New file, from GNU gettext. * m4/termcap.m4: New file, from GNU gettext. * m4/curses.m4: New file, from GNU gettext. * modules/termcap: New file, from GNU gettext. * modules/termcap-h: New file, from GNU gettext.
* alignalloc, xalignalloc: new modulesPaul Eggert2022-01-231-0/+10
| | | | | | | * lib/alignalloc.c, lib/alignalloc.h, lib/xalignalloc.c: * m4/alignalloc.m4, modules/alignalloc, modules/alignalloc-tests: * modules/xalignalloc, tests/test-alignalloc.c: New files.
* extern-inline: improve macOS portPaul Eggert2022-01-171-2/+17
| | | | | | | | | | * m4/extern-inline.m4 (gl_EXTERN_INLINE): Define HAVE___HEADER_INLINE at configure-time, so that config.h knows the workaround is not needed even though ctype.h has not yet been included. This lets the compiler use extern inline functions on newer macOS platforms, instead of static inline. Problem reported by Reuben Thomas in: https://lists.gnu.org/r/bug-gnulib/2022-01/msg00130.html
* Don't pass unknown warning option to clang.Bruno Haible2022-01-161-2/+2
| | | | | | | | Reported by Assaf Gordon via Paul Eggert in <https://lists.gnu.org/archive/html/coreutils/2022-01/msg00018.html>. * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Don't use -Wno-unsuffixed-float-constants with clang.
* havelib: Recognize ELF platform despite nvc 22.1.Bruno Haible2022-01-151-2/+2
| | | | | * m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Recognize Linux as an ELF platform, even with a compiler that does not define __ELF__.
* copy-file-range: work around Linux kernel bugPaul Eggert2022-01-142-1/+25
| | | | | | | | | | | | | | | | This workaround is adapted from Coreutils. * lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]: Include <sys/utsname.h>. (copy_file_range): Use a stub to replace the copy_file_range of Linux kernel versions 4.5 through 5.2. * lib/unistd.in.h (copy_file_range): * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): * modules/copy-file-range (configure.ac): * modules/unistd (unistd.h): Support replacement of copy_file_range. * m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE): Define HAVE_COPY_FILE_RANGE if the system has copy_file_range, and on Linux check whether the system’s is known to work.
* Avoid error "conditional LIBUNISTRING_COMPILE_... was never defined" when ↵Bruno Haible2022-01-141-2/+2
| | | | | | | | | | option --conditional-dependencies is used (regression 2022-01-09). Reported by Gavin Smith <gavinsmith0123@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00099.html>. * m4/libunistring-base.m4 (gl_LIBUNISTRING_MODULE): Use gl_CONDITIONAL instead of AM_CONDITIONAL.
* Avoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).Bruno Haible2022-01-131-2/+7
| | | | | | | | Reported by Werner Lemberg <wl@gnu.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00094.html>. * m4/gnulib-common.m4 (gl_COMMON_BODY): Avoid redefining _GL_ATTRIBUTE_DEALLOC_FREE.
* host-cpu-c-abi: Add support for LoongArch64 CPU.Bruno Haible2022-01-101-1/+4
| | | | | * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Define __loongarch64__. (GCC and clang predefine only __loongarch__, __loongarch64.)
* stdio: Fix "missing file" errors (regression from today).Bruno Haible2022-01-101-16/+10
| | | | | * modules/stdio (Files): Add stdio-read.c, stdio-write.c. * m4/stdio_h.m4 (gl_STDIO_H): Update comments.
* obstack: Move AC_LIBOBJ invocation to the module description.Bruno Haible2022-01-091-26/+24
| | | | | | * m4/obstack.m4 (gl_FUNC_OBSTACK): Renamed from AC_FUNC_OBSTACK. Don't invoke AC_LIBSOURCES nor AC_LIBOBJ. * modules/obstack (configure.ac): Update. Invoke AC_LIBOBJ here.
* stdio: Move AC_LIBOBJ invocations to the module description.Bruno Haible2022-01-091-4/+1
| | | | | * m4/stdio_h.m4 (gl_STDIO_H): Don't invoke AC_LIBOBJ. * modules/stdio (configure.ac): Invoke AC_LIBOBJ here.
* fchdir: Move AC_LIBOBJ invocation to the module description.Bruno Haible2022-01-091-3/+1
| | | | | | * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't invoke AC_LIBOBJ and gl_PREREQ_FCHDIR. * modules/fchdir (configure.ac): Invoke AC_LIBOBJ and gl_PREREQ_FCHDIR.
* Remove influence of Automake conditionals on conditional dependencies.Bruno Haible2022-01-092-4/+22
| | | | | | | | | | | | * m4/gnulib-common.m4 (gl_CONDITIONAL): New macro. (gl_CONDITIONAL_HEADER): Use it instead of AM_CONDITIONAL. * m4/libgmp.m4 (gl_LIBGMP): Likewise. * modules/posix_spawn_file_actions_addfchdir-tests (configure.ac): Likewise. * modules/uchar-c++-tests (configure.ac): Likewise. * gnulib-tool (func_modules_transitive_closure): Don't inhibit conditional dependencies processing on a module that uses an Automake conditional.
* Fix last commit.Bruno Haible2022-01-051-2/+4
| | | | | | | | Based on a patch by José E. Marchesi <jemarch@gnu.org>, reported in <https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00036.html>. * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): Don't enable -Wimplicit-fallthrough for GCC < 7.
* gnulib-tool: Avoid known warnings that reflect Gnulib's coding style.Bruno Haible2022-01-051-1/+65
| | | | | | | | | | * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): New macro. * gnulib-tool (func_emit_lib_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the CFLAGS of all the compilation units of the library. (func_emit_tests_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the CFLAGS. (func_import): Emit an invocation of gl_CC_GNULIB_WARNINGS.
* getpass-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-032-95/+97
| | | | | | | | | | | | | | | | * m4/getpass.m4 (gl_FUNC_GETPASS_GNU): Set REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Initialize the getpass-gnu module indicator. (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETPASS_FOR_GETPASS_GNU. * modules/unistd (Makefile.am): Substitute GNULIB_GETPASS_GNU, REPLACE_GETPASS_FOR_GETPASS_GNU. * modules/getpass-gnu (configure.ac): Test REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. Set a module indicator. * lib/unistd.in.h (getpass): Test REPLACE_GETPASS, REPLACE_GETPASS_FOR_GETPASS_GNU, and the respective module indicators instead of just REPLACE_GETPASS.
* fopen-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-032-4/+7
| | | | | | | | | | | | | | | | * m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Set REPLACE_FOPEN_FOR_FOPEN_GNU instead of REPLACE_FOPEN. * m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize the fopen-gnu module indicator. (gl_STDIO_H_DEFAULTS): Initialize REPLACE_FOPEN_FOR_FOPEN_GNU. * modules/stdio (Makefile.am): Substitute GNULIB_FOPEN_GNU, REPLACE_FOPEN_FOR_FOPEN_GNU. * modules/fopen-gnu (Depends-on): Add more dependencies. (configure.ac): Test REPLACE_FOPEN_FOR_FOPEN_GNU instead of REPLACE_FOPEN. * lib/stdio.in.h (fopen): Test REPLACE_FOPEN, REPLACE_FOPEN_FOR_FOPEN_GNU, and the respective module indicators instead of just REPLACE_FOPEN.
* realloc-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-032-6/+8
| | | | | | | | | | | | | | | | | | | | | | | * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Set REPLACE_REALLOC_FOR_REALLOC_GNU instead of REPLACE_REALLOC. (gl_FUNC_REALLOC_POSIX): Set REPLACE_REALLOC_FOR_REALLOC_POSIX instead of REPLACE_REALLOC. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the realloc-gnu module indicator. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_REALLOC_FOR_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_POSIX, not REPLACE_REALLOC. * modules/stdlib (Makefile.am): Substitute GNULIB_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_POSIX, not REPLACE_REALLOC. * modules/realloc-posix (Depends-on, configure.ac): Test REPLACE_REALLOC_FOR_REALLOC_POSIX instead of REPLACE_REALLOC. * modules/realloc-gnu (Comment): Remove section. (Depends-on): Add free-posix, malloc-gnu, xalloc-oversized. (configure.ac): Test REPLACE_REALLOC_FOR_REALLOC_GNU instead of REPLACE_REALLOC. Set a module indicator. * lib/stdlib.in.h (realloc): Test REPLACE_REALLOC_FOR_REALLOC_POSIX, REPLACE_REALLOC_FOR_REALLOC_GNU, and the respective module indicators instead of just REPLACE_REALLOC.
* calloc-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-032-6/+9
| | | | | | | | | | | | | | | | | | | | | | * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Set REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. (gl_FUNC_CALLOC_POSIX): Set REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the calloc-gnu module indicator. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/stdlib (Makefile.am): Substitute GNULIB_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/calloc-posix (Depends-on, configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * modules/calloc-gnu (Depends-on): Add xalloc-oversized. (configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. Set a module indicator. * lib/stdlib.in.h (calloc): Test REPLACE_CALLOC_FOR_CALLOC_POSIX, REPLACE_CALLOC_FOR_CALLOC_GNU, and the respective module indicators instead of just REPLACE_CALLOC.
* malloc-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-034-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Set REPLACE_MALLOC_FOR_MALLOC_GNU instead of REPLACE_MALLOC. (gl_FUNC_MALLOC_PTRDIFF, gl_FUNC_MALLOC_POSIX): Set REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Test REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC. * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the malloc-gnu module indicator. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_MALLOC_FOR_MALLOC_GNU, REPLACE_MALLOC_FOR_MALLOC_POSIX, not REPLACE_MALLOC. * modules/stdlib (Makefile.am): Substitute GNULIB_MALLOC_GNU, REPLACE_MALLOC_FOR_MALLOC_GNU, REPLACE_MALLOC_FOR_MALLOC_POSIX, not REPLACE_MALLOC. * modules/malloc-posix (Depends-on, configure.ac): Test REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC. * modules/malloc-gnu (Comment): Remove section. (Depends-on): Add xalloc-oversized. (configure.ac): Test REPLACE_MALLOC_FOR_MALLOC_GNU instead of REPLACE_MALLOC. Set a module indicator. * lib/stdlib.in.h (malloc): Test REPLACE_MALLOC_FOR_MALLOC_POSIX, REPLACE_MALLOC_FOR_MALLOC_GNU, and the respective module indicators instead of just REPLACE_MALLOC.
* maint: run 'make update-copyright'Paul Eggert2022-01-01820-820/+820
|
* timespec_getres: new modulePaul Eggert2021-12-282-1/+21
| | | | | | | | | | | * lib/time.in.h (timespec_getres): New decl. * lib/timespec_getres.c, m4/timespec_getres.m4: * modules/timespec_getres, modules/timespec_getres-tests: * tests/test-timespec_getres.c: New files. * m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS, gl_TIME_H_DEFAULTS): * modules/time (time.h): Support timespec_getres.
* gettime-res: new modulePaul Eggert2021-12-282-4/+13
| | | | | | | * lib/gettime-res.c, modules/gettime-res: New files. * lib/timespec.h (gettime_res): New decl. * m4/clock_time.m4 (gl_CLOCK_TIME): Also check for clock_getres. * m4/gettime.m4 (gl_GETTIME_RES): New macro.
* gettime: port better to non-POSIX C2xPaul Eggert2021-12-281-2/+2
| | | | | | | | | C2x requires a function timespec_get; prefer that to gettimeofday, since it has better resolution. * lib/gettime.c (gettime): Prefer timespec_get to gettimeofday. * m4/gettime.m4 (gl_GETTIME): Check for timespec_get. Omit a check for gettimeofday; not needed because the gettime module depends on the gettimeofday module.
* perl: let caller see whether perl was foundPaul Eggert2021-12-281-9/+16
| | | | | | | Problem reported for coreutils by Serge Belyshev (Bug#52844). * m4/perl.m4 (gl_PERL): Use AC_CACHE_CHECK, so that an invoker of gl_PERL can later inspect gl_cv_prog_perl to see whether perl was found.
* libtextstyle-optional: Fix generation of textstyle.h (regr. 2021-12-15).Bruno Haible2021-12-181-1/+8
| | | | | * m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Invoke gl_CONDITIONAL_HEADER.
* automake-subdir support: Support the libunistring modules.Bruno Haible2021-12-151-2/+6
| | | | | * m4/libunistring-base.m4 (gl_LIBUNISTRING_LIBHEADER): Use the value of the gl_source_base_prefix variable.
* Accommodate non-recursive Automake in a less hacky way.Bruno Haible2021-12-152-3/+12
| | | | | | | | | | | | | | | | | | | | | * gnulib-tool: New option --automake-subdir. (automake_subdir): New variable. (func_emit_initmacro_end): Add a second argument. Use it to prefix each object file name in *_LIBOBJS and *_LTLIBOBJS. (func_emit_shellvars_init): New function. (func_import): Add support for --automake-subdir. Invoke prefix-gnulib-mk. Update calls to func_emit_initmacro_end. Call func_emit_shellvars_init. (func_create_testdir): Update calls to func_emit_initmacro_end. Call func_emit_shellvars_init. * m4/gnulib-tool.m4 (gl_AUTOMAKE_SUBDIR): New macro. * m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): Use the value of the gl_source_base_prefix variable. * build-aux/prefix-gnulib-mk: New options --from-gnulib-tool, --prefix. (contents_of_file): Renamed from contents. (contents_of_stdin): New function. (process): Inline and remove function. * doc/gnulib-tool.texi (Non-recursive make): New section.
* Move .h file names out of the *.m4 files.Bruno Haible2021-12-1534-184/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful because Autoconf macros defined in *.m4 files can be AC_REQUIREd. In the configure file, they are then expanded before gl_INIT, i.e. at a place where it is not known whether they are required for the lib/ or for the tests/ directory (or both). * m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): New macro. * m4/alloca.m4 (gl_FUNC_ALLOCA): Set GL_GENERATE_ALLOCA_H instead of ALLOCA_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/alloca-opt (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/argz.m4 (gl_FUNC_ARGZ): Set GL_GENERATE_ARGZ_H instead of ARGZ_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/argz (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/assert_h.m4 (gl_ASSERT_H): Set GL_GENERATE_ASSERT_H instead of ASSERT_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/assert-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/byteswap.m4 (gl_BYTESWAP): Set GL_GENERATE_BYTESWAP_H instead of BYTESWAP_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/byteswap (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Set GL_GENERATE_ERRNO_H instead of ERRNO_H. Drop AC_SUBST and AM_CONDITIONAL invocations. (gl_REPLACE_ERRNO_VALUE): Update. * m4/perror.m4 (gl_FUNC_PERROR): Update. * m4/strerror.m4 (gl_FUNC_STRERROR): Update. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R, gl_FUNC_STRERROR_R_WORKS): Update. * modules/errno (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/execinfo.m4 (gl_EXECINFO_H): Set GL_GENERATE_EXECINFO_H instead of EXECINFO_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Drop AC_LIBOBJ invocation. * modules/execinfo (configure.ac): Invoke gl_CONDITIONAL_HEADER and AC_LIBOBJ. * m4/float_h.m4 (gl_FLOAT_H): Set GL_GENERATE_FLOAT_H instead of FLOAT_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/float (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/fnmatch_h.m4 (gl_FNMATCH_H, gl_REPLACE_FNMATCH_H): Set GL_GENERATE_FNMATCH_H instead of FNMATCH_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/fnmatch-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * modules/fnmatch (configure.ac): Likewise. * m4/getopt.m4 (gl_FUNC_GETOPT_POSIX, gl_GETOPT_SUBSTITUTE_HEADER): Set GL_GENERATE_GETOPT_H instead of GETOPT_H. Set GL_GENERATE_GETOPT_CDEFS_H instead of GETOPT_CDEFS_H. Drop AC_SUBST invocations. * modules/getopt-posix (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/glob_h.m4 (gl_GLOB_H, gl_REPLACE_GLOB_H): Set GL_GENERATE_GLOB_H instead of GLOB_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/glob-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * modules/glob (configure.ac): Likewise. * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS, gl_REPLACE_ICONV_H): Set GL_GENERATE_ICONV_H instead of ICONV_H. Drop AC_SUBST and AM_CONDITIONAL invocations. (gl_ICONV_H): Update. * modules/iconv-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * modules/iconv_open (configure.ac): Likewise. * m4/ieee754-h.m4 (gl_IEEE754_H): Set GL_GENERATE_IEEE754_H instead of IEEE754_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/ieee754-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/libgmp.m4 (gl_LIBGMP): Set GL_GENERATE_GMP_H instead of GMP_H. Drop AC_SUBST invocation. * modules/libgmp (configure.ac): Invoke gl_CONDITIONAL_HEADER. (Makefile.am): Use GL_GENERATE_GMP_H. * m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Set GL_GENERATE_TEXTSTYLE_H instead of TEXTSTYLE_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/libtextstyle-optional (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/limits-h.m4 (gl_LIMITS_H, gl_REPLACE_LIMITS_H): Set GL_GENERATE_LIMITS_H instead of LIMITS_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/limits-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/monetary_h.m4 (gl_MONETARY_H): Set GL_GENERATE_MONETARY_H instead of MONETARY_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/monetary (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/net_if_h.m4 (gl_HEADER_NET_IF): Set GL_GENERATE_NET_IF_H instead of NET_IF_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/net_if (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Set GL_GENERATE_NETINET_IN_H instead of NETINET_IN_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/netinet_in (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/selinux-context-h.m4 (gl_HEADERS_SELINUX_CONTEXT_H): Set GL_GENERATE_SELINUX_CONTEXT_H instead of SELINUX_CONTEXT_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * m4/selinux-label-h.m4 (gl_HEADERS_SELINUX_LABEL_H): Set GL_GENERATE_SELINUX_LABEL_H instead of SELINUX_LABEL_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/selinux-h (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/stdalign.m4 (gl_STDALIGN_H): Set GL_GENERATE_STDALIGN_H instead of STDALIGN_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/stdalign (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/stdarg.m4 (gl_STDARG_H): Set GL_GENERATE_STDARG_H instead of STDARG_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/stdarg (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/stdbool.m4 (gl_STDBOOL_H): Renamed from AM_STDBOOL_H. Set GL_GENERATE_STDBOOL_H instead of STDBOOL_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't require AM_STDBOOL_H. * modules/stdbool (configure.ac): Invoke gl_STDBOOL_H instead of AM_STDBOOL_H. Invoke gl_CONDITIONAL_HEADER. * m4/stddef_h.m4 (gl_STDDEF_H): Set GL_GENERATE_STDDEF_H instead of STDDEF_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/stddef (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/stdint.m4 (gl_STDINT_H): Set GL_GENERATE_STDINT_H instead of STDINT_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Update. * modules/stdint (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/stdnoreturn.m4 (gl_STDNORETURN_H): Set GL_GENERATE_STDNORETURN_H instead of STDNORETURN_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/stdnoreturn (configure.ac): Invoke gl_CONDITIONAL_HEADER. * m4/sys_socket_h.m4 (gl_SYS_SOCKET_H): Set GL_GENERATE_SYS_SOCKET_H instead of SYS_SOCKET_H. * m4/sysexits.m4 (gl_SYSEXITS): Set GL_GENERATE_SYSEXITS_H instead of SYSEXITS_H. Drop AC_SUBST and AM_CONDITIONAL invocations. * modules/sysexits (configure.ac): Invoke gl_CONDITIONAL_HEADER. * modules/sigsegv (configure.ac): Set GL_GENERATE_SIGSEGV_H instead of SIGSEGV_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Invoke gl_CONDITIONAL_HEADER.
* Indentation fix.Bruno Haible2021-12-151-3/+3
| | | | * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Correct indentation.
* gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.Bruno Haible2021-12-131-3/+0
| | | | | | | | * gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR invocation. * m4/non-recursive-gnulib-prefix-hack.m4 (gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke AC_CONFIG_LIBOBJ_DIR.
* gnulib-tool: Support different basenames for the lib/,tests/ Makefiles.Bruno Haible2021-12-131-1/+4
| | | | * m4/gnulib-tool.m4 (gl_TESTS_MAKEFILE_NAME): New macro.
* sigsegv: Fix build on some more embedded CPUs.Bruno Haible2021-12-061-2/+20
| | | | | * m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows negative, when the GCC 11 sources say so.
* lseek: port around macOS SEEK_DATA glitchPaul Eggert2021-11-151-2/+8
| | | | | | | | | | Problem reported by Sudhip Nashi (Bug#51857). * doc/posix-functions/lseek.texi (lseek): Mention macOS SEEK_DATA issue. * lib/lseek.c (rpl_lseek): Work around macOS portability glitch. * m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek on Darwin. * modules/lseek (Depends-on): Depend on msvc-nothrow and fstat only if needed.
* sigsegv: fix build on or1kFabrice Fontaine2021-11-111-0/+1
| | | | | | | Fix the following build failure on or1k with diffutils 3.8 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=e54aa6196947ed22ff66bcd714e4fc7bd0c5c3b4 sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this' http://autobuild.buildroot.org/results/5427e52489d29ed4f18b4a70b3c36f0f7bb0ddd9