* Makefile.in: Run autogen/copy_autogen if autogen.sh fails,
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Sep 2012 22:35:28 +0000 (15:35 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Sep 2012 22:35:28 +0000 (15:35 -0700)
to create 'configure'; problem reported by Andreas Schwab in
<http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00438.html>.
* autogen.sh: Exit with status 1 when failing due to missing tools,
reverting the 2012-09-10 change to this file.
* autogen/copy_autogen: Fail if one of the subsidiary actions fail.
Use 'cp -f' for the build-aux files, since the destinations are
typically read-only.

ChangeLog
Makefile.in
autogen.sh
autogen/copy_autogen

index 48d1e52..3b5b686 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,14 @@
        This undoes part of the 2012-09-10 patch.
        (bootstrap): Run ./configure, rather than trying to run config.status
        if it exists.  That builds src/epaths.h more reliably.
+       Run autogen/copy_autogen if autogen.sh fails,
+       to create 'configure'; problem reported by Andreas Schwab in
+       <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00438.html>.
+       * autogen.sh: Exit with status 1 when failing due to missing tools,
+       reverting the 2012-09-10 change to this file.
+       * autogen/copy_autogen: Fail if one of the subsidiary actions fail.
+       Use 'cp -f' for the build-aux files, since the destinations are
+       typically read-only.
 
        Remove no-longer-needed Solaris 2.4 vfork bug workaround.
        * configure.ac (ac_cv_func_vfork_works): Default to 'no' on
index 386c4c1..56a5440 100644 (file)
@@ -890,11 +890,11 @@ dvi:
 
 # Bootstrapping does the following:
 #  * Remove files to start from a clean slate.
-#  * Run autogen.sh, but don't worry about exit status 101 (missing tools).
+#  * Run autogen.sh, falling back on copy_autogen if autogen.sh fails.
 #  * Build Makefile, to build the build procedure itself.
 #  * Do the actual build.
 bootstrap: bootstrap-clean FRC
-       cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; }
+       cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; }
        ./configure $(CONFIGURE_FLAGS)
        $(MAKE) $(MFLAGS) info all
 
index dc8d53e..9cfaa40 100755 (executable)
@@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'.
 Please report any problems with this script to bug-gnu-emacs@gnu.org .
 EOF
 
-    exit 101 # Exit status 101 means tools were missing.
+    exit 1
 fi
 
 echo "Your system has the required tools, running autoreconf..."
index b6af9b6..8aacd4d 100755 (executable)
@@ -8,7 +8,7 @@
 ## regenerate configure and will fail if you do not have the required
 ## tools.  You will have to run this script again.
 
-test -d autogen && cd autogen
+test ! -d autogen || cd autogen || exit
 
 if test ! -e config.in; then
     echo "Cannot find autogen/ directory."
@@ -16,11 +16,12 @@ if test ! -e config.in; then
 fi
 
 ## Order implied by top-level Makefile's rules, for time-stamps.
-cp compile config.guess config.sub depcomp install-sh missing ../build-aux
-cp aclocal.m4 ../
-cp configure ../
-touch ../src/stamp-h.in
-cp config.in ../src/
-cp Makefile.in ../lib/
+cp -f compile config.guess config.sub depcomp install-sh missing \
+  ../build-aux &&
+cp aclocal.m4 ../ &&
+cp configure ../ &&
+touch ../src/stamp-h.in &&
+cp config.in ../src/ &&
+cp Makefile.in ../lib/ &&
 
 echo "You can now run configure"