]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* m4/mkdirp.m4 (AM_PROG_MKDIR_P): Remove `.' from the mkdir_p
authorAlexandre Duret-Lutz <adl@gnu.org>
Sun, 25 Jul 2004 21:34:41 +0000 (21:34 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sun, 25 Jul 2004 21:34:41 +0000 (21:34 +0000)
definition, it causes `make install' to fails for user with no
right to write in the source-tree.
* automake.in (handle_configure): Do not use mkdir_p in the
definition for $(mkdir_p).
Report from Harlan Stenn.

ChangeLog
automake.in
configure
doc/stamp-vti
doc/version.texi
m4/mkdirp.m4

index 41fedbdc0e42d57d958dff8797de320cc6576870..479bb0adc628202fc7a0eb4eccbc6d2db5ddca15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-07-25  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Remove `.' from the mkdir_p
+       definition, it causes `make install' to fails for user with no
+       right to write in the source-tree.
+       * automake.in (handle_configure): Do not use mkdir_p in the
+       definition for $(mkdir_p).
+       Report from Harlan Stenn.
+
        * lib/am/texi-vers.am (%STAMPVTI%): Typo in comment.
 
 2004-07-22  Alexandre Duret-Lutz  <adl@gnu.org>
index 3f3f15d9381fd55f09516db94ca82a2f5cebb1ae..93da5fb729b585cf58a4a6b80fdbb042d328e25f 100755 (executable)
@@ -3882,7 +3882,7 @@ sub handle_configure ($$$@)
     if @distclean_config;
 
   # Distribute and define mkinstalldirs only if it is already present
-  # in the package, for backward compatibility (some people my still
+  # in the package, for backward compatibility (some people may still
   # use $(mkinstalldirs)).
   my $mkidpath = "$config_aux_dir/mkinstalldirs";
   if (-f $mkidpath)
@@ -3895,7 +3895,10 @@ sub handle_configure ($$$@)
     }
   else
     {
-      define_variable ('mkinstalldirs', '$(mkdir_p)', INTERNAL);
+      # Use $(install_sh), not $(mkdir_p) because the latter requires
+      # at least one argument, and $(mkinstalldirs) used to work
+      # even without arguments (e.g. $(mkinstalldirs) $(conditional_dir)).
+      define_variable ('mkinstalldirs', '$(install_sh) -d', INTERNAL);
     }
 
   reject_var ('CONFIG_HEADER',
index 667a6e137e2fe9a29b64b10d2ecd6d437f8dd676..62daf5db4ef0f166a99ca9eddf43095dac166720 100755 (executable)
--- a/configure
+++ b/configure
@@ -1688,13 +1688,21 @@ echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
 if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # Keeping the `.' argument allows $(mkdir_p) to be used without
-  # argument.  Indeed, we sometimes output rules like
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
   #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.
-  # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
-  # expensive solution, as it forces Make to start a sub-shell.)
-  mkdir_p='mkdir -p -- .'
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
 else
   # On NextStep and OpenStep, the `mkdir' command does not
   # recognize any option.  It will interpret all options as
index 1868b47c66d1edb9f864c6c3aff1c66c50697de3..cbd3d31314e4e955dbfc793c306a00178e6a5f97 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 22 July 2004
+@set UPDATED 25 July 2004
 @set UPDATED-MONTH July 2004
 @set EDITION 1.8e
 @set VERSION 1.8e
index 1868b47c66d1edb9f864c6c3aff1c66c50697de3..cbd3d31314e4e955dbfc793c306a00178e6a5f97 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 22 July 2004
+@set UPDATED 25 July 2004
 @set UPDATED-MONTH July 2004
 @set EDITION 1.8e
 @set VERSION 1.8e
index 361d20cfd6366d3a36a62bc0f7186bf9e1301a18..5541b03aad94c55ab4048232b929ff818e652d1c 100644 (file)
 # this.)
 AC_DEFUN([AM_PROG_MKDIR_P],
 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # Keeping the `.' argument allows $(mkdir_p) to be used without
-  # argument.  Indeed, we sometimes output rules like
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
   #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.
-  # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
-  # expensive solution, as it forces Make to start a sub-shell.)
-  mkdir_p='mkdir -p -- .'
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
 else
   # On NextStep and OpenStep, the `mkdir' command does not
   # recognize any option.  It will interpret all options as