1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00
Commit Graph

1309 Commits

Author SHA1 Message Date
Philipp Stephani
c34d06e3d7 * configure.ac (LIBSECCOMP): Bump minimum version for faccessat2. 2022-01-24 11:38:43 +01:00
Po Lu
16c785b621 Make xwidgets work on builds that don't use Cairo drawing
* configure.ac: Check for the parts of Cairo that are needed for
xwidgets when they are enabled without cairo drawing.

* src/xterm.c:
* src/xwidget.c: Always include cairo-xlib headers when xwidgets
are enabled.
2022-01-21 19:10:05 +08:00
Po Lu
9693eb4aef Port some X11 tooltip code to XCB
* configure.ac: Require `xcb-aux' to be present before using
XCB.
* src/xfns.c (x_sync):
(x_create_tip_frame):
(Fx_show_tip): Port window related code to XCB.
2022-01-19 19:08:09 +08:00
Po Lu
de614ec950 Use Cairo XCB surfaces when XCB is available
This lets us get at goodies such as shm support, which aren't
available with the xlib surface.  (bug#52120)

* configure.ac: Test for cairo-xcb if cairo is available on X.
* src/xterm.c (USE_CAIRO_XCB_SURFACE): New define.
(x_begin_cr_clip): Create XCB surfaces if available.
(x_try_cr_xlib_drawable):
(x_scroll_run): Handle XCB surfaces.
(x_term_init): Find XCB visualtype structure.
* src/xterm.h (struct x_display_info): New field `xcb_visual'.
* src/xwidget.c (x_draw_xwidget_glyph_string): Fix integer
overflow.
2022-01-19 17:41:22 +08:00
Po Lu
1f5f3b7e89 Remove non-functional configure test
It cannot work anymore, leading to compiler warnings when
building xterm.c.

* configure.ac: Remove test for whether
XRegisterIMInstantiateCallback wants XPointer or XPointer * as
the client_data.

* src/xterm.c (xim_initialize):
(xim_close_dpy): Just cast client data to void * and hope that
the compiler keeps quiet.
2022-01-15 09:11:11 +08:00
Stefan Kangas
d193801f59 Bump Emacs version to 28.0.91
* README:
* configure.ac:
* msdos/sed2v2.inp:
* nt/README.W32: Bump Emacs version to 28.0.91.
2022-01-08 13:09:29 +01:00
Po Lu
3e247bd34c ; * configure.ac: Move some AC_SUBSTs to the correct location. 2022-01-04 17:51:05 +08:00
Yuuki Harano
183936ee8e Remove gsettings.m4 and write directly into Makefile.in
* configure.ac (HAVE_PGTK): Declare substitution
(HAVE_GSETTINGS): Declare substitution
* Makefile.in (HAVE_PGTK): New variable
(HAVE_GSETTINGS): New variable
(gsettingsschemadir): Don't use value from gsettings.m4
(distclean): Add clean-gsettings-schemas
(install-gsettings-schemas): Implement instead of gsettings.m4
(uninstall-gsettings-schemas): Implement instead of gsettings.m4
(clean-gsettings-schemas): Implement instead of gsettings.m4
($(gsettings_SCHEMAS:.xml=.valid)): Implement instead of gsettings.m4
* m4/gsettings.m4: Remove
2022-01-04 17:29:17 +09:00
Stefan Kangas
ad125a9927 Merge from origin/emacs-28
efb1c7ec37 ; * admin/notes/years: More known problems.
f475c5823a ; Copyright year fixes
2684def348 ; Run set-copyright from admin.el
2558b37b5e ; * admin/notes/years: Mention known problems with 'update...
2022-01-02 06:31:44 +01:00
Po Lu
96212e1a27 Fix XRegisterIMInstantiateCallback function argument configure test
* configure.ac: Use XIDProc where XIMProc was mistakenly used.
2022-01-02 11:02:49 +08:00
Glenn Morris
2684def348 ; Run set-copyright from admin.el 2022-01-01 09:52:06 -08:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Po Lu
62339e62d8 Add configure tests for faulty XI2 installations
* configure.ac: Detect cases where XI 2.4 headers are installed
without the correct event structures.
* src/xterm.c (handle_one_xevent): Don't use structures that
might not exist unless configure found them.
2021-12-26 14:48:13 +08:00
Stefan Kangas
be38405b1f Merge from origin/emacs-28
29fffbdd87 Revert field-related thingatpt changes
9bcb732686 * lisp/window.el (quit-restore-window): Select previously ...
b7d31d6192 Revert "Remove Motif support"

# Conflicts:
#	etc/NEWS
2021-12-23 06:31:26 +01:00
Robert Pluim
b7d31d6192 Revert "Remove Motif support"
This reverts commit db237850ab.
2021-12-21 18:39:39 +01:00
Kévin Le Gouguec
8535861430 Enable webp support in PGTK builds, too
* configure.ac (HAVE_WEBP): Enable webp in PGTK builds, too.
2021-12-19 14:58:41 +01:00
Paul Eggert
f05a93e823 Update from gnulib
Make the following changes by hand, and run ‘admin/merge-gnulib’.
* configure.ac (AM_CONDITIONAL): Adjust to new Gnulib convention.
2021-12-18 16:15:49 -08:00
Po Lu
120de8f9cb ; * configure.ac: Add missing object to Haiku cairo build 2021-12-18 13:59:49 +00:00
Po Lu
a1eb71413d Fix cairo build on haiku
* configure.ac: Move pgtk cairo detection to the correct
location.
2021-12-18 13:49:09 +00:00
Po Lu
0e69753ac1 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-12 11:15:00 +08:00
Eli Zaretskii
8c50016b10 Improve documentation of sqlite3 support
* lisp/sqlite-mode.el (sqlite-mode-list-data):
* configure.ac (HAVE_SQLITE3): Fix typos.

* doc/lispref/text.texi (Database): Improve and clarify wording,
add index entries, mention all the function arguments.

* etc/NEWS: Minor wording changes of the sqlite entries.
2021-12-11 13:04:55 +02:00
Po Lu
25084b1e95 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-11 18:34:05 +08:00
Lars Ingebrigtsen
ebf59d1a28 Check whether the sqlite supports sqlite3_load_extension
* configure.ac: Check for sqlite3_load_extension, which is
apparently missing in some versions.
* src/sqlite.c: Add guards.
(Fsqlite_load_extension): Ifdef out on systems that doesn't have it.
2021-12-11 06:40:01 +01:00
Lars Ingebrigtsen
3d38d1d134 Add sqlite3 support to Emacs
* configure.ac: Add check for the sqlite library.
* doc/lispref/text.texi (Database): Document it.

* lisp/sqlite.el: New file.

* lisp/term/w32-win.el (dynamic-library-alist): Add a mapping.

* src/Makefile.in (SQLITE3_LIBS): Add the libraries.

* src/alloc.c (union emacs_align_type): Add a Lisp_Sqlite struct.

* src/data.c (Ftype_of): Add sqlite.

* src/emacs.c (main): Load the syms.

* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add PVEC_SQLITE.
(GCALIGNED_STRUCT): New struct to keep data for sqlite database
objects and statement objects.
(SQLITEP, SQLITE, CHECK_SQLITE, XSQLITE): New macros for accessing
the objects.

* src/pdumper.c (dump_vectorlike): Update hash.
(dump_vectorlike): Don't dump it.

* src/print.c (print_vectorlike): Add a printer for the sqlite
object.

* src/sqlite.c: New file.

* test/src/sqlite-tests.el: Add tests.
2021-12-11 04:55:57 +01:00
Yuuki Harano
d44d6ae016 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-12-04 16:06:16 +09:00
Paul Eggert
1e2bc1bbf4 Port to Tiny C on x86-64
This allows Emacs to build on Ubuntu 21.10 x86-64 with
‘./configure --without-modules CC=tcc’.
* configure.ac (GC_SETJMP_WORKS):
Accept __x86_64__ as an alias for __amd64__.
* src/lisp.h (alignas): Provide a no-op substitute.
2021-12-03 13:09:34 -08:00
Stefan Kangas
740ae2818f Bump Emacs version to 28.0.90
* README:
* configure.ac:
* msdos/sed2v2.inp:
* nt/README.W32: Bump Emacs version to 28.0.90.
2021-12-01 17:49:32 +01:00
Po Lu
8f5d2a3181 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-11-30 08:16:50 +08:00
Po Lu
08d1c40507 Fix typos in configure.ac
* configure.ac: Fix typos in wording of XInput 2 options.
2021-11-28 10:11:53 +08:00
Michael Albinus
75d294cd4a Reorganize emba control files
Using dynamic job generation in GitLab does not work sufficiently.  So
we generate the jobs in the Emacs sources.

* configure.ac (SUBDIR_MAKEFILES): Add test/infra/Makefile.

* test/Makefile.in (subdirs, generate-test-jobs): New targets.

* test/infra/Makefile.in:
* test/infra/test-jobs.yml: New files.

* test/infra/default-gitlab-ci.yml:
* test/infra/test-jobs-generator.sh: Remove.

* test/infra/gitlab-ci.yml: Insert contents of default-gitlab-ci.yml.
(stages): Remove generator and trigger.  Add normal.
(test-jobs-generator, test-jobs-pipeline): Remove jobs.
(top): Include test-jobs.yml.
2021-11-21 14:39:29 +01:00
Po Lu
85a078e785 Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.

* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.

* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.

* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.

* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.

* doc/emacs/haiku.texi: New Haiku appendix.

* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.

* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.

* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.

* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.

* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.

* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.

* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.

* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.

* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.

* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.

(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.

(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.

* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.

* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.

* lisp/menu-bar.el (menu-bar-open): Add for Haiku.

* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.

* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.

* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.

* lisp/term/haiku-win.el: New file.

* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.

* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.

* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.

(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.

(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.

* src/alloc.c (garbage_collect): Mark Haiku display.

* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.

* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.

* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.

* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.

* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.

* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.

* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.

* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.

* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.

* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.

* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.

* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.

* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.

* src/haiku.c: Add new files for Haiku operating system
support.

* src/image.c: Implement image transforms and native XPM
support
on Haiku.

(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.

(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.

* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.

* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.

* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.

* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.

* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.

* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.

* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.

* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.

* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.

* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.

* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.

* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 21:46:07 +08:00
Eli Zaretskii
9ccfdd54fa ; * configure.ac (emacs_config_features): Add XINPUT2. 2021-11-20 12:44:13 +02:00
Po Lu
487ec3cf2a Add support for event processing via XInput 2
* configure.ac: Add an option to use XInput 2 if available.
* src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables.
(EMACS_CFLAGS): Add Xinput CFLAGS.
(LIBES): Add XInput libs.
* src/xmenu.c (popup_activated_flag): Expose flag if
XInput 2 is available.
* src/xfns.c (x_window): Set XInput 2 event mask.
(setup_xi_event_mask): New function.
(syms_of_xfns): Provide XInput 2 feature.
* src/xterm.c (x_detect_focus_change): Handle XInput 2
GenericEvents.
(handle_one_xevent): Handle XInput 2 events.
(x_term_init): Ask the server for XInput 2 support and set
xkb_desc if available.
(x_delete_terminal): Free XKB kb desc if it exists, and free
XI2 devices if they exist.
(xi_grab_or_ungrab_device)
(xi_reset_scroll_valuators_for_device_id)
(x_free_xi_devices, x_init_master_valuators): New functions.
(x_get_scroll_valuator_delta): New function.
(init_xterm): Don't tell GTK to only use Core Input when built
with XInput 2 support.
* src/xterm.h (struct x_display_info): Add fields for XKB
and XI2 support.
* src/gtkutil.c (xg_event_is_for_menubar): Handle
XIDeviceEvents.
(xg_is_menu_window): New function.
(xg_event_is_for_scrollbar): Handle XIDeviceEvents.
* etc/NEWS: Document changes.

* lisp/mwheel.el (mouse-wheel-down-alternate-event)
(mouse-wheel-up-alternate-event)
(mouse-wheel-left-alternate-event)
(mouse-wheel-right-alternate-event): New user options.

(mouse-wheel-text-scale)
(mwheel-scroll): Test for alternate events.
(mouse-wheel--setup-bindings): Set up bindings for alternate
buttons.
2021-11-20 18:25:09 +08:00
Jeff Walsh
8b98aafe35 configure.ac (PGTK_LIBS): remove pgtk dl dependency (Bug#50494) 2021-11-14 22:31:31 +09:00
Philipp Stephani
cc4edea872 Use posix_spawn if possible.
posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux.  Use
it if we don't need to configure a pseudoterminal.

Backported from commit a60053f836.
Unlike that commit, only define USABLE_POSIX_SPAWN on macOS, because
there posix_spawn is much faster than vfork.

Don't merge to master.

* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.

(cherry picked from commit a60053f836)
2021-11-13 16:45:19 +01:00
Yuuki Harano
c31d3dacf7 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-11-13 16:25:48 +09:00
Philipp Stephani
a60053f836 Use posix_spawn if possible.
posix_spawn is less error-prone than vfork + execve, and can make
better use of system-specific enhancements like 'clone' on Linux.  Use
it if we don't need to configure a pseudoterminal.

* configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
(HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New
configuration variables.
* src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro.
(emacs_posix_spawn_init_actions)
(emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New
helper functions.
(emacs_spawn): Use posix_spawn if possible.
2021-11-11 22:00:03 +01:00
Yuuki Harano
4dd1f56f29 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtk 2021-11-11 00:39:53 +09:00
Po Lu
b21f1cabd8 Revert "Add support for event processing via XInput 2"
This reverts commit 346cfc8124.
2021-11-10 14:04:24 +08:00
oldosfan
346cfc8124 Add support for event processing via XInput 2
* configure.ac: Add an option to use XInput 2 if available
* src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables
(EMACS_CFLAGS): Add Xinput CFLAGS
(LIBES): Add XInput libs
* src/xmenu.c (popup_activated_flag): Expose flag if XInput 2 is
available
* src/xfns.c (x_window): Set XInput 2 event mask
* src/xterm.c (x_detect_focus_change): Handle XInput 2 GenericEvents
(handle_one_xevent): Handle XInput 2 events
(x_term_init): Ask the server for XInput 2 support and set xkb_desc if
available
(x_delete_terminal): Free XKB kb desc if it exists, and free XI2
devices if they exist
(x_free_xi_devices, x_init_master_valuators): New functions
(x_get_scroll_valuator_delta): New function
(init_xterm): Don't tell GTK to only use Core Input when built with
XInput 2 support
* src/xterm.h (struct x_display_info): Add fields for XKB and XI2
support
* src/gtkutil.c (xg_event_is_for_menubar): Handle XIDeviceEvents
(xg_is_menu_window): New function
(xg_event_is_for_scrollbar): Handle XIDeviceEvents
2021-11-10 13:27:01 +08:00
Ken Brown
c86a3029ec Merge from origin/emacs-28
6ba4e3b78c Drop support for native compilation on 32-bit Cygwin
7e15ee5bc9 ; * doc/emacs/help.texi (Help Mode): Improve indexing.
2021-10-31 19:36:04 -04:00
Ken Brown
6ba4e3b78c Drop support for native compilation on 32-bit Cygwin
* configure.ac (cygwin32-native-compilation): New option.
[i686-pc-cygwin]: Don't allow native compilation unless that
option is specified.  (Bug#50666)
2021-10-31 19:30:25 -04:00
Eli Zaretskii
2bffa0189d Fix WebP support on MS-Windows
* src/image.c (WebPDecodeRGBA, WebPDecodeRGB, WebPFree): Use
correct names and argument lists in DEF_DLL_FN; fix typos.
(WebPGetFeaturesInternal): Load this instead of WebPGetFeatures,
which is a static inline function in webp/decode.h.
(WebPGetFeatures): Redirect to call WebPGetFeaturesInternal.

* lisp/term/w32-win.el (dynamic-library-alist): Fix the name of
the WebP symbol.

* configure.ac (HAVE_WEBP): Fix detection of libwebp on MinGW.

* nt/INSTALL.W64:
* nt/INSTALL: Update information about libwebp availability.
2021-10-22 15:41:00 +03:00
Stefan Kangas
bc2a5c1127 Add WebP image format support (Bug#51296)
* configure.ac (--with-webp): New option.
(HAVE_WEBP): New variable.
(emacs_config_features): Add webp.
* src/image.c (enum webp_keyword_index) [HAVE_WEBP]: New enum.
(webp_format) [HAVE_WEBP]: New variable.
(webp_image_p, init_webp_functions, webp_load) [HAVE_WEBP]: New
functions for WebP support.
(image_types) [HAVE_WEBP]: Define WebP format.
(syms_of_image) <Qwebp> [HAVE_WEBP]: New DEFSYM.  Add image type Qwebp.
* src/Makefile.in (LIBIMAGE): Add WEBP_LIBS.

* lisp/files.el (auto-mode-alist):
* lisp/image-file.el (image-file-name-extensions):
* lisp/image.el (image-type-header-regexps)
(image-type-file-name-regexps, image-type-auto-detectable): Add WebP
support.
* lisp/term/w32-win.el (dynamic-library-alist): Add the libwebp DLL.

* INSTALL:
* admin/CPP-DEFINES:
* doc/lispref/display.texi (Image Formats, Other Image Types):
* nt/INSTALL: Document WebP support.

* test/lisp/image-tests.el (image-find-image)
(image-type-from-file-name): Expand tests.
* test/src/image-tests.el (image-tests--files): Add WebP.
(image-tests-image-size/webp, image-tests-image-mask-p/webp)
(image-tests-image-metadata/webp): New tests.
* test/data/image/black.webp: New file.
2021-10-22 10:59:01 +02:00
Paul Eggert
33525102e7 Pacify GCC -Wanalyzer-possible-null-dereference
This fixes the only remaining GCC diagnostics when emacs-28 is
configured with --enable-gcc-warnings.  It does so by adding
ATTRIBUTE_RETURNS_NONNULL so that GCC knows certain functions
return nonnull.  It also arranges for three of those functions to
always return nonnull; I thought these functions already were
doing so, but apparently not, and it is conceivable (though I
haven’t checked this) that changing these functions to always
return nonnull even on non-GNU platforms may fix unlikely
portability bugs elsewhere in Emacs.  I used GCC 11.2.1 20210728
(Red Hat 11.2.1-1) on x86-64 when checking the diagnostics.
* configure.ac: Invoke gl_EEMALLOC before gl_INIT, in case
the regex code doesn't invoke gl_EEMALLOC; needed for src/alloc.c’s
use of MALLOC_0_IS_NONNULL.
* src/alloc.c (xmalloc, xzalloc, xrealloc): Don’t worry about the
special case where SIZE == 0, since lmalloc and lrealloc now
return null only on allocation failure.
(lmalloc, lrealloc): Return null only on allocation failure,
instead of having special cases that treat malloc (0) and
realloc (X, 0) as successes even when they return null.
* src/lisp.h: Add ATTRIBUTE_RETURNS_NONNULL to a few functions
that always return nonnull pointers, so that gcc -fanalyzer
does not issue diagnostics like “alloc.c: In function
‘allocate_vector_block’: alloc.c:2985:15: warning: dereference of
possibly-NULL ‘block’ [CWE-690] [-Wanalyzer-possible-null-dereference]”
as per <https://cwe.mitre.org/data/definitions/690.html>.
2021-10-13 11:47:20 -07:00
Glenn Morris
1b11fcae92 Merge from origin/emacs-28
1ccd3eb721 (origin/emacs-28) ; Fix typo in etc/NEWS
0f28ee94ac * NEWS: Mention rcirc connects to #emacs by default
aacafbe267 Refactor mh-utils-tests macro 'with-mh-test-env'
ead5c5cc51 Avoid using variable before it has been initialized
b2c50d7cf3 Clarify docstring of blink-matching-paren
d2a34cabcf ; Very minor touch-up to a recent change
36a7ce4393 ; * doc/emacs/trouble.texi (After a Crash): Fix typo.
1cd1b2835b * doc/misc/gnus.texi (Loose Threads): Use regexp-opt in ex...
9f041cdfac Bump project.el version
ad2287e659 Retain compatibility with older project.el projects
d86b2e59c7 native-comp-available-p is the definitive test
1b383ac424 Minor fix of a recently installed documentation change
4d76765b6c Fix md5 issue in recent Gnulib merge
18308b739a Tweak recent 'configure' fix

# Conflicts:
#	etc/NEWS
2021-10-06 07:50:33 -07:00
Paul Eggert
18308b739a Tweak recent 'configure' fix
* configure.ac (gt_TYPE_WINT_T): Omit obsolete and
now-overridden definition.
2021-10-05 09:09:22 -07:00
Glenn Morris
2dc88a27a4 Merge from origin/emacs-28
63abe976ce (origin/emacs-28) Document minibuffer-default-prompt-forma...
b5afbedc90 Backward compatibility option for 'nobreak-char-display'
ea1b728a06 ; * lisp/dired.el: Fix typo.
984eafeb98 Unbreak the build after Gnulib update
5946370cd1 Check, whether an FUSE mount has been broken in Tramp
90575a6c0c Disable 'nobreak-char-display' in Eldoc buffers
570e2c9a17 Fix small error in comint-send-input
fd7bb31412 Update documentation of search-whitespace-regexp
1f4ced47a1 Fix cc-compat.el syntax error
b431f54c1b Mention `seq-uniq' in `delete-dups' documentation
0a7bab689c ; Minor stylistic fixes found by checkdoc
e2861e2d08 ; * etc/NEWS: Fix typo.
1a65d49931 Port recent Gnulib changes to MS-Windows
68a256c892 Update from Gnulib
63cb65dcce * Fix mh tests for native comp builds (bug#50975)
e606cc6f40 * Fix `batch-native-compile' not to spawn a subprocess
894dfe70da Fix native-compilation build from tarball on Cygwin
2ce5e08058 Remove U+FE0F from script-representative-chars

# Conflicts:
#	etc/NEWS
2021-10-05 07:50:22 -07:00
Eli Zaretskii
984eafeb98 Unbreak the build after Gnulib update
* lib/gnulib.mk.in (GNULIBHEADERS_OVERRIDE_WINT_T): Rename from
GNULIB_OVERRIDES_WINT_T.
* configure.ac (GNULIBHEADERS_OVERRIDE_WINT_T): Define.
(Bug#50985)
2021-10-05 15:55:18 +03:00
Eli Zaretskii
44c13eefe8 Update emacs-module sources for Emacs 29
* configure.ac (module_env_snippet_29): New.

* src/module-env-28.h: Remove the comment with instructions for
the next release.
* src/module-env-29.h: New file.
2021-09-30 20:26:00 +03:00
Eli Zaretskii
3478e64c88 Bump Emacs version to 29.0.50
* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp:
* src/msdos.c (internal_terminal_init):
* etc/refcards/ru-refcard.tex:
* etc/NEWS: Bump Emacs version to 29.0.50.
* etc/NEWS.28: New file.

* lisp/cus-edit.el (customize-changed-options-previous-release):
Update the reference version of Emacs.
2021-09-30 20:11:43 +03:00
Eli Zaretskii
2750d97543 Cut the emacs-28 release branch
* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 28.0.60.

* lisp/cus-edit.el (customize-changed-options-previous-release):
Update the last released version of Emacs.
2021-09-30 20:05:09 +03:00
Dan Ports
5444f607a6 Use the newest gcc installed by Macports
* configure.ac: There may be more than one gcc version installed
in Macports (bug#50649).  Use the newest.

Copyright-paperwork-exempt: yes
2021-09-18 16:04:38 +02:00
Alan Third
443d37ff21 Fix libgccjit detection on macOS
* configure.ac: Combine the Homebrew and MacPorts detection so they
will not create nonsense flags if both are installed.
2021-09-14 10:08:11 +01:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Lars Ingebrigtsen
31226b0341 Only look for the port command on MacOS
* configure.ac: Only look for the port command on MacOS (bug#50259).
2021-08-30 01:20:30 +02:00
Clément Pit-Claudel
9117a76b53 Change --with-nativecomp to --with-native-compilation in messages
* configure.ac:
* test/infra/Dockerfile.emba:
* test/infra/gitlab-ci.yml: Fix mentions of --with-nativecomp
(bug#50255).
2021-08-29 21:32:01 +02:00
Alan Third
5eab7c3f70 * configure.ac: Make homebrew check for libgccjit match macports. 2021-08-21 13:12:56 +01:00
Yuuki Harano
299cfb413f * configure.ac: Add a notice to --with-pgtk 2021-08-15 17:15:54 +09:00
Yuuki Harano
c76d5ff243 * configure.ac: Remove imagemagick special support code for pgtk
When emacs did not support imagemagick 7 and I had imagemagick both 6 and 7,
I wanted to use imagemagick 6.
The code is not needed any more.
2021-08-15 17:07:56 +09:00
Grégoire Jadi
23973a5898 Fix freeze on OpenBSD when reading the SECONDARY selection
* configure.ac (NSIG_MINIMUM): OpenBSD doesn't have a broken SIGIO
any more (bug#29170).  Backport fix from the current OpenBSD port
tree.
2021-08-09 14:25:36 +02:00
Lars Ingebrigtsen
8ce7a697ca Allow building on MacOS with MacPorts and libgccjit
* configure.ac: Check for the "port" command (MacPorts).
Add the required lib/include directories for nativecomp.

* src/Makefile.in (LIBGCCJIT_CFLAGS, LIBGCCJIT_LIBS): Split into
two parts to allow including -L/-I for MacPorts.
(LIBES): Adjust.
(EMACS_CFLAGS): Ditto.
2021-08-07 11:56:44 +02:00
Alan Third
a4d2c88cde Simplify macOS drawing code
Convert EmacsSurface into a CALayer subclass so we can use the
built-in relationships.  Also simplify the macOS versioning code.
This will result in more warnings on older versions of macOS but makes
reading the code easier.

* configure.ac: Add QuartzCore framework.
* src/nsterm.h (NS_DRAW_TO_BUFFER): Remove define and all references.
(EmacsSurface, EmacsLayer): Rename EmacsSurface to EmacsLayer and
modify the definition to fit the new function.
* src/nsterm.m (ns_update_begin):
(ns_update_end):
(ns_focus):
(ns_unfocus): Use the new overridden lockFocus and unlockFocus and
simplify the frame management.
([EmacsView dealloc]):
([EmacsView viewDidResize:]):Don't explicitly release surfaces.
([EmacsView initFrameFromEmacs:]): Move the layer code to after the
NSWindow has been created as creating the layer now relies on some of
it's properties.
([EmacsView makeBackingLayer]): New function.
([EmacsView lockFocus]):
([EmacsView focusOnDrawingBuffer]): Rename to lockFocus.
([EmacsView unlockFocus]):
([EmacsView unfocusDrawingBuffer]): Rename to unlockFocus.
([EmacsView windowDidChangeBackingProperties]): Don't explicitly
release surfaces but reset EmacsLayer properties.
([EmacsView layout]):
([EmacsView viewWillDraw]): Rename to layout.
([EmacsView wantsUpdateLayer]): Remove function and change all callers
to [EmacsView wantsLayer].
(EmacsSurface, EmacsLayer): Rename to EmacsLayer.
([EmacsSurface getSize]):
([EmacsSurface initWithSize:ColorSpace:Scale:]): Remove methods.
([EmacsSurface initWithColorSpace:]):
([EmacsLayer checkDimensions]):
([EmacsLayer releaseSurfaces]):
([EmacsLayer display]): New functions.
* src/nsterm.m ([EmacsLayer dealloc]): Use releaseSurfaces.
([EmacsSurface getContext]): Automatically detect frame property
changes and clear the cache if required.  Use built-in CALayer
properties where available.
([EmacsLayer copyContentsTo:]): Use [CALayer contents] as source.
2021-07-31 11:13:05 +01:00
Yuuki Harano
492a0ae592 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-07-04 22:37:03 +09:00
Alan Third
1b88404acc Fix NS self contained eln location (bug#49271)
* Makefile.in:
* configure.ac: Change eln file install location to
Contents/Frameworks.
* src/comp.c (hash_native_abi): Replace dots with underscores in the
eln install location as the macOS code-signing tool won't sign the
files if the parent directories have dots.
2021-07-01 20:41:58 +01:00
Alan Third
995ab9d0a9 Fix NS native comp search path (bug#49270)
* configure.ac (NS_SELF_CONTAINED): We need to make lispdirrel the
same as lispdir when building a self contained app bundle as they're
both relative paths.
2021-07-01 20:41:57 +01:00
Alan Third
ecf7e8b20e Fix NS self-contained build configuration
* configure.ac: When rebuilding epaths.h for NS check that we're
actually doing an NS build first.
2021-06-26 12:48:15 +01:00
Alan Third
5dd2d50f3d Fix NS native compilation builds
* Makefile.in (ns_applibexecdir):
(ns_applibdir):
(ns_appdir): New variables.
(.PHONY): Include new rule.
(epaths-force-ns-self-contained): Remove the app bundle directory from
all paths.
* configure.ac (NS_SELF_CONTAINED): Set the default site-lisp
directory instead of hard-coding it in the ObjC code, and use the new
epaths generating make rule.
* src/callproc.c (init_callproc_1):
(init_callproc): Remove all the NS specific code as the special cases
are now handled by decode_env_path.
* src/emacs.c (load_pdump):
(decode_env_path): Use ns_relocate to find the correct directory after
relocation.
* src/lread.c (load_path_default): Remove all the NS specific code as
the special cases are now handled by decode_env_path.
* src/nsterm.h: Update function definitions.
* src/nsterm.m (ns_etc_directory):
(ns_exec_path):
(ns_load_path): Remove functions that are no longer needed.
(ns_relocate): New function to calculate paths within the NS app
bundle.
* nextstep/Makefile.in (ns_applibexecdir): New variable, and update
anything relying on the libexec location.
2021-06-26 10:34:59 +01:00
Peter Oliver
57ec4aadc6 Advertise support for Startup Notification when built with GTK
* etc/emacsclient.desktop, etc/emacsclient.desktop: Specify
StartupNotify=true.
* configure.ac (USE_STARTUP_NOTIFICATION): New variable, yes iff
HAVE_GTK.
* Makefile.in (install-etc): Remove StartupNotify=true from
etc/*.desktop unless USE_STARTUP_NOTIFICATION (bug#48783).
2021-06-22 15:17:28 +02:00
Yuuki Harano
7d5e94bada Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-06-13 17:34:06 +09:00
Eli Zaretskii
3272cfa8d4 ; Fix last change. 2021-06-03 10:49:09 +03:00
Eli Zaretskii
ed19ffc346 * configure.ac: Clarify "smoke test" error message. (Bug#48804) 2021-06-03 10:46:54 +03:00
Eli Zaretskii
6a152f898d * configure.ac: Improve error messages about libgccjit. 2021-06-03 09:55:00 +03:00
Yuuki Harano
67ae4b6271 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-05-29 18:00:13 +09:00
Eli Zaretskii
b2eed2ae56 Clean up the fix for unexec build on GNU/Linux
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS && HAVE_UNEXEC]:
Include <stdlib.h> here, before redirecting 'malloc' and friends
to their hybrid_* and unexec_* equivalents.  #undef malloc and
friends before redefining.  Provide prototypes for the
replacements.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
* src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc'
and friends, as they are now redundant: we include <stdlib.h> in
conf_post.h before redefining 'malloc' etc., and that provides
prototypes from system headers.

* configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement
of 'free' by Gnulib.  (Bug#36649)
2021-05-20 11:26:00 +03:00
Eli Zaretskii
5e1a8d5654 Fix the unexec build on GNU/Linux
The unexec build on GNU/Linux must use HYBRID_MALLOC (gmalloc.c) and
sheap.c.  This was inadvertently disabled because a configure-time
test for 'sbrk' was moved as side effect of an unrelated change.

* configure.ac: Test for 'sbrk' before using the result in the
decision about SYSTEM_MALLOC and HYBRID_MALLOC.
(HYBRID_MALLOC): Prevent Gnulib from redirecting 'free' to its
replacement 'rpl_free'.

* lib/Makefile.in (not_emacs_OBJECTS): Add mallooc/%.o and free.o.
2021-05-19 17:42:50 +03:00
Yuuki Harano
66a36f1e5a Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-04-27 21:12:21 +09:00
Andrea Corallo
289000eee7 Merge branch 'feature/native-comp' into into trunk 2021-04-25 20:06:22 +02:00
Yuuki Harano
b302a551ab Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-04-25 15:30:05 +09:00
Eli Zaretskii
9904aaebf7 ; * configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Fix last change. 2021-04-22 22:11:08 +03:00
Eli Zaretskii
61828e55a8 Fix MS-Windows link switches for unexec
* configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR
when linking for unexec.  Reported by Nikolay Kudryavtsev
<nikolay.kudryavtsev@gmail.com>.
2021-04-22 20:23:23 +03:00
Yuuki Harano
de46c7796e Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-04-18 15:30:29 +09:00
Andrea Corallo
686259e65a * configure.ac: Revert prev commit and fix native-comp NetBSD build. 2021-04-14 23:58:54 +02:00
Andrea Corallo
bfaa6df492 * configure.ac: Fix native-comp FreeBSD build. 2021-04-14 20:03:17 +02:00
Andrea Corallo
b064ddd3f6 Merge remote-tracking branch 'savannah/master' into native-comp 2021-04-13 12:06:23 +02:00
Philipp Stephani
17d20bb3cb Generate Seccomp filters only if we have the necessary constants.
If we're missing SECCOMP_SET_MODE_FILTER, the seccomp-filter build
fails.  Reuse the existing HAVE_SECCOMP configuration variable, which
checks for these macros.

* configure.ac (HAVE_SECCOMP): Substitute in Makefile.in.
* lib-src/Makefile.in (HAVE_SECCOMP): New variable.
(SECCOMP_FILTER): Define only if HAVE_SECCOMP.
2021-04-12 09:15:59 +02:00
Andreas Schwab
751e801f90 Fix check for timer_getoverrun
* configure.ac (timer_getoverrun): Move check after gnulib checks
and use $LIB_TIMER_TIME during check.
2021-04-11 17:33:33 +02:00
Philipp Stephani
725fc96b70 Use pkg-config to check for libseccomp.
We need at list version 2.4.0 of libseccomp for seccomp-filter.c to
build cleanly.

* configure.ac: Use pkg-config to check for libseccomp.
* lib-src/Makefile.in (HAVE_LIBSECCOMP, LIBSECCOMP_LIBS)
(LIBSECCOMP_CFLAGS): New variables.
(SECCOMP_FILTER, seccomp-filter$(EXEEXT)): Use them.
2021-04-11 16:50:29 +02:00
Philipp Stephani
0334fa0532 Add another check for the required header <linux/filter.h>.
* configure.ac: Also check for <linux/filter.h>.
* src/emacs.c (SECCOMP_USABLE): Also check for <linux/filter.h>.
2021-04-11 12:26:13 +02:00
Philipp Stephani
25937821bc Also check for needed seccomp macros.
It looks like these are not available on some versions of GNU/Linux,
breaking the build.

* configure.ac: Also check for needed seccomp macros.
* src/emacs.c (SECCOMP_USABLE): New macro.
(usage_message, main, standard_args): Use it.
2021-04-11 12:01:53 +02:00
Philipp Stephani
1060289f51 Add a helper binary to create a basic Secure Computing filter.
The binary uses the 'seccomp' helper library.  The library isn't
needed to load the generated Secure Computing filter.

* configure.ac: Check for 'seccomp' header and library.

* lib-src/seccomp-filter.c: New helper binary to generate a generic
Secure Computing filter for GNU/Linux.

* lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper
binary if possible.
(all): Add Secure Computing filter file if possible.
(seccomp-filter$(EXEEXT)): Compile helper binary.
(seccomp-filter.bpf seccomp-filter.pfc): Generate filter files.

* test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout)
(emacs-tests/seccomp/forbids-subprocess): New unit tests.

* test/Makefile.in (src/emacs-tests.log): Add dependency on the helper
binary.
2021-04-10 21:10:16 +02:00
Philipp Stephani
be8328acf9 Add support for --seccomp command-line option.
When passing this option on GNU/Linux, Emacs installs a Secure
Computing kernel system call filter.  See Bug#45198.

* configure.ac: Check for seccomp header.

* src/emacs.c (usage_message): Document --seccomp option.
(emacs_seccomp): New wrapper for 'seccomp' syscall.
(load_seccomp, maybe_load_seccomp): New helper functions.
(main): Potentially load seccomp filters during startup.
(standard_args): Add --seccomp option.

* lisp/startup.el (command-line): Detect and ignore --seccomp option.

* test/src/emacs-tests.el (emacs-tests/seccomp/absent-file)
(emacs-tests/seccomp/empty-file)
(emacs-tests/seccomp/file-too-large)
(emacs-tests/seccomp/invalid-file-size): New unit tests.
(emacs-tests--with-temp-file): New helper macro.

* etc/NEWS: Document new --seccomp option.
2021-04-10 18:47:26 +02:00
Alan Third
8ed46b7646 Remove hardcoded gcc version
* configure.ac: Use 'find' to find the brew installed libgccjit libs
instead of a hardcoded path.
2021-04-07 19:05:55 +01:00
Alan Third
c35a515a2f Fix install with NS app bundle
* configure.ac: Set up CFLAGS and LDFLAGS to find a Homebrew
installation of libgccjit.
* Makefile.in (ELN_DESTDIR): Set to the app bundle resource dir when
required.
(install-eln): macOS install doesn't support the -D flag, so make the
directories separately.
2021-04-07 09:06:00 +01:00
Yuuki Harano
5d2f319eec Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-03-21 15:54:46 +09:00
Andrea Corallo
6ca6c71cd0 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-19 15:28:00 +01:00
Lars Ingebrigtsen
2c3340909a Warn the user if we can't find pkg-config
* configure.ac (WITH_IFAVAILABLE): Warn the user if we can't find
a usable pkg-config (bug#47159).
2021-03-19 08:58:32 +01:00
Andrea Corallo
82bd6d57d5 Merge remote-tracking branch 'savannah/master' into native-comp 2021-03-12 16:42:51 +01:00
Andrea Corallo
43b0df62cd Merge commit '9cbdf20316' into native-comp 2021-03-09 10:03:47 +01:00