From 8cacc383db6f88a6ebae3256396200deb4f09d96 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 10 May 1997 23:10:59 +0000 Subject: [PATCH] error if srcdir already configured --- ChangeLog | 2 ++ Makefile.in | 14 ++++++++------ aclocal.m4 | 6 +++++- configure | 21 ++++++++++++--------- m4/init.m4 | 4 ++++ 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc52be16..28f22a07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Sat May 10 16:48:47 1997 Tom Tromey + * m4/init.m4: Error if source directory already configured. + * automake.in (scan_dependency_file): Always use srcdir name as passed in on command line. diff --git a/Makefile.in b/Makefile.in index 8c90d263..5d08900b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -240,7 +240,7 @@ install-info-am: $(INFO_DEPS) done; \ done @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ for file in $(INFO_DEPS); do \ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\ install-info --info-dir=$(infodir) $(infodir)/$$file; :;\ @@ -249,7 +249,7 @@ install-info-am: $(INFO_DEPS) uninstall-info: $(PRE_UNINSTALL) - if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ ii=yes; \ else ii=; fi; \ for file in $(INFO_DEPS); do \ @@ -314,21 +314,23 @@ uninstall-pkgdataDATA: all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: - @for subdir in $(SUBDIRS); do \ + @set fnord $(MAKEFLAGS); amf=$$2; \ + for subdir in $(SUBDIRS); do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ - || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + @set fnord $(MAKEFLAGS); amf=$$2; \ + rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ - || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ diff --git a/aclocal.m4 b/aclocal.m4 index d395fbac..eabf5ad0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.1o +dnl aclocal.m4 generated automatically by aclocal 1.1p # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. @@ -15,6 +15,10 @@ PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) diff --git a/configure b/configure index 7e8b54ed..e641b189 100755 --- a/configure +++ b/configure @@ -606,6 +606,9 @@ PACKAGE=automake VERSION=1.1p +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi cat >> confdefs.h <> confdefs.h <&6 -echo "configure:619: checking whether build environment is sane" >&5 +echo "configure:622: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -662,7 +665,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:666: checking for working aclocal" >&5 +echo "configure:669: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -675,7 +678,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:679: checking for working autoconf" >&5 +echo "configure:682: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -688,7 +691,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:692: checking for working automake" >&5 +echo "configure:695: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -701,7 +704,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:705: checking for working autoheader" >&5 +echo "configure:708: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -714,7 +717,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:718: checking for working makeinfo" >&5 +echo "configure:721: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -727,7 +730,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:731: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:734: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -761,7 +764,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:765: checking for $ac_word" >&5 +echo "configure:768: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -792,7 +795,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:796: checking for $ac_word" >&5 +echo "configure:799: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/m4/init.m4 b/m4/init.m4 index 68e78efc..b5cdeb04 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -13,6 +13,10 @@ PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) -- 2.43.5