automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with s,@mkdir_p@,mkdir -p -- .,


From: Alexandre Duret-Lutz
Subject: Re: Problem with s,@mkdir_p@,mkdir -p -- .,
Date: Sun, 25 Jul 2004 23:34:21 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Harlan" == Harlan Stenn <address@hidden> writes:

 Harlan> Hi,
 Harlan> I'm using systems where the source code is NFS-mounted, and for some
 Harlan> packages I need to do the install as root.

 Harlan> For security reasons, the NFS-mounted filesystems remap
 Harlan> root to a "safe" uid.

 Harlan> This means the 'mkdir .' fails, as root does not have
 Harlan> write permission to the current directory.

Thanks for the report.  I'm checking this in.

2004-07-25  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1567
diff -u -r1.1567 automake.in
--- automake.in 21 Jul 2004 17:44:06 -0000      1.1567
+++ automake.in 25 Jul 2004 21:31:45 -0000
@@ -3882,7 +3882,7 @@
     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 @@
     }
   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: m4/mkdirp.m4
===================================================================
RCS file: /cvs/automake/automake/m4/mkdirp.m4,v
retrieving revision 1.5
diff -u -r1.5 mkdirp.m4
--- m4/mkdirp.m4        15 Feb 2004 21:14:23 -0000      1.5
+++ m4/mkdirp.m4        25 Jul 2004 21:31:47 -0000
@@ -39,13 +39,21 @@
 # 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



-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]