Re: "$(MAKE) %STAMP%" without $(AM_MAKEFLAGS)?

2005-08-07 Thread Alexandre Duret-Lutz
>>> "SK" == Stepan Kasal <[EMAIL PROTECTED]> writes:

 SK> Hello,
 SK> I have noticed the following:
 SK> file lib/am/remake-hdr.am  contains command

 SK> $(MAKE) %STAMP%

 SK> while I'd expect the usual $(MAKE) $(AM_MAKEFLAGS) %STAMP% for the
 SK> recursive call of make.

 SK> Similar with %DIRSTAMP% in texibuild.am and texi-vers.am .

 SK> Isn't this a bug?

Thanks.  I'm installing this on HEAD.

2005-08-07  Alexandre Duret-Lutz  <[EMAIL PROTECTED]>

* automake.in (lang_yacc_target_hook): Use AM_MAKEFLAGS in recursive
$(MAKE) invocations.
* lib/am/texibuild.am (?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%):
Likewise.
* lib/am/texi-vers.am (%STAMPVTI%): Likewise.
* lib/am/remake-hdr.am (%CONFIG_H%): Likewise.
* Makefile.am (maintainer-check): Check for this.
Report from Stepan Kasal.

Index: Makefile.am
===
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.240
diff -u -r1.240 Makefile.am
--- Makefile.am 19 Jul 2005 19:19:17 -  1.240
+++ Makefile.am 7 Aug 2005 08:27:11 -
@@ -2,7 +2,7 @@
 
 ## Makefile for Automake.
 
-## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -184,6 +184,12 @@
  exit 1; \
fi
 ## Tests should never call make directly.
+   @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
+   grep -v 'AM_MAKEFLAGS'; then \
+ echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
+ exit 1; \
+   fi
+## Tests should never call make directly.
@if grep -v '^#' $(srcdir)/tests/*.test | grep ':[  ]*make'; then \
  echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 
1>&2; \
  exit 1; \
Index: automake.in
===
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1609
diff -u -r1.1609 automake.in
--- automake.in 27 Jul 2005 11:09:45 -  1.1609
+++ automake.in 7 Aug 2005 08:27:12 -
@@ -5425,12 +5425,13 @@
  INTERNAL))
  {
my $condstr = $cond->subst_string;
-   $output_rules .= ("$condstr${header}: $output\n"
- # Recover from removal of $header
- . "[EMAIL PROTECTED] test ! -f \$@; then \\\n"
- . "$condstr\t  rm -f $output; \\\n"
- . "$condstr\t  \$(MAKE) $output; \\\n"
- . "$condstr\telse :; fi\n");
+   $output_rules .=
+ "$condstr${header}: $output\n"
+ # Recover from removal of $header
+ . "[EMAIL PROTECTED] test ! -f \$@; then \\\n"
+ . "$condstr\t  rm -f $output; \\\n"
+ . "$condstr\t  \$(MAKE) $(AM_MAKEFLAGS) $output; \\\n"
+ . "$condstr\telse :; fi\n";
  }
# Distribute the generated file, unless its .y source was
# listed in a nodist_ variable.  (&handle_source_transform
Index: lib/am/remake-hdr.am
===
RCS file: /cvs/automake/automake/lib/am/remake-hdr.am,v
retrieving revision 1.45
diff -u -r1.45 remake-hdr.am
--- lib/am/remake-hdr.am14 May 2005 20:28:53 -  1.45
+++ lib/am/remake-hdr.am7 Aug 2005 08:27:12 -
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2005
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 ## Recover from removal of CONFIG_HEADER
@if test ! -f $@; then \
  rm -f %STAMP%; \
- $(MAKE) %STAMP%; \
+ $(MAKE) $(AM_MAKEFLAGS) %STAMP%; \
else :; fi
 
 
Index: lib/am/texi-vers.am
===
RCS file: /cvs/automake/automake/lib/am/texi-vers.am,v
retrieving revision 1.27
diff -u -r1.27 texi-vers.am
--- lib/am/texi-vers.am 14 May 2005 20:28:53 -  1.27
+++ lib/am/texi-vers.am 7 Aug 2005 08:27:12 -
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-## Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
+## 2004, 2005  Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
 ## %STAMPVTI% is distributed and %DIRSTA

Re: AM_PROG_MKDIR_P overcautious?

2005-08-07 Thread Alexandre Duret-Lutz
>>> "SK" == Stepan Kasal <[EMAIL PROTECTED]> writes:

 SK> Hello,
 SK> regarding the bug report about `mkdir -p -- .', archived at:
 SK> http://lists.gnu.org/archive/html/bug-automake/2004-07/msg00052.html

 SK> I think that the problem described here is a bug in a vendor mkdir.
 SK> Generally, mkdir -p on any existing directory should succeed, no matter
 SK> whether it is writable or not.

 SK> I asked Harlan Stenn, the author of the bug report, about the details,
 SK> but he doesn't remember.

OK.  Let's just fix the comment then.  I can't see any
compelling reason to add that dot back, especially since it took
several versions to get this check to a point where nobody is
complaining about it.

I'm installing this on HEAD.

2005-08-07  Alexandre Duret-Lutz  <[EMAIL PROTECTED]>

* m4/mkdirp.m4: Update misleading comment about `mkdir -p .'.
Prompted by Stepan Kasal.

Index: m4/mkdirp.m4
===
RCS file: /cvs/automake/automake/m4/mkdirp.m4,v
retrieving revision 1.7
diff -u -r1.7 mkdirp.m4
--- m4/mkdirp.m49 Jan 2005 14:46:21 -   1.7
+++ m4/mkdirp.m47 Aug 2005 08:08:05 -
@@ -25,30 +25,34 @@
 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
 # concurrently, both version can detect that a/ is missing, but only
 # one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
+# restrict ourselves to GNU mkdir (using the --version option ensures
 # this.)
 AC_DEFUN([AM_PROG_MKDIR_P],
 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
+  # We used to define $(mkdir_p) as `mkdir -p -- .', in order to
   # allow $(mkdir_p) to be used without argument.  As in
   #   $(mkdir_p) $(somedir)
-  # 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.
+  # where $(somedir) is conditionally defined.  However we don't do
+  # that anymore.
+  #  1. before we restricted the check to GNU mkdir, `mkdir -p .' was
+  # reported to fail in read-only directories.  The system where this
+  # happened has been forgotten.
+  #  2. in practice we call $(mkdir_p) on directories such as
+  #   $(mkdir_p) "$(DESTDIR)$(somedir)"
+  # and we don't want to create $(DESTDIR) if $(somedir) is empty.
+  # To support the latter case, we have to write
+  #   test -z "$(somedir)" || $(mkdir_p) "$(DESTDIR)$(somedir)"
+  # so $(mkdir_p) always has an argument.
+  # We will have better chances of detecting a missing test if
+  # $(mkdir_p) complains about missing arguments.
+  #  3. $(mkdir_p) is named after `mkdir -p' and we don't expect this
+  # to accept no argument.
+  #  4. having something like `mkdir .' in the output is unsightly.
   mkdir_p='mkdir -p --'
 else
   # On NextStep and OpenStep, the `mkdir' command does not
   # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
+  # directories to create.
   for d in ./-p ./--version;
   do
 test -d $d && rmdir $d

-- 
Alexandre Duret-Lutz





Re: AM_PROG_MKDIR_P overcautious?

2005-08-07 Thread Stepan Kasal
Hello Alexandre,

On Sun, Aug 07, 2005 at 10:09:54AM +0200, Alexandre Duret-Lutz wrote:
> OK.  Let's just fix the comment then.

thank you for resolving that.

I think the last part of your patch should be reverted, though:

># On NextStep and OpenStep, the `mkdir' command does not
># recognize any option.  It will interpret all options as
> -  # directories to create, and then abort because `.' already
> -  # exists.
> +  # directories to create.

If mkdir doesn't recognize -p, it fails because `.' already exists.
And the code relies on that failure.

Have a nice day,
Stepan




Re: AM_PROG_MKDIR_P overcautious?

2005-08-07 Thread Stepan Kasal
Hello,

I understand why most of my patch was rejected, but one question remains.
What would be wrong with this:

-  define_variable ('mkinstalldirs', '$(install_sh) -d', INTERNAL);
+  define_variable ('mkinstalldirs', '$(mkdir_p) .', INTERNAL);

I think it could make the make output more readable, even with that dot.

Stepan




Re: No AM_YFLAGS support within conditionals

2005-08-07 Thread Alexandre Duret-Lutz
>>> "JL" == Juergen Leising <[EMAIL PROTECTED]> writes:
[...]
 JL> src/libbsql/Makefile.am:8: automake does not support AM_YFLAGS
 JL> being defined conditionally
 JL> automake: 
 JL> automake: ## Internal Error ##
 JL> automake: 
 JL> automake: undefined condition `TRUE' for `AM_YFLAGS'
[...]

Thanks.  I'm installing this on HEAD.

2005-08-07  Alexandre Duret-Lutz  <[EMAIL PROTECTED]>

* lib/Automake/Variable.pm (variable_value): Do not read the TRUE
value of a conditionally defined variable.
Report from Juergen Leising.

Index: THANKS
===
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.274
diff -u -r1.274 THANKS
--- THANKS  9 Jul 2005 09:24:40 -   1.274
+++ THANKS  7 Aug 2005 09:54:24 -
@@ -125,6 +125,7 @@
 js pendry  [EMAIL PROTECTED]
 Juergen A. Erhard  [EMAIL PROTECTED]
 Juergen Keil   [EMAIL PROTECTED]
+Juergen Leising[EMAIL PROTECTED]
 Julien Sopena  [EMAIL PROTECTED]
 Karl Berry [EMAIL PROTECTED]
 Karl Heuer [EMAIL PROTECTED]
Index: lib/Automake/Variable.pm
===
RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v
retrieving revision 1.39
diff -u -r1.39 Variable.pm
--- lib/Automake/Variable.pm27 Jul 2005 11:09:45 -  1.39
+++ lib/Automake/Variable.pm7 Aug 2005 09:54:25 -
@@ -1180,7 +1180,7 @@
 
 Get the C value of a variable, warn if the variable is
 conditionally defined.  C<$var> can be either a variable name
-or a C instance (this allows to calls sucha
+or a C instance (this allows calls such
 as C<$var-Evariable_value>).
 
 =cut
@@ -1191,7 +1191,8 @@
 my $v = ref ($var) ? $var : var ($var);
 return () unless $v;
 $v->check_defined_unconditionally;
-return $v->rdef (TRUE)->value;
+my $d = $v->def (TRUE);
+return $d ? $d->value : "";
 }
 
 =item C<$str = output_variables>

-- 
Alexandre Duret-Lutz