* m4sh.m4 (AS_BASENAME): New.

(AS_SHELL_SANITIZE): Set `$as_me'.
* acgeneral.m4: Don't set as_me; AS_SHELL_SANITIZE now does this.
* tests/atgeneral.m4: Likewise.
(AT_INIT): Use $PATH_SEPARATOR for walking the path.
* autoconf.sh: Be DOS-friendly when setting as_me and M4.
Add quotes to support spaces in $tmp.
Work around problem in DJGPP port of awk by using a temporary file.
* autoheader.sh: Be DOS-friendly when setting as_me.
* autoreconf.sh: Be DOS-friendly when setting as_me, dir and
template_dir.
This commit is contained in:
Akim Demaille 2001-03-30 12:49:36 +00:00
parent e620bb0400
commit 75a3a3d326
16 changed files with 98 additions and 61 deletions

View File

@ -1,3 +1,17 @@
2001-03-30 Tim Van Holder <tim.van.holder@pandora.be>
* m4sh.m4 (AS_BASENAME): New.
(AS_SHELL_SANITIZE): Set `$as_me'.
* acgeneral.m4: Don't set as_me; AS_SHELL_SANITIZE now does this.
* tests/atgeneral.m4: Likewise.
(AT_INIT): Use $PATH_SEPARATOR for walking the path.
* autoconf.sh: Be DOS-friendly when setting as_me and M4.
Add quotes to support spaces in $tmp.
Work around problem in DJGPP port of awk by using a temporary file.
* autoheader.sh: Be DOS-friendly when setting as_me.
* autoreconf.sh: Be DOS-friendly when setting as_me, dir and
template_dir.
2001-03-27 Lars J. Aas <larsa@sim.no>
* acgeneral.m4 (AC_INIT_VERSION): Improved version information string

View File

@ -723,9 +723,6 @@ AS_SHELL_SANITIZE
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
# Name of the executable.
as_me=`echo "$[0]" | sed 's,.*/,,'`
cat >config.log <<EOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -3596,7 +3593,6 @@ cat >$CONFIG_STATUS <<_ACEOF
# configure, is in config.log if it exists.
debug=false
as_me=\`echo "\$[0]" | sed 's,.*/,,'\`
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
@ -4000,8 +3996,8 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[[\\/$]]* | ?:[[\\/]]*)
# Absolute
[[\\/$]]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
echo $f;;
*) # Relative
@ -4147,8 +4143,8 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[[\\/$]]* | ?:[[\\/]]*)
# Absolute
[[\\/$]]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
echo $f;;
*) # Relative

View File

@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -95,8 +95,8 @@ ac_LF_and_DOT=`echo; echo .`
# Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
: ${M4=@M4@}
case $M4 in
/*|[a-zA-Z]:*) test -f "$M4" || M4=m4 ;;
case "$M4" in
[\\/]* | ?:[\\/]*) test -f "$M4" || M4=m4 ;;
esac
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help </dev/null 2>&1` in
@ -322,7 +322,7 @@ case $task in
# Put the real line numbers into configure to make config.log more
# helpful. Because quoting can sometimes get really painful in m4,
# there are special @tokens@ to substitute.
sed 's/^ //' >$tmp/finalize.awk <<EOF
sed 's/^ //' >"$tmp/finalize.awk" <<EOF
# Load the list of tokens which escape the forbidden patterns.
BEGIN {
# Be sure the read GAWK documentation to understand the parens
@ -344,7 +344,10 @@ case $task in
function errprint (message)
{
print message | "cat >&2"
# BAD! the pipe to 'cat >&2' doesn't work for DJGPP.
# print message | "cat >&2"
# Use normal redirection instead:
print message > "$tmp/finalize.err"
}
function undefined (file, line, macro)
@ -421,8 +424,10 @@ case $task in
EOF
$AWK -v tmp="$tmp" \
`$verbose "-v verbose=1"` \
-f $tmp/finalize.awk <$tmp/configure >&4 ||
{ (exit 1); exit; }
-f "$tmp/finalize.awk" <$tmp/configure >&4 ||
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
(exit 1); exit; }
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
;; # End of the task script.

View File

@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -95,8 +95,8 @@ ac_LF_and_DOT=`echo; echo .`
# Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
: ${M4=@M4@}
case $M4 in
/*|[a-zA-Z]:*) test -f "$M4" || M4=m4 ;;
case "$M4" in
[\\/]* | ?:[\\/]*) test -f "$M4" || M4=m4 ;;
esac
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help </dev/null 2>&1` in
@ -322,7 +322,7 @@ case $task in
# Put the real line numbers into configure to make config.log more
# helpful. Because quoting can sometimes get really painful in m4,
# there are special @tokens@ to substitute.
sed 's/^ //' >$tmp/finalize.awk <<EOF
sed 's/^ //' >"$tmp/finalize.awk" <<EOF
# Load the list of tokens which escape the forbidden patterns.
BEGIN {
# Be sure the read GAWK documentation to understand the parens
@ -344,7 +344,10 @@ case $task in
function errprint (message)
{
print message | "cat >&2"
# BAD! the pipe to 'cat >&2' doesn't work for DJGPP.
# print message | "cat >&2"
# Use normal redirection instead:
print message > "$tmp/finalize.err"
}
function undefined (file, line, macro)
@ -421,8 +424,10 @@ case $task in
EOF
$AWK -v tmp="$tmp" \
`$verbose "-v verbose=1"` \
-f $tmp/finalize.awk <$tmp/configure >&4 ||
{ (exit 1); exit; }
-f "$tmp/finalize.awk" <$tmp/configure >&4 ||
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
(exit 1); exit; }
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
;; # End of the task script.

View File

@ -20,7 +20,7 @@
# Written by Roland McGrath.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[/\\],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]

View File

@ -20,7 +20,7 @@
# Written by Roland McGrath.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[/\\],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
dir=`echo "$0" | sed -e 's,[^\\/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false
@ -382,7 +382,7 @@ while read dir; do
: colon
s/:.*//
'`
template_dir=`echo $template | sed 's,/*[^/]*$,,;s,^$,.,'`
template_dir=`echo $template | sed -e 's,[\\/]*[^\\/]*$,,;s,^$,.,'`
stamp_num=`test "$tcount" -gt 1 && echo "$tcount"`
stamp=$template_dir/stamp-h$stamp_num.in
# If config.hin exists, don't override it unless it was really

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
dir=`echo "$0" | sed -e 's,[^\\/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false
@ -382,7 +382,7 @@ while read dir; do
: colon
s/:.*//
'`
template_dir=`echo $template | sed 's,/*[^/]*$,,;s,^$,.,'`
template_dir=`echo $template | sed -e 's,[\\/]*[^\\/]*$,,;s,^$,.,'`
stamp_num=`test "$tcount" -gt 1 && echo "$tcount"`
stamp=$template_dir/stamp-h$stamp_num.in
# If config.hin exists, don't override it unless it was really

View File

@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -95,8 +95,8 @@ ac_LF_and_DOT=`echo; echo .`
# Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
: ${M4=@M4@}
case $M4 in
/*|[a-zA-Z]:*) test -f "$M4" || M4=m4 ;;
case "$M4" in
[\\/]* | ?:[\\/]*) test -f "$M4" || M4=m4 ;;
esac
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help </dev/null 2>&1` in
@ -322,7 +322,7 @@ case $task in
# Put the real line numbers into configure to make config.log more
# helpful. Because quoting can sometimes get really painful in m4,
# there are special @tokens@ to substitute.
sed 's/^ //' >$tmp/finalize.awk <<EOF
sed 's/^ //' >"$tmp/finalize.awk" <<EOF
# Load the list of tokens which escape the forbidden patterns.
BEGIN {
# Be sure the read GAWK documentation to understand the parens
@ -344,7 +344,10 @@ case $task in
function errprint (message)
{
print message | "cat >&2"
# BAD! the pipe to 'cat >&2' doesn't work for DJGPP.
# print message | "cat >&2"
# Use normal redirection instead:
print message > "$tmp/finalize.err"
}
function undefined (file, line, macro)
@ -421,8 +424,10 @@ case $task in
EOF
$AWK -v tmp="$tmp" \
`$verbose "-v verbose=1"` \
-f $tmp/finalize.awk <$tmp/configure >&4 ||
{ (exit 1); exit; }
-f "$tmp/finalize.awk" <$tmp/configure >&4 ||
{ test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
(exit 1); exit; }
test -f "$tmp/finalize.err" && cat "$tmp/finalize.err" >&2
;; # End of the task script.

View File

@ -20,7 +20,7 @@
# Written by Roland McGrath.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[/\\],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]

View File

@ -17,7 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
me=`echo "$0" | sed -e 's,.*/,,'`
me=`echo "$0" | sed -e 's,.*[\\/],,'`
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
dir=`echo "$0" | sed -e 's,[^\\/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false
@ -382,7 +382,7 @@ while read dir; do
: colon
s/:.*//
'`
template_dir=`echo $template | sed 's,/*[^/]*$,,;s,^$,.,'`
template_dir=`echo $template | sed -e 's,[\\/]*[^\\/]*$,,;s,^$,.,'`
stamp_num=`test "$tcount" -gt 1 && echo "$tcount"`
stamp=$template_dir/stamp-h$stamp_num.in
# If config.hin exists, don't override it unless it was really

View File

@ -723,9 +723,6 @@ AS_SHELL_SANITIZE
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
# Name of the executable.
as_me=`echo "$[0]" | sed 's,.*/,,'`
cat >config.log <<EOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -3596,7 +3593,6 @@ cat >$CONFIG_STATUS <<_ACEOF
# configure, is in config.log if it exists.
debug=false
as_me=\`echo "\$[0]" | sed 's,.*/,,'\`
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
@ -4000,8 +3996,8 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[[\\/$]]* | ?:[[\\/]]*)
# Absolute
[[\\/$]]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
echo $f;;
*) # Relative
@ -4147,8 +4143,8 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
for f in $ac_file_in; do
case $f in
-) echo $tmp/stdin ;;
[[\\/$]]* | ?:[[\\/]]*)
# Absolute
[[\\/$]]*)
# Absolute (can't be DOS-style, as IFS=:)
test -f "$f" || AC_MSG_ERROR([cannot find input file: $f])
echo $f;;
*) # Relative

View File

@ -95,9 +95,6 @@ m4_divert_push([DEFAULT])dnl
#! /bin/sh
AS_SHELL_SANITIZE
# Name of the executable.
as_me=`echo "$[0]" | sed 's,.*/,,'`
SHELL=${CONFIG_SHELL-/bin/sh}
. ./atconfig
@ -108,12 +105,12 @@ at_top_srcdir=`cd "$top_srcdir" && pwd`
# Don't take risks: use absolute path names.
at_path=`pwd`
at_IFS_save=$IFS
IFS=:
IFS=$PATH_SEPARATOR
for at_dir in $AUTOTEST_PATH $PATH; do
# There might be directories that don't exist, but don't redirect
# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
at_dir=`(cd "$at_dir" && pwd) 2>/dev/null`
test -n "$at_dir" && at_path=$at_path:$at_dir
test -n "$at_dir" && at_path="$at_path$PATH_SEPARATOR$at_dir"
done
IFS=$at_IFS_save
PATH=$at_path

View File

@ -66,6 +66,10 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
# Name of the executable.
dnl Moved here because the tests below can use AC_MSG_ERROR, which uses $as_me
as_me=`AS_BASENAME($[0])`
_AS_EXPR_PREPARE
_AS_LN_S_PREPARE
_AS_TEST_PREPARE
@ -291,6 +295,13 @@ m4_defun([AS_DIRNAME],
AS_DIRNAME_SED([$1])])
# AS_BASENAME(PATHNAME)
# --------------------
# Simulate running `basename(1)' on PATHNAME, not all systems have it.
# This macro must be usable from inside ` `.
m4_defun([AS_BASENAME],
[echo "$1" |sed 's,.*[[\\/]],,'])
# AS_EXECUTABLE_P
# ---------------
# Check whether a file is executable.
@ -317,7 +328,7 @@ fi
# _AS_LN_S_PREPARE
# ----------------
# Don't use conftest.sym to avoid filename issues on DJGPP, where this
# would yield conftest.sym.exe for DJGPP < 2.04. And do use `conftest'
# would yield conftest.sym.exe for DJGPP < 2.04. And don't use `conftest'
# as base name to avoid prohibiting concurrency (e.g., concurrent
# config.statuses).
m4_defun([_AS_LN_S_PREPARE],

13
m4sh.m4
View File

@ -66,6 +66,10 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
# Name of the executable.
dnl Moved here because the tests below can use AC_MSG_ERROR, which uses $as_me
as_me=`AS_BASENAME($[0])`
_AS_EXPR_PREPARE
_AS_LN_S_PREPARE
_AS_TEST_PREPARE
@ -291,6 +295,13 @@ m4_defun([AS_DIRNAME],
AS_DIRNAME_SED([$1])])
# AS_BASENAME(PATHNAME)
# --------------------
# Simulate running `basename(1)' on PATHNAME, not all systems have it.
# This macro must be usable from inside ` `.
m4_defun([AS_BASENAME],
[echo "$1" |sed 's,.*[[\\/]],,'])
# AS_EXECUTABLE_P
# ---------------
# Check whether a file is executable.
@ -317,7 +328,7 @@ fi
# _AS_LN_S_PREPARE
# ----------------
# Don't use conftest.sym to avoid filename issues on DJGPP, where this
# would yield conftest.sym.exe for DJGPP < 2.04. And do use `conftest'
# would yield conftest.sym.exe for DJGPP < 2.04. And don't use `conftest'
# as base name to avoid prohibiting concurrency (e.g., concurrent
# config.statuses).
m4_defun([_AS_LN_S_PREPARE],

View File

@ -95,9 +95,6 @@ m4_divert_push([DEFAULT])dnl
#! /bin/sh
AS_SHELL_SANITIZE
# Name of the executable.
as_me=`echo "$[0]" | sed 's,.*/,,'`
SHELL=${CONFIG_SHELL-/bin/sh}
. ./atconfig
@ -108,12 +105,12 @@ at_top_srcdir=`cd "$top_srcdir" && pwd`
# Don't take risks: use absolute path names.
at_path=`pwd`
at_IFS_save=$IFS
IFS=:
IFS=$PATH_SEPARATOR
for at_dir in $AUTOTEST_PATH $PATH; do
# There might be directories that don't exist, but don't redirect
# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
at_dir=`(cd "$at_dir" && pwd) 2>/dev/null`
test -n "$at_dir" && at_path=$at_path:$at_dir
test -n "$at_dir" && at_path="$at_path$PATH_SEPARATOR$at_dir"
done
IFS=$at_IFS_save
PATH=$at_path