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
20 # Note that the top-level mozconfig file is in $2.
22 if [ "$(dirname "$2")" = "$topsrcdir" ]; then
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."
29 elif [ -d "$topsrcdir/comm/mail" ]; then
30 # Building with mozilla-central as top-level directory.
31 . "$topsrcdir/comm/build/mozconfig.comm-support"
33 echo "ERROR: Unknown build directory layout."
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"
43 echo "ERROR: Unknown build directory layout."
47 echo "ERROR: Unknown build directory layout."