1 ## ------------------------ -*- Autoconf -*-
2 ## Emacs LISP file handling
4 ## Almost entirely rewritten by Alexandre Oliva
5 ## ------------------------
7 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
8 # Free Software Foundation, Inc.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2, or (at your option)
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
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 set to t, that means we are running in a shell under Emacs.
37 # If you have an Emacs named "t", then use the full path.
38 test x"$EMACS" = xt && EMACS=
39 AC_CHECK_PROGS(EMACS, emacs xemacs, no)
40 if test $EMACS != "no"; then
41 if test x${lispdir+set} != xset; then
42 AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir],
43 [# If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly
44 # Some emacsen will start up in interactive mode, requiring C-x C-c to exit,
45 # which is non-obvious for non-emacs users.
46 # Redirecting /dev/null should help a bit; pity we can't detect "broken"
47 # emacsen earlier and avoid running this altogether.
48 AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' </dev/null >conftest.out])
49 am_cv_lispdir=`sed -n \
51 -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' \
52 -e '/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}' \
55 if test -z "$am_cv_lispdir"; then
56 am_cv_lispdir='${datadir}/emacs/site-lisp'
59 lispdir="$am_cv_lispdir"
66 AU_DEFUN([ud_PATH_LISPDIR], [AM_PATH_LISPDIR])