+2008-10-10 Eric Blake <ebb9@byu.net>
+
+ 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) <AS_MKDIR_P>: Tweak
+ wording to better match behavior.
+
2008-10-10 Paolo Bonzini <bonzini@gnu.org>
* doc/autoconf.texi: Be less wary of shell functions.
+ * NEWS: Document the increased use of shell functions.
2008-10-10 Paolo Bonzini <bonzini@gnu.org>
@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
# 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
])
-# _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;;
# -------------------
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"'