1dnl This Source Code Form is subject to the terms of the Mozilla Public
2dnl License, v. 2.0. If a copy of the MPL was not distributed with this
3dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5dnl Wrap AC_INIT_PREPARE to add the above trap.
6define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
7define([AC_INIT_PREPARE],
8[_MOZ_AC_INIT_PREPARE($1)
9
10test "x$prefix" = xNONE && prefix=$ac_default_prefix
11# Let make expand exec_prefix.
12test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13])
14
15dnl Print error messages in config.log as well as stderr
16define([AC_MSG_ERROR],
17[{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])
18
19dnl Divert AC_TRY_COMPILER to make ac_cv_prog_*_works actually cached.
20dnl This will allow to just skip the test when python configure has set
21dnl the value for us. But since ac_cv_prog_*_cross is calculated at the same
22dnl time, and has a different meaning as in python configure, we only want to
23dnl use its value to display whether a cross-compile is happening. We forbid
24dnl configure tests that would rely on ac_cv_prog_*_cross autoconf meaning
25dnl (being able to execute the product of compilation), which are already bad
26dnl for cross compiles anyways, so it's a win to get rid of them.
27define([_MOZ_AC_TRY_COMPILER], defn([AC_TRY_COMPILER]))
28define([AC_TRY_COMPILER], [AC_CACHE_VAL($2, _MOZ_AC_TRY_COMPILER($1, $2, $3))])
29
30define([AC_TRY_RUN], [m4_fatal([AC_TRY_RUN is forbidden])])
31define([AC_CHECK_FILE], [m4_fatal([AC_CHECK_FILE is forbidden])])
32