]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor enhancements to the Android build system
authorPo Lu <luangruo@yahoo.com>
Thu, 6 Jun 2024 12:55:40 +0000 (20:55 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 7 Jun 2024 10:44:10 +0000 (12:44 +0200)
* build-aux/ndk-build-helper-1.mk:

* build-aux/ndk-build-helper-2.mk:

* cross/ndk-build/ndk-build-shared-library.mk:

* cross/ndk-build/ndk-build-static-library.mk:

* cross/ndk-build/ndk-resolve.mk
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)):
(NDK_LOCAL_SO_NAMES_$(LOCAL_MODULE)):
(NDK_LOCAL_A_NAMES_$(LOCAL_MODULE)): Reinforce tests for string
prefixes.

* m4/ndk-build.m4 (ndk_INIT): Guarantee that a module's
dependencies are recorded.

* configure.ac (XCONFIGURE): Prepare for building librsvg.

(cherry picked from commit a48f062e36be3ce5890a8a789272f31f074fea40)

build-aux/ndk-build-helper-1.mk
build-aux/ndk-build-helper-2.mk
configure.ac
cross/ndk-build/ndk-build-shared-library.mk
cross/ndk-build/ndk-build-static-library.mk
cross/ndk-build/ndk-resolve.mk
m4/ndk-build.m4

index 490064b6e323424a55697b3b79499ae652cbe158..985f7cddfaf20cfbfdc39e0c199c6f10a19663d4 100644 (file)
@@ -37,7 +37,7 @@ $(info Building $(build_kind))
 $(info $(LOCAL_MODULE))
 $(info $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES$(EMACS_ABI))))
 
-ifeq ($(findstring lib,$(LOCAL_MODULE)),lib)
+ifeq ($(filter-out lib%,$(LOCAL_MODULE)),)
 NDK_SO_NAMES = $(LOCAL_MODULE)_emacs.so
 else
 NDK_SO_NAMES = lib$(LOCAL_MODULE)_emacs.so
@@ -50,7 +50,7 @@ $$(foreach module,$$(filter-out $$(SYSTEM_LIBRARIES), $$(NDK_$(1)_STATIC_LIBRARI
 endef
 
 define add-so-name
-ifeq ($(findstring lib,$(1)),lib)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_SO_NAME = $(1)_emacs.so
 else
 NDK_SO_NAME = lib$(1)_emacs.so
index e696fcbdadec9d00f735ca9509c8f47b73fca40c..697740b3d451d28dbbcd3718937a4b5929b8bb05 100644 (file)
@@ -31,14 +31,14 @@ $(info Building $(build_kind))
 $(info $(LOCAL_MODULE))
 $(info $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES$(EMACS_ABI))))
 
-ifeq ($(findstring lib,$(LOCAL_MODULE)),lib)
+ifeq ($(filter-out lib%,$(LOCAL_MODULE)),)
 NDK_A_NAMES = $(LOCAL_MODULE).a
 else
 NDK_A_NAMES = lib$(LOCAL_MODULE).a
 endif
 
 define add-a-name
-ifeq ($(findstring lib,$(1)),lib)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_A_NAME = $(1).a
 else
 NDK_A_NAME = lib$(1).a
@@ -58,7 +58,7 @@ endif
 endef
 
 define add-so-name
-ifeq ($(findstring lib,$(1)),lib)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_SO_NAME = $(1)_emacs.so
 else
 NDK_SO_NAME = lib$(1)_emacs.so
index 9d91e8731b5ce1733ef812776c8e2beb3e391047..b0fdcaeb2c4d30d33bc5215213cd0df50a4d9e70 100644 (file)
@@ -1251,6 +1251,7 @@ package will likely install on older systems but crash on startup.])
   passthrough="$passthrough --with-pop=$with_pop"
   passthrough="$passthrough --with-harfbuzz=$with_harfbuzz"
   passthrough="$passthrough --with-threads=$with_threads"
+  passthrough="$passthrough --with-rsvg=$with_rsvg"
 
   # Now pass through some checking-related options.
   emacs_val="--enable-check-lisp-object-type=$enable_check_lisp_object_type"
@@ -1341,9 +1342,9 @@ if test "$ANDROID" = "yes"; then
     with_harfbuzz=no
     with_native_compilation=no
     with_threads=no
+    with_rsvg=no
   fi
 
-  with_rsvg=no
   with_libsystemd=no
   with_cairo=no
   with_xft=no
@@ -3592,10 +3593,13 @@ fi
 HAVE_RSVG=no
 if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" \
    || test "${opsys}" = "mingw32" || test "${HAVE_BE_APP}" = "yes" \
-   || test "${window_system}" = "pgtk"; then
+   || test "${window_system}" = "pgtk" \
+   || test "${REALLY_ANDROID}" = "yes"; then
   if test "${with_rsvg}" != "no"; then
     RSVG_REQUIRED=2.14.0
-    RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
+    AS_IF([test "${REALLY_ANDROID}" = "yes"],
+      [RSVG_MODULE="librsvg"],
+      [RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"])
 
     EMACS_CHECK_MODULES([RSVG], [$RSVG_MODULE])
     AC_SUBST([RSVG_CFLAGS])
index 74c6756a0c1f3330c4f6c1ffad68e64023209db4..b0605503271fa93abe060e0b41fbe79e5033bc2c 100644 (file)
@@ -125,7 +125,7 @@ NDK_CFLAGS ::= -mthumb
 endif
 endif
 
-ifeq ($(findstring lib,$(LOCAL_MODULE)),lib)
+ifeq ($(filter-out lib%,$(LOCAL_MODULE)),)
 LOCAL_MODULE_FILENAME := $(LOCAL_MODULE)_emacs
 else
 LOCAL_MODULE_FILENAME := lib$(LOCAL_MODULE)_emacs
index aba4539f6bb84e5036ba4c38397f00bc6d3df314..449eaadb403a4d9d607116620ec1001286f0553b 100644 (file)
@@ -110,7 +110,7 @@ NDK_CFLAGS ::= -mthumb
 endif
 endif
 
-ifeq ($(findstring lib,$(LOCAL_MODULE)),lib)
+ifeq ($(filter-out lib%,$(LOCAL_MODULE)),)
 LOCAL_MODULE_FILENAME := $(LOCAL_MODULE)
 else
 LOCAL_MODULE_FILENAME := lib$(LOCAL_MODULE)
index 4d8ecf8667a1b358a1a4e487f332a5487190f957..896c29f7f904b434dc0e414bfd44336aca37e18e 100644 (file)
@@ -140,7 +140,7 @@ NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE) += -landroid
 endif
 
 ifeq ($(findstring $(1),$(NDK_SYSTEM_LIBRARIES))$(2)$(3),)
-ifneq ($(findstring lib,$(1)),)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_LOCAL_SO_NAMES_$(LOCAL_MODULE) += $(1)_emacs.so
 else
 NDK_LOCAL_SO_NAMES_$(LOCAL_MODULE) += lib$(1)_emacs.so
@@ -148,7 +148,7 @@ endif
 endif
 
 ifneq ($(2),)
-ifneq ($(findstring lib,$(1)),)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_LOCAL_A_NAMES_$(LOCAL_MODULE) += $(1).a
 else
 NDK_LOCAL_A_NAMES_$(LOCAL_MODULE) += lib$(1).a
@@ -156,7 +156,7 @@ endif
 endif
 
 ifneq ($(3),)
-ifneq ($(findstring lib,$(1)),)
+ifeq ($(filter-out lib%,$(1)),)
 NDK_WHOLE_A_NAMES_$(LOCAL_MODULE) += $(1).a
 else
 NDK_WHOLE_A_NAMES_$(LOCAL_MODULE) += lib$(1).a
index 2689ee3428780c7e8b6f54613baa876ee3b0d40d..f86d4e4fc1e16a1fa29c19c6cdf8a0e43a9a35f0 100644 (file)
@@ -178,6 +178,7 @@ but a working C++ compiler was not found.])])
   AC_MSG_RESULT([yes])
 
   # Make sure the module is prepended.
+  ndk_MODULES="$ndk_MODULES $module_target"
   ndk_MAKEFILES="$ndk_android_mk $ndk_MAKEFILES"
   ndk_import_includes="$module_includes $ndk_import_includes"