]> sourceware.org Git - automake.git/commitdiff
* m4/lispdir.m4: Do not override lispdir if it's already defined.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 17 Apr 1999 22:44:09 +0000 (22:44 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 17 Apr 1999 22:44:09 +0000 (22:44 +0000)
Run some emacs-lisp to find out the site-lisp directory, but
relocate it into prefix.

ChangeLog
m4/lispdir.m4

index 418ba96ebcfcc57ecc5181415818dcb28c9dd2da..9c396f4ac460a75812ed4461e04e824f5d7dd730 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-04-18  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * m4/lispdir.m4: Do not override lispdir if it's already defined.
+       Run some emacs-lisp to find out the site-lisp directory, but
+       relocate it into prefix.
+
 1999-04-17  Paul Eggert  <eggert@twinsun.com>
 
        * m4/mktime.m4 (bigtime_test, main): Move alarm from
index 981ba88cc614b662cf98c29bdc5c339ff997e120..a85434d72f4a83e9b968b25667c9daad2b13c74c 100644 (file)
@@ -1,37 +1,27 @@
 ## ------------------------
 ## Emacs LISP file handling
 ## From Ulrich Drepper
+## Heavily simplified by Alexandre Oliva
 ## ------------------------
 
-# serial 1
+# serial 2
 
 AC_DEFUN(AM_PATH_LISPDIR,
  [# If set to t, that means we are running in a shell under Emacs.
   # If you have an Emacs named "t", then use the full path.
-  test "$EMACS" = t && EMACS=
-  AC_PATH_PROGS(EMACS, emacs xemacs, no)
+  test x"$EMACS" = xt && EMACS=
+  AC_CHECK_PROGS(EMACS, emacs xemacs, no)
   if test $EMACS != "no"; then
-    AC_MSG_CHECKING([where .elc files should go])
-    dnl Set default value
-    lispdir="\$(datadir)/emacs/site-lisp"
-    emacs_flavor=`echo "$EMACS" | sed -e 's,^.*/,,'`
-    if test "x$prefix" = "xNONE"; then
-      if test -d $ac_default_prefix/share/$emacs_flavor/site-lisp; then
-       lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
-      else
-       if test -d $ac_default_prefix/lib/$emacs_flavor/site-lisp; then
-         lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
+    if test x${lispdir+set} != xset; then
+      AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
+       am_cv_lispdir=`$EMACS -q -batch -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' | sed -n -e 's,/$,,' -e '/emacs\/site-lisp$/{p;q;}'`
+       if test -z "$am_cv_lispdir"; then
+         am_cv_lispdir='${datadir}/emacs/site-lisp'
+       else
+         am_cv_lispdir=`echo "$am_cv_lispdir" | sed -e 's,^.*/lib/,${libdir}/,' -e 's,^.*/share/,${datadir}/,'`
        fi
-      fi
-    else
-      if test -d $prefix/share/$emacs_flavor/site-lisp; then
-       lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
-      else
-       if test -d $prefix/lib/$emacs_flavor/site-lisp; then
-         lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
-       fi
-      fi
+      ])
+      lispdir="$am_cv_lispdir"
     fi
-    AC_MSG_RESULT($lispdir)
   fi
   AC_SUBST(lispdir)])
This page took 0.033351 seconds and 5 git commands to generate.