summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-01-24 19:10:58 +0800
committerPo Lu <luangruo@yahoo.com>2023-01-24 19:10:58 +0800
commit54836c47c76f655a7e3d6cf28f0cf27b8d9f3cdd (patch)
tree0ac362c622f571a738593afff8f1a8fbaadaac46 /build-aux
parent56e55a80080f78754db6f385d574d17c3631ee30 (diff)
downloademacs-54836c47c76f655a7e3d6cf28f0cf27b8d9f3cdd.tar.gz
Enable libjpeg on Android
* INSTALL.android: Update documentation. * build-aux/ndk-build-helper-1.mk: When building shared libraries, do not link libemacs.so with dependent archive files. * build-aux/ndk-build-helper-2.mk: Add whole archive dependencies as well. * configure.ac (HAVE_JPEG): Enable on Android. * cross/ndk-build/ndk-build-shared-library.mk: Link the shared object with archive file dependencies. * cross/ndk-build/ndk-build-static-library.mk: Build all code position-independently. * cross/ndk-build/ndk-resolve.mk: Separately resolve a names of archive and whole archive dependencies. * src/Makefile.in (JPEG_CFLAGS): New variable. (EMACS_CFLAGS): Add it.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/ndk-build-helper-1.mk22
-rw-r--r--build-aux/ndk-build-helper-2.mk2
2 files changed, 4 insertions, 20 deletions
diff --git a/build-aux/ndk-build-helper-1.mk b/build-aux/ndk-build-helper-1.mk
index d20f7d4472f..86e3ebd6558 100644
--- a/build-aux/ndk-build-helper-1.mk
+++ b/build-aux/ndk-build-helper-1.mk
@@ -47,22 +47,6 @@ else
NDK_SO_NAMES = $(LOCAL_MODULE_FILENAME).so
endif
-define add-a-name
-ifeq ($(findstring lib,$(1)),lib)
-NDK_A_NAME = $(1).a
-else
-NDK_A_NAME = lib$(1).a
-endif
-
-ifeq ($$(NDK_A_NAMES:$$(NDK_A_NAME)=),$$(NDK_A_NAMES))
-NDK_A_NAMES := $$(NDK_A_NAMES) $$(NDK_A_NAME)
-
-# Now recurse over this module's dependencies.
-$$(foreach module,$$(filter-out $$(SYSTEM_LIBRARIES), $$(NDK_$(1)_STATIC_LIBRARIES)),$$(eval $$(call add-a-name,$$(module))))
-$$(foreach module,$$(filter-out $$(SYSTEM_LIBRARIES), $$(NDK_$(1)_SHARED_LIBRARIES)),$$(eval $$(call add-so-name,$$(module))))
-endif
-endef
-
define add-so-name
ifeq ($(findstring lib,$(1)),lib)
NDK_SO_NAME = $(1)_emacs.so
@@ -74,17 +58,17 @@ ifeq ($$(NDK_SO_NAMES:$$(NDK_SO_NAME)=),$$(NDK_SO_NAMES))
NDK_SO_NAMES := $$(NDK_SO_NAMES) $$(NDK_SO_NAME)
# Now recurse over this module's dependencies.
-$$(foreach module,$$(filter-out $$(SYSTEM_LIBRARIES), $$(NDK_$(1)_STATIC_LIBRARIES)),$$(eval $$(call add-a-name,$$(module))))
$$(foreach module,$$(filter-out $$(SYSTEM_LIBRARIES), $$(NDK_$(1)_SHARED_LIBRARIES)),$$(eval $$(call add-so-name,$$(module))))
endif
endef
# Resolve additional dependencies based on LOCAL_STATIC_LIBRARIES and
-# LOCAL_SHARED_LIBRARIES.
+# LOCAL_SHARED_LIBRARIES. Static library dependencies can be ignored
+# while building a shared library, as they will be linked in to the
+# resulting shared object file later.
SYSTEM_LIBRARIES = z libz libc c
-$(foreach module,$(filter-out $(SYSTEM_LIBRARIES), $(LOCAL_STATIC_LIBRARIES)),$(eval $(call add-a-name,$(module))))
$(foreach module,$(filter-out $(SYSTEM_LIBRARIES), $(LOCAL_SHARED_LIBRARIES)),$(eval $(call add-so-name,$(module))))
$(info $(LOCAL_EXPORT_LDFLAGS) $(abspath $(addprefix $(NDK_BUILD_DIR)/,$(NDK_A_NAMES))) -L$(abspath $(NDK_BUILD_DIR)) $(foreach soname,$(NDK_SO_NAMES),-l:$(soname)))
diff --git a/build-aux/ndk-build-helper-2.mk b/build-aux/ndk-build-helper-2.mk
index 82c1d53c7d0..bd50e8b3efa 100644
--- a/build-aux/ndk-build-helper-2.mk
+++ b/build-aux/ndk-build-helper-2.mk
@@ -79,7 +79,7 @@ endef
SYSTEM_LIBRARIES = z libz
-$(foreach module,$(filter-out $(SYSTEM_LIBRARIES), $(LOCAL_STATIC_LIBRARIES)),$(eval $(call add-a-name,$(module))))
+$(foreach module,$(filter-out $(SYSTEM_LIBRARIES), $(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES)),$(eval $(call add-a-name,$(module))))
$(foreach module,$(filter-out $(SYSTEM_LIBRARIES), $(LOCAL_SHARED_LIBRARIES)),$(eval $(call add-so-name,$(module))))
$(info $(LOCAL_EXPORT_LDFLAGS) $(abspath $(addprefix $(NDK_BUILD_DIR)/,$(NDK_A_NAMES))) $(and $(NDK_SO_NAMES), -L$(abspath $(NDK_BUILD_DIR)) $(foreach soname,$(NDK_SO_NAMES),-l:$(soname))))