Bug 241047 - Don't allow srcdir == objdir builds; r=ted
authorGregory Szorc <gps@mozilla.com>
Thu, 17 Oct 2013 08:14:50 -0700
changeset 151134 e2f94498037340ea57ba004f40352483d0b29d43
parent 151133 315b927c1934ef5d0b975276d7dbd022a280090b
child 151135 9b1ab0fcde02aaeed74058805069dd2e075326cd
push id25479
push usercbook@mozilla.com
push dateFri, 18 Oct 2013 09:36:13 +0000
treeherdermozilla-central@2def80d5a106 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs241047
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 241047 - Don't allow srcdir == objdir builds; r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -81,48 +81,61 @@ MISSING_X=
 AC_PROG_AWK
 
 dnl Initialize the Pthread test variables early so they can be
 dnl  overridden by each platform.
 dnl ========================================================
 MOZ_USE_PTHREADS=
 _PTHREAD_LDFLAGS=""
 
-dnl Do not allow a separate objdir build if a srcdir build exists.
+dnl Do not allow objdir == srcdir builds.
 dnl ==============================================================
 _topsrcdir=`cd \`dirname $0\`; pwd`
 _objdir=`pwd`
 
-if test "$_topsrcdir" != "$_objdir"
-then
-  # Check for a couple representative files in the source tree
-  _conflict_files=
-  for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
-    if test -f $file; then
-      _conflict_files="$_conflict_files $file"
-    fi
+
+
+dnl TODO Don't exempt L10N builds once bug 842760 is resolved.
+if test "$_topsrcdir" = "$_objdir" -a "${with_l10n_base+set}" != set; then
+  echo "  ***"
+  echo "  * Building directly in the main source directory is not allowed."
+  echo "  *"
+  echo "  * To build, you must run configure from a separate directory"
+  echo "  * (referred to as an object directory)."
+  echo "  *"
+  echo "  * If you are building with a mozconfig, you will need to change your"
+  echo "  * mozconfig to point to a different object directory."
+  echo "  ***"
+  exit 1
+fi
+
+# Check for a couple representative files in the source tree
+_conflict_files=
+for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
+  if test -f $file; then
+    _conflict_files="$_conflict_files $file"
+  fi
+done
+if test "$_conflict_files"; then
+  echo "***"
+  echo "*   Your source tree contains these files:"
+  for file in $_conflict_files; do
+    echo "*         $file"
   done
-  if test "$_conflict_files"; then
-    echo "***"
-    echo "*   Your source tree contains these files:"
-    for file in $_conflict_files; do
-      echo "*         $file"
-    done
-    cat 1>&2 <<-EOF
+  cat 1>&2 <<-EOF
 	*   This indicates that you previously built in the source tree.
 	*   A source tree build can confuse the separate objdir build.
 	*
 	*   To clean up the source tree:
 	*     1. cd $_topsrcdir
 	*     2. gmake distclean
 	***
 	EOF
-    exit 1
-    break
-  fi
+  exit 1
+  break
 fi
 MOZ_BUILD_ROOT=`pwd`
 
 MOZ_PYTHON
 
 MOZ_DEFAULT_COMPILER
 
 COMPILE_ENVIRONMENT=1