From 767da53fa3a15ed448c14aa4dc468f187a6e2df9 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 22 Feb 2023 21:20:30 +0800 Subject: [PATCH] Update Android port 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 | 62 +++++++++++++++++++- build-aux/ndk-build-helper-1.mk | 4 -- build-aux/ndk-build-helper-2.mk | 5 -- build-aux/ndk-build-helper.mk | 3 + configure.ac | 24 ++++++-- cross/ndk-build/ndk-build-shared-library.mk | 15 +++-- cross/ndk-build/ndk-build-static-library.mk | 20 +++---- cross/ndk-build/ndk-clear-vars.mk | 64 ++++++++++----------- m4/ndk-build.m4 | 24 ++++---- 9 files changed, 145 insertions(+), 76 deletions(-) diff --git a/INSTALL.android b/INSTALL.android index 1b362fbb583..b3a29d511db 100644 --- a/INSTALL.android +++ b/INSTALL.android @@ -209,8 +209,8 @@ themselves: its Android.mk includes $(BUILD_SHARED_LIBRARY), then copy android/jansson_config.h to android/jansson_private_config.h.) -And Emacs developers have ported the following dependencies to arm64 -Android systems: +Emacs developers have ported the following dependencies to ARM Android +systems: gnutls, gmp - https://sourceforge.net/projects/android-ports-for-gnu-emacs (Please see the section GNUTLS near the end of this file.) @@ -219,6 +219,12 @@ Android systems: tree-sitter - https://sourceforge.net/projects/android-ports-for-gnu-emacs (Please see the section TREE-SITTER near the end of this file.) +And other developers have ported the following dependencies to Android +systems: + + ImageMagick, lcms2 - https://github.com/MolotovCherry/Android-ImageMagick7 + (Please see the section IMAGEMAGICK near the end of this file.) + We anticipate that most untested non-trivial ndk-build dependencies will need adjustments in Emacs to work, as the Emacs build system which emulates ndk-build is in an extremely early state. @@ -590,6 +596,14 @@ the following tar archive in that site: and add the resulting folder to ``--with-ndk-build''. +IMAGEMAGICK + +There is a third party port of ImageMagick to Android. Unfortunately, +the port also uses its own patched versions of libpng, libjpeg, +libtiff and libwebp, which conflict with those used by Emacs. Its +Makefiles were also written for MS Windows, so you must also apply the +patch at the end of this file. + This file is part of GNU Emacs. @@ -835,3 +849,47 @@ index e82f3d5..be3a3c4 100644 linux_x86_sources := \ linux-x86/crypto/aes/aes-586.S\ + +PATCH FOR IMAGEMAGICK + +diff --git a/make/libmagickwand-7.mk b/make/libmagickwand-7.mk +index 7be2fb6..70a2cee 100644 +--- a/make/libmagickwand-7.mk ++++ b/make/libmagickwand-7.mk +@@ -14,7 +14,7 @@ LOCAL_C_INCLUDES := \ + + # always ignored in static builds + ifneq ($(STATIC_BUILD),true) +- LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -lz ++ LOCAL_LDLIBS := -llog -lz + endif + + LOCAL_SRC_FILES := \ +@@ -54,6 +54,27 @@ ifeq ($(OPENCL_BUILD),true) + LOCAL_SHARED_LIBRARIES += libopencl + endif + ++ifeq ($(TARGET_ARCH_ABI),arm64-v8a) ++ LOCAL_EXPORT_C_INCLUDES += $(IMAGE_MAGICK)/configs/arm64 ++ LOCAL_C_INCLUDES += $(IMAGE_MAGICK)/configs/arm64 ++else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) ++ LOCAL_EXPORT_C_INCLUDES += $(IMAGE_MAGICK)/configs/arm ++ LOCAL_C_INCLUDES += $(IMAGE_MAGICK)/configs/arm ++else ifeq ($(TARGET_ARCH_ABI),x86) ++ LOCAL_EXPORT_C_INCLUDES += $(IMAGE_MAGICK)/configs/x86 ++ LOCAL_C_INCLUDES += $(IMAGE_MAGICK)/configs/x86 ++else ifeq ($(TARGET_ARCH_ABI),x86_64) ++ LOCAL_EXPORT_C_INCLUDES += $(IMAGE_MAGICK)/configs/x86-64 ++ LOCAL_C_INCLUDES += $(IMAGE_MAGICK)/configs/x86-64 ++ ++ ifneq ($(STATIC_BUILD),true) ++ LOCAL_LDFLAGS += -latomic ++ endif ++ ++endif ++ ++LOCAL_EXPORT_C_INCLUDES += $(IMAGE_MAGICK) ++ + ifeq ($(BUILD_MAGICKWAND),true) + ifeq ($(STATIC_BUILD),true) + LOCAL_STATIC_LIBRARIES := \ diff --git a/build-aux/ndk-build-helper-1.mk b/build-aux/ndk-build-helper-1.mk index 898edf3a137..04acecb5b29 100644 --- a/build-aux/ndk-build-helper-1.mk +++ b/build-aux/ndk-build-helper-1.mk @@ -36,15 +36,11 @@ $(info Building $(build_kind)) $(info $(LOCAL_MODULE)) $(info $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES$(EMACS_ABI)))) -ifeq ($(LOCAL_MODULE_FILENAME),) ifeq ($(findstring lib,$(LOCAL_MODULE)),lib) NDK_SO_NAMES = $(LOCAL_MODULE)_emacs.so else NDK_SO_NAMES = lib$(LOCAL_MODULE)_emacs.so endif -else -NDK_SO_NAMES = $(LOCAL_MODULE_FILENAME).so -endif define add-so-name-1 # Now recurse over this module's dependencies. diff --git a/build-aux/ndk-build-helper-2.mk b/build-aux/ndk-build-helper-2.mk index 6be7f268fe7..59f77106784 100644 --- a/build-aux/ndk-build-helper-2.mk +++ b/build-aux/ndk-build-helper-2.mk @@ -30,16 +30,11 @@ $(info Building $(build_kind)) $(info $(LOCAL_MODULE)) $(info $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES$(EMACS_ABI)))) -ifeq ($(LOCAL_MODULE_FILENAME),) - ifeq ($(findstring lib,$(LOCAL_MODULE)),lib) NDK_A_NAMES = $(LOCAL_MODULE).a else NDK_A_NAMES = lib$(LOCAL_MODULE).a endif -else -NDK_A_NAMES = $(LOCAL_MODULE_FILENAME).a -endif define add-a-name ifeq ($(findstring lib,$(1)),lib) diff --git a/build-aux/ndk-build-helper.mk b/build-aux/ndk-build-helper.mk index 886459b1378..fe8a6a5119c 100644 --- a/build-aux/ndk-build-helper.mk +++ b/build-aux/ndk-build-helper.mk @@ -21,6 +21,9 @@ # See the text under ``NDK BUILD SYSTEM IMPLEMENTATION'' in # INSTALL.android for more details. +# TARGET_ARCH_ABI is the ABI that is being built for. +TARGET_ARCH_ABI := $(EMACS_ABI) + # NDK_LAST_MAKEFILE is the last Makefile that was included. NDK_LAST_MAKEFILE = $(lastword $(filter %Android.mk,$(MAKEFILE_LIST))) diff --git a/configure.ac b/configure.ac index 4aa8945b8ba..715d8790026 100644 --- a/configure.ac +++ b/configure.ac @@ -1078,6 +1078,8 @@ package will likely install on older systems but crash on startup.]) passthrough="$passthrough --with-selinux=$with_selinux" passthrough="$passthrough --with-modules=$with_modules" passthrough="$passthrough --with-tree-sitter=$with_tree_sitter" + passthrough="$passthrough --with-imagemagick=$with_imagemagick" + passthrough="$passthrough --with-lcms2=$with_lcms2" AS_IF([XCONFIGURE=android ANDROID_CC="$ANDROID_CC" \ ANDROID_SDK="$android_sdk" android_abi=$android_abi \ @@ -1152,13 +1154,13 @@ if test "$ANDROID" = "yes"; then with_selinux=no with_modules=no with_tree_sitter=no + with_imagemagick=no + with_lcms2=no fi with_rsvg=no - with_lcms2=no with_libsystemd=no with_cairo=no - with_imagemagick=no with_xft=no with_harfbuzz=no with_libotf=no @@ -3430,7 +3432,8 @@ AC_SUBST([SQLITE3_CFLAGS]) HAVE_IMAGEMAGICK=no if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" = "yes" || \ - test "${HAVE_BE_APP}" = "yes" || test "${window_system}" = "pgtk"; then + test "${HAVE_BE_APP}" = "yes" || test "${window_system}" = "pgtk" || \ + test "${REALLY_ANDROID}" = "yes"; then if test "${with_imagemagick}" != "no"; then if test -n "$BREW"; then # Homebrew doesn't link ImageMagick 6 by default, so make sure @@ -3453,14 +3456,23 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" OLD_LIBS=$LIBS CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" LIBS="$IMAGEMAGICK_LIBS $LIBS" - AC_CHECK_FUNCS([MagickRelinquishMemory MagickExportImagePixels \ - MagickMergeImageLayers MagickAutoOrientImage]) + if test "$REALLY_ANDROID" != "yes"; then + AC_CHECK_FUNCS([MagickRelinquishMemory MagickExportImagePixels \ + MagickMergeImageLayers MagickAutoOrientImage]) + else + # AC_CHECK_FUNCS doesn't work for Android dependencies because + # they are built alongside Emacs. + AC_CHECK_DECLS([MagickRelinquishMemory,MagickExportImagePixels, +MagickMergeImageLayers,MagickAutoOrientImage], + [], [], [#include ]) + fi CFLAGS=$OLD_CFLAGS LIBS=$OLD_LIBS # Check that ImageMagick links. It does not link on Fedora 25 # with './configure CC=clang', as pkg-config outputs flags like # -lomp that work for GCC but not Clang. - if test "$ac_cv_func_MagickRelinquishMemory" != yes; then + if test "$ac_cv_func_MagickRelinquishMemory" != yes \ + && test "$REALLY_ANDROID" != "yes"; then HAVE_IMAGEMAGICK=no fi fi diff --git a/cross/ndk-build/ndk-build-shared-library.mk b/cross/ndk-build/ndk-build-shared-library.mk index 44d5bbb1991..6d86bdb7e8c 100644 --- a/cross/ndk-build/ndk-build-shared-library.mk +++ b/cross/ndk-build/ndk-build-shared-library.mk @@ -27,6 +27,10 @@ eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) # same name but of different types. objname = $(1)-shared-$(subst /,_,$(2).o) +# LOCAL_SRC_FILES sometimes contains absolute file names. Filter them +# out with this function. +maybe-absolute = $(or $(and $(wildcard $(1)),$(1)),$(LOCAL_PATH)/$(1)) + # Here are the default flags to link shared libraries with. NDK_SO_DEFAULT_LDFLAGS := -lc -lm @@ -34,26 +38,26 @@ define single-object-target ifeq (x$(suffix $(1)),x.c) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_CFLAGS_$(LOCAL_MODULE)) $(NDK_BUILD_CFLAGS) $(call LOCAL_C_ADDITIONAL_FLAGS,$(1)) else ifeq (x$(suffix $(1)),x.$(or $(LOCAL_CPP_EXTENSION),cpp)) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_CFLAGS_$(LOCAL_MODULE)) $(NDK_BUILD_CFLAGS) $(NDK_CXXFLAGS_$(LOCAL_MODULE)) else ifneq ($(or $(call eq,x$(suffix $(1)),x.s),$(call eq,x$(suffix $(1)),x.S)),) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) else ifneq (x$(suffix $(1)),x.asm) ifeq (x$(suffix $(1)),x.cc) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_CFLAGS_$(LOCAL_MODULE)) $(NDK_BUILD_CFLAGS) $(NDK_CXXFLAGS_$(LOCAL_MODULE)) else @@ -137,9 +141,8 @@ ALL_SOURCE_FILES := $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) ALL_OBJECT_FILES$(LOCAL_MODULE) := # Now filter out code that is only built on systems with neon. -ifeq ($(NDK_BUILD_ABI),armeabi-v7a) +ifneq $(findstring v8,$(NDK_BUILD_ARCH)) ALL_SOURCE_FILES := $(filter-out %.neon,$(ALL_SOURCE_FILES)) -endif $(foreach source,$(ALL_SOURCE_FILES),$(eval $(call single-object-target,$(source)))) diff --git a/cross/ndk-build/ndk-build-static-library.mk b/cross/ndk-build/ndk-build-static-library.mk index c1584e789a7..3c68b902e6a 100644 --- a/cross/ndk-build/ndk-build-static-library.mk +++ b/cross/ndk-build/ndk-build-static-library.mk @@ -22,30 +22,34 @@ eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) objname = $(1)-static-$(subst /,_,$(2).o) +# LOCAL_SRC_FILES sometimes contains absolute file names. Filter them +# out with this function. +maybe-absolute = $(or $(and $(wildcard $(1)),$(1)),$(LOCAL_PATH)/$(1)) + define single-object-target ifeq (x$(suffix $(1)),x.c) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_BUILD_CFLAGS) $(NDK_CFLAGS_$(LOCAL_MODULE)) $(call LOCAL_C_ADDITIONAL_FLAGS,$(1)) else ifeq (x$(suffix $(1)),x.$(or $(LOCAL_CPP_EXTENSION),cpp)) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_BUILD_CFLAGS) $(NDK_CFLAGS_$(LOCAL_MODULE)) $(NDK_CXXFLAGS_$(LOCAL_MODULE)) else ifneq ($(or $(call eq,x$(suffix $(1)),x.s),$(call eq,x$(suffix $(1)),x.S)),) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) else ifneq (x$(suffix $(1)),x.asm) ifeq (x$(suffix $(1)),x.cc) -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_BUILD_CFLAGS) $(NDK_CFLAGS_$(LOCAL_MODULE)) $(NDK_CXXFLAGS_$(LOCAL_MODULE)) else @@ -63,7 +67,7 @@ ifeq ($(findstring x86,$(NDK_BUILD_ARCH)),) $$(error Trying to build nasm file on non-Intel platform!) else -$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) +$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(call maybe-absolute,$(1)) $(NDK_BUILD_NASM) -o $$@ -i $(LOCAL_PATH) -i $$(dir $$<) $(NDK_ASFLAGS_$(LOCAL_MODULE)) $$< endif @@ -102,15 +106,11 @@ NDK_CFLAGS ::= -mthumb endif endif -LOCAL_MODULE_FILENAME := $(strip $(LOCAL_MODULE_FILENAME)) - -ifndef LOCAL_MODULE_FILENAME ifeq ($(findstring lib,$(LOCAL_MODULE)),lib) LOCAL_MODULE_FILENAME := $(LOCAL_MODULE) else LOCAL_MODULE_FILENAME := lib$(LOCAL_MODULE) endif -endif LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).a @@ -123,9 +123,7 @@ include ndk-resolve.mk ALL_SOURCE_FILES := $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) # Now filter out code that is only built on systems with neon. -ifeq ($(NDK_BUILD_ABI),armeabi-v7a) ALL_SOURCE_FILES := $(filter-out %.neon,$(ALL_SOURCE_FILES)) -endif # This defines all dependencies. ALL_OBJECT_FILES$(LOCAL_MODULE) = diff --git a/cross/ndk-build/ndk-clear-vars.mk b/cross/ndk-build/ndk-clear-vars.mk index 5e8eff9f0ab..7309b7bb513 100644 --- a/cross/ndk-build/ndk-clear-vars.mk +++ b/cross/ndk-build/ndk-clear-vars.mk @@ -19,39 +19,39 @@ # variables, and then having those Makefiles include another makefile # which actually builds targets. -undefine LOCAL_MODULE -undefine LOCAL_MODULE_FILENAME -undefine LOCAL_SRC_FILES -undefine LOCAL_CPP_EXTENSION -undefine LOCAL_CPP_FEATURES -undefine LOCAL_C_INCLUDES -undefine LOCAL_CFLAGS -undefine LOCAL_CPPFLAGS -undefine LOCAL_STATIC_LIBRARIES -undefine LOCAL_SHARED_LIBRARIES -undefine LOCAL_WHOLE_STATIC_LIBRARIES -undefine LOCAL_LDLIBS -undefine LOCAL_LDFLAGS -undefine LOCAL_ALLOW_UNDEFINED_SYMBOLS -undefine LOCAL_ARM_MODE -undefine LOCAL_ARM_NEON -undefine LOCAL_DISABLE_FORMAT_STRING_CHECKS -undefine LOCAL_EXPORT_CFLAGS -undefine LOCAL_EXPORT_CPPFLAGS -undefine LOCAL_EXPORT_C_INCLUDES -undefine LOCAL_EXPORT_C_INCLUDE_DIRS -undefine LOCAL_EXPORT_LDFLAGS -undefine LOCAL_EXPORT_LDLIBS +LOCAL_MODULE := +LOCAL_MODULE_FILENAME := +LOCAL_SRC_FILES := +LOCAL_CPP_EXTENSION := +LOCAL_CPP_FEATURES := +LOCAL_C_INCLUDES := +LOCAL_CFLAGS := +LOCAL_CPPFLAGS := +LOCAL_STATIC_LIBRARIES := +LOCAL_SHARED_LIBRARIES := +LOCAL_WHOLE_STATIC_LIBRARIES := +LOCAL_LDLIBS := +LOCAL_LDFLAGS := +LOCAL_ALLOW_UNDEFINED_SYMBOLS := +LOCAL_ARM_MODE := +LOCAL_ARM_NEON := +LOCAL_DISABLE_FORMAT_STRING_CHECKS := +LOCAL_EXPORT_CFLAGS := +LOCAL_EXPORT_CPPFLAGS := +LOCAL_EXPORT_C_INCLUDES := +LOCAL_EXPORT_C_INCLUDE_DIRS := +LOCAL_EXPORT_LDFLAGS := +LOCAL_EXPORT_LDLIBS := # AOSP extensions. -undefine LOCAL_SRC_FILES_$(NDK_BUILD_ARCH) -undefine LOCAL_ASFLAGS_$(NDK_BUILD_ARCH) -undefine LOCAL_CFLAGS_$(NDK_BUILD_ARCH) -undefine LOCAL_ADDITIONAL_DEPENDENCIES -undefine LOCAL_CLANG_ASFLAGS_$(NDK_BUILD_ARCH) -undefine LOCAL_IS_HOST_MODULE +LOCAL_SRC_FILES_$(NDK_BUILD_ARCH) := +LOCAL_ASFLAGS_$(NDK_BUILD_ARCH) := +LOCAL_CFLAGS_$(NDK_BUILD_ARCH) := +LOCAL_ADDITIONAL_DEPENDENCIES := +LOCAL_CLANG_ASFLAGS_$(NDK_BUILD_ARCH) := +LOCAL_IS_HOST_MODULE := # Emacs extensions! -undefine LOCAL_ASM_RULE_DEFINED -undefine LOCAL_ASM_RULE -undefine LOCAL_C_ADDITIONAL_FLAGS +LOCAL_ASM_RULE_DEFINED := +LOCAL_ASM_RULE := +LOCAL_C_ADDITIONAL_FLAGS := diff --git a/m4/ndk-build.m4 b/m4/ndk-build.m4 index e1e4115ffca..7b5c45997b1 100644 --- a/m4/ndk-build.m4 +++ b/m4/ndk-build.m4 @@ -82,6 +82,7 @@ esac ndk_package_map="libwebpdemux:webpdemux libxml-2.0:libxml2 jansson:libjansson" ndk_package_map="$ndk_package_map sqlite3:libsqlite_static_minimal" +ndk_package_map="$ndk_package_map MagickWand:libmagickwand-7 lcms2:liblcms2" # Replace ndk_module with the appropriate Android module name if it is # found in ndk_package_map. @@ -111,7 +112,8 @@ ndk_parse_pkg_config_string () { ndk_input="$(printf "$ndk_input" | cut -s -f2- -d' ')" if test "$ndk_str" = ">=" || test "$ndk_str" = "<=" \ - || test "$ndk_str" = ">" || test "$ndk_str" = "<"; then + || test "$ndk_str" = ">" || test "$ndk_str" = "<" \ + || test "$ndk_str" = "!="; then ndk_input="$(printf "$ndk_input" | cut -s -f2- -d' ')" else ndk_modules="$ndk_modules$ndk_str " @@ -135,11 +137,12 @@ ndk_resolve_import_module () { # Read this Android.mk file. Set NDK_ROOT to /tmp: the Android in # tree build system sets it to a meaning value, but build files # just use it to test whether or not the NDK is being used. - ndk_commands=$($MAKE -s -f build-aux/ndk-build-helper.mk EMACS_SRCDIR=. \ - EMACS_ABI=$ndk_ABI ANDROID_MAKEFILE="$ndk_android_mk" \ - ANDROID_MODULE_DIRECTORY=$(dirname "$ndk_android_mk") \ - NDK_BUILD_DIR="$ndk_DIR" NDK_ROOT="/tmp" \ - | awk -f build-aux/ndk-module-extract.awk \ + ndk_commands=$(($MAKE -s -f build-aux/ndk-build-helper.mk EMACS_SRCDIR=. \ + EMACS_ABI=$ndk_ABI ANDROID_MAKEFILE="$ndk_android_mk" \ + ANDROID_MODULE_DIRECTORY=$(dirname "$ndk_android_mk") \ + NDK_BUILD_DIR="$ndk_DIR" NDK_ROOT="/tmp" \ + 2>&AS_MESSAGE_LOG_FD) \ + | awk -f build-aux/ndk-module-extract.awk \ MODULE="$ndk_module") AS_IF([test -n "${ndk_commands//\n }"], [eval "$ndk_commands"]) @@ -298,10 +301,11 @@ for ndk_android_mk in $ndk_module_files; do # Read this Android.mk file. Set NDK_ROOT to /tmp: the Android in # tree build system sets it to a meaning value, but build files just # use it to test whether or not the NDK is being used. - ndk_commands=$($MAKE -s -f build-aux/ndk-build-helper.mk EMACS_SRCDIR=. \ - EMACS_ABI=$ndk_ABI ANDROID_MAKEFILE="$ndk_android_mk" \ - ANDROID_MODULE_DIRECTORY=$(dirname "$ndk_android_mk") \ - NDK_BUILD_DIR="$ndk_DIR" NDK_ROOT="/tmp" \ + ndk_commands=$(($MAKE -s -f build-aux/ndk-build-helper.mk EMACS_SRCDIR=. \ + EMACS_ABI=$ndk_ABI ANDROID_MAKEFILE="$ndk_android_mk" \ + ANDROID_MODULE_DIRECTORY=$(dirname "$ndk_android_mk") \ + NDK_BUILD_DIR="$ndk_DIR" NDK_ROOT="/tmp" \ + 2>&AS_MESSAGE_LOG_FD) \ | awk -f build-aux/ndk-module-extract.awk \ MODULE="$ndk_module") -- 2.39.5