1 dnl Copyright (C) 1999 NISHIDA Keisuke <knishida@ring.aist.go.jp>
3 dnl This program is free software; you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation; either version 2, or (at your option)
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 AC_DEFUN(AM_PATH_LISPDIR,
23 [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, xemacs...]],
26 no) AC_MSG_ERROR([emacs is not available]) ;;
27 *) EMACS=${withval} ;;
29 if test "x$EMACS" = "xt" -o "x$EMACS" = x; then
30 AC_PATH_PROGS(EMACS, emacs xemacs mule, no)
31 if test $EMACS = no; then
32 AC_MSG_ERROR(you should install Emacs first)
36 dnl # Check Emacs directories
38 AC_MSG_CHECKING([where emacs files are in])
39 EMACS_BASENAME="`echo x$EMACS | sed -e 's/x//' -e 's/^.*\///'`"
40 if test "x$emacsdir" = x; then
41 if test "x$prefix" = "xNONE"; then
42 prefix=$ac_default_prefix
44 emacsdir="\$(datadir)/emacs"
45 case "$EMACS_BASENAME" in
47 if test -d $prefix/lib/emacs; then
48 emacsdir="$prefix/lib/emacs"
50 if test -d $prefix/share/emacs; then
51 emacsdir="$prefix/share/emacs"
55 if test -d $prefix/lib/xemacs; then
56 emacsdir="$prefix/lib/xemacs"
58 if test -d $prefix/share/xemacs; then
59 emacsdir="$prefix/share/xemacs"
63 if test -d $prefix/lib/emacs; then
64 emacsdir="$prefix/lib/emacs"
66 if test -d $prefix/share/emacs; then
67 emacsdir="$prefix/share/emacs"
69 if test -d $prefix/lib/mule; then
70 emacsdir="$prefix/lib/mule"
72 if test -d $prefix/share/mule; then
73 emacsdir="$prefix/share/mule"
78 AC_MSG_RESULT($emacsdir)
81 dnl # Check Emacs site-lisp directories
84 [ --with-lispdir=DIR emacs lisp files go to DIR [guessed]],
87 no) AC_MSG_ERROR(lispdir is not available) ;;
88 *) lispdir=${withval} ;;
90 AC_MSG_CHECKING([where .elc files should go])
91 if test "x$lispdir" = x; then
92 lispdir="$emacsdir/site-lisp"
93 if test -d $emacsdir/lisp; then
94 lispdir="$emacsdir/lisp"
96 case "$EMACS_BASENAME" in
98 lispdir="$lispdir/lookup"
102 AC_MSG_RESULT($lispdir)