make top_builddir consistent with Automake

This commit is contained in:
Stepan Kasal 2005-05-20 08:13:15 +00:00
parent 661cc613b0
commit 8641b608b5
6 changed files with 54 additions and 30 deletions

View File

@ -1,3 +1,19 @@
2005-05-20 Stepan Kasal <kasal@ucw.cz>
* NEWS: @top_builddir@ is now a dirname, ac_top_builddir will follow.
* lib/autoconf/status.m4 (_AC_SRCDIRS): Rename ...
(ac_top_builddir): ... this ...
(ac_top_build_prefix): ... to this; the old name is also kept, for
backward compatibility.
(ac_top_builddir_sub): New variable, without the trailing slash,
always nonempty.
(_AC_OUTPUT_FILES): s/@top_builddir@/$ac_top_builddir_sub/
* doc/autoconf.texi (Configuration Actions): Rename
ac_top_builddir to ac_top_build_prefix.
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Rename
at_top_builddir to at_top_build_prefix.
* lib/autotest/general.m4 (AT_INIT): Likewise.
2005-05-20 Stepan Kasal <kasal@ucw.cz>
* ./lib/autoconf/general.m4 (_AC_INIT_PREPARE): Simplify the init

5
NEWS
View File

@ -31,6 +31,11 @@
`@mandir@' in a file, you will have to ensure `${datarootdir}' is
defined in this file.
** @top_builddir@ is now a dir name: it is always nonempty and doesn't have
a trailing slash. Similar change will be made to ac_top_builddir in a
future release; the old style value, which matches (../)*, is (and will
continue to be) available as ac_top_build_prefix.
** AC_PROG_CC_C89, AC_PROG_CC_C99
New macros for ISO C99 support. AC_PROG_CC_C89 and AC_PROG_CC_C99
check for ANSI C89 and ISO C99 support respectively.

View File

@ -1970,7 +1970,7 @@ The name of the top source directory, assuming that the working
directory is the current build directory.
@item ac_top_builddir
@item ac_top_build_prefix
The name of the top build directory, assuming that the working
directory is the current build directory.
It can be empty, or else ends with a slash, so that you may concatenate
@ -1997,8 +1997,8 @@ AC_CONFIG_COMMANDS([deep/dir/out:in/in.in], [@dots{}], [@dots{}])
# Argument of --srcdir
srcdir='../package'
# Reversing deep/dir
ac_top_builddir='../../'
# Concatenation of $ac_top_builddir and srcdir
ac_top_build_prefix='../../'
# Concatenation of $ac_top_build_prefix and srcdir
ac_top_srcdir='../../../package'
# Concatenation of $ac_top_srcdir and deep/dir
ac_srcdir='../../../package/deep/dir'

View File

@ -1,7 +1,7 @@
# This file is part of Autoconf. -*- Autoconf -*-
# Interface with Autotest.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -75,7 +75,7 @@ at_srcdir='$ac_srcdir'
abs_srcdir='$ac_abs_srcdir'
at_top_srcdir='$ac_top_srcdir'
abs_top_srcdir='$ac_abs_top_srcdir'
at_top_builddir='$ac_top_builddir'
at_top_build_prefix='$ac_top_build_prefix'
abs_top_builddir='$ac_abs_top_builddir'
AUTOTEST_PATH='m4_default([$2], [$1])'

View File

@ -126,43 +126,46 @@
# - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
# - `$srcdir' is `top-build -> top-src'
#
# Ouputs:
# Outputs:
# - `ac_builddir' is `.', for symmetry only.
# - `ac_top_builddir' is `build -> top_build'.
# - `ac_top_builddir_sub' is `build -> top_build'.
# This is used for @top_builddir@.
# - `ac_top_build_prefix' is `build -> top_build'.
# If not empty, has a trailing slash.
# - `ac_srcdir' is `build -> src'.
# - `ac_top_srcdir' is `build -> top-src'.
#
# and `ac_abs_builddir' etc., the absolute directory names.
m4_define([_AC_SRCDIRS],
[ac_builddir=.
if test $1 != .; then
case $1 in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
# A "../" for each directory in $ac_dir_suffix.
ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,../,g'`
else
ac_dir_suffix= ac_top_builddir=
fi
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,/..,g;s,/,,'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # No --srcdir option. We are building in place.
ac_srcdir=.
if test -z "$ac_top_builddir"; then
ac_top_srcdir=.
else
ac_top_srcdir=`expr $ac_top_builddir : ['\(.*[^/]\)']`
fi
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[[\\/]]* | ?:[[\\/]]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
@ -815,7 +818,7 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
case $srcdir in
[[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
*) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
*) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;;
esac
# Try a symlink, then a hard link, then a copy.
@ -976,7 +979,7 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
[ case $INSTALL in
[[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
])dnl
@ -1036,7 +1039,7 @@ s|@top_srcdir@|$ac_top_srcdir|;t t
s|@abs_top_srcdir@|$ac_abs_top_srcdir|;t t
s|@builddir@|$ac_builddir|;t t
s|@abs_builddir@|$ac_abs_builddir|;t t
s|@top_builddir@|$ac_top_builddir|;t t
s|@top_builddir@|$ac_top_builddir_sub|;t t
s|@abs_top_builddir@|$ac_abs_top_builddir|;t t
AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t
])dnl
@ -1178,7 +1181,7 @@ if test "$no_recursion" != yes; then
case $cache_file in
[[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
*) # Relative name.
ac_sub_cache_file=$ac_top_builddir$cache_file ;;
ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
esac
AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])

View File

@ -182,7 +182,7 @@ done
# in, but the groups themselves are run in testsuite-dir/group-dir.
if test -n "$at_top_srcdir"; then
builddir=../..
for at_dir in srcdir top_srcdir top_builddir
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/../..)
@ -479,12 +479,12 @@ case $as_dir in
at_path=$at_path$as_dir
;;
* )
if test -z "$at_top_builddir"; then
if test -z "$at_top_build_prefix"; then
# Stand-alone test suite.
at_path=$at_path$as_dir
else
# Embedded test suite.
at_path=$at_path$at_top_builddir/$as_dir$PATH_SEPARATOR
at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR
at_path=$at_path$at_top_srcdir/$as_dir
fi
;;
@ -899,8 +899,8 @@ else
echo
fi
if test -n "$at_top_srcdir"; then
AS_BOX([$at_top_builddir/config.log])
sed 's/^/| /' $at_top_builddir/config.log
AS_BOX([${at_top_build_prefix}config.log])
sed 's/^/| /' ${at_top_build_prefix}config.log
echo
fi
} >&AS_MESSAGE_LOG_FD