Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / build / mozconfig.comm-support
blob5c7465965fe66f00650ef3e35ecc5f8146ca9783
1 # This file exists to support comm-central from building with mozilla-central
2 # as a subdirectory to building as a subdirectory of mozilla-central.
4 # In order to have mozconfig files that support building in either
5 # configuration during the transition, without duplicating the logic
6 # in every mozconfig file, there needs to exist a file that exists at the
7 # same path in mozilla-central and comm-central.
9 # This file gets included under two circumstances.
10 # 1. comm-central is being built as a subdirectory of mozilla-central.
11 # 2. comm-central is being built as a parent directory of mozilla-central,
12 #    but `mach` was invoked from the objdir and thinks that $topsrcdir is
13 #    the mozilla-central directory. If we detect this is the case, we fix
14 #    $topsrcdir before proceeding.
15 # In either case, we then invoke the identically named file that lives in
16 # comm-central, which sets some variables that can be used by the rest of the
17 # mozconfig.
20 # Note that the top-level mozconfig file is in $2.
22 if [ "$(dirname "$2")" = "$topsrcdir" ]; then
23   # No weirdness
24   if [ -d "$topsrcdir/mail" ]; then
25     # Building with comm-central as top-level directory.
26     echo "ERROR: Should not include mozilla/build/mozconfig.comm when building"
27     echo "       with comm-central as top-level directory."
28     exit 1
29   elif [ -d "$topsrcdir/comm/mail" ]; then
30     # Building with mozilla-central as top-level directory.
31     . "$topsrcdir/comm/build/mozconfig.comm-support"
32   else
33     echo "ERROR: Unknown build directory layout."
34     exit 1
35   fi
36 elif [ "$(dirname "$2")" = "$(dirname "$topsrcdir")" ]; then
37   if [ -d "$topsrcdir/../mail" ]; then
38     # Building with comm-central as top-level directory;
39     # but invoked with $topsrcdir as "mozilla/".
40     topsrcdir=$(dirname "$topsrcdir")
41     . "$topsrcdir/build/mozconfig.comm-support"
42   else
43     echo "ERROR: Unknown build directory layout."
44     exit 1
45   fi
46 else
47   echo "ERROR: Unknown build directory layout."
48   exit 1