From: Eric Blake Date: Fri, 10 Oct 2008 14:40:09 +0000 (-0600) Subject: Fix _AS_MKDIR_P usage. X-Git-Tag: v2.63b~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523ee0e116b772dfc7293212e2481db10042babe;p=thirdparty%2Fautoconf.git Fix _AS_MKDIR_P usage. * lib/m4sugar/m4sh.m4 (_AS_MKDIR_P): Correct documentation to match implementation. (_AS_PREPARE, _AS_MKDIR_P_PREPARE): Adjust callers. * doc/autoconf.texi (Programming in M4sh) : Tweak wording to better match behavior. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 2ead8c69..2ab03942 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,16 @@ +2008-10-10 Eric Blake + + Fix _AS_MKDIR_P usage. + * lib/m4sugar/m4sh.m4 (_AS_MKDIR_P): Correct documentation to + match implementation. + (_AS_PREPARE, _AS_MKDIR_P_PREPARE): Adjust callers. + * doc/autoconf.texi (Programming in M4sh) : Tweak + wording to better match behavior. + 2008-10-10 Paolo Bonzini * doc/autoconf.texi: Be less wary of shell functions. + * NEWS: Document the increased use of shell functions. 2008-10-10 Paolo Bonzini diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 2ea542c8..e1afada4 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -11872,9 +11872,10 @@ script. Finally, it changes the current diversion to @code{BODY}. @defmac AS_MKDIR_P (@var{file-name}) @asindex{MKDIR_P} Make the directory @var{file-name}, including intervening directories -as necessary. This is equivalent to @samp{mkdir -p @var{file-name}}, +as necessary. This is equivalent to @samp{mkdir -p -- @var{file-name}}, except that it is portable to older versions of @command{mkdir} that -lack support for the @option{-p} option. Also, @code{AS_MKDIR_P} +lack support for the @option{-p} option or for the @option{--} +delimiter. Also, @code{AS_MKDIR_P} succeeds if @var{file-name} is a symbolic link to an existing directory, even though Posix is unclear whether @samp{mkdir -p} should succeed in that case. If creation of @var{file-name} fails, exit the diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index c0a1e30d..369d27a4 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -257,7 +257,7 @@ fi # important not to forget some: config.status needs them. m4_defun([_AS_PREPARE], [as_func_mkdir_p() { - _AS_MKDIR_P([$[]1]) + _AS_MKDIR_P } _AS_EXPR_PREPARE @@ -1033,9 +1033,11 @@ $as_ln_s $1 $2 ]) -# _AS_MKDIR_P(DIR) -# ---------------- -# Emulate `mkdir -p` with plain `mkdir'. +# _AS_MKDIR_P +# ----------- +# Emit code that can be used to emulate `mkdir -p` with plain `mkdir'; +# the code assumes that "$as_dir" contains the directory to create. +# $as_dir is normalized, so there is no need to worry about using --. m4_define([_AS_MKDIR_P], [case $as_dir in #( -*) as_dir=./$as_dir;; @@ -1067,7 +1069,7 @@ as_dir=$1; as_func_mkdir_p])# AS_MKDIR_P # ------------------- m4_defun([_AS_MKDIR_P_PREPARE], [AS_REQUIRE_SHELL_FN([as_func_mkdir_p], [ - _AS_MKDIR_P([$[]1]) + _AS_MKDIR_P ]) if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"'