From df46b3b5cd30d0522a1158fb8f70ce9e5bead8e7 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 8 Apr 2013 08:31:50 +0200 Subject: [PATCH] Bug 788613 - Dump config.log when configure fails. r=ted --- aclocal.m4 | 1 + build/autoconf/hooks.m4 | 26 ++++++++++++++++++++++++++ js/src/aclocal.m4 | 1 + js/src/build/autoconf/hooks.m4 | 26 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 build/autoconf/hooks.m4 create mode 100644 js/src/build/autoconf/hooks.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 52398cf6224c..4d967cbf27d9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -3,6 +3,7 @@ dnl Local autoconf macros used with mozilla dnl The contents of this file are under the Public Domain. 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 diff --git a/build/autoconf/hooks.m4 b/build/autoconf/hooks.m4 new file mode 100644 index 000000000000..17176bbc40bc --- /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 exists 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 +]) diff --git a/js/src/aclocal.m4 b/js/src/aclocal.m4 index afa827187503..f2f94aa8f75e 100644 --- a/js/src/aclocal.m4 +++ b/js/src/aclocal.m4 @@ -3,6 +3,7 @@ dnl Local autoconf macros used with mozilla dnl The contents of this file are under the Public Domain. 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 diff --git a/js/src/build/autoconf/hooks.m4 b/js/src/build/autoconf/hooks.m4 new file mode 100644 index 000000000000..17176bbc40bc --- /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 exists 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 +])