2013-04-10 18:15:01 +04:00
|
|
|
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 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)
|
2015-12-26 21:40:54 +03:00
|
|
|
|
|
|
|
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
|
|
|
# Let make expand exec_prefix.
|
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
|
|
|
2014-08-07 09:20:38 +04:00
|
|
|
> subconfigures
|
2014-11-04 07:50:18 +03:00
|
|
|
> skip_subconfigures
|
2013-04-10 18:15:01 +04:00
|
|
|
])
|
|
|
|
|
2014-07-11 14:05:59 +04:00
|
|
|
define([AC_OUTPUT_SUBDIRS],
|
2014-08-02 03:02:30 +04:00
|
|
|
[for moz_config_dir in $1; do
|
|
|
|
_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
2014-07-11 14:05:59 +04:00
|
|
|
case "$moz_config_dir" in
|
|
|
|
*:*)
|
2014-08-02 03:02:30 +04:00
|
|
|
objdir=$(echo $moz_config_dir | awk -F: '{print [$]2}')
|
2014-07-11 14:05:59 +04:00
|
|
|
;;
|
|
|
|
*)
|
2014-08-02 03:02:30 +04:00
|
|
|
objdir=$moz_config_dir
|
2014-07-11 14:05:59 +04:00
|
|
|
;;
|
|
|
|
esac
|
2014-08-07 09:20:38 +04:00
|
|
|
dnl Because config.status, storing AC_SUBSTs, is written before any
|
|
|
|
dnl subconfigure runs, we need to use a file. Moreover, some subconfigures
|
|
|
|
dnl are started from a subshell, and variable modifications from a subshell
|
|
|
|
dnl wouldn't be preserved.
|
|
|
|
echo $objdir >> subconfigures
|
2014-08-02 03:02:30 +04:00
|
|
|
|
|
|
|
dumpenv="true | "
|
2014-07-11 14:05:59 +04:00
|
|
|
case "$host" in
|
|
|
|
*-mingw*)
|
2013-08-20 10:23:28 +04:00
|
|
|
_CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
|
|
|
|
if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
|
|
|
|
_CONFIG_SHELL="${_CONFIG_SHELL}.exe"
|
|
|
|
fi
|
2014-08-02 03:02:30 +04:00
|
|
|
dnl Yes, this is horrible. But since msys doesn't preserve environment
|
|
|
|
dnl variables and command line arguments as they are when transitioning
|
|
|
|
dnl from msys (this script) to python (below), we have to resort to hacks,
|
|
|
|
dnl storing the environment and command line arguments from a msys process
|
|
|
|
dnl (perl), and reading it from python.
|
2014-10-08 18:43:47 +04:00
|
|
|
dumpenv="$PERL $_topsrcdir/build/win32/dumpenv4python.pl $ac_configure_args | "
|
2013-08-20 10:23:28 +04:00
|
|
|
;;
|
2014-07-11 14:05:59 +04:00
|
|
|
esac
|
2013-08-20 10:23:28 +04:00
|
|
|
|
2014-08-02 03:02:30 +04:00
|
|
|
eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args ifelse($2,,,--cache-file="$2")
|
|
|
|
|
2014-11-04 07:50:18 +03:00
|
|
|
dnl Actual subconfigure execution happens in MOZ_RUN_CONFIG_STATUS
|
|
|
|
done
|
|
|
|
])
|
|
|
|
|
|
|
|
define([AC_OUTPUT_SUBDIRS_NOW],
|
|
|
|
[
|
|
|
|
for moz_config_dir_ in $1; do
|
|
|
|
AC_OUTPUT_SUBDIRS($moz_config_dir_,$2)
|
|
|
|
tail -1 subconfigures >> skip_subconfigures
|
|
|
|
MOZ_RUN_SUBCONFIGURES(`tail -1 skip_subconfigures`)
|
2013-08-20 10:23:28 +04:00
|
|
|
done
|
2013-04-10 18:15:01 +04:00
|
|
|
])
|
2013-08-15 18:45:07 +04:00
|
|
|
|
2014-11-04 07:50:18 +03:00
|
|
|
define([MOZ_RUN_SUBCONFIGURES],
|
|
|
|
[dnl Execute subconfigure, unless --no-recursion was passed to configure.
|
|
|
|
if test "$no_recursion" != yes; then
|
|
|
|
trap '' EXIT
|
|
|
|
if ! $PYTHON $_topsrcdir/build/subconfigure.py $1; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2014-11-06 03:29:12 +03:00
|
|
|
define([MOZ_RUN_ALL_SUBCONFIGURES],[
|
2014-11-04 07:50:18 +03:00
|
|
|
MOZ_RUN_SUBCONFIGURES([--list subconfigures --skip skip_subconfigures])
|
2014-11-06 03:29:12 +03:00
|
|
|
])
|
2014-11-04 07:50:18 +03:00
|
|
|
|
2013-08-15 18:45:07 +04:00
|
|
|
dnl Print error messages in config.log as well as stderr
|
|
|
|
define([AC_MSG_ERROR],
|
|
|
|
[{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])
|