* emacsclient.c (main): Return EXIT_FAILURE if Emacs sends us an error string
[bpt/emacs.git] / make-dist
index 38275f9..a113e00 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -7,7 +7,7 @@
 #### you should make sure that this script will include it.
 
 # Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
-#   2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+#   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 #
@@ -121,8 +121,8 @@ while [ $# -gt 0 ]; do
 done
 
 ### Make sure we're running in the right place.
-if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
-  echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2
+if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/subr.el ]; then
+  echo "${progname}: Can't find \`src/lisp.h' and \`lisp/subr.el'." >&2
   echo "${progname} must be run in the top directory of the Emacs" >&2
   echo "distribution tree.  cd to that directory and try again." >&2
   exit 1
@@ -150,12 +150,12 @@ then
 fi
 
 ### Find out which version of Emacs this is.
-shortversion=`grep 'defconst[   ]*emacs-version' lisp/version.el \
+shortversion=`grep 'char emacs_version' src/emacs.c \
         | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
-version=`grep 'defconst[        ]*emacs-version' lisp/version.el \
+version=`grep 'char emacs_version' src/emacs.c \
         | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 if [ ! "${version}" ]; then
-  echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
+  echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2
   exit 1
 fi
 
@@ -197,8 +197,12 @@ if [ $check = yes ];
 then
   ### Check for .elc files with no corresponding .el file.
   ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
+       lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
+       lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
        leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
   ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
+       lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
+       lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
        leim/[a-z]*/[a-z]*.elc > /tmp/elc
   bogosities="`comm -13 /tmp/el /tmp/elc`"
   if [ "${bogosities}" != "" ]; then
@@ -209,8 +213,12 @@ then
 
   ### Check for .el files with no corresponding .elc file.
   ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
+       lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
+       lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
        leim/[a-z]*/[a-z]*.el > /tmp/el
   ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
+       lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
+       lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
        leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
   losers="`comm -23 /tmp/el /tmp/elc`"
   bogosities=
@@ -273,7 +281,7 @@ echo "Making lisp/MANIFEST"
 (cd lisp;
  files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'`
  for dir in [!=]*; do
-  if [ -d $dir ] && [ $dir != term ] && [ $dir != CVS ] && [ $dir != RCS ]
+  if [ -d $dir ] && [ $dir != term ]
   then
     echo $dir
     thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'`
@@ -332,7 +340,7 @@ for subdir in lisp site-lisp \
              etc/images/gud etc/images/icons etc/images/icons/hicolor \
              etc/images/icons/hicolor/*x* etc/images/icons/hicolor/scalable \
              etc/images/icons/hicolor/*/apps etc/images/icons/hicolor/*/mimetypes \
-             etc/images/low-color etc/images/mail \
+             etc/images/low-color etc/images/mail etc/images/mpc \
              etc/images/smilies etc/images/smilies/grayscale \
              etc/images/smilies/medium etc/images/tree-widget \
              etc/images/tree-widget/default etc/images/tree-widget/folder \
@@ -375,7 +383,7 @@ echo "Making links to \`lisp' and its subdirectories"
  ## Find all subdirs of lisp dir
  for file in `find . -type d -print`; do
    case $file in
-     . | .. | */Old | */CVS | */RCS | */=*)
+     . | .. | */=*)
        ;;
      *)
        if [ -d $file ]; then
@@ -390,10 +398,10 @@ echo "Making links to \`lisp' and its subdirectories"
    mkdir -p ../${tempdir}/lisp/$file
    ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file
    ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file
-   ## calc/README.priv, nxml/TODO
+   ## calc/README.priv
    for f in $file/[a-zA-Z]*.xpm $file/[a-zA-Z]*.[xp]bm \
        $file/README $file/ChangeLog $file/ChangeLog.*[0-9] \
-       $file/README.prev $file/TODO; do
+       $file/README.prev; do
      if [ -f $f ]; then
        ln $f ../${tempdir}/lisp/$file
      fi
@@ -432,6 +440,7 @@ echo "Making links to \`src'"
  ln [a-zA-Z]*.h ../${tempdir}/src
  ln [a-zA-Z]*.m ../${tempdir}/src
  ln [a-zA-Z]*.in ../${tempdir}/src
+ ln [a-zA-Z]*.mk ../${tempdir}/src
  ## If we ended up with a symlink, or if we did not get anything
  ## due to a cross-device symlink, copy the file.
  for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in; do
@@ -452,7 +461,7 @@ echo "Making links to \`src'"
  ln makefile.w32-in ../${tempdir}/src
  ln .gdbinit .dbxinit ../${tempdir}/src
  cd ../${tempdir}/src
- rm -f config.h epaths.h Makefile Makefile.c
+ rm -f config.h epaths.h Makefile
  rm -f =* TAGS)
 
 echo "Making links to \`src/bitmaps'"
@@ -461,8 +470,7 @@ echo "Making links to \`src/bitmaps'"
 
 echo "Making links to \`src/m'"
 (cd src/m
- # We call files for miscellaneous input (to linker etc) .inp.
- ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m)
+ ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/m)
 
 echo "Making links to \`src/s'"
 (cd src/s
@@ -491,7 +499,6 @@ echo "Making links to \`lib-src'"
    fi
  done
  cd ../${tempdir}/lib-src
- rm -f Makefile.c
  rm -f getopt.h
  rm -f =* TAGS)
 
@@ -530,7 +537,7 @@ echo "Making links to \`nt/icons'"
 echo "Making links to \`msdos'"
 (cd msdos
  ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos
- ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos
+ ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos
  cd ../${tempdir}/msdos
  rm -f =*)
 
@@ -573,7 +580,7 @@ echo "Making links to \`etc'"
 ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or
 ### tex litter.
 (cd etc
- files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$' \
+ files=`ls -d * | grep -v '^e$' \
         | grep -v '^charsets$' | grep -v '^gnus$' | grep -v '^images$' | grep -v '^nxml$' \
         | grep -v '^refcards$' | grep -v '^tutorials$'| grep -v '^schema$'`
  ln $files ../${tempdir}/etc
@@ -601,7 +608,7 @@ echo "Making links to \`etc'"
 for dir in etc/charsets etc/e etc/gnus etc/nxml etc/tutorials etc/refcards etc/schema ; do
     echo "Making links to \`${dir}'"
     (cd ${dir}
-       ln `ls -d * | grep -v CVS | grep -v RCS` ../../${tempdir}/${dir}
+       ln `ls -d *` ../../${tempdir}/${dir}
        cd ../../${tempdir}/${dir}
        rm -f *~ \#*\# *,v =* core)
 done
@@ -618,7 +625,7 @@ echo "Making links to \`etc/images'"
 
 for dir in etc/images/custom etc/images/ezimage etc/images/gnus \
     etc/images/gud etc/images/icons etc/images/low-color etc/images/mail \
-    etc/images/smilies ; do
+    etc/images/mpc etc/images/smilies ; do
     echo "Making links to \`${dir}'"
     (cd ${dir}
      for f in *; do
@@ -635,7 +642,7 @@ for dir in etc/images/tree-widget/default etc/images/tree-widget/folder \
     etc/images/smilies/grayscale  etc/images/smilies/medium; do
     echo "Making links to \`${dir}'"
     (cd ${dir}
-     ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../${tempdir}/${dir}
+     ln `ls -d *` ../../../../${tempdir}/${dir}
      cd ../../../../${tempdir}/${dir}
      rm -f *~ \#*\# *,v =* core)
 done
@@ -644,7 +651,7 @@ for dir in etc/images/icons/hicolor/*/apps \
     etc/images/icons/hicolor/*/mimetypes; do
     echo "Making links to \`${dir}'"
     (cd ${dir}
-     ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../../../${tempdir}/${dir}
+     ln `ls -d *` ../../../../../../${tempdir}/${dir}
      cd ../../../../../../${tempdir}/${dir}
      rm -f *~ \#*\# *,v =* core)
 done
@@ -652,7 +659,7 @@ done
 echo "Making links to \`info'"
 # Don't distribute backups or autosaves.
 (cd info
- ln `find . -type f -print | grep -v CVS | grep -v RCS | grep -v cvsignore` ../${tempdir}/info
+ ln `find . -type f -print` ../${tempdir}/info
  #ln [a-zA-Z]* ../${tempdir}/info
  cd ../${tempdir}/info
  # Avoid an error when expanding the wildcards later.
@@ -698,7 +705,7 @@ echo "Making links to \`doc/lispref'"
 
 echo "Making links to \`doc/lispintro'"
 (cd doc/lispintro
- ln *.texi *.aux *.fns *.kys *.vrs *.eps ../../${tempdir}/doc/lispintro
+ ln *.texi *.aux *.fns *.kys *.vrs *.eps *.pdf ../../${tempdir}/doc/lispintro
  ln makefile.w32-in ../../${tempdir}/doc/lispintro
  test -f README && ln README ../../${tempdir}/doc/lispintro
  test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispintro