From e245c4f226979ccb717cccc8f82b2b0a0f96bdac Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 3 Oct 2022 12:45:21 +0200 Subject: [PATCH] Add --with-native-compilation=aot configuration option * configure.ac: Allow --with-native-compilation=aot to switch full ahead-of-time on. * lisp/Makefile.in: Use the setting from configure. --- configure.ac | 24 +++++++++++++++++++++++- etc/NEWS | 6 ++++++ lisp/Makefile.in | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4590ed3506e..2d843440503 100644 --- a/configure.ac +++ b/configure.ac @@ -494,7 +494,6 @@ OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) OPTION_DEFAULT_ON([zlib],[don't compile with zlib decompression support]) OPTION_DEFAULT_ON([modules],[don't compile with dynamic modules support]) OPTION_DEFAULT_ON([threads],[don't compile with elisp threading support]) -OPTION_DEFAULT_OFF([native-compilation],[compile with Emacs Lisp native compiler support]) OPTION_DEFAULT_OFF([cygwin32-native-compilation],[use native compilation on 32-bit Cygwin]) OPTION_DEFAULT_ON([xinput2],[don't use version 2 of the X Input Extension for input]) OPTION_DEFAULT_OFF([small-ja-dic],[generate a smaller-size Japanese dictionary]) @@ -1009,6 +1008,29 @@ AC_ARG_ENABLE([gcc-warnings], [gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])]) fi]) +NATIVE_COMPILATION_AOT=no +AC_ARG_WITH([native-compilation], + [AS_HELP_STRING([--with-native-compilation@<:@=TYPE@:>@], + [compile with Emacs Lisp native compiler support. The TYPE + 'yes' (or empty) means to enable it and compile natively + preloaded Lisp files; 'no' means to disable it; + 'aot' will make the build process compile all the Lisp + files in the tree natively ahead of time. (This will + usually be quite slow.)])], + [ + case $withval in + aot) + withval=yes + NATIVE_COMPILATION_AOT=yes + ;; + yes|no) ;; + *) AC_MSG_ERROR([bad value $withval for native-compilation option]) ;; + esac + with_native_compilation=$withval], + [with_native_compilation=no] +) +AC_SUBST([NATIVE_COMPILATION_AOT]) + AC_ARG_ENABLE([check-lisp-object-type], [AS_HELP_STRING([--enable-check-lisp-object-type], [Enable compile time checks for the Lisp_Object data type, diff --git a/etc/NEWS b/etc/NEWS index 8f9b0a03301..db7c675edb5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -24,6 +24,12 @@ applies, and please also update docstrings as needed. * Installation Changes in Emacs 29.1 +--- +** Ahead-of-time native compilation can now be specified via configure. +Use --with-native-compilation=aot to specify that all the Lisp files +in the Emacs tree should be natively compiled ahead of time. (This is +slow on most machines.) + +++ ** Emacs can be built with built-in support for accessing SQLite databases. This uses the popular sqlite3 library, and can be disabled by using diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 4c26e423701..256017f6c5b 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -31,10 +31,16 @@ EXEEXT = @EXEEXT@ XARGS_LIMIT = @XARGS_LIMIT@ HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@ +NATIVE_COMPILATION_AOT = @NATIVE_COMPILATION_AOT@ ifeq ($(HAVE_NATIVE_COMP),yes) +# Environment variable to enable Ahead-Of-Time compilation. ifndef NATIVE_FULL_AOT NATIVE_SKIP_NONDUMP = 1 endif +# Configured for Ahead-Of-Time compilation. +ifeq ($(NATIVE_COMPILATION_AOT),yes) +NATIVE_SKIP_NONDUMP = "" +endif endif -include ${top_builddir}/src/verbose.mk -- 2.39.2