Improve C++ standard library detection on Android

* 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.
This commit is contained in:
Po Lu
2024-03-17 19:32:15 +08:00
parent 445e2499ba
commit 7a0f4de3c1
9 changed files with 335 additions and 131 deletions

View File

@@ -323,7 +323,9 @@ public final class EmacsNative
Every time you add a new shared library dependency to Emacs,
please add it here as well. */
libraryDeps = new String[] { "png_emacs", "selinux_emacs",
libraryDeps = new String[] { "c++_shared", "gnustl_shared",
"stlport_shared", "gabi++_shared",
"png_emacs", "selinux_emacs",
"crypto_emacs", "pcre_emacs",
"packagelistparser_emacs",
"gnutls_emacs", "gmp_emacs",
@@ -331,7 +333,7 @@ public final class EmacsNative
"tasn1_emacs", "hogweed_emacs",
"jansson_emacs", "jpeg_emacs",
"tiff_emacs", "xml2_emacs",
"icuuc_emacs",
"icuuc_emacs", "harfbuzz_emacs",
"tree-sitter_emacs", };
for (String dependency : libraryDeps)