Paul Eggert [Tue, 5 Mar 2019 23:05:33 +0000 (15:05 -0800)]
git-version-gen: fix --version copyright year
* build-aux/git-version-gen, build-aux/move-if-change (version):
--version output copyright year is now taken from script year,
so that it no longer needs to be updated by hand.
Bruno Haible [Mon, 4 Mar 2019 16:25:09 +0000 (17:25 +0100)]
relocatable-prog: Use wrapper-free installation on Mac OS X, take 2.
This approach supports relocatable installation of shared libraries
which depend on other shared libraries from the same package.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Determine use_macos_tools.
If use_macos_tools is true, use reloc-ldflags and set LIBTOOL to be a
wrapper around the original LIBTOOL.
* build-aux/reloc-ldflags: Add support for Mac OS X, which uses the
token '@loader_path' instead of '$ORIGIN'.
* build-aux/libtool-reloc: New file.
* modules/relocatable-prog (Files): Add it.
* doc/relocatable-maint.texi (Supporting Relocation): Update to match
the recent changes. Document the need to set the *_LDFLAGS of libraries.
RELOCATABLE_LIBRARY_PATH and RELOCATABLE_CONFIG_H_DIR should be set in
Makefile.am, not in configure.ac.
Paul Eggert [Mon, 25 Feb 2019 07:32:07 +0000 (23:32 -0800)]
nstrftime: support the ‘+’ flag
* lib/nstrftime.c (add, __strftime_internal):
Add support for the ‘+’ flag introduced in POSIX.1-2017.
(__strftime_internal): New arg ‘width’. All uses changed.
(DO_YEARISH, DO_MAYBE_SIGNED_NUMBER): New macros.
Bruno Haible [Sun, 24 Feb 2019 10:59:48 +0000 (11:59 +0100)]
stat, lstat: Fix conflict with relocatable-prog-wrapper module.
* lib/stat.c: On platforms other than OSF/1, include <sys/stat.h>, not
"sys/stat.h".
* lib/lstat.c: Likewise.
* lib/fstat.c: Likewise.
* lib/fstatat.c: Likewise.
Bernhard Voelker [Thu, 29 Nov 2018 08:06:26 +0000 (09:06 +0100)]
long-options: add parse_gnu_standard_options_only
Discussed in https://bugs.gnu.org/33468 .
* lib/long-options.c (parse_long_options): Use EXIT_SUCCESS instead
of 0.
(parse_gnu_standard_options_only): Add function to
process the GNU default options --help and --version and fail for any other
unknown long or short option. See
https://gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html .
* lib/long-options.h (parse_gnu_standard_options_only): Declare it.
* modules/long-options (depends-on): Add stdbool, exitfail.
* top/maint.mk (sc_prohibit_long_options_without_use): Update
syntax-check rule, add new function name.
Bruno Haible [Sat, 23 Feb 2019 21:42:54 +0000 (22:42 +0100)]
relocatable-prog: Use wrapper-free installation also on Mac OS X.
Reported by Paul Smith <psmith@gnu.org>.
* build-aux/install-reloc: Accept a 'mode' argument as first argument.
(func_relativize): New function, from gnulib-tool.
Handle mode 'macosx' through invocations of 'otool' and
'install_name_tool'.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Determine use_macos_tools.
If use_macos_tools is true, set INSTALL_PROGRAM_ENV to an
'install-reloc' invocation with mode 'macosx'.
Paul Eggert [Fri, 22 Feb 2019 04:07:21 +0000 (20:07 -0800)]
nstrftime: merge glibc strftime changes
This incorporates:
2019-02-11 Fix a few whitespace arrangement inconsistencies
2019-01-24 strftime: Pass flags from "%EY" to "%Ey" [BZ #24096]
2019-01-24 Set the default width of "%Ey" to 2 [BZ #23758]
2019-01-11 strftime: use the "L_" macro with character literals
* lib/nstrftime.c (__strftime_internal): New arg yr_spec. All
callers changed. Default width of %Ey is now 2. This is needed
for proper handling of Japanese dates starting on 2019-05-01.
Bruno Haible [Wed, 20 Feb 2019 01:39:52 +0000 (02:39 +0100)]
relocatable-prog: Use $ORIGIN trick on more platforms.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Use $ORIGIN trick also on
FreeBSD >= 7.3, DragonFly >= 3.0, NetBSD >= 8.0, OpenBSD >= 5.4,
Solaris >= 10, Haiku. But don't use it on Android.
* build-aux/reloc-ldflags: Allow the use of the $ORIGIN trick also on
Hurd, FreeBSD, DragonFly, NetBSD, OpenBSD, Solaris, Haiku.
Bruno Haible [Tue, 19 Feb 2019 20:42:54 +0000 (21:42 +0100)]
progreloc: Speed up executable lookup on various platforms.
* lib/progreloc.c: Include <errno.h>.
(safe_read, full_read): New functions.
(find_executable): On GNU/kFreeBSD, FreeBSD, DragonFly, NetBSD, Solaris,
prefer the information from the /proc file system to a PATH search.
Bruno Haible [Fri, 15 Feb 2019 20:27:44 +0000 (21:27 +0100)]
gnulib-tool: Support --import with just a few tests, not --with-tests.
* gnulib-tool (func_import): New variable 'gentests'. Use it instead of
'inctests' when generating files; use 'inctests' only for computing the
transitive closure.
Bruno Haible [Thu, 14 Feb 2019 19:50:57 +0000 (20:50 +0100)]
gnulib-tool: Improve handling of multiple --local-dir options.
* doc/gnulib.texi (Extending Gnulib): Explain how multiple --local-dir
options work.
* gnulib-tool (func_path_prepend): Remove function.
(func_path_foreach): Make IFS handling more robust.
(local_gnulib_path): Collect --local-dir values using func_path_append,
not func_path_prepend.
(func_determine_path_separator): Make IFS handling more robust.
(func_lookup_file_cb): New function.
(func_lookup_file): Rewritten to use func_lookup_file_cb instead of
func_lookup_local_file. Apply the patches in the reverse order of their
origin in $local_gnulib_path.
(func_count_relative_local_gnulib_path): Make IFS handling more robust.
* NEWS: Mention that the first --local-dir option is the one with
highest priority.
Paul Eggert [Sat, 2 Feb 2019 21:01:55 +0000 (13:01 -0800)]
dtoastr,ftoastr,ldtoastr: port to c-strtod changes
Decouple these modules from c-strtod. Nowadays it’s reasonable to
assume the C99 signatures for strtod and strtold. Programs that
require stricter adherence to C99 should also use the strtod and
strtold modules as needed, and we no longer need the
HAVE_C99_STRTOLD macro.
* NEWS: Mention this.
* lib/ftoastr.c (STRTOF) [LENGTH == 3]: Assume strtold.
* m4/c-strtod.m4 (gl_C_STRTOLD): Do not define HAVE_C99_STRTOLD.
* modules/dtoastr, modules/ftoastr, modules/ldtoastr:
(Files): Remove m4/c-strtod.m4.
(configure.ac): Do not require gl_C99_STRTOLD, which no longer
exists.
Bruno Haible [Fri, 1 Feb 2019 03:34:37 +0000 (04:34 +0100)]
c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
* lib/stdlib.in.h (GNULIB_defined_strtod_function,
GNULIB_defined_strtold_function): New macros.
* lib/c-strtod.c (HAVE_GOOD_STRTOD_L): New macro.
(STRTOD): Ignore HAVE_C99_STRTOLD.
(c_locale): Don't define it on platforms where strtod_l/strtold_l is
deemed buggy. But do use it on platforms where uselocale exists and is
usable.
(C_STRTOD): Don't use STRTOD_L on platforms where strtod_l/strtold_l is
deemed buggy. On platforms where uselocale exists and is usable, use
uselocale and strtod/strtold.
* m4/c-strtod.m4 (gl_C99_STRTOLD): Remove macro.
(gl_C_STRTOD): Require gt_FUNC_USELOCALE.
(gl_C_STRTOLD): Likewise. Define HAVE_C99_STRTOLD unconditionally.
* modules/c-strtod (Files): Add m4/intl-thread-locale.m4.
(Depends-on): Add strtod.
* modules/c-strtold (Files): Add m4/intl-thread-locale.m4.
(Depends-on): Add strtold.
Bruno Haible [Fri, 1 Feb 2019 02:12:28 +0000 (03:12 +0100)]
strtod, strtold: Use the locale's decimal point.
* lib/strtod.c: Include <locale.h>, <stdio.h>, <langinfo.h>.
(decimal_point_char): New function, copied from lib/vasnprintf.c.
(parse_number): Add a radixchar argument. Use it instead of '.'.
(STRTOD): Invoke decimal_point_char and pass the result to parse_number.
* m4/strtod.m4 (gl_PREREQ_STRTOD): Test whether nl_langinfo exists.
* m4/strtold.m4 (gl_PREREQ_STRTOLD): Likewise.
* tests/test-strtod1.c: New file.
* tests/test-strtod1.sh: New file.
* modules/strtod-tests (Files): Add test-strtod1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtod1.c and run
test-strtod1.sh.
* tests/test-strtold1.c: New file.
* tests/test-strtold1.sh: New file.
* modules/strtold-tests (Files): Add test-strtold1.{sh,c}. Add
locale-fr.m4 and its dependencies.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8.
(Makefile.am): Arrange to compile test-strtold1.c and run
test-strtold1.sh.
Bruno Haible [Thu, 31 Jan 2019 23:18:57 +0000 (00:18 +0100)]
strtod, strtold: Work around HP-UX 11.31/ia64 bug.
* lib/strtod.c (STRTOD): When there is an extra character after the
exponent marker 'p', reparse the number.
* doc/posix-functions/strtod.texi: Document the HP-UX 11.31 bug.
* doc/posix-functions/strtold.texi: Likewise.
Bruno Haible [Wed, 30 Jan 2019 02:52:31 +0000 (03:52 +0100)]
strtold: New module.
* lib/stdlib.in.h (strtold): New declaration.
* lib/strtold.c: New file.
* lib/strtod.c: Consider USE_LONG_DOUBLE.
(STRTOD, LDEXP, HAVE_UNDERLYING_STRTOD, DOUBLE, MIN, MAX, L_,
USE_LDEXP): New macros.
(LDEXP, scale_radix_exp, parse_number, STRTOD): Adapt for
USE_LONG_DOUBLE.
(underlying_strtod): Remove function. Replace with some macros.
Re-add the code for a missing underlying function that was removed on
2013-02-19.
* m4/strtold.m4: New file.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtold is declared.
(gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOLD, HAVE_STRTOLD,
REPLACE_STRTOLD.
* modules/stdlib (Makefile.am): Substitute GNULIB_STRTOLD, HAVE_STRTOLD,
REPLACE_STRTOLD.
* modules/strtold: New file.
* doc/posix-functions/strtold.texi: Document the new module.
Bruno Haible [Mon, 28 Jan 2019 20:14:08 +0000 (21:14 +0100)]
Fix build error when building a shared libunistring on Android.
* tests/uninorm/test-nfc.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfd.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfkc.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
* tests/uninorm/test-nfkd.c (n): Don't define on Android.
(main): Add 'volatile', to defeat a GCC optimization that would
eliminate the reference.
Bruno Haible [Sun, 27 Jan 2019 15:15:39 +0000 (16:15 +0100)]
tests: Don't assume that /tmp exists.
* tests/test-set-mode-acl-1.sh: Skip the test if /tmp does not exist.
* tests/test-copy-acl-1.sh: Likewise.
* tests/test-file-has-acl-1.sh: Likewise.
* tests/test-copy-file-1.sh: Likewise.
Bruno Haible [Sun, 27 Jan 2019 03:57:24 +0000 (04:57 +0100)]
fts: Add support for Android.
* m4/fts.m4 (gl_FUNC_FTS_CORE): Avoid conflicts between the symbols
defined by this module and the ones in libc.
* tests/test-fts.c (main): Treat mkdir error EMLINK like EMFILE.
Bruno Haible [Sat, 26 Jan 2019 23:21:17 +0000 (00:21 +0100)]
mountlist: Use Linux code on Android.
* lib/mountlist.c (setmntent, endmntent): Define fallbacks.
(unescape_tab, read_file_system_list): Enable Linux code on Android
as well.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Test for setmntent
and endmntent.
* modules/mountlist (Depends-on): Add 'getline'.
Bruno Haible [Sat, 26 Jan 2019 14:23:19 +0000 (15:23 +0100)]
ptsname_r: Work around bug on Android 4.3.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Define
HAVE_ESSENTIALLY_WORKING_PTSNAME_R. Test whether the return value is
correct.
* lib/ptsname_r.c (__ptsname_r): If HAVE_ESSENTIALLY_WORKING_PTSNAME_R
is defined, just fix the return value.
* doc/glibc-functions/ptsname_r.texi: Mention the Android bug. Reword:
The behaviour of musl libc is nothing to be "fixed", since it is
compliant with the next POSIX standard.
Bruno Haible [Sat, 26 Jan 2019 10:56:31 +0000 (11:56 +0100)]
ttyname_r: Work around bug on Android 4.3.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test whether ttyname_r is a stub.
* lib/ttyname_r.c (ttyname_r): Implement for Android.
* doc/posix-functions/ttyname_r.texi: Mention the Android bug.
* doc/posix-functions/ttyname.texi: Likewise.
Bruno Haible [Fri, 25 Jan 2019 22:39:28 +0000 (23:39 +0100)]
wcrtomb: Work around bug on Android 4.3.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Test also whether wcrtomb works in
the C locale.
* lib/wcrtomb.c (wcrtomb): Provide alternate implementation for Android,
which does not have the 'wctomb' function.
* doc/posix-functions/wcrtomb.texi: Mention the Android bug.
* tests/test-wcrtomb.c (main): Accept argument '5'.
* tests/test-wcrtomb.sh: Add tests in the POSIX locale.
Bruno Haible [Fri, 25 Jan 2019 22:26:24 +0000 (23:26 +0100)]
setlocale: Work around bug on Android 4.3.
* m4/setlocale.m4 (gl_FUNC_SETLOCALE): Test whether setlocale supports
the "C" locale.
* lib/setlocale.c (setlocale_unixlike): New wrapper for Android.
* doc/posix-functions/setlocale.texi: Mention the Android bug.
Bruno Haible [Thu, 24 Jan 2019 23:42:40 +0000 (00:42 +0100)]
mbtowc: Fix compilation error on Android 4.3.
* lib/stdlib.in.h (mbtowc): Test also HAVE_MBTOWC.
* m4/mbtowc.m4 (gl_FUNC_MBTOWC): Test whether mbtowc exists. Set
HAVE_MBTOWC.
* m4/stdlib_h.m4 (gl_STDLIB_H): Test whether mbtowc is declared.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_MBTOWC.
* modules/stdlib (Makefile.am): Substitute HAVE_MBTOWC.
* modules/mbtowc (Depends-on, configure.ac): Test also HAVE_MBTOWC.
* doc/posix-functions/mbtowc.texi: Mention the change.
Bruno Haible [Thu, 24 Jan 2019 22:51:11 +0000 (23:51 +0100)]
fchownat: Fix compilation error on Android 4.3.
* lib/unistd.in.h: Include <sys/stat.h> when module 'fchownat' is in
use.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG,
gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Include also <sys/stat.h>.
* doc/posix-functions/fchownat.texi: Mention the issue.
Bruno Haible [Thu, 24 Jan 2019 03:47:08 +0000 (04:47 +0100)]
threadlib: Revert commit from 2018-06-25. We now have a better fix.
* m4/threadlib.m4 (gl_THREADLIB_BODY): Don't attempt to defeat a
preceding -Wl,--as-needed option. Don't check whether the linker
supports --as-needed/--no-as-needed and --push-state/--pop-state.
Bruno Haible [Sun, 20 Jan 2019 22:48:18 +0000 (23:48 +0100)]
log10l: Work around inaccurate implementation on NetBSD.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Add test for a certain accuracy.
* lib/log10l.c: Comment out too simplistic override.
* doc/posix-functions/log10l.texi: Mention the NetBSD bug.
Bruno Haible [Sun, 20 Jan 2019 21:57:41 +0000 (22:57 +0100)]
logl: Work around inaccurate implementation on NetBSD.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Add test for a certain accuracy.
* lib/logl.c: Comment out unused code.
* doc/posix-functions/logl.texi: Mention the NetBSD bug.