diff lib-src/update-autoloads.sh @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 5a88923fcbfe
children 15872534500d
line wrap: on
line diff
--- a/lib-src/update-autoloads.sh	Mon Aug 13 09:44:44 2007 +0200
+++ b/lib-src/update-autoloads.sh	Mon Aug 13 09:45:46 2007 +0200
@@ -1,6 +1,16 @@
 #!/bin/sh
 ### update-autoloads.sh --- update auto-autoloads.el as necessary
 
+# Author: Jamie Zawinski, Ben Wing, Martin Buchholz, Steve Baur
+# Maintainer: Steve Baur
+# Keywords: internal
+
+### This file is part of XEmacs
+
+### Commentary:
+
+### Code:
+
 set -eu
 
 # This means we're running in a Sun workspace
@@ -9,8 +19,8 @@
 # get to the right directory
 test ! -d ./lisp -a -d ../lisp && cd ..
 if test ! -d ./lisp ; then
-  echo $0: neither ./lisp/ nor ../lisp/ exist
-  exit 1
+	echo $0: neither ./lisp/ nor ../lisp/ exist
+	exit 1
 fi
 
 EMACS="./src/xemacs"
@@ -20,27 +30,50 @@
 
 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
 
-echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
+echo "Rebuilding autoloads/custom-loads in `pwd|sed 's|^/tmp_mnt||'`"
 echo "          with $REAL..."
 
+if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
+  echon()
+  {    
+    /bin/echo $* '\c'
+  }
+else
+  echon()
+  {
+    echo -n $*
+  }
+fi
+
+# Compute patterns to ignore when searching for files
+ignore_dirs=""
+
+# Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
+echon "Checking for Mule support..."
+lisp_prog='(princ (featurep (quote mule)))'
+mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`"
+if test "$mule_p" = nil ; then
+	echo No
+	ignore_dirs="$ignore_dirs its egg mule leim"
+else
+	echo Yes
+fi
+
 dirs=
 for dir in lisp/*; do
-  if test -d $dir \
-   -a $dir != lisp/CVS \
-   -a $dir != lisp/SCCS \
-   -a $dir != lisp/egg \
-   -a $dir != lisp/its \
-   -a $dir != lisp/language \
-   -a $dir != lisp/leim; then
-    dirs="$dirs $dir"
-  fi
+	if test -d $dir \
+		-a $dir != lisp/CVS \
+		-a $dir != lisp/SCCS \
+		-a $dir != lisp/language; then
+		for ignore in $ignore_dirs; do
+			if test $dir = lisp/$ignore; then
+				continue 2
+			fi
+		done
+		dirs="$dirs $dir"
+	fi
 done
-# cat > lisp/prim/auto-autoloads.el << EOF
-# ;;; Do NOT edit this file!
-# ;;; It is automatically generated using "make autoloads"
-# ;;; See update-autoloads.sh and autoload.el for more details.
-# 
-# EOF
+
 set -x
 for dir in $dirs; do
 	$EMACS -batch -q -l autoload -f batch-update-directory $dir