autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with $srcdir and friends in autotest


From: Noah Misch
Subject: Re: problem with $srcdir and friends in autotest
Date: Fri, 15 Jun 2007 18:59:34 -0700
User-agent: Mutt/1.5.9i

Hi Ralf,

On Fri, Jun 15, 2007 at 09:12:11AM +0200, Ralf Wildenhues wrote:
> * Noah Misch wrote on Thu, Jun 14, 2007 at 03:40:55AM CEST:
> > +# Build directory as subdirectory of source directory.
> > +cd pkg/vpath-inside
> > +AT_CHECK([top_srcdir=$abs_top_srcdir ../configure], [0], [ignore])
> [...]
> 
> and `pwd`/../configure (and fix the test failures that show up ;-)

Thanks.  I added one test with an absolute srcdir and one test with the builddir
above the srcdir, for good measure.  Does this seem to cover things?


2007-06-15  Noah Misch  <address@hidden>

        * lib/autotest/general.m4 (AT_INIT): Handle absolute `srcdir'.
        * tests/autotest.at (srcdir propagation): Test absolute `srcdir' and
        `srcdir' as subdirectory of `builddir'.

diff -Nurp -X dontdiff ac-clean/lib/autotest/general.m4 
ac-moresrcdir/lib/autotest/general.m4
--- ac-clean/lib/autotest/general.m4    2007-06-14 20:53:33.000000000 -0400
+++ ac-moresrcdir/lib/autotest/general.m4       2007-06-15 21:41:11.000000000 
-0400
@@ -220,7 +220,11 @@ if test -n "$at_top_srcdir"; then
   for at_dir in srcdir top_srcdir top_build_prefix
   do
     at_val=AS_VAR_GET([at_$at_dir])
-    AS_VAR_SET([$at_dir], [../../$at_val])
+    case $at_val in
+      [[\\/$]]* | ?:[[\\/]]* ) at_prefix= ;;
+      *) at_prefix=../../ ;;
+    esac
+    AS_VAR_SET([$at_dir], [$at_prefix$at_val])
   done
 fi
 
diff -Nurp -X dontdiff ac-clean/tests/autotest.at 
ac-moresrcdir/tests/autotest.at
--- ac-clean/tests/autotest.at  2007-06-14 20:53:33.000000000 -0400
+++ ac-moresrcdir/tests/autotest.at     2007-06-15 21:20:01.000000000 -0400
@@ -425,7 +425,7 @@ AT_SETUP([srcdir propagation])
 AT_KEYWORDS([autotest])
 AT_CAPTURE_FILE([suite.log])
 
-mkdir pkg vpath-outside
+mkdir pkg vpath-outside vpath-abs
 mkdir pkg/t pkg/vpath-inside
 AT_DATA([pkg/a])
 AT_DATA([pkg/t/b])
@@ -461,6 +461,14 @@ cd t
 AT_CHECK([../../pkg/t/suite], [0], [ignore])
 cd ../..
 
+# Build directory totally outside source directory (absolute).
+my_srcdir=`pwd`/pkg
+cd vpath-abs
+AT_CHECK([top_srcdir=$abs_top_srcdir "$my_srcdir"/configure], [0], [ignore])
+cd t
+AT_CHECK(["$my_srcdir"/t/suite], [0], [ignore])
+cd ../..
+
 # Build directory as subdirectory of source directory.
 cd pkg/vpath-inside
 AT_CHECK([top_srcdir=$abs_top_srcdir ../configure], [0], [ignore])
@@ -468,6 +476,12 @@ cd t
 AT_CHECK([../../t/suite], [0], [ignore])
 cd ../../..
 
+# Build directory as parent of source directory.
+AT_CHECK([top_srcdir=$abs_top_srcdir pkg/configure], [0], [ignore])
+cd t
+AT_CHECK([../pkg/t/suite], [0], [ignore])
+cd ..
+
 # Build directory as source directory.
 cd pkg
 AT_CHECK_CONFIGURE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]