The improved version. make check is running and up to 50 (i.e.,
torture is passed), everything is fine. My previous questions still
apply :)
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
While preserved in configure, srcdir is trashed in config.status.
Reported by Ralf Corsepius.
* tests/aclocal.m4 (AC_STATE_SAVE): It is ok to modify
CONFIG_STATUS, DEFS, prefix and exec_prefix.
It is OK to produce config.* files.
* tests/atspecific.m4 (AT_CONFIGURE_AC): Save the env *after*
AC_OUTPUT to check that it doesn't break anything by itself.
* tests/torture.m4 (srcdir): New test, from Ralf Corsepius.
* acgeneral.m4 (_AC_OUTPUT_FILES): Use ac_top_srcdir and ac_srcdir
to preserve srcdir and top_srcdir.
Remove any use of `ac_given_srcdir' as `$srcdir' being preserved
is usable.
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.678
diff -u -u -r1.678 acgeneral.m4
--- acgeneral.m4 2001/01/24 10:04:47 1.678
+++ acgeneral.m4 2001/01/24 11:28:22
@@ -3630,11 +3630,10 @@
$CONFIG_STATUS generated by $as_me (Autoconf AC_ACVERSION).
Configured on host $ac_hostname by
`echo "[$]0 $ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
-
-ac_given_srcdir=$srcdir
+srcdir=$srcdir
AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
[dnl Leave those double quotes here: this $INSTALL is evaluated in a
-dnl here document, wbich might result in `ac_given_srcdir=/bin/install -c'.
+dnl here document, wbich might result in `srcdir=/bin/install -c'.
ac_given_INSTALL="$INSTALL"
])dnl
EOF
@@ -3894,7 +3893,8 @@
* ) ac_file_in=$ac_file.in ;;
esac
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+ # Adjust a relative ac_srcdir, ac_top_srcdir, and INSTALL for
+ # subdirectories.
ac_dir=`AS_DIRNAME(["$ac_file"])`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
AS_MKDIR_P(["$ac_dir"])
@@ -3905,16 +3905,19 @@
ac_dir_suffix= ac_dots=
fi
- case $ac_given_srcdir in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots | sed 's,/$,,'`; fi ;;
+ case $srcdir in
+ .) ac_srcdir=.
+ if test -z "$ac_dots"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+ fi ;;
[[\\/]]* | ?:[[\\/]]* )
- srcdir=$ac_given_srcdir$ac_dir_suffix;
- top_srcdir=$ac_given_srcdir ;;
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
*) # Relative path.
- srcdir=$ac_dots$ac_given_srcdir$ac_dir_suffix
- top_srcdir=$ac_dots$ac_given_srcdir ;;
+ ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_dots$srcdir ;;
esac
AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
@@ -3948,9 +3951,9 @@
if test -f "$f"; then
# Build tree
echo $f
- elif test -f "$ac_given_srcdir/$f"; then
+ elif test -f "$srcdir/$f"; then
# Source tree
- echo $ac_given_srcdir/$f
+ echo $srcdir/$f
else
# /dev/null tree
AC_MSG_ERROR([cannot find input file: $f])
@@ -3969,8 +3972,8 @@
:t
[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$srcdir,;t t
-s,@top_srcdir@,$top_srcdir,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$INSTALL,;t t
])dnl
dnl The parens around the eval prevent an "illegal io" in Ultrix sh.
@@ -4095,9 +4098,9 @@
if test -f "$f"; then
# Build tree
echo $f
- elif test -f "$ac_given_srcdir/$f"; then
+ elif test -f "$srcdir/$f"; then
# Source tree
- echo $ac_given_srcdir/$f
+ echo $srcdir/$f
else
# /dev/null tree
AC_MSG_ERROR([cannot find input file: $f])
@@ -4253,7 +4256,6 @@
#
# CONFIG_LINKS section.
#
-srcdir=$ac_given_srcdir
dnl Here we use : instead of .. because if AC_LINK_FILES was used
dnl with empty parameters (as in gettext.m4), then we obtain here
Index: tests/aclocal.m4
===================================================================
RCS file: /cvs/autoconf/tests/aclocal.m4,v
retrieving revision 1.12
diff -u -u -r1.12 aclocal.m4
--- tests/aclocal.m4 2001/01/18 09:15:53 1.12
+++ tests/aclocal.m4 2001/01/24 11:29:05
@@ -10,6 +10,11 @@
# is AC_SUBST.
# - ^ac_
# Autoconf's shell name space.
+# - prefix and exec_prefix
+# are kept undefined (NONE) until AC_OUTPUT with then sets them to
+# `/usr/local' and `${prefix}' for make.
+# - CONFIG_STATUS and DEFS
+# Set by AC_OUTPUT.
# - ALLOCA|NEED_SETGID|KMEM_GROUP
# AC_FUNCs from acspecific.
# - AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC
@@ -30,6 +35,7 @@
[(set) 2>&1 |
egrep -v -e 'm4_join([|],
[^ac_],
+ [^((exec_)?prefix|DEFS|CONFIG_STATUS)=],
[^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
[^(LIBS|LIBOBJS|LDFLAGS)=],
[^INSTALL(_(DATA|PROGRAM|SCRIPT))?=],
@@ -47,5 +53,5 @@
grep '^m4_defn([m4_re_word])=' >state-env.$1
test $? = 0 || rm -f state-env.$1
-ls -1 | grep -v '^state' | sort >state-ls.$1
+ls -1 | egrep -v '^(state.*|config\.)' | sort >state-ls.$1
])# AC_STATE_SAVE
Index: tests/atspecific.m4
===================================================================
RCS file: /cvs/autoconf/tests/atspecific.m4,v
retrieving revision 1.39
diff -u -u -r1.39 atspecific.m4
--- tests/atspecific.m4 2001/01/22 09:03:38 1.39
+++ tests/atspecific.m4 2001/01/24 11:29:05
@@ -34,8 +34,8 @@
AC_CONFIG_HEADER(config.h:config.hin)
AC_STATE_SAVE(before)
$1
-AC_STATE_SAVE(after)
AC_OUTPUT
+AC_STATE_SAVE(after)
])])
Index: tests/torture.at
===================================================================
RCS file: /cvs/autoconf/tests/torture.at,v
retrieving revision 1.12
diff -u -u -r1.12 torture.at
--- tests/torture.at 2001/01/22 08:59:02 1.12
+++ tests/torture.at 2001/01/24 11:29:05
@@ -294,3 +294,43 @@
])])
AT_CLEANUP(dummy)
+
+
+## -------- ##
+## srcdir. ##
+## -------- ##
+
+AT_SETUP([srcdir])
+
+rm -rf at-dir
+mkdir at-dir
+: >at-dir/bar.in
+: >foo.in
+
+AT_DATA([configure.ac],
+[[AC_INIT
+
+AC_CONFIG_FILES([foo at-dir/bar])
+
+AC_CONFIG_COMMANDS([report],
+[test -f $srcdir/configure.ac ||
+ AC_MSG_ERROR([cannot find $srcdir/configure.ac])],
+ [srcdir=$srcdir])
+
+AC_OUTPUT
+rm -rf foo at-dir/bar
+]])
+
+AT_CHECK_AUTOCONF
+
+# In place.
+AT_CHECK([./configure], [], [ignore])
+
+# Relative path.
+AT_CHECK([cd at-dir && ../configure], [], [ignore])
+
+# Absolute path.
+at_here=`pwd`
+AT_CHECK([cd at-dir && $at_here/configure], [], [ignore])
+
+AT_CLEANUP(at-dir foo.in foo)