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.
+2001-01-24 Akim Demaille <akim@epita.fr>
+
+ 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.
+
2001-01-24 Alexandre Duret-Lutz <duret_g@epita.fr>
configure -q did not work since 2000-11-03.
$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
* ) 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"])
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],
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])
: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.
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])
#
# 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
$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
* ) 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"])
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],
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])
: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.
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])
#
# 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
# 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
[(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))?=],
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
AC_CONFIG_HEADER(config.h:config.hin)
AC_STATE_SAVE(before)
$1
-AC_STATE_SAVE(after)
AC_OUTPUT
+AC_STATE_SAVE(after)
])])
])])
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)