Fixes automake bug https://bugs.gnu.org/21547.
If users have interactive site file logic, the lispdir probing can hang, as can the compilation of elisp files. Use --no-site-file to disable loading any of that possible user logic. * NEWS: Note emacs --no-site-file change. * doc/automake.texi: Run emacs with --no-site-file. * lib/am/lisp.am: Likewise. * m4/lispdir.m4: Likewise. --- NEWS | 5 +++++ doc/automake.texi | 2 +- lib/am/lisp.am | 2 +- m4/lispdir.m4 | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 29c4d8a96588..40384264c4ab 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,11 @@ please see NEWS-2.0 and start following the advice there now. New in 1.17: +* Bugs fixed + + - When compiling emacs lisp files, emacs is run with --no-site-file to + disable user config files that might hang or access the terminal. + * New features added - RANLIB may be overridden on a per-target basis. diff --git a/doc/automake.texi b/doc/automake.texi index 4a2c17fa9044..b6a38dc27ce5 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -13349,7 +13349,7 @@ instance, here is how @code{AM_PATH_LISPDIR} (@pxref{Emacs Lisp}) computes @samp{$(lispdir)}: @example -$EMACS -batch -Q -eval '(while load-path +$EMACS -batch -Q --no-site-file -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' >conftest.out lispdir=`sed -n diff --git a/lib/am/lisp.am b/lib/am/lisp.am index 45c58a6da938..746f01679f72 100644 --- a/lib/am/lisp.am +++ b/lib/am/lisp.am @@ -38,7 +38,7 @@ endif %?INSTALL% esac; \ ## Emacs byte-compilation won't create this automatically, sadly. test -d "$$am__dir" || $(MKDIR_P) "$$am__dir" || exit 1; \ - $(EMACS) --batch \ + $(EMACS) --batch --no-site-file \ $(AM_ELCFLAGS) $(ELCFLAGS) \ $$am__subdir_includes -L $(builddir) -L $(srcdir) \ --eval '$(am__emacs_byte_compile_setup)' \ diff --git a/m4/lispdir.m4 b/m4/lispdir.m4 index 525e3ee6da38..6f9b89d2ca1a 100644 --- a/m4/lispdir.m4 +++ b/m4/lispdir.m4 @@ -34,7 +34,7 @@ AC_DEFUN([AM_PATH_LISPDIR], # which is non-obvious for non-emacs users. # Redirecting /dev/null should help a bit; pity we can't detect "broken" # emacsen earlier and avoid running this altogether. - AC_RUN_LOG([$EMACS -batch -Q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' </dev/null >conftest.out]) + AC_RUN_LOG([$EMACS -batch -Q --no-site-file -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' </dev/null >conftest.out]) am_cv_lispdir=`sed -n \ -e 's,/$,,' \ -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \ -- 2.34.1