1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/unix/print-failed-commands.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +#!/bin/sh 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +# 1.10 +# Usage from makefile: 1.11 +# ELOG = . $(topdir)/build/autoconf/print-failed-commands.sh 1.12 +# $(ELOG) $(CC) $CFLAGS -o $@ $< 1.13 +# 1.14 +# This shell script is used by the build system to print out commands that fail 1.15 +# to execute properly. It is designed to make the "make -s" command more 1.16 +# useful. 1.17 +# 1.18 +# Note that in the example we are sourcing rather than execing the script. 1.19 +# Since make already started a shell for us, we might as well use it rather 1.20 +# than starting a new one. 1.21 + 1.22 +( exec "$@" ) || { 1.23 + echo 1.24 + echo "In the directory " `pwd` 1.25 + echo "The following command failed to execute properly:" 1.26 + echo "$@" 1.27 + exit 1; 1.28 +}