1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00
Commit Graph

436 Commits

Author SHA1 Message Date
Po Lu
6684d3af3b Don't use // substitution in `ndk_resolve_import_module'
* m4/ndk-build.m4 (ndk_resolve_import_module): Stop testing if
ndk_commands is empty; just eval it.  (bug#65292)
2023-08-15 14:19:56 +08:00
Po Lu
0e390f54fa ; Update from Gnulib
* lib/boot-time-aux.h (get_linux_uptime):
* lib/boot-time.c (UT_USER):
* lib/nproc.c (num_processors_ignoring_omp):
* lib/readutmp.h (WTMP_FILE):
* m4/readutmp.m4 (gl_READUTMP):
* m4/stdint.m4: Update from Gnulib.
2023-08-14 09:15:51 +08:00
Paul Eggert
5e736ca6cc Improve boot-time gathering
Simplify Emacs proper by using Gnulib’s boot-time module
instead of doing it all by hand.  This should port Emacs
better to obscurish hosts, as Bruno Haible has merged the
best of Emacs’s and Gnulib’s boot-time gathering.
* lib/boot-time-aux.h, lib/boot-time.c, lib/boot-time.h:
* lib/readutmp.h, m4/readutmp.m4: New files, copied from Gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add boot-time.
* configure.ac: Do not check for utmp.h;
the boot-time module now does this.
(BOOT_TIME_FILE): Remove; no longer used.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/filelock.c [__FreeBSD__]: Do not include <sys/sysctl.h>.
[HAVE_UTMP_H]: Do not include utmp.h.
Include boot-time instead: boot-time does the work now.
(BOOT_TIME) [HAVE_ANDROID && !ANDROID_STUBIFY]: Don’t undef.
(WTMP_FILE): Don’t define.
(boot_time, boot_time_initialized, get_boot_time_1, get_boot_time):
Remove.
(get_boot_sec): New function that simply calls Gnulib get_boot_time.
(lock_file_1, current_lock_owner): Use get_boot_sec instead
of get_boot_time.
2023-08-12 19:46:12 -07:00
Paul Eggert
5315e6e8d7 Avoid stpncpy
It’s not worth the porting hassle, and as the glibc manual says,
“this function is generally a poor choice for processing strings”.
* admin/merge-gnulib (GNULIB_MODULES): Remove stpncpy.
* exec/configure.ac: Do not check for stpncpy.
* exec/exec.c (rpl_stpncpy, stpncpy): Remove this replacement.
(exec_0): Properly clear buffer1.  Use memcpy instead of
stpncpy to add the trailing name.  This code is clearly
still suboptimal but efficiency is not that important here
and I tried to minimize the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
2023-08-12 12:57:35 -07:00
Paul Eggert
f3868cb9d1 Update from Gnulib by running admin/merge-gnulib 2023-08-12 12:57:35 -07:00
Po Lu
76cac8ae6f Update from Gnulib, remove printf-posix
* m4, lib: Update from Gnulib.

* msdos/sedlibmk.inp: Remove variables deleted as part of previous
change.

* admin/merge-gnulib (GNULIB_MODULES): Remove vasprintf and
printf-posix.
2023-08-07 08:14:38 +08:00
Po Lu
faca007b61 ; Update from Gnulib
* lib/vasnprintf.c (VASNPRINTF):
* m4/printf.m4 (gl_SWPRINTF_WORKS):
(gl_SWPRINTF_DIRECTIVE_LA):
* m4/vasnprintf.m4 (gl_PREREQ_PRINTF_PARSE):
2023-07-10 08:24:40 +08:00
Po Lu
8dd34ad8d8 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-10 08:21:59 +08:00
Paul Eggert
b76878cfab Simplify ‘configure’ check for MB_CUR_MAX
* admin/merge-gnulib: Remove m4/locale-fr.m4.
* configure.ac (gt_LOCALE_FR_UTF8): Replace Gnulib’s
definition with a near no-op, as Emacs doesn’t care
about the Solaris 10 MB_CUR_MAX bug.
* lib/gnulib.mk.in: Regenerate.
* m4/locale-fr.m4: Remove; no longer needed due
to above changes.
2023-07-09 13:45:13 -07:00
Paul Eggert
c3cfada3c0 Update from Gnulib by running admin/merge-gnulib 2023-07-09 13:45:13 -07:00
Po Lu
59fdd16f90 Merge remote-tracking branch 'origin/master' into feature/android 2023-06-08 08:46:19 +08:00
Paul Eggert
a902156068 Update from Gnulib by running admin/merge-gnulib 2023-06-07 12:04:00 -07:00
Po Lu
bb95cdaa06 Merge remote-tracking branch 'origin/master' into feature/android 2023-05-17 09:16:48 +08:00
Paul Eggert
f836452beb Update from Gnulib by running admin/merge-gnulib 2023-05-15 23:44:29 -07:00
Po Lu
5a3f009ad7 ; Update from Gnulib 2023-05-15 10:40:34 +08:00
Po Lu
a46e231a5f Merge remote-tracking branch 'origin/master' into feature/android 2023-05-15 10:38:10 +08:00
Paul Eggert
3cd8ce87d2 Work after 2038 on 32-bit GNU/Linux
This adds support for 64-bit time_t on 32-bit GNU/Linux ARM and
x86, where time_t was historically 32-bit.  The resulting Emacs
should continue to work for timestamps after mid-January 2038.
* admin/merge-gnulib (GNULIB_MODULES): Add year2038.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
2023-05-14 19:28:13 -07:00
Paul Eggert
b77d357ea3 Update from Gnulib by running admin/merge-gnulib
* lib/dirent-private.h, m4/codeset.m4, m4/locale-fr.m4, m4/musl.m4:
New files, from Gnulib.
2023-05-14 19:28:09 -07:00
Po Lu
3d7c06869d Update Android port
* build-aux/ndk-build-helper.mk (TARGET_ARCH): Define variable.
* configure.ac (ENABLE_CHECKING, CHECK_STRUCTS)
(GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST, GLYPH_DEBUG)
(GC_CHECK_STRING_BYTES): Enable checking correctly on Android.
* java/README: Fix typos.
* m4/ndk-build.m4 (ndk_run_test): Pass target arch.
* src/android.c (android_get_content_name, android_close)
(android_fclose, android_check_string): Fix various typos caught
by checking.
* src/charset.c (load_charset_map_from_file): Call emacs_fclose,
not fclose.
* src/image.c (image_set_transform): Fix thinko.
(png_load_body, jpeg_load_body, gif_load): Call emacs_fclose,
not fclose.  Use open instead of fdopen.
* src/xfaces.c (Fx_load_color_file): Likewise.
2023-04-29 08:27:44 +08:00
Po Lu
e7025ed689 Update Android port
* configure.ac:
* m4/ndk-build.m4 (ndk_INIT):
(ndk_LATE): Avoid AC_REQUIRE magic.
2023-03-17 19:26:16 +08:00
Po Lu
af7f0b6f9b Update Android port
* cross/Makefile.in (lib/gnulib.mk): Edit out
build-aux stuff.
* m4/ndk-build.m4: Also look for cross ranlib.
2023-03-15 16:17:32 +08:00
Po Lu
f573ce3f66 Merge remote-tracking branch 'origin/master' into feature/android 2023-03-11 09:55:05 +08:00
Paul Eggert
c6bfffa9fe Update from Gnulib by running admin/merge-gnulib
Run admin/merge-gnulib along with the following change:
* admin/merge-gnulib (GNULIB_MODULES): Replace ‘time’ with
‘time-h’, adjusting to a recent renaming in Gnulib modules.
Emacs doesn’t appear to need the new Gnulib ‘time’ module.
2023-03-10 16:53:07 -08:00
Po Lu
798003b04f ; * m4/ndk-build.m4 (ndk_INIT): Fix typo. 2023-03-04 11:47:32 +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
edfa0f8fa0 Minor fixes to configury
* configure.ac (ANDROID_SDK_8_OR_EARLIER): Pass through
`--with-ndk-cxx-shared'.
* m4/ndk-build.m4: Fix quoting of $CC.
2023-03-03 21:58:48 +08:00
Po Lu
d8ea139e83 Improve ndk-build implementation
* build-aux/ndk-build-helper.mk: Define in terms of BUILD_AUXDIR.
* m4/ndk-build.m4 (ndk_INIT): Find right build-aux directory.
Remove uses of unportable shell constructs.
2023-03-03 21:13:58 +08:00
Po Lu
74a7d34361 Update from gnulib
* cross/lib/unistd.in.h:
* lib/gnulib.mk.in (INT64_MAX_EQ_LONG_MAX):
* m4/gnulib-comp.m4 (gl_EARLY): Update from gnulib.
2023-02-26 14:14:43 +08:00
Paul Eggert
6a3a729705 Update from Gnulib by running admin/merge-gnulib 2023-02-25 17:13:29 -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
137bdaced6 Update Android port
* INSTALL.android: Port to MIPS.
* configure.ac (modules): Default to ifavailable.
Write actual test for __attribute__((cleanup)).
* m4/ndk-build.m4: Recognize mips and mips64.
* src/emacs-module.c: Remove broken HAS_ATTRIBUTE test.
2023-02-22 11:01:44 +08:00
Po Lu
8ca4162ecd Update from gnulib
* admin/merge-gnulib (GNULIB_MODULES):
* cross/lib/getopt-pfx-core.h (optind):
* cross/lib/limits.in.h (BOOL_WIDTH):
* cross/lib/math.in.h:
* cross/lib/stpncpy.c (__stpncpy):
* cross/lib/string.in.h:
* lib/getopt-pfx-core.h (optind):
* lib/gnulib.mk.in (ANDROID_MIN_SDK):
(GL_COND_OBJ_STDIO_READ_CONDITION):
(LIBS):
(NDK_BUILD_AR):
(REPLACE__EXIT):
(libgnu_a_SOURCES):
* lib/limits.in.h (BOOL_WIDTH):
* lib/math.in.h:
* lib/stpncpy.c (__stpncpy):
* lib/string.in.h:
* m4/assert_h.m4 (gl_ASSERT_H):
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR):
* m4/getdelim.m4 (gl_FUNC_GETDELIM):
* m4/getline.m4 (gl_FUNC_GETLINE):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
(gl_CONDITIONAL_HEADER):
(gl_CHECK_FUNCS_ANDROID):
* m4/gnulib-comp.m4 (gl_EARLY):
(gl_INIT):
(gl_FILE_LIST):
* m4/limits-h.m4:
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK):
* m4/malloc.m4 (_AC_FUNC_MALLOC_IF):
* m4/printf.m4 (gl_PRINTF_SIZES_C99):
(gl_PRINTF_INFINITE):
(gl_PRINTF_INFINITE_LONG_DOUBLE):
(gl_PRINTF_DIRECTIVE_A):
(gl_PRINTF_DIRECTIVE_F):
(gl_PRINTF_FLAG_ZERO):
(gl_SNPRINTF_PRESENCE):
(gl_SNPRINTF_DIRECTIVE_N):
(gl_VSNPRINTF_ZEROSIZE_C99):
* m4/pselect.m4 (gl_FUNC_PSELECT):
* m4/readlink.m4 (gl_FUNC_READLINK):
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF):
* m4/signbit.m4 (gl_SIGNBIT):
* m4/stpncpy.m4 (gl_FUNC_STPNCPY):
* m4/symlink.m4 (gl_FUNC_SYMLINK): Add gnulib module stpncpy.
* src/android.c: Include string.h.
2023-02-21 16:29:57 +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
1b8beed960 Update from gnulib
* admin/merge-gnulib (avoided_flags):
* cross/lib/cdefs.h (__bos):
(__glibc_unsigned_or_positive):
(__glibc_unsafe_len):
(__glibc_fortify):
(__glibc_fortify_n):
* cross/lib/isnan.c:
* cross/lib/libc-config.h:
* cross/lib/openat-proc.c (openat_proc_name):
* cross/lib/vasnprintf.c (VASNPRINTF):
* cross/lib/verify.h (_Static_assert):
(_GL_SA3):
* lib/gnulib.mk.in (HAVE_GRANTPT):
(HAVE_SPAWN_H):
(NEXT_AS_FIRST_DIRECTIVE_LIMITS_H):
(NEXT_LIMITS_H):
(REPLACE_GETSUBOPT):
(REPLACE_ILOGB):
(SYSTEM_TYPE):
(BUILT_SOURCES):
* lib/isnan.c:
* lib/vasnprintf.c (VASNPRINTF):
* lib/verify.h (_GL_SA3):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* m4/gnulib-comp.m4 (gl_INIT): Update from gnulib.
2023-02-05 21:06:11 +08:00
Po Lu
0ee01457a8 Merge remote-tracking branch 'origin/master' into feature/android 2023-02-05 20:55:21 +08:00
Paul Eggert
b429274c5b Use Gnulib module alignasof instead of stdalign
* admin/merge-gnulib (GNULIB_MODULES):
Replace obsolescent Gnulib module stdalign with alignasof.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/stdalign.in.h: Remove; no longer needed.
2023-02-04 15:14:16 -08:00
Paul Eggert
04d97e76a9 Update from Gnulib by running admin/merge-gnulib 2023-02-04 15:14:16 -08:00
Po Lu
6f2a518f27 Update from gnulib
* cross/lib/stdalign.in.h (_GL_STDALIGN_H):
(_):
(__alignof_is_defined):
* cross/lib/vasnprintf.c:
* lib/gnulib.mk.in (ANDROID_MIN_SDK):
(HAVE_SPAWN_H):
(LIBGCCJIT_LIBS):
(NATIVE_COMPILATION_AOT):
(NEXT_AS_FIRST_DIRECTIVE_LIMITS_H):
(NEXT_LIMITS_H):
(SIZEOF_LONG):
(stdalign.h):
* ../../../../dev/null:
* lib/stdalign.in.h (_GL_STDALIGN_H):
(_):
(__alignof_is_defined):
* lib/vasnprintf.c:
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* m4/stdalign.m4 (gl_ALIGNASOF):
* m4/stddef_h.m4: Update from gnulib.
2023-01-28 14:33:58 +08:00
Po Lu
b0e7ae6d5b Update Android port
* INSTALL.android: Describe that apksigner is also required.
* configure.ac: Correctly add cross/Makefile to
SUBDIR_MAKEFILES.
* cross/Makefile.in: (config.status): Depend on
$(top_srcdir)/config.status.
* doc/emacs/input.texi (On-Screen Keyboards): Document how to
quit without a physical keyboard.
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): New
function `quit'.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): New field
`lastVolumeButtonPress'.
(onKeyDown): Quit if necessary.
* m4/ndk-build.m4 (ndk_where_cc): Fix search if CC is not a
single word.
* src/android.c (android_open): Remove unused variable.
(quit): New function.
* src/androidmenu.c (android_process_events_for_menu): Allow
quitting the menu.
* src/xterm.c (handle_one_xevent, x_term_init, syms_of_xterm):
Implement features described above, so they work on free
operating systems.
* src/xterm.h (struct x_display_info): New fields `quit_keysym',
`quit_keysym_time'.
2023-01-26 22:11:04 +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
6f9a2a8f29 Import gnulib modules printf-posix and vasprintf-posix
These are neccessary because Android's printf is missing basic format
modifiers such as t.

* admin/merge-gnulib (GNULIB_MODULES): Add printf-posix and
vasprintf-posix.  Update from gnulib.
* configure.ac (CFLAGS): Add -DHAVE_CONFIG_H.
2023-01-25 18:39:36 +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
3267a2d6d2 Update from gnulib
Update from gnulib.  In addition,

* admin/merge-gnulib: Fix paths for rename.
2023-01-24 10:46:53 +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
Po Lu
26f0dd5089 Update Android port
* src/android.c (android_run_select_thread, android_init_events)
(android_select): Add alternative android_select implementation
for API 16 and lower.
* src/androidterm.c (handle_one_android_event): Fix
use-after-frees.
2023-01-20 21:21:15 +08:00
Po Lu
a496509ced Update Android port
* .gitignore: Add new files.
* INSTALL.android: Explain how to build Emacs for ancient
versions of Android.
* admin/merge-gnulib (GNULIB_MODULES): Add getdelim.
* build-aux/config.guess (timestamp, version):
* build-aux/config.sub (timestamp, version): Autoupdate.
* configure.ac (BUILD_DETAILS, ANDROID_MIN_SDK):
(ANDROID_STUBIFY): Allow specifying CFLAGS via ANDROID_CFLAGS.
Add new configure tests for Android API version when not
explicitly specified.

* doc/emacs/android.texi (Android): Add reference to ``Other
Input Devices''.
(Android File System): Remove restrictions on directory-files on
the assets directory.
* doc/emacs/emacs.texi (Top): Add Other Input Devices to menu.
* doc/emacs/input.texi (Other Input Devices): New node.
* doc/lispref/commands.texi (Touchscreen Events): Document
changes to touchscreen input events.
* doc/lispref/frames.texi (Pop-Up Menus): Likewise.
* etc/NEWS: Announce changes.
* java/Makefile.in: Use lib-src/asset-directory-tool to generate
an `directory-tree' file placed in /assets.
* java/debug.sh: Large adjustments to support Android 2.2 and
later.

* java/org/gnu/emacs/EmacsContextMenu.java (inflateMenuItems):
* java/org/gnu/emacs/EmacsCopyArea.java (perform):
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog):
* java/org/gnu/emacs/EmacsDrawLine.java (perform):
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform):
* java/org/gnu/emacs/EmacsDrawable.java (EmacsDrawable):
* java/org/gnu/emacs/EmacsFillPolygon.java (perform):
* java/org/gnu/emacs/EmacsFillRectangle.java (perform):
* java/org/gnu/emacs/EmacsGC.java (EmacsGC):
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap):
(destroyHandle):
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (draw): Avoid
redundant canvas saves and restores.
* java/org/gnu/emacs/EmacsService.java (run):
* java/org/gnu/emacs/EmacsView.java (EmacsView):
(handleDirtyBitmap):
* java/org/gnu/emacs/EmacsWindow.java (changeWindowBackground)
(EmacsWindow): Make compatible with Android 2.2 and later.

* lib-src/Makefile.in (DONT_INSTALL): Add asset-directory-tool
on Android.:(asset-directory-tool{EXEEXT}): New target.
* lib-src/asset-directory-tool.c (struct directory_tree, xmalloc)
(main_1, main_2, main): New file.

* lib, m4: Merge from gnulib.  This will be reverted before
merging to master.

* lisp/button.el (button-map):
(push-button):
* lisp/frame.el (display-popup-menus-p): Improve touchscreen
support.
* lisp/subr.el (event-start):
(event-end): Handle touchscreen events.
* lisp/touch-screen.el (touch-screen-handle-timeout):
(touch-screen-handle-point-update):
(touch-screen-handle-point-up):
(touch-screen-track-tap):
(touch-screen-track-drag):
(touch-screen-drag-mode-line-1):
(touch-screen-drag-mode-line): New functions.
([mode-line touchscreen-begin]):
([bottom-divider touchscreen-begin]): Bind new events.

* lisp/wid-edit.el (widget-event-point):
(widget-keymap):
(widget-event-start):
(widget-button--check-and-call-button):
(widget-button-click): Improve touchscreen support.

* src/alloc.c (make_lisp_symbol): Avoid ICE on Android NDK GCC.
(mark_pinned_symbols): Likewise.

* src/android.c (struct android_emacs_window): New struct.
(window_class): New variable.
(android_run_select_thread): Add workaround for Android platform
bug.
(android_extract_long, android_scan_directory_tree): New
functions.
(android_file_access_p): Use those functions instead.
(android_init_emacs_window): New function.
(android_init_emacs_gc_class): Update signature of `markDirty'.
(android_change_gc, android_set_clip_rectangles): Tell the GC
whether or not clip rects were dirtied.
(android_swap_buffers): Do not look up method every time.
(struct android_dir): Adjust for new directory tree lookup.
(android_opendir, android_readdir, android_closedir): Likewise.
(android_four_corners_bilinear): Fix coding style.
(android_ftruncate): New function.
* src/android.h: Update prototypes.  Replace ftruncate with
android_ftruncate when necessary.

* src/androidterm.c (handle_one_android_event): Pacify GCC.  Fix
touch screen tool bar bug.
* src/emacs.c (using_utf8): Fix compilation error.
* src/fileio.c (Ffile_system_info): Return Qnil when fsusage.o
is not built.
* src/filelock.c (BOOT_TIME_FILE): Fix definition for Android.
* src/frame.c (Fx_parse_geometry): Fix uninitialized variable
uses.
* src/keyboard.c (lispy_function_keys): Fix `back'.
* src/menu.c (x_popup_menu_1): Handle touch screen events.
(Fx_popup_menu): Document changes.

* src/sfnt.c (main): Improve tests.

* src/sfntfont-android.c (sfntfont_android_put_glyphs): Fix
minor problem.
(init_sfntfont_android): Check for
HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL.
* src/sfntfont.c (struct sfnt_font_desc): New fields `adstyle'
and `languages'.
(sfnt_parse_style): Append tokens to adstyle.
(sfnt_parse_languages): New function.
(sfnt_enum_font_1): Parse supported languages and adstyle.
(sfntfont_list_1): Handle new fields.
(sfntfont_text_extents): Fix uninitialized variable use.
(syms_of_sfntfont, mark_sfntfont): Adjust accordingly.
2023-01-19 22:19:06 +08:00
Paul Eggert
7ff5c0d704 Port xattr handling to Fedora 9
Problem reported by Po Lu (Bug#60843).
* m4/xattr.m4: Sync from Gnulib.
2023-01-17 15:39:21 -08:00
Paul Eggert
9912049173 Update from Gnulib by running admin/merge-gnulib
This adds a new file m4/xattr.m4 from Gnulib,
for NFS v4 attribute copying.
Also, do these changes by hand:
* configure.ac: Mention $LIB_XATTR" in ACL summary.
* src/Makefile.in (QCOPY_ACL_LIB): New macro.
(LIBES): Use it.
2023-01-13 20:03:54 -08:00