[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
proposed fix for Autoconf 2.53 IFS='/\\' problem with Solaris 8 dtksh
From: |
Paul Eggert |
Subject: |
proposed fix for Autoconf 2.53 IFS='/\\' problem with Solaris 8 dtksh |
Date: |
Thu, 14 Mar 2002 15:10:27 -0800 (PST) |
The "35: torture.at:541" test failure with Autoconf 2.53 on Solaris 8
with CONFIG_SHELL=/usr/dt/bin/dtksh is due to an IFS incompatibility.
dtksh executes the following tests/testsuite code:
{ case inner/innermost in
[\\/]* | ?:[\\/]* ) as_incr_dir=;;
*) as_incr_dir=.;;
esac
as_dummy=inner/innermost
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
case $as_mkdir_dir in
# Skip DOS drivespec
?:) as_incr_dir=$as_mkdir_dir ;;
*)
as_incr_dir=$as_incr_dir/$as_mkdir_dir
test -d "$as_incr_dir" ||
mkdir "$as_incr_dir" ||
{ { echo "$as_me:$LINENO: error: cannot create inner/innermost"
>&6
echo "$as_me: error: cannot create inner/innermost" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
done; }
as follows:
+ as_incr_dir=.
+ as_dummy=inner/innermost
+ IFS='/\'
+ set X inner innermost
+ shift
+ echo inner innermost
+ as_incr_dir='./inner innermost'
+ test -d './inner innermost'
+ mkdir './inner innermost'
which is not what is wanted.
I guess the moral of the story is: don't futz with IFS if you can
avoid it. Here is a proposed patch, which is inspired by mkinstalldirs.
2002-03-14 Paul Eggert <address@hidden>
* lib/m4sugar/m4sh.m4 (_AS_MKDIR_P_PREPARE): New macro.
(AS_MKDIR_P): Require it. Use mkdir -p if available, falling
back on AS_DIRNAME to compute prefixes otherwise; this is
roughly what mkinstalldirs does. That way, we need not have
our own filename disassembler. The old disassembler did not
work with Solaris 8 dtksh, which is ksh Version M-12/28/93d.
===================================================================
RCS file: lib/m4sugar/m4sh.m4,v
retrieving revision 2.53
retrieving revision 2.53.0.1
diff -pu -r2.53 -r2.53.0.1
--- lib/m4sugar/m4sh.m4 2002/02/07 15:37:55 2.53
+++ lib/m4sugar/m4sh.m4 2002/03/14 22:58:46 2.53.0.1
@@ -626,31 +626,32 @@ $as_ln_s $1 $2
])
+# _AS_MKDIR_P_PREPARE
+# -------------------
+m4_defun([_AS_MKDIR_P_PREPARE],
+[if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+])# _AS_MKDIR_P_PREPARE
+
# AS_MKDIR_P(PATH)
# ----------------
# Emulate `mkdir -p' with plain `mkdir'.
-#
-# Don't set IFS to '\\/' (see the doc): you would end up with
-# directories called foo\bar and foo?az and others depending upon the
-# shell.
m4_define([AS_MKDIR_P],
-[{ case $1 in
- [[\\/]]* | ?:[[\\/]]* ) as_incr_dir=;;
- *) as_incr_dir=.;;
-esac
-as_dummy=$1
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo
"address@hidden"`; do
- case $as_mkdir_dir in
- # Skip DOS drivespec
- ?:) as_incr_dir=$as_mkdir_dir ;;
- *)
- as_incr_dir=$as_incr_dir/$as_mkdir_dir
- test -d "$as_incr_dir" ||
- mkdir "$as_incr_dir" ||
- AS_ERROR([cannot create $1])
- ;;
- esac
-done; }
+[AS_REQUIRE([_$0_PREPARE])dnl
+{ if $as_mkdir_p; then
+ mkdir -p $1
+ else
+ as_dir=$1
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`AS_DIRNAME("$as_dir")`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || AS_ERROR([cannot create directory $1]); }
])# AS_MKDIR_P
- proposed fix for Autoconf 2.53 IFS='/\\' problem with Solaris 8 dtksh,
Paul Eggert <=