1## ------------------------
2## Emacs LISP file handling
3## From Ulrich Drepper
4## Almost entirely rewritten by Alexandre Oliva
5## ------------------------
6
7# serial 3
8
9AC_DEFUN(AM_PATH_LISPDIR,
10 [# If set to t, that means we are running in a shell under Emacs.
11  # If you have an Emacs named "t", then use the full path.
12  test x"$EMACS" = xt && EMACS=
13  AC_CHECK_PROGS(EMACS, emacs xemacs, no)
14  if test $EMACS != "no"; then
15    if test x${lispdir+set} != xset; then
16      AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
17	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;}'`
18	if test -z "$am_cv_lispdir"; then
19	  am_cv_lispdir='${datadir}/emacs/site-lisp'
20	fi
21      ])
22      lispdir="$am_cv_lispdir"
23    fi
24  fi
25  AC_SUBST(lispdir)])
26