* automake.texi (Texinfo): Mention vers*.texi.
[automake.git] / m4 / lispdir.m4
blob009a0e0ff64ae31138a640210c4b4b4ffd2f3b74
1 ## ------------------------
2 ## Emacs LISP file handling
3 ## From Ulrich Drepper
4 ## Almost entirely rewritten by Alexandre Oliva
5 ## ------------------------
7 # serial 3
9 AC_DEFUN(AM_PATH_LISPDIR,
10  [AC_ARG_WITH(lispdir, 
11   [   --with-lispdir            Override the default lisp directory ],
12   [ lispdir="$withval" 
13     AC_MSG_CHECKING([where .elc files should go])
14     AC_MSG_RESULT($lispdir)],
15   [
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'
26         fi
27       ])
28       lispdir="$am_cv_lispdir"
29     fi
30   fi
31  ])
32  AC_SUBST(lispdir)])