diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 103 |
1 files changed, 99 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index f0c8e5210f9..5aceac6d951 100644 --- a/configure.ac +++ b/configure.ac @@ -187,7 +187,8 @@ dnl It is important that variables on the RHS not be expanded here, dnl hence the single quotes. This is per the GNU coding standards, see dnl (autoconf) Installation Directory Variables dnl See also epaths.h below. -lispdir='${datadir}/emacs/${version}/lisp' +lispdirrel='${version}/lisp' +lispdir='${datadir}/emacs/'${lispdirrel} standardlisppath='${lispdir}' locallisppath='${datadir}/emacs/${version}/site-lisp:'\ '${datadir}/emacs/site-lisp' @@ -484,6 +485,7 @@ 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([nativecomp],[compile with Emacs Lisp native compiler support]) AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB], [use a file notification library (LIB one of: yes, inotify, kqueue, gfile, w32, no)])], @@ -1907,7 +1909,8 @@ if test "${with_ns}" != no; then NS_IMPL_COCOA=yes ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS - ns_appresdir=${ns_appdir}/Contents/Resources + lispdirrel=Contents/Resources + ns_appresdir=${ns_appdir}/{lispdirrel} ns_appsrc=Cocoa/Emacs.base ns_fontfile=macfont.o elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then @@ -3669,6 +3672,7 @@ AC_SUBST(LIBZ) LIBMODULES= HAVE_MODULES=no MODULES_OBJ= +NEED_DYNLIB=no case $opsys in cygwin|mingw32) MODULES_SUFFIX=".dll" ;; darwin) MODULES_SUFFIX=".dylib" ;; @@ -3704,7 +3708,8 @@ if test "${with_modules}" != "no"; then fi if test "${HAVE_MODULES}" = yes; then - MODULES_OBJ="dynlib.o emacs-module.o" + MODULES_OBJ="emacs-module.o" + NEED_DYNLIB=yes AC_DEFINE(HAVE_MODULES, 1, [Define to 1 if dynamic modules are enabled]) AC_DEFINE_UNQUOTED(MODULES_SUFFIX, "$MODULES_SUFFIX", [System extension for dynamic libraries]) @@ -3731,6 +3736,94 @@ module_env_snippet_28="$srcdir/src/module-env-28.h" emacs_major_version="${PACKAGE_VERSION%%.*}" AC_SUBST(emacs_major_version) +### Emacs Lisp native compiler support + +AC_DEFUN([libgccjit_smoke_test], [ + AC_LANG_SOURCE( + [[#include <libgccjit.h> + #include <stdlib.h> + #include <stdio.h> + int + main (int argc, char **argv) + { + gcc_jit_context *ctxt; + gcc_jit_result *result; + ctxt = gcc_jit_context_acquire (); + if (!ctxt) + exit (1); + gcc_jit_type *int_type = + gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); + gcc_jit_function *func = + gcc_jit_context_new_function (ctxt, NULL, + GCC_JIT_FUNCTION_EXPORTED, + int_type, "foo", 0, NULL, 0); + gcc_jit_block *block = gcc_jit_function_new_block (func, "foo"); + gcc_jit_block_end_with_return ( + block, + NULL, + gcc_jit_context_new_rvalue_from_int (ctxt, int_type, 1)); + result = gcc_jit_context_compile (ctxt); + if (!result) + exit (1); + typedef int (*fn_type) (void); + fn_type foo = + (fn_type)gcc_jit_result_get_code (result, "foo"); + if (!foo) + exit (1); + if (foo () != 1) + exit (1); + gcc_jit_context_release (ctxt); + gcc_jit_result_release (result); + return 0; + }]])]) + +AC_DEFUN([libgccjit_not_found], [ + AC_MSG_ERROR([elisp native compiler requested but libgccjit not found. +If you are sure you want Emacs compiled without elisp native compiler, pass + --without-nativecomp +to configure.])]) + +AC_DEFUN([libgccjit_broken], [ + AC_MSG_ERROR([Installed libgccjit has failed passing the smoke test. +You can verify it yourself compiling: +<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>. +Please report the issue to your distribution. +Here instructions on how to compile and install libgccjit from source: +<https://gcc.gnu.org/wiki/JIT>.])]) + +HAVE_NATIVE_COMP=no +LIBGCCJIT_LIB= +if test "${with_nativecomp}" != "no"; then + if test "${HAVE_PDUMPER}" = no; then + AC_MSG_ERROR(['--with-nativecomp' requires '--with-dumping=pdumper']) + fi + if test "${HAVE_ZLIB}" = no; then + AC_MSG_ERROR(['--with-nativecomp' requires zlib]) + fi + emacs_save_LIBS=$LIBS + LIBS="-lgccjit" + AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken], + [AC_LINK_IFELSE([libgccjit_smoke_test], [], [libgccjit_not_found])]) + LIBS=$emacs_save_LIBS + HAVE_NATIVE_COMP=yes + # mingw32 loads the library dynamically. + if test "${opsys}" != "mingw32"; then + LIBGCCJIT_LIB="-lgccjit -ldl" + fi + NEED_DYNLIB=yes + AC_DEFINE(HAVE_NATIVE_COMP, 1, [Define to 1 if native compiler is available.]) +fi +AC_DEFINE_UNQUOTED(NATIVE_ELISP_SUFFIX, ".eln", + [System extension for native compiled elisp]) +AC_SUBST(HAVE_NATIVE_COMP) +AC_SUBST(LIBGCCJIT_LIB) + +DYNLIB_OBJ= +if test "${NEED_DYNLIB}" = yes; then + DYNLIB_OBJ="dynlib.o" +fi +AC_SUBST(DYNLIB_OBJ) + ### Use -lpng if available, unless '--with-png=no'. HAVE_PNG=no LIBPNG= @@ -5234,6 +5327,7 @@ AC_SUBST(sharedstatedir) AC_SUBST(libexecdir) AC_SUBST(mandir) AC_SUBST(infodir) +AC_SUBST(lispdirrel) AC_SUBST(lispdir) AC_SUBST(standardlisppath) AC_SUBST(locallisppath) @@ -5658,7 +5752,7 @@ emacs_config_features= for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \ GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT \ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \ - NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER UNEXEC LCMS2 GMP; do + NS MODULES NATIVE_COMP THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER UNEXEC LCMS2 GMP; do case $opt in PDUMPER) val=${with_pdumper} ;; @@ -5737,6 +5831,7 @@ AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D Does Emacs support the portable dumper? ${with_pdumper} Does Emacs support legacy unexec dumping? ${with_unexec} Which dumping strategy does Emacs use? ${with_dumping} + Does Emacs have native lisp compiler? ${HAVE_NATIVE_COMP} "]) if test -n "${EMACSDATA}"; then |