| 1 | ## ------------------------ -*- Autoconf -*-
|
|---|
| 2 | ## Emacs LISP file handling
|
|---|
| 3 | ## From Ulrich Drepper
|
|---|
| 4 | ## Almost entirely rewritten by Alexandre Oliva
|
|---|
| 5 | ## ------------------------
|
|---|
| 6 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
|---|
| 7 | # Free Software Foundation, Inc.
|
|---|
| 8 | #
|
|---|
| 9 | # This file is free software; the Free Software Foundation
|
|---|
| 10 | # gives unlimited permission to copy and/or distribute it,
|
|---|
| 11 | # with or without modifications, as long as this notice is preserved.
|
|---|
| 12 |
|
|---|
| 13 | # serial 9
|
|---|
| 14 |
|
|---|
| 15 | # AM_PATH_LISPDIR
|
|---|
| 16 | # ---------------
|
|---|
| 17 | AC_DEFUN([AM_PATH_LISPDIR],
|
|---|
| 18 | [ # If set to t, that means we are running in a shell under Emacs.
|
|---|
| 19 | # If you have an Emacs named "t", then use the full path.
|
|---|
| 20 | test x"$EMACS" = xt && EMACS=
|
|---|
| 21 | AC_CHECK_PROGS([EMACS], [emacs xemacs], [no])
|
|---|
| 22 | AC_ARG_VAR([EMACS], [the Emacs editor command])
|
|---|
| 23 | AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path])
|
|---|
| 24 | AC_ARG_WITH([lispdir],
|
|---|
| 25 | [ --with-lispdir override the default lisp directory],
|
|---|
| 26 | [ lispdir="$withval"
|
|---|
| 27 | AC_MSG_CHECKING([where .elc files should go])
|
|---|
| 28 | AC_MSG_RESULT([$lispdir])],
|
|---|
| 29 | [
|
|---|
| 30 | AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [
|
|---|
| 31 | if test $EMACS != "no"; then
|
|---|
| 32 | if test x${lispdir+set} != xset; then
|
|---|
| 33 | # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly
|
|---|
| 34 | # Some emacsen will start up in interactive mode, requiring C-x C-c to exit,
|
|---|
| 35 | # which is non-obvious for non-emacs users.
|
|---|
| 36 | # Redirecting /dev/null should help a bit; pity we can't detect "broken"
|
|---|
| 37 | # emacsen earlier and avoid running this altogether.
|
|---|
| 38 | 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])
|
|---|
| 39 | am_cv_lispdir=`sed -n \
|
|---|
| 40 | -e 's,/$,,' \
|
|---|
| 41 | -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \
|
|---|
| 42 | -e '/.*\/share\/x*emacs\/site-lisp$/{s,.*/share/\(x*emacs/site-lisp\),${datadir}/\1,;p;q;}' \
|
|---|
| 43 | conftest.out`
|
|---|
| 44 | rm conftest.out
|
|---|
| 45 | fi
|
|---|
| 46 | fi
|
|---|
| 47 | test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp'
|
|---|
| 48 | ])
|
|---|
| 49 | lispdir="$am_cv_lispdir"
|
|---|
| 50 | ])
|
|---|
| 51 | AC_SUBST([lispdir])
|
|---|
| 52 | ])# AM_PATH_LISPDIR
|
|---|
| 53 |
|
|---|
| 54 | AU_DEFUN([ud_PATH_LISPDIR], [AM_PATH_LISPDIR])
|
|---|