1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

28 Commits

Author SHA1 Message Date
Po Lu
a48f062e36 Minor enhancements to the Android build system
* build-aux/ndk-build-helper-1.mk:

* build-aux/ndk-build-helper-2.mk:

* cross/ndk-build/ndk-build-shared-library.mk:

* cross/ndk-build/ndk-build-static-library.mk:

* cross/ndk-build/ndk-resolve.mk
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)):
(NDK_LOCAL_SO_NAMES_$(LOCAL_MODULE)):
(NDK_LOCAL_A_NAMES_$(LOCAL_MODULE)): Reinforce tests for string
prefixes.

* m4/ndk-build.m4 (ndk_INIT): Guarantee that a module's
dependencies are recorded.

* configure.ac (XCONFIGURE): Prepare for building librsvg.
2024-06-06 20:56:33 +08:00
Po Lu
3bcdf010a9 Generate Android shared library list automatically
* .gitignore: Ignore new generated files.

* cross/Makefile.in (src/Makefile): Remove leftover
specification of the source Gnulib directory.

* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_READELF): New
variable.

* java/Makefile.in (CONFIG_FILE, ALL_DEPENDENCIES, READELF)
(cf-stamp-1, cf-stamp): New variables and rules; compute the set
of library files in the order of loading and generate a file
with this information.
(ALL_CLASS_FILES): New variable; if builddir is not srcdir,
$($(CONFIG_FILE), $(CLASS_FILES)): Depend on EmacsConfig.java.
add generated files in the build directory.
(classes.dex): Adjust to match.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
<static initializer>: Load shared libraries from
EMACS_SHARED_LIBRARIES rather than a hard-coded list.

* m4/ndk-build.m4 (ndk_INIT): Search for readelf...
(ndk_CHECK_MODULES): ...and substitute its path as
NDK_BUILD_READELF.
2024-04-22 16:30:15 +08:00
Po Lu
7a0f4de3c1 Improve C++ standard library detection on Android
* configure.ac: Stop relaying --with-ndk-cxx-shared to the
nested invocation of configure.

* build-aux/ndk-build-helper-1.mk (SYSTEM_LIBRARIES):

* build-aux/ndk-build-helper-2.mk (SYSTEM_LIBRARIES): Insert all
of the C++ libraries available on Android.

* configure.ac: Call ndk_LATE and ndk_LATE_EARLY within if
statement at toplevel, averting needless calls to AC_PROG_CXX.

* cross/ndk-build/Makefile.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS):

* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS): New variables.

* cross/ndk-build/ndk-resolve.mk (NDK_SYSTEM_LIBRARIES):
Introduce several other C++ libraries sometimes present on
Android.
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Insert NDK_BUILD_CXX_STL
when any of these new C++ libraries are requested.

* m4/ndk-build.m4: Completely rewrite C++ compiler and library
detection.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Attempt to
load more libraries from static initializer.

* java/INSTALL: Remove obsolete information.
2024-03-17 19:34:09 +08:00
Po Lu
070cb32463 ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
Stefan Kangas
06a12b0ccc ; Fix typos 2023-12-10 13:22:04 +01:00
Po Lu
b5bf4dc5b5 Fix x86_64 builds of libjpeg on Android
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Specify right ELF
format for 64 bit executables.
2023-03-04 21:05:02 +08:00
Po Lu
8f3f9c2550 Fix calls to nasm in cross/ndk-build
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Ensure nasm
generates ELF objects.
2023-03-04 21:01:28 +08:00
Po Lu
0e995d06a8 Improve support for building Android C++ dependencies
* configure.ac: Call ndk_LATE after gl_EARLY.
* cross/ndk-build/Makefile.in (NDK_BUILD_CXX): New variable.
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Use it.
* java/INSTALL: Describe how to build C++ dependencies.
* m4/ndk-build.m4 (ndk_LATE): New macro.
(ndk_INIT): Try to find a suitable C++ compiler.
(ndk_CHECK_MODULES): Make sure the C++ compiler works before
allowing C++ dependencies.
2023-03-04 11:19:25 +08:00
Po Lu
0d363aded1 Fix cross-compilation of C++ code with old NDK versions
* cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS_CXX): New variable.
* cross/ndk-build/ndk-build-shared-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))):
* cross/ndk-build/ndk-build-static-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))): Use it to build
C++ code.
2023-03-04 08:45:11 +08:00
Po Lu
ece6d61301 Fix out-of-tree builds with native dependencies
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk: Include
ndk-resolve.mk in srcdir.
2023-03-03 21:22:00 +08:00
Po Lu
468e8d7322 ; * cross/ndk-build/README: Update accordingly. 2023-03-03 21:14:08 +08:00
Po Lu
960230d88d Summary: Update Android port
* INSTALL: Document where to find Android installation
instructions.
* configure.ac (CHECK_LISP_OBJECT_TYPE): Pacify
-Wsuggest-attribute=noreturn only on Android.
* cross/ndk-build/README: New file.
* doc/emacs/android.texi (Android):
* doc/emacs/emacs.texi (Top):
* doc/emacs/input.texi (Other Input Devices): Untabify menus.
* etc/NEWS: Move INSTALL.android to java/INSTALL.
* java/INSTALL: New file.
* java/README:
* src/coding.c (from_unicode_buffer): Make Android specific code
only build on Android.
2023-03-02 18:31:35 +08:00
Po Lu
351813556d Fix ImageMagick build on Android
* INSTALL.android (-linux_arm_sources):
* build-aux/ndk-build-helper-1.mk:
(NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES)::(NDK_CXX_FLAG_$(LOCAL_MODULE)):
* build-aux/ndk-build-helper-2.mk:
(NDK_$(LOCAL_MODULE)_STATIC_LIBRARIES)::(NDK_CXX_FLAG_$(LOCAL_MODULE)):
* 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))))::(ALL_OBJECT_FILES$(LOCAL_MODULE)):
(ALL_SOURCE_FILES): Update ImageMagick build instructions and
C++ module detection.
2023-02-23 21:31:42 +08:00
Po Lu
1d84465236 ; Fix typo
* cross/ndk-build/ndk-build-shared-library.mk: Fix typo.
2023-02-22 21:24:59 +08:00
Po Lu
767da53fa3 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
2023-02-22 21:20:30 +08:00
Po Lu
585ee91b21 More fixes to parallel Make
* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_MODULES)
(NDK_BUILD_SHARED, NDK_BUILD_STATIC): Define group rule to build
all files so that they are built within one make process.
* java/Makefile.in: Reorganize cross compilation and make sure
there is only one make subprocess for each subdirectory of
cross.
2023-02-19 21:52:21 +08:00
Po Lu
e1c7b8ad61 Adjust ndk-build implementation for old NDK versions
* configure.ac: Pass ANDROID_CFLAGS to ndk_INIT.
* cross/ndk-build/Makefile.in (NDK_BUILD_CFLAGS):
* cross/ndk-build/ndk-build-shared-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))):
($$(error Unsupported suffix):
* cross/ndk-build/ndk-build-static-library.mk
($(call objname,$(LOCAL_MODULE),$(basename $(1)))):
($$(error Unsupported suffix): Use NDK_BUILD_CFLAGS.
* m4/ndk-build.m4 (ndk_INIT): Accept cflags.
(ndk_CONFIG_FILES): Export NDK_BUILD_CFLAGS.
2023-02-06 22:26:45 +08:00
Po Lu
98c90135fe Update Android port
* INSTALL.android: Explain how to build selinux.
* configure.ac: Enable selinux on Android.
* cross/ndk-build/ndk-build-shared-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)):
* cross/ndk-build/ndk-build-static-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix)::(NDK_CFLAGS_$(LOCAL_MODULE)): Correctly
handle files with a .cc suffix, and clang-specific asflags.
* cross/ndk-build/ndk-clear-vars.mk: Handle AOSP extensions
LOCAL_ADDITIONAL_DEPENDENCIES,
LOCAL_CLANG_ASFLAGS_$(NDK_BUILD_ARCH) and LOCAL_IS_HOST_MODULE.

* doc/emacs/android.texi (Android Startup): Explain emacsclient
wrapper.

* java/org/gnu/emacs/EmacsView.java (EmacsView): New flag
`isCurrentlyTextEditor'.
(showOnScreenKeyboard, hideOnScreenKeyboard): Set as
appropriate.
(onCheckIsTextEditor): Return its value.

* lisp/touch-screen.el (touch-screen-handle-scroll): Don't ding
at buffer limits.
* m4/ndk-build.m4: Improve doc.

* src/Makefile.in (LIBSELINUX_CFLAGS): New variable.
(EMACS_CFLAGS): Add it.
2023-02-05 23:02:14 +08:00
Po Lu
f69583941c Update Android port
* cross/ndk-build/ndk-build-shared-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1)))):
* cross/ndk-build/ndk-build-static-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1)))): Revert broken typo
fixes.
* src/sfnt.c (TEST_STATIC): Define ARRAYELTS.
(sfnt_table_names): New CVT and FPGM tables.
(sfnt_decompose_compound_glyph, sfnt_decompose_glyph)
(struct sfnt_large_integer, sfnt_multiply_divide_1)
(sfnt_count_leading_zero_bits, sfnt_multiply_divide_2)
(sfnt_multiply_divide, sfnt_mul_fixed, sfnt_div_fixed)
(sfnt_ceil_fixed, sfnt_build_glyph_outline): Fix fixed point
multiplication routines on systems without 64 bit long long
type.
(SFNT_ENABLE_HINTING, struct sfnt_test_dcontext, sfnt_test_move_to)
(sfnt_test_line_to, sfnt_test_curve_to, sfnt_test_get_glyph)
(sfnt_test_free_glyph, sfnt_test_span, sfnt_test_edge_ignore)
(sfnt_read_cvt_table, sfnt_test_edge, sfnt_test_raster)
(sfnt_read_fpgm_table, struct sfnt_unit_vector)
(struct sfnt_interpreter_definition)
(struct sfnt_interpreter_graphics_state, struct sfnt_interpreter)
(sfnt_div_f26dot6, sfnt_mul_f26dot6, sfnt_floor_f26dot6)
(sfnt_ceil_f26dot6, sfnt_round_f26dot6, sfnt_init_graphics_state)
(sfnt_make_interpreter, enum sfnt_interpreter_run_context)
(sfnt_interpret_trap, STACKSIZE, sfnt_set_srounding_state)
(sfnt_skip_code, sfnt_interpret_unimplemented, sfnt_interpret_fdef)
(sfnt_interpret_idef, sfnt_interpret_if, sfnt_interpret_else)
(sfnt_round_none, sfnt_round_to_grid, sfnt_round_to_double_grid)
(sfnt_round_down_to_grid, sfnt_round_up_to_grid)
(sfnt_round_to_half_grid, sfnt_round_super, sfnt_validate_gs)
(sfnt_interpret_run, sfnt_interpret_font_program)
(test_interpreter_profile, test_cvt_values, test_interpreter_cvt)
(test_interpreter_head, sfnt_make_test_interpreter)
(struct sfnt_interpreter_test, sfnt_run_interpreter_test)
(struct sfnt_generic_test_args, sfnt_generic_check)
(sfnt_check_srp0, sfnt_check_szp0, sfnt_check_sloop)
(struct sfnt_rounding_test_args, sfnt_check_rounding)
(sfnt_check_smd, sfnt_check_scvtci, sfnt_check_sswci)
(sfnt_check_ssw, sfnt_check_flipon, sfnt_check_flipoff)
(npushb_test_args, npushw_test_args, pushb_test_args)
(pushw_test_args, stack_overflow_test_args)
(stack_underflow_test_args, rtg_test_args, rtg_symmetric_test_args)
(rtg_1_test_args, rtg_1_symmetric_test_args, rthg_test_args)
(rthg_1_test_args, rtdg_test_args, rtdg_1_test_args)
(rtdg_2_test_args, rtdg_3_test_args, else_test_args)
(jmpr_test_args, dup_test_args, pop_test_args, clear_test_args)
(swap_test_args, depth_test_args, cindex_test_args)
(mindex_test_args, raw_test_args, loopcall_test_args)
(call_test_args, fdef_test_args, fdef_1_test_args, endf_test_args)
(ws_test_args, rs_test_args, wcvtp_test_args, rcvt_test_args)
(mppem_test_args, mps_test_args, debug_test_args, lt_test_args)
(all_tests, main): Check in WIP hinting code.

* src/sfnt.h (enum sfnt_table): Add `cvt ' and `fpgm' tables.
2023-01-30 21:19:33 +08:00
Po Lu
492aa74b13 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.
2023-01-29 11:21:07 +08:00
Po Lu
22749d69e5 Add libtiff support to Android port
* INSTALL.android: Document how to build with libtiff.

* build-aux/ndk-build-helper-1.mk (NDK_SO_NAME):
* build-aux/ndk-build-helper-2.mk (NDK_A_NAME):
* build-aux/ndk-build-helper-4.mk: Decrease number of duplicate
dependencies found.
* configure.ac (ANDROID_SDK_18_OR_EARLIER, XCONFIGURE, PNG_CFLAGS)
(HAVE_TIFF): Allow using libtiff on Android.
* cross/ndk-build/ndk-clear-vars.mk: Undefine additional
variables.
* cross/ndk-build/ndk-resolve.mk: Split CFLAGS resolution from
a-name resolution, and do not recursively add archive or shared
object names for dependencies of shared libraries.

* src/Makefile.in (TIFF_CFLAGS): New variable.
(EMACS_CFLAGS): Use it.
2023-01-28 20:47:26 +08:00
Po Lu
e3b50ec8ec Update Android port
* INSTALL.android: Document support for gnutls and libgmp.
* build-aux/ndk-build-helper-1.mk (NDK_SO_NAMES, NDK_INCLUDES)
(SYSTEM_LIBRARIES):
* build-aux/ndk-build-helper-2.mk: Recursively resolve and add
shared library dependencies; even those of static libraries.
* build-aux/ndk-module-extract.awk: Fix makefile_imports code.
* configure.ac (ANDROID_SDK_18_OR_EARLIER, XCONFIGURE)
(LIBGMP_CFLAGS): Enable GMP and gnutls on Android.

* cross/ndk-build/Makefile.in (LOCAL_EXPORT_C_INCLUDES):
* cross/ndk-build/ndk-build-shared-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix)::($(LOCAL_MODULE_FILENAME)):
* cross/ndk-build/ndk-build-static-library.mk: ($(call
objname,$(LOCAL_MODULE),$(basename $(1))))::($$(error
Unsupported suffix):
* cross/ndk-build/ndk-clear-vars.mk:
* cross/ndk-build/ndk-resolve.mk (NDK_SYSTEM_LIBRARIES):
(NDK_LOCAL_EXPORT_C_INCLUDES_$(LOCAL_MODULE)):
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)):
Implement ``LOCAL_ASM_RULE'' and ``LOCAL_C_ADDITIONAL_FLAGS''
extensions for libgmp.

* doc/emacs/input.texi (Touchscreens): Document how to
horizontally scroll.
* java/org/gnu/emacs/EmacsActivity.java (attachWindow): Give the
view focus again if necessary.
(onPause): Call right super function.
* java/org/gnu/emacs/EmacsPreferencesActivity.java (onClick):
Clear dumpFileName lest Emacs try to load a nonexistent dump
file.
* java/org/gnu/emacs/EmacsView.java (onDetachedFromWindow)
(onAttachedToWindow): Call super functions.
(onCreateInputConnection): Make sure the IME never obscures
Emacs.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow, onKeyDown)
(onKeyUp): Improve tracking of quit keys.

* lisp/isearch.el (isearch-mode): Bring up the onscreen
keyboard.
* lisp/touch-screen.el (touch-screen-current-tool): Add three
fields.
(touch-screen-handle-scroll): Allow hscrolling as well.
(touch-screen-handle-touch): Add additional fields to
`touch-screen-current-tool'.
* src/Makefile.in (LIBGMP_CFLAGS, EMACS_CFLAGS): Add new
variable.
* src/android.c (android_run_select_thread):
(android_write_event): Use pthread_cond_broadcast because
pthread_cond_signal does nothing on some Android
versions/devices?
2023-01-28 14:29:51 +08:00
Po Lu
22f7ad1057 Update Android port
* INSTALL.android: Document how to install sqlite3.
* build-aux/ndk-build-helper-1.mk (SYSTEM_LIBRARIES):
* build-aux/ndk-build-helper-2.mk (SYSTEM_LIBRARIES): Add liblog
and libandroid.
* configure.ac (SQLITE3_LIBS, HAVE_SQLITE3)
(HAVE_SQLITE3_LOAD_EXTENSION): Support on Android.
(APKSIGNER): Look for this new required binary.

* cross/ndk-build/ndk-build-shared-library.mk (objname):
* cross/ndk-build/ndk-build-static-library.mk (objname): Avoid
duplicate rules by prefixing objects with module type.

* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_SHARED): Fix
definition.
* cross/ndk-build/ndk-resolve.mk:
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Handle new system
libraries.

* doc/emacs/android.texi (Android File System): Document Android
10 system restriction.

* java/AndroidManifest.xml.in: Target Android 33, not 28.
* java/Makefile.in (SIGN_EMACS_V2, APKSIGNER): New variables.
($(APK_NAME)): Make sure to apply a ``version 2 signature'' to
the package as well.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
argument apiLevel.
* java/org/gnu/emacs/EmacsNoninteractive.java (main):
* java/org/gnu/emacs/EmacsThread.java (run): Pass API level.
* m4/ndk-build.m4 (ndk_package_mape): Add package mapping for
sqlite3.
* src/Makefile.in (SQLITE3_CFLAGS): New substition.
(EMACS_CFLAGS): Add that variable.

* src/android.c (android_api_level): New variable.
(initEmacs): Set it.
(android_file_access_p): Make static.
(android_hack_asset_fd): Adjust for restrictions in Android 29
and later.
(android_close_on_exec): New function.
(android_open): Adjust to not duplicate file descriptor even if
CLOEXEC.
(android_faccessat): Use fstatat at-func emulation.

* src/android.h: Update prototypes.
* src/dired.c (file_name_completion_dirp):
* src/fileio.c (file_access_p, Faccess_file): Now that
sys_faccessat takes care of everything, stop calling
android_file_access_p.
2023-01-26 19:54:38 +08:00
Po Lu
4255d7f051 Update Android port
* .gitignore: Ignore lib/math.h.
* INSTALL.android: Update accordingly.
* build-aux/ndk-build-helper-1.mk:
* build-aux/ndk-build-helper-2.mk:
* build-aux/ndk-build-helper.mk:
* build-aux/ndk-module-extract.awk: Handle C++ modules.
* configure.ac: Enable libxml2 on Android.

* cross/ndk-build/Makefile.in:
* cross/ndk-build/ndk-build-shared-library.mk:
* cross/ndk-build/ndk-build-static-library.mk:
* cross/ndk-build/ndk-build.mk.in:
* cross/ndk-build/ndk-resolve.mk: Fix dependency resolution of
includes.

* java/org/gnu/emacs/EmacsView.java (popupMenu): Fix minimum SDK
version for actual popup menus.
* lib/math.h: Delete file.

* m4/ndk-build.m4 (ndk_SEARCH_MODULE, ndk_CHECK_MODULES): Look
for nasm and C++ libraries.

* src/android.c (faccessat): Rename to `android_faccessat'.
* src/android.h: Update prototypes.
* src/dired.c (file_name_completion_dirp):
* src/fileio.c (file_access_p, Faccess_file, file_directory_p):
* src/lisp.h:
* src/lread.c (openp):
* src/process.c (allocate_pty): Use sys_faccessat.
* src/sysdep.c (sys_faccessat): New function.
2023-01-26 15:37:04 +08:00
Po Lu
8125e26a32 Remove unused file
* cross/ndk-build/ndk-build.in: Delete unused file.
2023-01-26 14:13:24 +08:00
Po Lu
54836c47c7 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.
2023-01-24 19:10:58 +08:00
Po Lu
56e55a8008 Update Android port
* INSTALL.android: Update.
* build-aux/ndk-build-helper-1.mk: Fix typo.
* configure.ac: Enable --with-json on Android.
* cross/ndk-build/ndk-build-shared-library.mk:
(NDK_CFLAGS_$(LOCAL_MODULE)):
(LOCAL_MODULE_FILENAME):
* cross/ndk-build/ndk-build-static-library.mk:
(ALL_OBJECT_FILES$(LOCAL_MODULE)):
(LOCAL_MODULE_FILENAME): Recursively resolve dependencies.
* cross/ndk-build/ndk-resolve.mk: New function.

* doc/emacs/android.texi (Android Startup): Document how Emacs
is dumped during initial startup.

* java/Makefile.in (filename): Fix build with multiple shared
libraries.
* java/README: Improve commentary.
* java/org/gnu/emacs/EmacsApplication.java (onCreate): Look and
set dump file.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function getFingerprint.
* java/org/gnu/emacs/EmacsPreferencesActivity.java (onCreate):
Add option to erase the dump file.
* java/org/gnu/emacs/EmacsService.java (browseUrl): New
function.
* java/org/gnu/emacs/EmacsThread.java (run): Specify dump file
if found.
* lisp/loadup.el: Always dump during loadup on Android.

* lisp/net/browse-url.el (browse-url--browser-defcustom-type):
(browse-url-default-browser):
(browse-url-default-android-browser): New browse url type.

* m4/ndk-build.m4 (ndk_package_map): Map jansson to libjansson.
* src/android.c (struct android_emacs_service): New method
`browse_url'.
(getFingerprint): New function.
(android_init_emacs_service): Initialize new method.
(android_browse_url): New function.

* src/android.h: Update prototypes.

* src/androidselect.c (Fandroid_browse_url): New function.
(syms_of_androidselect): Define it.

* src/emacs.c (load_pdump): Don't look in fancy places on
Android.
* src/pdumper.c (Fdump_emacs_portable): Allow dumping while
interactive on Android.
(syms_of_pdumper): New variable `pdumper-fingerprint'.

* src/sfntfont-android.c (sfntfont_android_composite_bitmap):
Fix unused variables.
2023-01-24 17:31:16 +08:00
Po Lu
4de6b18793 Update Android port
* .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.
2023-01-24 10:34:40 +08:00