Re: Use "$(MKDIR_P) sys", not race-prone "test -d sys || mkdir sys".

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

 



Hello Jim, all,

* Jim Meyering wrote on Mon, Jan 22, 2007 at 03:52:21PM CET:
> 
>     dnl Do special magic for MKDIR_P instead of AC_SUBST, to get
>     dnl relative names right.
>     AC_MSG_RESULT([$MKDIR_P])
> 
> The only case I can imagine is when MKDIR_P is specified
> as e.g., MKDIR_P='../build-aux/install-sh -d' in one place,
> and later (in another Makefile) as
> MKDIR_P='somewhere/else/install-sh -d' in another.
> 
> I wonder which use case made it so using AC_SUBST wasn't an option.

The AC_SUBST is actually harmless.  It adds a couple of unneeded
lines to the configure script, but config.status is written in a way
that the special magic happens before the regular substitutions, so
that latter bit will actually be a noop.

This issue is unfortunate.  It arises because at the same time we
changed it, also the logic of automake to trace the macro AC_SUBST_TRACE
rather than AC_SUBST directly was changed; which is why Automake-1.10
works fine but older doesn't.  I tested CVS Autoconf with older
(non-CVS) Automake versions back then, which is why I originally
suggested using a different name (MKDIR_P rather than mkdir_p);
but I did not test using the newer Autoconf macro AC_PROG_MKDIR_P in
conjunction with the older Automake.  Sorry about that.

Autoconf could consider adding AC_SUBST([MKDIR_P]); it will cause an
extraneous line in the configure script, but should be harmless
otherwise, as far as I can see it.  But surely people could update
to Automake 1.10 just as well, given the number of bugs it has fixed
over 1.9.6.

OK to apply?

Cheers,
Ralf

2007-01-22  Ralf Wildenhues  <Ralf.Wildenhues@xxxxxx>

	* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Also
	AC_SUBST([MKDIR_P]), so that Automake < 1.10 will pick up its
	trace, if a package uses AC_PROG_MKDIR_P explicitly.  The actual
	substitution will still be done by the special code.
	Report by Jim Meyering.

Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.64
diff -u -r1.64 programs.m4
--- lib/autoconf/programs.m4	11 Jan 2007 21:17:37 -0000	1.64
+++ lib/autoconf/programs.m4	22 Jan 2007 19:36:23 -0000
@@ -682,8 +682,12 @@
     MKDIR_P="$ac_install_sh -d"
   fi
 fi
-dnl Do special magic for MKDIR_P instead of AC_SUBST, to get
-dnl relative names right.
+dnl In status.m4, we di special magic for MKDIR_P instead of AC_SUBST,
+dnl to get relative names right.  However, here we also AC_SUBST, so
+dnl that Automake versions before 1.10 will pick it up (they do not
+dnl trace AC_SUBST_TRACE).
+dnl FIXME: Remove this once we drop support for Automake < 1.10.
+AC_SUBST([MKDIR_P])dnl
 AC_MSG_RESULT([$MKDIR_P])
 ])# AC_PROG_MKDIR_P
 


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux