* .gitignore: Update with new files. Do not ignore std*.in.h. * INSTALL.android: Explain how to build Emacs with external dependencies. * Makefile.in (xcompile, cross): Rename to `cross'. (clean_dirs): Clean cross, not xcompile. * README: Document new directories. * build-aux/ndk-build-helper-1.mk (build_kind, NDK_SO_NAMES): * build-aux/ndk-build-helper-2.mk (build_kind, NDK_SO_NAMES): * build-aux/ndk-build-helper-3.mk (build_kind): * build-aux/ndk-build-helper-4.mk: * build-aux/ndk-build-helper.mk (NDK_BUILD_DIR, my-dir): * build-aux/ndk-module-extract.awk: New files. * configure.ac: Set up libgif, libwebp, and libpng for ndk-build. * cross/ndk-build/Makefile.in (srcdir, NDK_BUILD_ANDROID_MK): * cross/ndk-build/ndk-build-executable.mk: * cross/ndk-build/ndk-build-shared-library.mk (eq, objname): * cross/ndk-build/ndk-build-static-library.mk (eq, objname): * cross/ndk-build/ndk-build.in (NDK_BUILD_MODULES): * cross/ndk-build/ndk-build.mk.in (NDK_BUILD_MODULES) (NDK_BUILD_SHARED): * cross/ndk-build/ndk-clear-vars.mk: * cross/ndk-build/ndk-prebuilt-shared-library.mk: * cross/ndk-build/ndk-prebuilt-static-library.mk: New files. * doc/emacs/android.texi (Android, Android Environment): Document clipboard support on Android. * doc/emacs/emacs.texi (Top): Update menus. * etc/MACHINES: Document Android. * java/AndroidManifest.xml.in: Respect new `--with-android-debug' option. * java/Makefile.in (CROSS_BINS, CROSS_LIBS): Adjust for rename. Include ndk-build.mk.:(emacs.apk-in): Depend on shared libraries. Then, package shared libraries. * java/org/gnu/emacs/EmacsClipboard.java (EmacsClipboard): New class. * java/org/gnu/emacs/EmacsFontDriver.java: Update comment to say this is unused. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function `sendExpose'. * java/org/gnu/emacs/EmacsSdk11Clipboard.java (EmacsSdk11Clipboard): * java/org/gnu/emacs/EmacsSdk8Clipboard.java (EmacsSdk8Clipboard): New classes. * java/org/gnu/emacs/EmacsView.java (EmacsView, handleDirtyBitmap) (onDetachedFromWindow): When window is reattached, expose the frame. * lib/Makefile.in (VPATH): (ALL_CFLAGS): Adjust for rename. * lisp/term/android-win.el (android-clipboard-exists-p) (android-get-clipboard, android-set-clipboard) (android-clipboard-owner-p, android-primary-selection) (android-get-clipboard-1, android-get-primary) (android-selection-bounds, android-encode-select-string) (gui-backend-get-selection, gui-backend-selection-exists-p) (gui-backend-selection-owner-p, gui-backend-set-selection): New functions. * m4/ndk-build.m4: New file. * src/Makefile.in (GIF_CFLAGS, ANDROID_LDFLAGS): New variables. (EMACS_CFLAGS): Add GIF_CFLAGS. Include ndk-build.mk. (libemacs.so): Depend on and link with required libraries. * src/android.c (android_check_compressed_file): New function. (android_open): Work around Android platform bug. (sendExpose): New function. (android_readdir): Set d_type if this is a directory. * src/androidgui.h (enum android_event_type) (struct android_expose_event, union android_event): Add expose events. * src/androidselect.c (struct android_emacs_clipboard) (android_init_emacs_clipboard, Fandroid_clipboard_owner_p) (Fandroid_set_clipboard, Fandroid_get_clipboard) (Fandroid_clipboard_exists_p, init_androidselect) (syms_of_androidselect): New file. * src/androidterm.c (handle_one_android_event): Handle exposures. * src/androidterm.h: Update prototypes. * src/emacs.c (android_emacs_init): Initialize androidselect.
83 lines
2.8 KiB
Makefile
83 lines
2.8 KiB
Makefile
# Copyright 2023 Free Software Foundation, Inc.
|
|
|
|
# This file is part of GNU Emacs.
|
|
|
|
# GNU Emacs is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
# GNU Emacs is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
# ndk-build works by including a bunch of Makefiles which set
|
|
# variables, and then having those Makefiles include another makefile
|
|
# which actually builds targets.
|
|
|
|
eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
|
|
objname = $(1)-$(subst /,_,$(2).o)
|
|
|
|
define single-object-target
|
|
|
|
ifeq (x$(suffix $(1)),x.c)
|
|
|
|
$(call objname,$(LOCAL_MODULE),$(basename $(1))): $(LOCAL_PATH)/$(1)
|
|
$(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_CFLAGS_$(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)
|
|
$(NDK_BUILD_CC) -c $$< -o $$@ $(NDK_ASFLAGS_$(LOCAL_MODULE))
|
|
|
|
else
|
|
$$(error Unsupported suffix: $(suffix $(1)))
|
|
endif
|
|
endif
|
|
|
|
ALL_OBJECT_FILES$(LOCAL_MODULE) += $(call objname,$(LOCAL_MODULE),$(basename $(1)))
|
|
|
|
endef
|
|
|
|
NDK_CFLAGS_$(LOCAL_MODULE) := $(addprefix -I,$(addprefix $(LOCAL_PATH),$(LOCAL_C_INCLUDES)))
|
|
NDK_CFLAGS_$(LOCAL_MODULE) ::= -fPIC -iquote $(LOCAL_EXPORT_CFLAGS) $(LOCAL_PATH) $(LOCAL_CFLAGS)
|
|
NDK_LDFLAGS_$(LOCAL_MODULE) := $(LOCAL_LDLIBS)
|
|
NDK_LDFLAGS_$(LOCAL_MODULE) := $(LOCAL_LDFLAGS)
|
|
ALL_OBJECT_FILES_$(LOCAL_MODULE) :=
|
|
|
|
ifeq ($(NDK_BUILD_ARCH)$(NDK_ARM_MODE),armarm)
|
|
NDK_CFLAGS ::= -marm
|
|
else
|
|
ifeq ($(NDK_BUILD_ARCH),arm)
|
|
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)_emacs
|
|
else
|
|
LOCAL_MODULE_FILENAME := lib$(LOCAL_MODULE)_emacs
|
|
endif
|
|
endif
|
|
|
|
# Since a shared library is being built, suffix the library with
|
|
# _emacs. Otherwise, libraries already on the system will be found
|
|
# first, with potentially nasty consequences.
|
|
|
|
LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME).so
|
|
|
|
# Then define rules to build all objects.
|
|
ALL_SOURCE_FILES = $(LOCAL_SRC_FILES)
|
|
$(foreach source,$(ALL_SOURCE_FILES),$(eval $(call single-object-target,$(source))))
|
|
|
|
# Now define the rule to build the shared library.
|
|
$(LOCAL_MODULE_FILENAME): $(ALL_OBJECT_FILES$(LOCAL_MODULE))
|
|
$(NDK_BUILD_CC) $^ -o $@ -shared $(NDK_LDFLAGS$(LOCAL_MODULE))
|