OSDN Git Service

set version as 1.4.8-snapshot3
[howm/howm.git] / acinclude.m4
1 # serial 3
2
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.$$
9 ac_output=confout.$$
10 rm -f $ac_temp $ac_output
11 cat >$ac_temp <<\_ACEOF
12 (defun ac-temp-func ()
13 $2
14 (princ "\n") ; make sure the output has trailing newline.
15 )
16 _ACEOF
17 $EMACS -batch -q -l $ac_temp -f ac-temp-func | sed -e '/^ *$/d' > $ac_output
18 $1=`cat $ac_output`
19 rm -f $ac_temp $ac_output; }])
20
21 # grab and hack from lispdir.m4
22
23 ## ------------------------
24 ## Emacs LISP file handling
25 ## From Ulrich Drepper
26 ## Almost entirely rewritten by Alexandre Oliva
27 ## ------------------------
28
29 AC_DEFUN([AM_PATH_LISPDIR],
30  [AC_ARG_WITH(lispdir,
31   [  --with-lispdir          Override the default lisp directory],
32   [ lispdir="$withval"
33     AC_MSG_CHECKING([where .elc files should go])
34     AC_MSG_RESULT([$lispdir])],
35   [
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
39 (defvar result nil)
40 (setq load-path (nreverse load-path))
41 (while load-path
42   (if (string-match "\\`\\(.+/site-lisp\\)/?\\'" (car load-path))
43       (setq result (match-string 1 (car load-path))
44             load-path nil)
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'
49       fi
50     ])
51     lispdir="$am_cv_lispdir"
52   fi
53  ])
54  AC_SUBST(lispdir)])