+2001-09-22 Akim Demaille <akim@epita.fr>
+
+ Rely on `$LINENO' when possible instead of `__oline__'.
+
+ * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Provide some form of
+ `$LINENO' support replacement when not supported.
+ (_AS_CR_PREPARE, _AS_TR_CPP_PREPARE, _AS_TR_SH_PREPARE): Invoke
+ them explicitly to be sure they are not output before this section
+ (via m4_require). Cosmetic only.
+ * lib/autoconf/c.m4, lib/autoconf/general.m4,
+ * lib/autoconf/programs.m4: Replace all the occurrences of
+ `__oline__' with `$LINENO'.
+ * doc/autoconf.texi (Special Shell Variables): Document LINENO.
+
2001-09-21 Tim Van Holder <tim.van.holder@pandora.be>
* lib/autoconf/functions.m4 (_AC_FUNC_FORK): Replaceded an 8-bit
* Major changes in Autoconf 2.52e -*- outline -*-
-** Licensing
- The Autoconf manual is now distributed under the terms of the GNU FDL.
+
** Requirements
- Perl 5.005 is now required to run Autoconf.
+ Perl 5.005 is required.
+
** Documentation
- AC_INIT
Argument requirements, output variables, defined macros.
First sketch of its documentation.
- Double quoting macros
AC_TRY_CPP, AC_TRY_COMPILE, AC_TRY_LINK and AC_TRY_RUN.
+- Licensing
+ The Autoconf manual is now distributed under the terms of the GNU FDL.
+
+** $LINENO
+ Is now used instead of hard coded line numbers.
+ This eases the comparison of `configure's, and diminishes the
+ pressure over control version archives.
+ Automatic replacement for shells that don't support this feature.
+
** autom4te
New executable, used by the Autoconf suite to cache and speed up
- some processing.
+ most processing.
+
** Standardization of the executables interface
- --force, -f
Supported by autom4te, autoconf and autoheader.
- --include, -I
Replaces --autoconf-dir and --localdir in autoconf, autoheader and
autoupdate.
+
** Bug fixes
- The top level $prefix is propagated to the AC_CONFIG_SUBDIRS configures.
+
** C Macros
- AC_C_BIGENDIAN supports the cross-compiling case.
- AC_C_BIGENDIAN accepts ACTION-IF-TRUE, ACTION-IF-FALSE, and
ACTION-IF-UNKNOWN arguments. All are facultative, and the default
for ACTION-IF-TRUE is to define WORDS_BIGENDIAN like AC_C_BIGENDIAN
always did.
+
** Generic macros
- AC_CONFIG_COMMANDS, HEADERS, FILES, LINKS.
Provide the user with srcdir, ac_top_srcdir, ac_top_builddir, ac_srcdir.
using @samp{C} as a fall back value. see @ref{Limitations of Builtins},
builtin @command{unset}, for more details.
+@item LINENO
+@evindex LINENO
+Most modern shells provide the current line number in @code{LINENO}.
+Its value is the line number of the beginning of the current command
+(see below the output of the here document). The behavior wrt
+@command{eval} differs according to the shell, but, amusingly, not in
+the case of sub shells:
+
+@example
+@group
+$ cat lineno
+echo 1. $LINENO
+cat <<EOF
+3. $LINENO
+4. $LINENO
+EOF
+( echo 6. $LINENO )
+eval 'echo 7. $LINENO'
+@end group
+@group
+$ ash lineno
+1.
+3.
+4.
+6.
+7.
+@end group
+@group
+$ bash-2.03 lineno
+1. 1
+3. 2
+4. 2
+6. 6
+7. 1
+@end group
+@group
+$ zsh-3.1.9 lineno
+1. 1
+3. 2
+4. 2
+6. 6
+7. 7
+@end group
+@end example
+
+
@item NULLCMD
@evindex NULLCMD
When executing the command @samp{>foo}, @command{zsh} executes
# AC_LANG_SOURCE(C)(BODY)
# -----------------------
# This sometimes fails to find confdefs.h, for some reason.
-# #line __oline__ "$[0]"
+# #line $LINENO "$[0]"
m4_define([AC_LANG_SOURCE(C)],
-[#line __oline__ "configure"
+[#line $LINENO "configure"
#include "confdefs.h"
$1])
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
# Provide some information about the compiler.
-echo "$as_me:__oline__:" \
+echo "$as_me:$LINENO:" \
"checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
ac_compiler=`set X $ac_compile; echo $[2]`
_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
g++)
# Provide some information about the compiler.
-echo "$as_me:__oline__:" \
+echo "$as_me:$LINENO:" \
"checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
ac_compiler=`set X $ac_compile; echo $[2]`
_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
# AC_MSG_CHECKING(FEATURE)
# ------------------------
m4_define([AC_MSG_CHECKING],
-[_AS_ECHO([$as_me:__oline__: checking $1], AS_MESSAGE_LOG_FD)
+[_AS_ECHO([$as_me:$LINENO: checking $1], AS_MESSAGE_LOG_FD)
_AS_ECHO_N([checking $1... ])[]dnl
])
# AC_MSG_RESULT(RESULT)
# ---------------------
m4_define([AC_MSG_RESULT],
-[_AS_ECHO([$as_me:__oline__: result: $1], AS_MESSAGE_LOG_FD)
+[_AS_ECHO([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
_AS_ECHO([${ECHO_T}$1])[]dnl
])
# ------------------------------
# Likewise, but perform $ ` \ shell substitutions.
m4_define([AC_MSG_RESULT_UNQUOTED],
-[_AS_ECHO_UNQUOTED([$as_me:__oline__: result: $1], AS_MESSAGE_LOG_FD)
+[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
])
[{ ($2) >&AS_MESSAGE_LOG_FD
($1) 2>&AS_MESSAGE_LOG_FD
ac_status=$?
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
# Eval COMMAND, save the exit status in ac_status, and log it.
AC_DEFUN([_AC_EVAL],
[_AC_RUN_LOG([eval $1],
- [eval echo "$as_me:__oline__: \"$1\""])])
+ [eval echo "$as_me:$LINENO: \"$1\""])])
# _AC_EVAL_STDERR(COMMAND)
# Note that when tracing, most shells will leave the traces in stderr
AC_DEFUN([_AC_EVAL_STDERR],
[_AC_RUN_LOG_STDERR([eval $1],
- [eval echo "$as_me:__oline__: \"$1\""])])
+ [eval echo "$as_me:$LINENO: \"$1\""])])
# AC_TRY_EVAL(VARIABLE)
# -------------------
AC_DEFUN([AC_RUN_LOG],
[_AC_RUN_LOG([$1],
- [echo "$as_me:__oline__: AS_ESCAPE([$1])"])])
+ [echo "$as_me:$LINENO: AS_ESCAPE([$1])"])])
## ------------------ ##
continue
fi])dnl
ac_cv_prog_$1="$3"
- echo "$as_me:__oline__: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD
break 2
fi
done])
[for ac_exec_ext in '' $ac_executable_extensions; do
if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); then
ac_cv_path_$1="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:__oline__: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&AS_MESSAGE_LOG_FD
break 2
fi
done])
# Name of the executable.
as_me=`AS_BASENAME($[0])`
+# If LINENO is not supported by the shell, produce a version of this
+# script where LINENO is hard coded. Rewrite if not up to date only.
+# Comparing LINENO against _oline_ is not a good solution, since in
+# the case of embedded executables (such as config.status within
+# configure) you'd compare LINENO wrt config.status vs. _oline_ vs
+# configure. Hence a useless rewrite (not to mention the risk of
+# ``infinite'' rewrites. Merely check that LINENO is incremented
+# between two lines, which is a property guaranteed for _oline_, hence
+# it protects us from repetitive rewrites.
+as_lineno_1=$LINENO
+as_lineno_2=$LINENO
+# Compute as_lineno_1 in two steps: some shells restart LINENO for
+# subshells.
+as_lineno_1=`(expr $as_lineno_1 + 1) 2>/dev/null`
+if test "x$as_lineno_1" != "x$as_lineno_2"; then
+ if test ! -f $as_me.lineno ||
+ test x`ls -1dt $as_me.lineno $as_me 2>/dev/null | sed 1q` \
+ != x$as_me.lineno; then
+ # Be sure to write the pattern so that it doesn't replace itself:
+ # it must not match itself.
+ awk '{
+ if ($[0] ~ /[[$]]LINENO/)
+ while (sub (/[[$]]LINENO/, NR))
+ continue
+ print
+ }' <$as_me >$as_me.lineno
+ chmod +x $as_me.lineno
+ fi
+ exec ${SHELL-/bin/sh} ./$as_me.lineno
+fi
+
+_AS_CR_PREPARE
_AS_ECHO_N_PREPARE
_AS_EXPR_PREPARE
_AS_LN_S_PREPARE
_AS_PATH_SEPARATOR_PREPARE
_AS_TEST_PREPARE
-_AS_TR_PREPARE
+_AS_TR_CPP_PREPARE
+_AS_TR_SH_PREPARE
_AS_UNSET_PREPARE
# NLS nuisances.
# ----------------------------------------
m4_define([AS_MESSAGE],
[m4_ifset([AS_MESSAGE_LOG_FD],
- [{ _AS_ECHO([$as_me:__oline__: $1], [AS_MESSAGE_LOG_FD])
+ [{ _AS_ECHO([$as_me:$LINENO: $1], [AS_MESSAGE_LOG_FD])
_AS_ECHO([$as_me: $1], [$2]);}],
[_AS_ECHO([$as_me: $1], [$2])])[]dnl
])