C23's <stdbit.h> in the long run should be better supported than
Gnulib's count-one-bits.h and similar headers, so switch to the
C23 primitives, with a Gnulib fallback for platforms lacking C23.
* admin/merge-gnulib (GNULIB_MODULES): Remove count-leading-zeros,
count-one-bits, count-trailing-zeros. Add stdc_bit_width,
stdc_count_ones, stdc_trailing_zeros.
* lib/count-leading-zeros.c, lib/count-leading-zeros.h:
* lib/count-one-bits.c, lib/count-one-bits.h:
* lib/count-trailing-zeros.c, lib/count-trailing-zeros.h: Remove.
* lib/stdbit.c, lib/stdbit.in.h, lib/stdc_bit_width.c:
* lib/stdc_count_ones.c, lib/stdc_leading_zeros.c:
* lib/stdc_trailing_zeros.c, m4/stdbit_h.m4:
New files, copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/data.c: Do not include count-one-bits.h, count-trailing-zeros.h.
Instead, rely on lisp.h including stdbit.h.
(Flogcount, Fbool_vector_count_population)
(Fbool_vector_count_consecutive): Use stdbit.h macros instead of
count-one-bits.h and count-trailing-zeros.h macros.
(shift_right_ull, count_one_bits_word, pre_value)
(count_trailing_zero_bits): Remove; no longer needed.
* src/lisp.h: Include stdbit.h instead of count-leading-zeros.h.
(elogb): Use stdbit.h macro instead of count-leading-zeros.h macro.
* .gitignore: Ignore new generated files.
* cross/Makefile.in (src/Makefile): Remove leftover
specification of the source Gnulib directory.
* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_READELF): New
variable.
* java/Makefile.in (CONFIG_FILE, ALL_DEPENDENCIES, READELF)
(cf-stamp-1, cf-stamp): New variables and rules; compute the set
of library files in the order of loading and generate a file
with this information.
(ALL_CLASS_FILES): New variable; if builddir is not srcdir,
$($(CONFIG_FILE), $(CLASS_FILES)): Depend on EmacsConfig.java.
add generated files in the build directory.
(classes.dex): Adjust to match.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
<static initializer>: Load shared libraries from
EMACS_SHARED_LIBRARIES rather than a hard-coded list.
* m4/ndk-build.m4 (ndk_INIT): Search for readelf...
(ndk_CHECK_MODULES): ...and substitute its path as
NDK_BUILD_READELF.
* configure.ac: Stop relaying --with-ndk-cxx-shared to the
nested invocation of configure.
* build-aux/ndk-build-helper-1.mk (SYSTEM_LIBRARIES):
* build-aux/ndk-build-helper-2.mk (SYSTEM_LIBRARIES): Insert all
of the C++ libraries available on Android.
* configure.ac: Call ndk_LATE and ndk_LATE_EARLY within if
statement at toplevel, averting needless calls to AC_PROG_CXX.
* cross/ndk-build/Makefile.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS):
* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS): New variables.
* cross/ndk-build/ndk-resolve.mk (NDK_SYSTEM_LIBRARIES):
Introduce several other C++ libraries sometimes present on
Android.
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Insert NDK_BUILD_CXX_STL
when any of these new C++ libraries are requested.
* m4/ndk-build.m4: Completely rewrite C++ compiler and library
detection.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Attempt to
load more libraries from static initializer.
* java/INSTALL: Remove obsolete information.
Simplify Emacs proper by using Gnulib’s boot-time module
instead of doing it all by hand. This should port Emacs
better to obscurish hosts, as Bruno Haible has merged the
best of Emacs’s and Gnulib’s boot-time gathering.
* lib/boot-time-aux.h, lib/boot-time.c, lib/boot-time.h:
* lib/readutmp.h, m4/readutmp.m4: New files, copied from Gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add boot-time.
* configure.ac: Do not check for utmp.h;
the boot-time module now does this.
(BOOT_TIME_FILE): Remove; no longer used.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/filelock.c [__FreeBSD__]: Do not include <sys/sysctl.h>.
[HAVE_UTMP_H]: Do not include utmp.h.
Include boot-time instead: boot-time does the work now.
(BOOT_TIME) [HAVE_ANDROID && !ANDROID_STUBIFY]: Don’t undef.
(WTMP_FILE): Don’t define.
(boot_time, boot_time_initialized, get_boot_time_1, get_boot_time):
Remove.
(get_boot_sec): New function that simply calls Gnulib get_boot_time.
(lock_file_1, current_lock_owner): Use get_boot_sec instead
of get_boot_time.
It’s not worth the porting hassle, and as the glibc manual says,
“this function is generally a poor choice for processing strings”.
* admin/merge-gnulib (GNULIB_MODULES): Remove stpncpy.
* exec/configure.ac: Do not check for stpncpy.
* exec/exec.c (rpl_stpncpy, stpncpy): Remove this replacement.
(exec_0): Properly clear buffer1. Use memcpy instead of
stpncpy to add the trailing name. This code is clearly
still suboptimal but efficiency is not that important here
and I tried to minimize the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* m4, lib: Update from Gnulib.
* msdos/sedlibmk.inp: Remove variables deleted as part of previous
change.
* admin/merge-gnulib (GNULIB_MODULES): Remove vasprintf and
printf-posix.
* admin/merge-gnulib: Remove m4/locale-fr.m4.
* configure.ac (gt_LOCALE_FR_UTF8): Replace Gnulib’s
definition with a near no-op, as Emacs doesn’t care
about the Solaris 10 MB_CUR_MAX bug.
* lib/gnulib.mk.in: Regenerate.
* m4/locale-fr.m4: Remove; no longer needed due
to above changes.
This adds support for 64-bit time_t on 32-bit GNU/Linux ARM and
x86, where time_t was historically 32-bit. The resulting Emacs
should continue to work for timestamps after mid-January 2038.
* admin/merge-gnulib (GNULIB_MODULES): Add year2038.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Run admin/merge-gnulib along with the following change:
* admin/merge-gnulib (GNULIB_MODULES): Replace ‘time’ with
‘time-h’, adjusting to a recent renaming in Gnulib modules.
Emacs doesn’t appear to need the new Gnulib ‘time’ module.
* configure.ac: Call ndk_LATE after gl_EARLY.
* cross/ndk-build/Makefile.in (NDK_BUILD_CXX): New variable.
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Use it.
* java/INSTALL: Describe how to build C++ dependencies.
* m4/ndk-build.m4 (ndk_LATE): New macro.
(ndk_INIT): Try to find a suitable C++ compiler.
(ndk_CHECK_MODULES): Make sure the C++ compiler works before
allowing C++ dependencies.
* build-aux/ndk-build-helper.mk: Define in terms of BUILD_AUXDIR.
* m4/ndk-build.m4 (ndk_INIT): Find right build-aux directory.
Remove uses of unportable shell constructs.
ImageMagick now builds but does not link yet some of the time.
* INSTALL.android: Document ImageMagick and caveats.
* build-aux/ndk-build-helper-1.mk (NDK_SO_NAMES):
* build-aux/ndk-build-helper-2.mk (NDK_A_NAMES):
* build-aux/ndk-build-helper.mk (TARGET_ARCH_ABI): Define architecture
and don't respect explicitly specified library names.
* configure.ac: Enable ImageMagick and lcms2 on Android.
* cross/ndk-build/ndk-build-shared-library.mk (objname)::($(call
objname,$(LOCAL_MODULE),$(basename
$(1))))::(ALL_OBJECT_FILES$(LOCAL_MODULE)):
* cross/ndk-build/ndk-build-static-library.mk (objname)::($(call
objname,$(LOCAL_MODULE),$(basename $(1)))):
(NDK_CFLAGS, ALL_SOURCE_FILES): Handle sources files which start with
$(LOCAL_PATH).
* cross/ndk-build/ndk-clear-vars.mk: Don't undefine; clear variables
instead.
* m4/ndk-build.m4 (ndk_SEARCH_MODULE): Redirect make stderr to
config.log.xf64
* INSTALL.android: Port to MIPS.
* configure.ac (modules): Default to ifavailable.
Write actual test for __attribute__((cleanup)).
* m4/ndk-build.m4: Recognize mips and mips64.
* src/emacs-module.c: Remove broken HAS_ATTRIBUTE test.