mirror of
git://git.sv.gnu.org/autoconf
synced 2024-12-03 02:00:36 +08:00
(_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.
This commit is contained in:
parent
e90f7903d2
commit
8064dd81b2
@ -627,31 +627,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 "$[@]"`; 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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user