1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Update Android port

* INSTALL.android (module_target): Clarify documentation.
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Fix building Neon objects.
* java/AndroidManifest.xml.in: Add a version code.
This commit is contained in:
Po Lu 2023-01-29 11:21:07 +08:00
parent f9e32ce157
commit 492aa74b13
4 changed files with 41 additions and 6 deletions

View file

@ -34,7 +34,8 @@ script like so:
Replacing the paths in the command line above with:
- the path to the `android.jar' headers which come with the Android
SDK. They must correspond to Android version 13 or later.
SDK. They must correspond to Android version 13 (API level 33) or
later.
- the path to the C compiler in the Android NDK, for the machine you
are building Emacs to run on.
@ -154,6 +155,8 @@ work, along with what has to be patched to make them work:
libpng - https://android.googlesource.com/platform/external/libpng
libwebp - https://android.googlesource.com/platform/external/webp
(You must apply the patch at the end of this file for the resulting
binary to work on armv7 devices.)
giflib - https://android.googlesource.com/platform/external/giflib
(You must add LOCAL_EXPORT_CFLAGS := -I$(LOCAL_PATH) before
its Android.mk includes $(BUILD_STATIC_LIBRARY))
@ -639,3 +642,24 @@ index bf277d2..36734d9 100644
LOCAL_MODULE:= libsqlite_static_minimal
LOCAL_SDK_VERSION := 23
include $(BUILD_STATIC_LIBRARY)
PATCH FOR WEBP
diff --git a/Android.mk b/Android.mk
index c7bcb0f5..d4da1704 100644
--- a/Android.mk
+++ b/Android.mk
@@ -28,9 +28,10 @@ ifneq ($(findstring armeabi-v7a, $(TARGET_ARCH_ABI)),)
# Setting LOCAL_ARM_NEON will enable -mfpu=neon which may cause illegal
# instructions to be generated for armv7a code. Instead target the neon code
# specifically.
- NEON := c.neon
- USE_CPUFEATURES := yes
- WEBP_CFLAGS += -DHAVE_CPU_FEATURES_H
+ # NEON := c.neon
+ # USE_CPUFEATURES := yes
+ # WEBP_CFLAGS += -DHAVE_CPU_FEATURES_H
+ NEON := c
else
NEON := c
endif

View file

@ -50,7 +50,7 @@ $(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1)
$(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE))
else
ifneq (x$(suffix $(1)),x.asm)
ifneq (x.$(suffix $(1)),x.asm)
$$(error Unsupported suffix: $(suffix $(1)))
else
ifneq (x$(LOCAL_ASM_RULE_DEFINED),x)
@ -124,10 +124,15 @@ LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).so
include ndk-resolve.mk
# Then define rules to build all objects.
ALL_SOURCE_FILES = $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH))
ALL_SOURCE_FILES := $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH))
# This defines all dependencies.
ALL_OBJECT_FILES$(LOCAL_MODULE) =
ALL_OBJECT_FILES$(LOCAL_MODULE) :=
# 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
$(foreach source,$(ALL_SOURCE_FILES),$(eval $(call single-object-target,$(source))))

View file

@ -42,7 +42,7 @@ $(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1)
$(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE))
else
ifneq (x$(suffix $(1)),x.asm)
ifneq (x.$(suffix $(1)),x.asm)
$$(error Unsupported suffix: $(suffix $(1)))
else
ifneq (x$(LOCAL_ASM_RULE_DEFINED),x)
@ -113,7 +113,12 @@ LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).a
include ndk-resolve.mk
# Then define rules to build all objects.
ALL_SOURCE_FILES = $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH))
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) =

View file

@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
package="org.gnu.emacs"
android:targetSandboxVersion="1"
android:installLocation="auto"
android:versionCode="@emacs_major_version@"
android:versionName="@version@">
<!-- Paste in every permission in existence so Emacs can do