Bug 788613 - Dump config.log when configure fails. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 10 Apr 2013 16:15:01 +0200
changeset 128337 32c37babc5bf9f2aa42b0a8d5dc4406e2bf23b60
parent 128336 a4d23f9a3081bea39cc88a82084450df06d207ec
child 128338 64d2859ca6b19a8d0558bf09e14d4cc14ff46275
push id24528
push userryanvm@gmail.com
push dateThu, 11 Apr 2013 19:19:41 +0000
treeherderautoland@7b8ed29c6bc0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs788613
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 788613 - Dump config.log when configure fails. r=ted
aclocal.m4
build/autoconf/hooks.m4
js/src/aclocal.m4
js/src/build/autoconf/hooks.m4
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,25 +1,26 @@
 dnl
 dnl Local autoconf macros used with mozilla
 dnl The contents of this file are under the Public Domain.
 dnl
 
+builtin(include, build/autoconf/acwinpaths.m4)dnl
+builtin(include, build/autoconf/hooks.m4)dnl
 builtin(include, build/autoconf/config.status.m4)dnl
 builtin(include, build/autoconf/toolchain.m4)dnl
 builtin(include, build/autoconf/ccache.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/nss.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/codeset.m4)dnl
 builtin(include, build/autoconf/altoptions.m4)dnl
 builtin(include, build/autoconf/mozprog.m4)dnl
 builtin(include, build/autoconf/mozheader.m4)dnl
 builtin(include, build/autoconf/mozcommonheader.m4)dnl
-builtin(include, build/autoconf/acwinpaths.m4)dnl
 builtin(include, build/autoconf/lto.m4)dnl
 builtin(include, build/autoconf/gcc-pr49911.m4)dnl
 builtin(include, build/autoconf/gcc-pr39608.m4)dnl
 builtin(include, build/autoconf/llvm-pr8927.m4)dnl
 builtin(include, build/autoconf/frameptr.m4)dnl
 builtin(include, build/autoconf/compiler-opts.m4)dnl
 builtin(include, build/autoconf/expandlibs.m4)dnl
 builtin(include, build/autoconf/arch.m4)dnl
new file mode 100644
--- /dev/null
+++ b/build/autoconf/hooks.m4
@@ -0,0 +1,26 @@
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl Output the contents of config.log when configure exits with an
+dnl error code.
+define([MOZ_CONFIG_LOG_TRAP],
+[changequote(<<<, >>>)dnl
+trap '[ "$?" != 0 ] && echo "------ config.log ------" && tail -n 25 config.log' EXIT
+changequote([, ])dnl
+])
+
+dnl Wrap AC_INIT_PREPARE to add the above trap.
+define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
+define([AC_INIT_PREPARE],
+[_MOZ_AC_INIT_PREPARE($1)
+MOZ_CONFIG_LOG_TRAP
+])
+
+dnl Disable the trap when running sub-configures.
+define([_MOZ_AC_OUTPUT_SUBDIRS], defn([AC_OUTPUT_SUBDIRS]))
+define([AC_OUTPUT_SUBDIRS],
+[trap '' EXIT
+_MOZ_AC_OUTPUT_SUBDIRS($1)
+MOZ_CONFIG_LOG_TRAP
+])
--- a/js/src/aclocal.m4
+++ b/js/src/aclocal.m4
@@ -1,24 +1,25 @@
 dnl
 dnl Local autoconf macros used with mozilla
 dnl The contents of this file are under the Public Domain.
 dnl
 
+builtin(include, build/autoconf/acwinpaths.m4)dnl
+builtin(include, build/autoconf/hooks.m4)dnl
 builtin(include, build/autoconf/config.status.m4)dnl
 builtin(include, build/autoconf/toolchain.m4)dnl
 builtin(include, build/autoconf/ccache.m4)dnl
 builtin(include, build/autoconf/pkg.m4)dnl
 builtin(include, build/autoconf/nspr.m4)dnl
 builtin(include, build/autoconf/altoptions.m4)dnl
 builtin(include, build/autoconf/moznbytetype.m4)dnl
 builtin(include, build/autoconf/mozprog.m4)dnl
 builtin(include, build/autoconf/mozheader.m4)dnl
 builtin(include, build/autoconf/mozcommonheader.m4)dnl
-builtin(include, build/autoconf/acwinpaths.m4)dnl
 builtin(include, build/autoconf/lto.m4)dnl
 builtin(include, build/autoconf/gcc-pr49911.m4)dnl
 builtin(include, build/autoconf/gcc-pr39608.m4)dnl
 builtin(include, build/autoconf/llvm-pr8927.m4)dnl
 builtin(include, build/autoconf/frameptr.m4)dnl
 builtin(include, build/autoconf/compiler-opts.m4)dnl
 builtin(include, build/autoconf/expandlibs.m4)dnl
 builtin(include, build/autoconf/arch.m4)dnl
new file mode 100644
--- /dev/null
+++ b/js/src/build/autoconf/hooks.m4
@@ -0,0 +1,26 @@
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl Output the contents of config.log when configure exits with an
+dnl error code.
+define([MOZ_CONFIG_LOG_TRAP],
+[changequote(<<<, >>>)dnl
+trap '[ "$?" != 0 ] && echo "------ config.log ------" && tail -n 25 config.log' EXIT
+changequote([, ])dnl
+])
+
+dnl Wrap AC_INIT_PREPARE to add the above trap.
+define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
+define([AC_INIT_PREPARE],
+[_MOZ_AC_INIT_PREPARE($1)
+MOZ_CONFIG_LOG_TRAP
+])
+
+dnl Disable the trap when running sub-configures.
+define([_MOZ_AC_OUTPUT_SUBDIRS], defn([AC_OUTPUT_SUBDIRS]))
+define([AC_OUTPUT_SUBDIRS],
+[trap '' EXIT
+_MOZ_AC_OUTPUT_SUBDIRS($1)
+MOZ_CONFIG_LOG_TRAP
+])