1 ## ------------------------
2 ## Emacs LISP file handling
4 ## Almost entirely rewritten by Alexandre Oliva
5 ## ------------------------
9 AC_DEFUN([AM_PATH_LISPDIR],
11 [ --with-lispdir Override the default lisp directory ],
13 AC_MSG_CHECKING([where .elc files should go])
14 AC_MSG_RESULT([$lispdir])],
16 # If set to t, that means we are running in a shell under Emacs.
17 # If you have an Emacs named "t", then use the full path.
18 test x"$EMACS" = xt && EMACS=
19 AC_CHECK_PROGS(EMACS, emacs xemacs, no)
20 if test $EMACS != "no"; then
21 if test x${lispdir+set} != xset; then
22 AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
23 am_cv_lispdir=`$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' | sed -n -e 's,/$,,' -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' -e '/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}'`
24 if test -z "$am_cv_lispdir"; then
25 am_cv_lispdir='${datadir}/emacs/site-lisp'
28 lispdir="$am_cv_lispdir"