diff --git a/js/src/configure.in b/js/src/configure.in index ab2ac43d789..7c72702ba9b 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -71,27 +71,36 @@ dnl ======================================================== 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 $srcdir; pwd` _objdir=`pwd` -if test "$_topsrcdir" != "$_objdir" +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 + 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 " ***" + 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. * @@ -100,9 +109,8 @@ then * 2. gmake distclean *** EOF - exit 1 - break - fi + exit 1 + break fi MOZ_BUILD_ROOT=`pwd`