3 # AC_EMACS_LISP(var, code)
4 # Set `var' with output of elisp `code'.
5 # To avoid incompatibilities of "single-quote in back-quote" etc,
6 # temporary files are used to store emacs-lisp and output of it.
7 AC_DEFUN([AC_EMACS_LISP],[dnl
8 { ac_temp=./conftemp.$$
10 rm -f $ac_temp $ac_output
11 cat >$ac_temp <<\_ACEOF
12 (defun ac-temp-func ()
14 (princ "\n") ; make sure the output has trailing newline.
17 $EMACS -batch -q -l $ac_temp -f ac-temp-func | sed -e '/^ *$/d' > $ac_output
19 rm -f $ac_temp $ac_output; }])
21 # grab and hack from lispdir.m4
23 ## ------------------------
24 ## Emacs LISP file handling
25 ## From Ulrich Drepper
26 ## Almost entirely rewritten by Alexandre Oliva
27 ## ------------------------
29 AC_DEFUN([AM_PATH_LISPDIR],
31 [ --with-lispdir Override the default lisp directory],
33 AC_MSG_CHECKING([where .elc files should go])
34 AC_MSG_RESULT([$lispdir])],
36 if test x${lispdir+set} != xset; then
37 AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
38 AC_EMACS_LISP(am_cv_lispdir,[dnl
40 (setq load-path (nreverse load-path))
42 (if (string-match "\\`\\(.+/site-lisp\\)/?\\'" (car load-path))
43 (setq result (match-string 1 (car load-path))
45 (setq load-path (cdr load-path))))
46 (princ (or result (expand-file-name "../site-lisp" data-directory)))])
47 if test -z "$am_cv_lispdir"; then
48 am_cv_lispdir='${datadir}/emacs/site-lisp'
51 lispdir="$am_cv_lispdir"