diff options
author | Mathieu Lirzin <mthl@gnu.org> | 2017-09-20 00:08:59 +0200 |
---|---|---|
committer | Mathieu Lirzin <mthl@gnu.org> | 2017-09-20 00:08:59 +0200 |
commit | 7508174f4a6c19eeda89a7e18b8d1398fe85ccf0 (patch) | |
tree | 2938ba28267cfc6d6cba0b763f80e4b32ce49b03 /m4/lispdir.m4 | |
parent | c2757b974cb4c182333859edb45a01194550bc0e (diff) | |
parent | ced195a8556b68eab3dd0887e07a97c6ae4917bf (diff) | |
download | automake-7508174f4a6c19eeda89a7e18b8d1398fe85ccf0.tar.gz |
Merge branch 'minor'
Diffstat (limited to 'm4/lispdir.m4')
-rw-r--r-- | m4/lispdir.m4 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/m4/lispdir.m4 b/m4/lispdir.m4 new file mode 100644 index 000000000..846ef3f0e --- /dev/null +++ b/m4/lispdir.m4 @@ -0,0 +1,51 @@ +## ------------------------ -*- Autoconf -*- +## Emacs LISP file handling +## From Ulrich Drepper +## Almost entirely rewritten by Alexandre Oliva +## ------------------------ +# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PATH_LISPDIR +# --------------- +AC_DEFUN([AM_PATH_LISPDIR], +[AC_PREREQ([2.60])dnl + # If set to t, that means we are running in a shell under Emacs. + # If you have an Emacs named "t", then use the full path. + test x"$EMACS" = xt && EMACS= + AC_CHECK_PROGS([EMACS], [emacs xemacs], [no]) + AC_ARG_VAR([EMACS], [the Emacs editor command]) + AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path]) + AC_ARG_WITH([lispdir], + [AS_HELP_STRING([--with-lispdir], + [override the default lisp directory])], + [ lispdir="$withval" + AC_MSG_CHECKING([where .elc files should go]) + AC_MSG_RESULT([$lispdir])], + [ + AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [ + if test $EMACS != "no"; then + if test x${lispdir+set} != xset; then + # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly + # Some emacsen will start up in interactive mode, requiring C-x C-c to exit, + # 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]) + am_cv_lispdir=`sed -n \ + -e 's,/$,,' \ + -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \ + -e '/.*\/share\/x*emacs\/site-lisp$/{s,.*/share/\(x*emacs/site-lisp\),${datarootdir}/\1,;p;q;}' \ + conftest.out` + rm conftest.out + fi + fi + test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp' + ]) + lispdir="$am_cv_lispdir" +]) +AC_SUBST([lispdir]) +])# AM_PATH_LISPDIR |