Bumping manifests a=b2g-bump
[gecko.git] / build / autoconf / wrapper.m4
bloba61df70c8b43f2bc741805671e70d6532ad42e08
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/.
5 dnl =======================================================================
6 dnl = Enable compiling with various compiler wrappers (distcc, ccache, etc)
7 dnl =======================================================================
8 AC_DEFUN([MOZ_CHECK_COMPILER_WRAPPER],
10 MOZ_ARG_WITH_STRING(compiler_wrapper,
11 [  --with-compiler-wrapper[=path/to/wrapper]
12     Enable compiling with wrappers such as distcc and ccache],
13     COMPILER_WRAPPER=$withval, COMPILER_WRAPPER="no")
15 if test "$COMPILER_WRAPPER" != "no"; then
16     case "$target" in
17     *-mingw*)
18         dnl When giving a windows path with backslashes, js/src/configure
19         dnl fails because of double wrapping because the test further below
20         dnl doesn't work with backslashes. While fixing that test to work
21         dnl might seem better, a lot of the make build backend actually
22         dnl doesn't like backslashes, so normalize windows paths to use
23         dnl forward slashes.
24         COMPILER_WRAPPER=`echo "$COMPILER_WRAPPER" | tr '\\' '/'`
25         ;;
26     esac
28     case "$CC" in
29     $COMPILER_WRAPPER\ *)
30         :
31         ;;
32     *)
33         CC="$COMPILER_WRAPPER $CC"
34         CXX="$COMPILER_WRAPPER $CXX"
35         _SUBDIR_CC="$CC"
36         _SUBDIR_CXX="$CXX"
37         ac_cv_prog_CC="$CC"
38         ac_cv_prog_CXX="$CXX"
39         MOZ_USING_COMPILER_WRAPPER=1
40         ;;
41     esac
44 AC_SUBST(MOZ_USING_COMPILER_WRAPPER)