build/autoconf/hooks.m4

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:83f76ce946ab
1 dnl This Source Code Form is subject to the terms of the Mozilla Public
2 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
3 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 dnl Output the contents of config.log when configure exits with an
6 dnl error code.
7 define([MOZ_CONFIG_LOG_TRAP],
8 [changequote(<<<, >>>)dnl
9 trap '[ "$?" != 0 ] && echo "------ config.log ------" && tail -n 25 config.log' EXIT
10 changequote([, ])dnl
11 ])
12
13 dnl Wrap AC_INIT_PREPARE to add the above trap.
14 define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
15 define([AC_INIT_PREPARE],
16 [_MOZ_AC_INIT_PREPARE($1)
17 MOZ_CONFIG_LOG_TRAP
18 ])
19
20 dnl Disable the trap when running sub-configures.
21 define([_MOZ_AC_OUTPUT_SUBDIRS], defn([AC_OUTPUT_SUBDIRS]))
22 define([MOZ_SUBCONFIGURE_WRAP],
23 [ _CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
24 case "$host" in
25 *-mingw*)
26 _CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
27 if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
28 _CONFIG_SHELL="${_CONFIG_SHELL}.exe"
29 fi
30 ;;
31 esac
32
33 if test -d "$1"; then
34 (cd "$1"; $PYTHON $_topsrcdir/build/subconfigure.py dump "$_CONFIG_SHELL")
35 else
36 mkdir -p "$1"
37 fi
38 $2
39 (cd "$1"; $PYTHON $_topsrcdir/build/subconfigure.py adjust $ac_sub_configure)
40 ])
41
42 define([AC_OUTPUT_SUBDIRS],
43 [trap '' EXIT
44 for moz_config_dir in $1; do
45 MOZ_SUBCONFIGURE_WRAP([$moz_config_dir],[
46 _MOZ_AC_OUTPUT_SUBDIRS($moz_config_dir)
47 ])
48 done
49
50 MOZ_CONFIG_LOG_TRAP
51 ])
52
53 dnl Print error messages in config.log as well as stderr
54 define([AC_MSG_ERROR],
55 [{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])

mercurial