diff --git a/build/autoconf/clean-config.sh b/build/autoconf/clean-config.sh index 9dd0c76440851251d57574ab5c314e95b610566b..20f8138f0db94878739867970e7f8425b3eb1170 100755 --- a/build/autoconf/clean-config.sh +++ b/build/autoconf/clean-config.sh @@ -35,12 +35,21 @@ if [ ! -f configure.in ]; then exit 1 fi -MOZ_EDITOR=1 MOZ_MAILNEWS=1 . allmakefiles.sh +if [ -f mailnews/makefiles ]; then + MOZ_MAIL_NEWS=1 + export MOZ_MAIL_NEWS +fi + +if [ -d editor ]; then + MOZ_EDITOR=1 + export MOZ_EDITOR +fi + +. allmakefiles.sh + rm -fr $MAKEFILES \ config-defs.h \ config.cache \ config.log \ config.status \ $NULL - -echo "Removed all files generated by configure." 2>&1 diff --git a/client.mk b/client.mk index 7817736fc400396ba5deebee88592fdfcc4779d1..55706ee62634dcfb2e8de868fd224df8d63a2470 100644 --- a/client.mk +++ b/client.mk @@ -265,7 +265,22 @@ clean realclean: cd $(OBJDIR); $(MAKE) $@ rm -fr $(ALL_TRASH) +cleansrcdir: + @cd $(TOPSRCDIR); \ + if [ -f Makefile ]; then \ + $(MAKE) realclean && _skip_find=1; \ + fi; \ + if [ ! "$$_skip_find" ]; then \ + echo "Removing object files from srcdir..."; \ + rm -fr `find . -type d \( -name .deps -print -o -name CVS \ + -o -exec test ! -d {}/CVS \; \) -prune \ + -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \ + fi; \ + echo "Removing files generated by configure..."; \ + build/autoconf/clean-config.sh; + + # (! IS_FIRST_CHECKOUT) endif -.PHONY: checkout depend build clean realclean pull_all build_all clobber clobber_all pull_and_build_all +.PHONY: checkout depend build clean realclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all diff --git a/configure.in b/configure.in index 5dbc8f989bd037a95ae969098c40e4f521a5bb58..9ea342e973a44f81aff0c0aad5026238d024301f 100644 --- a/configure.in +++ b/configure.in @@ -67,35 +67,37 @@ MISSING_X= MISSING_MOTIF= MISSING_GTK= -dnl Check for invalid object directory setup. -dnl If the tree has already been built in topsrcdir, -dnl do not allow it to be built in a separate object -dnl directory unless the src tree is cleaned up. -dnl ======================================================== +dnl Do not allow a separate objdir build if a srcdir build exists. +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 - cat 1>&2 <<-EOF - Error: Your source tree contains the file, - $file - - This is an indication that you previously built in the source - tree. Files built in the source tree can confuse the separate - objdir build. - - You can clean up the source tree with the following steps: - 1. cd $_topsrcdir - 2. gmake realclean; build/autoconf/clean-config.sh - - EOF - exit 1 - break + _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 + 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 -f client.mk cleansrcdir + *** + EOF + exit 1 + break + fi fi dnl Checks for programs.