Commit graph

1615 commits

Author SHA1 Message Date
Paul Eggert
f84fb38a82 Fix SELinux config without -lselinux
Without this fix, a 64-bit build on Ubuntu 25.10 x86-64 failed
when the libselinux1-dev:i386 package (providing <selinux/selinux.h>)
was installed but the libselinux1-dev package (providing
/usr/lib/x86_64-linux-gnu/libselinux.so) was not.
The first symptom was when compiling emacsclient:
‘/usr/bin/ld: ../lib/libgnu.a(file-has-acl.o): in function
`get_aclinfo': .../lib/file-has-acl.c:247:(.text+0x4d8): undefined
reference to `getfilecon'’.
* configure.ac: Default with_selinux to maybe, not to yes.
Defer our SELinux configuration to after Gnulib’s, so that
we handle any SELinux problems that Gnulib discovers.
2026-02-15 12:18:30 -08:00
Yuan Fu
69dc5d3f0e
Fix tree-sitter traversal slowness (bug#80108)
* configure.ac (LIBSYSTEMD_CFLAGS): Increase minimal required
tree-sitter version to 0.20.10.
* src/treesit.c (treesit_traverse_sibling_helper): When
traversing forward, use the new function
ts_tree_cursor_goto_previous_sibling.
2026-01-28 01:08:52 -08:00
Basil L. Contovounesios
2092516a74 Clarify libwebp configuration checks
* configure.ac [HAVE_WEBP]: Explicitly check for both libwebpdemux
and libwebp (where the former depends on the latter), since we use
both (bug#57420, bug#61988, bug#66221).  Check for WebPDecodeRGBA as
a representative of libwebp and libwebpdecoder now that we no longer
use WebPGetInfo elsewhere.  Prepend WEBP_LIBS to LIBS as per
AC_CHECK_LIB.  Clarify commentary.
2026-01-24 19:37:30 +01:00
Paul Eggert
c0afab671c Omit -Wzero-as-null-pointer-constant
* configure.ac: If --enable-gcc-warnings, don’t use
-Wzero-as-null-pointer-constant, which is enabled by default with
bleeding-edge Gnulib (as there seems to be movement in this
direction in C2y).  Although -Wzero-as-null-pointer-constant is
useful, Emacs isn’t clean for it yet.
2026-01-19 12:49:15 -08:00
Yavor Doganov
bc5fb19d16 NS: Fix startup with HAVE_NATIVE_COMP && !NS_SELF_CONTAINED
* src/pdumper.c (pdumper_set_emacs_execdir): Add workaround for
!NS_SELF_CONTAINED so that launching Emacs from the app bundle
works flawlessly when built with native compilation.
* configure.ac: Define BINDIR.  (Bug#80094)
2026-01-17 16:56:50 +02:00
Yavor Doganov
98f56a156e NS: Use Cocoa implementation of EmacsBell -init if named image is declared
* configure.ac: Check for 'NSImageNameCaution' declaration when
building on GNUstep.
* src/nsterm.m ([EmacsBell init]): Use fallback implementation on
GNUstep only if 'NSImageNameCaution' is not declared.  (Bug#80107)
2026-01-10 14:30:43 +02:00
Sean Whitton
c31f6adc31 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Paul Eggert
1880cd0aa5 Use GCC warning -Wunused-const-variable=2
* configure.ac: Stop suppresssing -Wunused-const-variable=2 when
configured --with-gcc-warnings.  Suppressing no longer seems to be
needed with current GCC and src/lisp.h.
2025-12-13 21:33:01 -08:00
Paul Eggert
b9b0c7ed51 Work even if aclocal is invoked by hand
Problem reported by Ulrich Müller (bug#79974).
* configure.ac (gl_ALIGNASOF): Arrange for it to be defined
even if aclocal is invoked other than via admin/merge-gnulib.
Also, change comments from # to dnl as they don’t make
much sense in the shell script.
2025-12-09 18:04:29 -08:00
Paul Eggert
88bf047d39 Garbage-collect Gnulib sources
Remove Gnulib sources no longer needed or used.
admin/merge-gnulib is typically not smart enough to do that.
* configure.ac: Do not call gl_EEMALLOC, as it is no longer
supplied or needed.
* lib/explicit_bzero.c, lib/malloc/scratch_buffer_dupfree.c:
* lib/xalloc-oversized.h, m4/eealloc.m4, m4/explicit_bzero.m4:
* m4/st_dm_mode.m4, m4/year2038.m4:
Remove.
2025-12-09 13:27:27 -08:00
Paul Eggert
4990849514 Move Gnulib configuration back to where it was
* configure.ac: Move the gl_INIT call back to where it was,
as Mattias Engdegård reported the following problem:
  checking whether pthread_sigmask is a macro... no
  ./configure: line 32767: test: =: unary operator expected
because moving gl_INIT up made the check for pthread_sigmask’s
availability appear later than Gnulib’s check whether it’s a macro.
Instead of moving gl_INIT up, call gl_ALIGNASOF earlier,
as that’s the only part of gl_INIT that is needed earlier.
2025-12-08 18:19:41 -08:00
Paul Eggert
0d43f2a562 Align config.h better to src/lisp.h
This is mostly a cleanup patch to fix growing discrepancies
between src/lisp.h and configure.ac in terms of how they deduce
how EMACS_INT aligns.  The patch includes a static check that the
two methods now agree.  It also speeds up ‘configure’ a bit.
* configure.ac (ALIGNOF_INT, ALIGNOF_LONG, ALIGNOF_LONG_LONG):
Remove; no longer used.
(ALIGNOF_EMACS_INT): New macro.
(system_malloc): Set to 'no' more consistently with what’s
in src/lisp.h.
* src/lisp.h (ALIGNOF_EMACS_INT): Do not define here, as config.h
defines it now.  Check that config.h’s definition equals the
actual alignof (EMACS_INT).
(USE_USB_TAG): Set more consistently with what’s in configure.ac.
(alignas): Don’t second-guess Gnulib.
2025-12-07 15:45:20 -08:00
Paul Eggert
a8b9364949 Move Gnulib configuration up in configure.ac
This is so that later patches can fix some near-duplication errors
in the malloc configuration.
* configure.ac: Move Gnulib configuration earlier.
2025-12-07 15:45:19 -08:00
Paul Eggert
2203fac659 Remove some obsolete C89, C99, Automake cruft
These have not been needed for some time in configure.ac.
* configure.ac (_AC_PROG_CC_C89): Don’t bother redefining to empty.
(gl_PROG_CC_C99, AC_PROG_CC_C_O): Remove; no longer needed.
2025-12-07 15:45:19 -08:00
Alexander Adolf
3e81d0573a ; xwidgets: pacify macOS compiler warnings
* configure.ac: When the WebKit header files are not available
in the hard-coded location, query for the location of the
currently active SDK, and resort to the header files there.
(Bug#79847)
2025-12-06 12:15:46 +02:00
Paul Eggert
1b2b433fc0 Port to GNU/Linux HPPA malloc
On this platform, you cannot reliably malloc objects containing
values of type pthread_mutex_t or pthread_cond_t, since malloc
guarantees only 8-byte alignment but these two types require
16-byte alignment.  See GCC bug 115750
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115750> reported by
Sam James and Emacs bug 79936 <https://bugs.gnu.org/79936>
reported by John Paul Adrian Glaubitz.
* configure.ac (ALIGNOF_MAX_ALIGN_T, ALIGNOF_PTHREAD_COND_T)
(ALIGNOF_PTHREAD_MUTEX_T) [HAVE_PTHREAD]: New C macros.
* src/systhread.c (sys_mutex_init, sys_mutex_lock)
(sys_mutex_unlock, sys_cond_init, sys_cond_wait)
(sys_cond_signal, sys_cond_broadcast, sys_cond_destroy):
Use SYTHREAD_ALIGN_PTR to convert sys_mutex_t and sys_cond_t to
pthread_mutex_t and pthread_cond_t, since runtime conversion is
needed on GNU/Linux HPPA.
* src/systhread.h (SYSTHREAD_ALIGN_ROOM, SYSTHREAD_ALIGN_PTR):
New macros, which affect the generated code only on
unusual platforms like GNU/Linux HPPA.
(sys_mutex_t, sys_cond_t) [HAVE_PTHREAD]: Use them.
2025-12-02 17:46:56 -08:00
Paul Eggert
85f2bf2bc7 Port better to GNUstep with Nix gcc
Problem reported by David Caldwell (bug#79879).
* configure.ac: When configuring for GNUstep and the
Objective C compiler does not support even C99 features,
use the first flag of -std=gnu23, -std=gnu17, -std=gnu11, -std=gnu99
that works, instead of insisting on -std=c99 which (a) is too
strict and (b) can override another -std= option in an
undesirable way.
2025-11-27 23:40:14 -08:00
Po Lu
32fc382e9e Disable C23 for Android builds
* configure.ac (ac_cv_prog_cc_c23): Define to no when
configuring for Android.
2025-11-21 10:01:10 +08:00
Po Lu
aba7974607 * configure.ac Remove patch for bugs in nproc that have been remediated. 2025-11-07 09:36:08 +08:00
Po Lu
e54fd7c012 Fix compilation on Android SDK 20 and earlier
* configure.ac (gl_PREREQ_NPROC): Disable ac_cv_header_mntent_h
if on Android and setmntent is not declared.
2025-11-05 11:10:11 +08:00
Po Lu
240355949e Fix the Android port
* configure.ac (gl_cv_onwards_func_tzalloc): Don't disable on
Android SDK 35.

* src/conf_post.h (tzalloc): Don't override Gnulib-selected
identifier on Android SDK 35.
2025-11-05 10:32:52 +08:00
Robert Pluim
dc5ae70cb4 Fix macOS build with SDK version 26
* configure.ac: Use gl_CHECK_FUNCS_ANDROID_MACOS to check for
'posix_spawn_file_actions_addchdir', since it checks which
version of macOS is being used for the build, rather than what
is available in the SDK.  (Bug#79489)
2025-09-29 15:53:36 +02:00
Po Lu
752894ef54 ; * configure.ac: Document why AC_CONFIG_SUBDIRS is not suitable for `exec'. 2025-09-29 09:48:04 +08:00
Paul Eggert
3415fa15e4 ; Update comment re GCC bugs 117423 and 119085. 2025-09-17 14:26:30 -07:00
Paul Eggert
33adf9ea4e Update comments re GCC bugs 117423 and 119085 2025-08-20 15:37:00 -07:00
Paul Eggert
0eaf5c045f GCC union bugs to be fixed in GCC 15.2
Thanks to Martin Jambor for the GCC fixes; see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423#c27
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119085#c12
Also, thanks to Sam James for letting me know.
* configure.ac (emacs_cv_gcc_union_bugs_CFLAGS):
Rename from emacs_cv_gcc_bug_119085_CFLAGS.  All uses changed.
Assume the GCC union bugs will be fixed in GCC 15.2.
2025-07-30 18:41:26 -07:00
Paul Eggert
69af0d4c85 GCC bug 119085 fixed in GCC 16
* configure.ac (emacs_cv_gcc_bug_119085_CFLAGS):
Assume the bug is fixed starting in GCC 16.
2025-07-23 13:05:56 -07:00
Paul Eggert
07ee5ebeca GCC bug 117423 has a fix
Document the change in dependency.  As we still need to work
around GCC bug 119085, there is no functional change in ‘configure’.
* configure.ac (emacs_cv_gcc_bug_119085_CFLAGS):
Rename from emacs_cv_gcc_bug_117423_CFLAGS.  All uses changed.
2025-07-18 11:50:13 -07:00
Paul Eggert
f3d3a5803e Work around GCC bug 121030
* configure.ac: Disable -Wanalyzer-use-of-uninitialized-value.
2025-07-13 15:26:46 -07:00
Po Lu
82af5c10c5 * configure.ac: Detect Android API 36. 2025-06-11 10:35:28 +08:00
Collin Funk
1b03a348f7 Pacify Clang's -Wformat-signedness.
* configure.ac: Enable -Wno-format-signedness if Clang is being used.
2025-06-02 00:23:45 -07:00
Paul Eggert
9dfc605654 Work around GCC bug 117423
Problem reported by Oliver Reiter and Pip Cet (Emacs bug#78473).
It looks like GCC tree-sra is trouble in general with how Emacs
uses unions, so disable tree-sra until the GCC bug is fixed.
* configure.ac (C_SWITCH_MACHINE): Also work around GCC bug 117423.
2025-05-21 10:10:57 -07:00
Po Lu
fa05cfd445 Fix compilation on Android 35 and on Termux
* configure.ac (gl_cv_onwards_func_tzalloc): Define to "future
OS version" on Android API 35 and later.
Detect posix_spawn* by means of gl_CHECK_FUNCS_ANDROID.

* src/conf_post.h (tzalloc, tzfree): Define to non-conflicting
names on Android 35 and later.
2025-05-06 22:29:46 +08:00
Paul Eggert
589f596c96 Use -Wtrailing-whitespace when warning
* configure.ac: When enabling GCC warnings, enable GCC 15’s new
-Wtrailing-whitespace option if available, as that’s the Emacs style.
2025-04-19 19:31:27 -07:00
Paul Eggert
3169aeb421 ; Fix typo in comment. 2025-04-12 12:30:58 -07:00
Ulrich Müller
5dc0981875 New configure option --with-systemduserunitdir
* configure.ac (systemduserunitdir): New variable and option.
* Makefile.in (systemduserunitdir): New, set by configure.
(install-etc, uninstall): Don't install emacs.service when
systemduserunitdir is unspecified.
* etc/NEWS: Announce the new configure option.  (Bug#76924)
2025-03-14 08:01:47 +01:00
Po Lu
26f5e6339b Don't warn about Xft >= 2.3.6
* configure.ac: Don't warn about Xft >= 2.3.6.  Clarify warning
message printed on old releases.
2025-03-12 17:28:37 +08:00
Sean Whitton
2aef2951c0 ; Replace "Elisp" with "Lisp" or "Emacs Lisp" in some places
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/lispref/elisp.texi (Top):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/TODO:
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* src/frame.c (do_switch_frame):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test): Say "Lisp"
not "Elisp".
* lisp/progmodes/peg.el (peg-translate-exp): Say "Emacs Lisp"
not "Elisp".
2025-03-12 10:24:22 +08:00
Sean Whitton
60c0524ad2 Fix capitalization ELisp -> Elisp
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/emacs/buffers.texi (List Buffers):
* doc/lispref/elisp.texi (Tree-sitter C API):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/DEBUG:
* etc/NEWS:
* etc/NEWS.25:
* etc/NEWS.26:
* etc/NEWS.28:
* etc/NEWS.30:
* etc/TODO:
* lib-src/emacsclient.c (print_help_and_exit):
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/cedet/semantic/wisent/comp.el
(wisent-automaton-lisp-form):
* lisp/cedet/srecode/el.el (srecode-semantic-apply-tag-to-dict):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/bindat.el (bindat-type):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/cl-macs.el (cl--labels-convert):
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs)
(lisp-fill-paragraphs-as-doc-string):
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/emacs-lisp/re-builder.el:
* lisp/erc/erc-button.el (erc-emacswiki-lisp-url):
* lisp/help-fns.el
(help-fns--describe-function-or-command-prompt):
* lisp/menu-bar.el (menu-bar-search-documentation-menu):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* lisp/org/org-capture.el (org-capture):
* lisp/org/org.el (org-category, org-todo):
* lisp/org/ox.el (org-export-async-start):
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
* lisp/progmodes/peg.el (peg-translate-exp):
* lisp/progmodes/ruby-ts-mode.el:
* lisp/woman.el (woman-mode, woman-parse-numeric-arg):
* src/chartab.c (map_char_table_for_charset):
* src/fns.c (extract_data_from_object):
* src/frame.c (do_switch_frame):
* src/keyboard.c (make_lispy_event):
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test):
* test/manual/etags/c-src/emacs/src/keyboard.c
(make_lispy_event): Fix capitalization ELisp -> Elisp.
2025-03-12 09:38:33 +08:00
Po Lu
02681b0fbf Don't claim that xftfont is being considered for deletion
* configure.ac: Don't claim that Xft is being considered for
deletion or that recent releases are buggy, or imply that
HarfBuzz support is exclusive to Cairo.
2025-03-10 11:28:38 +08:00
Po Lu
a5f8ce9f1e Re-port to 32-bit systems without alignment primitives
* configure.ac (ALIGNOF_INT, ALIGNOF_LONG, ALIGNOF_LONG_LONG):
New variables.
(emacs_cv_alignas_unavailable): Define if alignas and structure
alignment primitives are unavailable.  In such an environment,
the MSB tagging scheme must be enabled, as must the GNU malloc.

* msdos/sed2v2.inp: Adjust correspondingly.

* src/alloc.c (union emacs_align_type): Remove types which
contain flexible array members.  The address of a field
subsequent to an aggregate with flexible array members cannot
validly be taken.
(mark_memory) [!USE_LSB_TAG && !WIDE_EMACS_INT]: Strip type bits
before scanning memory.

* src/emacs.c (main):

* src/eval.c (Fautoload_do_load):

* src/fns.c (Frequire): Rename a number of illogically named
fields.

* src/lisp.h (ALIGNOF_EMACS_INT): Define to the natural
alignment of EMACS_INT.
(IDEAL_GCALIGNMENT): New macro.
(USE_LSB_TAG): Disable if no alignment specifiers are available,
WIDE_EMACS_INT is undefined, and the natural alignment of
EMACS_INT falls short of LSB tagging's requirements.
(gflags): Rename illogically named fields and don't define them
as bitfields, which runs afoul of certain compiler issues.
(will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
(dumped_with_pdumper_p): Adjust accordingly.

* src/pdumper.c (VM_SUPPORTED): Define to 0 when !USE_LSB_TAG.
It is better to read dump files into the heap by hand than to be
supplied with an address that is not representable.
(_dump_object_start_pseudovector): Rename to
dump_object_start_pseudovector, to avoid encroaching on reserved
names.
(START_DUMP_PVEC): Adjust correspondingly.
(dump_mmap_contiguous_vm): Preserve errno around failure
cleanup.
(dump_bitset_bit_set_p): Work around certain compiler issues.
(pdumper_load) [!USE_LSB_TAG]: Reject dump file allocations
that are not representable as Lisp_Objects.

Tested on i386-unknown-solaris2.10, sparc-sun-solaris2.10.
2025-03-09 23:07:33 +08:00
Stefan Kangas
678fdcc165 ; Grammar fixes for "native-compiled"
1. Prefer "native-compiled" to "native compiled".
The adjective "native-compiled" with the hyphen is generally more
consistent with the typical pattern in English, especially when the
compound modifies a noun (e.g., "native-compiled code").

2. Prefer "natively compiled" to "natively-compiled".
The adverb "natively" modifies "compiled", and it is standard not
to hyphenate an adverb + adjective combination when the adverb ends
in -ly (e.g., "code that is natively compiled").

For example, note that we say "high-speed internet" but "highly
performant code".

* Makefile.in (dest):
* configure.ac (HAVE_NATIVE_COMP):
* doc/emacs/building.texi (Lisp Libraries):
* doc/lispref/compile.texi (Native Compilation)
(Native-Compilation Functions, Native-Compilation Variables):
* doc/lispref/functions.texi (What Is a Function, Declare Form):
* doc/lispref/loading.texi (How Programs Do Loading, Library Search):
* etc/NEWS:
* etc/NEWS.28:
* etc/NEWS.29:
* etc/NEWS.30:
* lisp/emacs-lisp/comp-common.el (native-comp-never-optimize-functions)
(comp-function-type-spec):
* lisp/emacs-lisp/comp-cstr.el:
* lisp/subr.el (locate-eln-file):
* src/comp.c (SETJMP_NAME, syms_of_comp):
* src/data.c (Fsubrp, Fnative_comp_function_p, Fsubr_native_lambda_list):
* src/lread.c (Fload):
* src/pdumper.c (dump_do_dump_relocation):
* test/src/comp-tests.el (lambda-return2): Avoid grammatically incorrect
variations on "natively compiled" and "native-compiled".  (Bug#56727)
2025-02-28 20:20:55 +01:00
Po Lu
f3212fa420 * configure.ac (BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER): Correct test. 2025-02-21 13:29:40 +08:00
Po Lu
6e8bb75784 Fix compilation on Haiku Nightly hrev58622
* configure.ac (BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER):
Define if BObjectList ownership over its contents is specified
as a template parameter.

* src/haiku_support.cc (class EmacsFontSelectionDialog)
[BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER]: Adjust
accordingly.
2025-02-10 12:04:27 +08:00
Manuel Giraud
c4a67a4050 Fix OpenBSD compilation (bug#76009)
* configure.ac: Remove a bogus LD_SWITCH_SYSTEM for OpenBSD.
2025-02-03 23:21:50 +01:00
Eli Zaretskii
669bb2eaf5 Announce XINERAM and XRANDR in 'system-configuration-features'
* configure.ac (emacs_config_features): Add XINERAMA and XRANDR.
(Bug#75936)
2025-02-02 16:06:04 +02:00
Stefan Kangas
bf97946d7d Merge branch 'scratch/no-purespace' into 'master' 2025-02-01 04:56:52 +01:00
Paul Eggert
dcccb92562 Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h
* configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be
included (Bug#75667).
2025-01-19 16:23:27 -08:00
Paul Eggert
a94988c01d Port better to AIX 7.3 with -lz but not zlib.h
* configure.ac (HAVE_ZLIB, LIBZ):
Define only if zlib.h can be included (Bug#75667).
2025-01-19 16:23:27 -08:00
Paul Eggert
d65f727ab4 Port to AIX 7.3 ‘find’
* configure.ac (FIND_DELETE): Port to AIX 7.3 ‘find’,
which exits with nonzero status if ‘-exec rm -f {} +’
is never invoked.
2025-01-18 23:28:10 -08:00