diff options
| author | Po Lu | 2023-01-29 11:21:07 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-29 11:21:07 +0800 |
| commit | 492aa74b13bb2c9d5a751d043fed2ef9e9365781 (patch) | |
| tree | 7cbece4e23483e52fe8bdb05cce8b67f9d133cff | |
| parent | f9e32ce1575da69cc3a9e4690b6df2dbee41d14d (diff) | |
| download | emacs-492aa74b13bb2c9d5a751d043fed2ef9e9365781.tar.gz emacs-492aa74b13bb2c9d5a751d043fed2ef9e9365781.zip | |
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.
| -rw-r--r-- | INSTALL.android | 26 | ||||
| -rw-r--r-- | cross/ndk-build/ndk-build-shared-library.mk | 11 | ||||
| -rw-r--r-- | cross/ndk-build/ndk-build-static-library.mk | 9 | ||||
| -rw-r--r-- | java/AndroidManifest.xml.in | 1 |
4 files changed, 41 insertions, 6 deletions
diff --git a/INSTALL.android b/INSTALL.android index d84d20b533b..eeeb14d78b3 100644 --- a/INSTALL.android +++ b/INSTALL.android | |||
| @@ -34,7 +34,8 @@ script like so: | |||
| 34 | Replacing the paths in the command line above with: | 34 | Replacing the paths in the command line above with: |
| 35 | 35 | ||
| 36 | - the path to the `android.jar' headers which come with the Android | 36 | - the path to the `android.jar' headers which come with the Android |
| 37 | SDK. They must correspond to Android version 13 or later. | 37 | SDK. They must correspond to Android version 13 (API level 33) or |
| 38 | later. | ||
| 38 | 39 | ||
| 39 | - the path to the C compiler in the Android NDK, for the machine you | 40 | - the path to the C compiler in the Android NDK, for the machine you |
| 40 | are building Emacs to run on. | 41 | are building Emacs to run on. |
| @@ -154,6 +155,8 @@ work, along with what has to be patched to make them work: | |||
| 154 | 155 | ||
| 155 | libpng - https://android.googlesource.com/platform/external/libpng | 156 | libpng - https://android.googlesource.com/platform/external/libpng |
| 156 | libwebp - https://android.googlesource.com/platform/external/webp | 157 | libwebp - https://android.googlesource.com/platform/external/webp |
| 158 | (You must apply the patch at the end of this file for the resulting | ||
| 159 | binary to work on armv7 devices.) | ||
| 157 | giflib - https://android.googlesource.com/platform/external/giflib | 160 | giflib - https://android.googlesource.com/platform/external/giflib |
| 158 | (You must add LOCAL_EXPORT_CFLAGS := -I$(LOCAL_PATH) before | 161 | (You must add LOCAL_EXPORT_CFLAGS := -I$(LOCAL_PATH) before |
| 159 | its Android.mk includes $(BUILD_STATIC_LIBRARY)) | 162 | its Android.mk includes $(BUILD_STATIC_LIBRARY)) |
| @@ -639,3 +642,24 @@ index bf277d2..36734d9 100644 | |||
| 639 | LOCAL_MODULE:= libsqlite_static_minimal | 642 | LOCAL_MODULE:= libsqlite_static_minimal |
| 640 | LOCAL_SDK_VERSION := 23 | 643 | LOCAL_SDK_VERSION := 23 |
| 641 | include $(BUILD_STATIC_LIBRARY) | 644 | include $(BUILD_STATIC_LIBRARY) |
| 645 | |||
| 646 | PATCH FOR WEBP | ||
| 647 | |||
| 648 | diff --git a/Android.mk b/Android.mk | ||
| 649 | index c7bcb0f5..d4da1704 100644 | ||
| 650 | --- a/Android.mk | ||
| 651 | +++ b/Android.mk | ||
| 652 | @@ -28,9 +28,10 @@ ifneq ($(findstring armeabi-v7a, $(TARGET_ARCH_ABI)),) | ||
| 653 | # Setting LOCAL_ARM_NEON will enable -mfpu=neon which may cause illegal | ||
| 654 | # instructions to be generated for armv7a code. Instead target the neon code | ||
| 655 | # specifically. | ||
| 656 | - NEON := c.neon | ||
| 657 | - USE_CPUFEATURES := yes | ||
| 658 | - WEBP_CFLAGS += -DHAVE_CPU_FEATURES_H | ||
| 659 | + # NEON := c.neon | ||
| 660 | + # USE_CPUFEATURES := yes | ||
| 661 | + # WEBP_CFLAGS += -DHAVE_CPU_FEATURES_H | ||
| 662 | + NEON := c | ||
| 663 | else | ||
| 664 | NEON := c | ||
| 665 | endif | ||
diff --git a/cross/ndk-build/ndk-build-shared-library.mk b/cross/ndk-build/ndk-build-shared-library.mk index f169e89d058..a63bf90b042 100644 --- a/cross/ndk-build/ndk-build-shared-library.mk +++ b/cross/ndk-build/ndk-build-shared-library.mk | |||
| @@ -50,7 +50,7 @@ $(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) | |||
| 50 | $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) | 50 | $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) |
| 51 | 51 | ||
| 52 | else | 52 | else |
| 53 | ifneq (x$(suffix $(1)),x.asm) | 53 | ifneq (x.$(suffix $(1)),x.asm) |
| 54 | $$(error Unsupported suffix: $(suffix $(1))) | 54 | $$(error Unsupported suffix: $(suffix $(1))) |
| 55 | else | 55 | else |
| 56 | ifneq (x$(LOCAL_ASM_RULE_DEFINED),x) | 56 | ifneq (x$(LOCAL_ASM_RULE_DEFINED),x) |
| @@ -124,10 +124,15 @@ LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).so | |||
| 124 | include ndk-resolve.mk | 124 | include ndk-resolve.mk |
| 125 | 125 | ||
| 126 | # Then define rules to build all objects. | 126 | # Then define rules to build all objects. |
| 127 | ALL_SOURCE_FILES = $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) | 127 | ALL_SOURCE_FILES := $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) |
| 128 | 128 | ||
| 129 | # This defines all dependencies. | 129 | # This defines all dependencies. |
| 130 | ALL_OBJECT_FILES$(LOCAL_MODULE) = | 130 | ALL_OBJECT_FILES$(LOCAL_MODULE) := |
| 131 | |||
| 132 | # Now filter out code that is only built on systems with neon. | ||
| 133 | ifeq ($(NDK_BUILD_ABI),armeabi-v7a) | ||
| 134 | ALL_SOURCE_FILES := $(filter-out %.neon,$(ALL_SOURCE_FILES)) | ||
| 135 | endif | ||
| 131 | 136 | ||
| 132 | $(foreach source,$(ALL_SOURCE_FILES),$(eval $(call single-object-target,$(source)))) | 137 | $(foreach source,$(ALL_SOURCE_FILES),$(eval $(call single-object-target,$(source)))) |
| 133 | 138 | ||
diff --git a/cross/ndk-build/ndk-build-static-library.mk b/cross/ndk-build/ndk-build-static-library.mk index d5a8e93800d..e6e2d2810fb 100644 --- a/cross/ndk-build/ndk-build-static-library.mk +++ b/cross/ndk-build/ndk-build-static-library.mk | |||
| @@ -42,7 +42,7 @@ $(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1) | |||
| 42 | $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) | 42 | $(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE)) |
| 43 | 43 | ||
| 44 | else | 44 | else |
| 45 | ifneq (x$(suffix $(1)),x.asm) | 45 | ifneq (x.$(suffix $(1)),x.asm) |
| 46 | $$(error Unsupported suffix: $(suffix $(1))) | 46 | $$(error Unsupported suffix: $(suffix $(1))) |
| 47 | else | 47 | else |
| 48 | ifneq (x$(LOCAL_ASM_RULE_DEFINED),x) | 48 | ifneq (x$(LOCAL_ASM_RULE_DEFINED),x) |
| @@ -113,7 +113,12 @@ LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).a | |||
| 113 | include ndk-resolve.mk | 113 | include ndk-resolve.mk |
| 114 | 114 | ||
| 115 | # Then define rules to build all objects. | 115 | # Then define rules to build all objects. |
| 116 | ALL_SOURCE_FILES = $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) | 116 | ALL_SOURCE_FILES := $(LOCAL_SRC_FILES) $(LOCAL_SRC_FILES_$(NDK_BUILD_ARCH)) |
| 117 | |||
| 118 | # Now filter out code that is only built on systems with neon. | ||
| 119 | ifeq ($(NDK_BUILD_ABI),armeabi-v7a) | ||
| 120 | ALL_SOURCE_FILES := $(filter-out %.neon,$(ALL_SOURCE_FILES)) | ||
| 121 | endif | ||
| 117 | 122 | ||
| 118 | # This defines all dependencies. | 123 | # This defines all dependencies. |
| 119 | ALL_OBJECT_FILES$(LOCAL_MODULE) = | 124 | ALL_OBJECT_FILES$(LOCAL_MODULE) = |
diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in index 09e4e788e0b..3833e1735c3 100644 --- a/java/AndroidManifest.xml.in +++ b/java/AndroidManifest.xml.in | |||
| @@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. --> | |||
| 24 | package="org.gnu.emacs" | 24 | package="org.gnu.emacs" |
| 25 | android:targetSandboxVersion="1" | 25 | android:targetSandboxVersion="1" |
| 26 | android:installLocation="auto" | 26 | android:installLocation="auto" |
| 27 | android:versionCode="@emacs_major_version@" | ||
| 27 | android:versionName="@version@"> | 28 | android:versionName="@version@"> |
| 28 | 29 | ||
| 29 | <!-- Paste in every permission in existence so Emacs can do | 30 | <!-- Paste in every permission in existence so Emacs can do |