* lib/autotest/general.m4 (AT_INIT): Handle absolute `srcdir'.

* tests/autotest.at (srcdir propagation): Test absolute `srcdir' and
`srcdir' as subdirectory of `builddir'.
This commit is contained in:
Noah Misch 2007-06-19 19:49:05 +00:00
parent fdb749cd8a
commit aa643c7ef8
3 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2007-06-17 Noah Misch <noah@cs.caltech.edu>
* lib/autotest/general.m4 (AT_INIT): Handle absolute `srcdir'.
* tests/autotest.at (srcdir propagation): Test absolute `srcdir' and
`srcdir' as subdirectory of `builddir'.
2007-06-13 Noah Misch <noah@cs.caltech.edu>
* lib/autotest/general.m4 (AT_INIT): Compute $srcdir correctly.

View File

@ -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

View File

@ -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