GNU bug report logs - #27781
LIBOBJS should depend on LIBOBJDIR

Previous Next

Package: automake;

Reported by: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>

Date: Fri, 21 Jul 2017 09:09:01 UTC

Severity: normal

Tags: confirmed, fixed, patch

Done: Mathieu Lirzin <mthl <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27781 in the body.
You can then email your comments to 27781 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Fri, 21 Jul 2017 09:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Fri, 21 Jul 2017 09:09:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: bug-automake <at> gnu.org
Subject: LIBOBJS should depend on LIBOBJDIR
Date: Fri, 21 Jul 2017 11:07:56 +0200
Hi,

in flex-2.6.4, the $(LIBOBJDIR) does contain source files only,
eventually required via LDADD=$(LIBOBJ) in another directory.

Now with --disable-dependency-tracking, an out of source build fails
because $top_builddir/$(LIBOBJDIR) is not created by anyone, see
the discussion in https://github.com/westes/flex/issues/244 and
http://lists.gnu.org/archive/html/autoconf-patches/2017-07/msg00002.html

I have no idea for how to fix automake for this situation, but it
feels like automake should add this line to src/Makefile.in here:

$(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)

Thanks!
/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Tue, 08 Aug 2017 21:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 08 Aug 2017 23:17:06 +0200
Hello,

Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> Hi,
>
> in flex-2.6.4, the $(LIBOBJDIR) does contain source files only,
> eventually required via LDADD=$(LIBOBJ) in another directory.
>
> Now with --disable-dependency-tracking, an out of source build fails
> because $top_builddir/$(LIBOBJDIR) is not created by anyone, see
> the discussion in https://github.com/westes/flex/issues/244 and
> http://lists.gnu.org/archive/html/autoconf-patches/2017-07/msg00002.html
>
> I have no idea for how to fix automake for this situation, but it
> feels like automake should add this line to src/Makefile.in here:
>
> $(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)
>
> Thanks!
> /haubi/

I confirm that this is an Automake issue.  After some digging I think
'automake' should call the 'require_build_directory' subroutine for the
LIBOBJDIR variable.  However I don't have time to investigate more right
now.

Thanks for the report.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Added tag(s) confirmed. Request was from Mathieu Lirzin <mthl <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 08 Aug 2017 21:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Wed, 16 Aug 2017 16:37:02 GMT) Full text and rfc822 format available.

Message #13 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Wed, 16 Aug 2017 18:36:37 +0200
[Message part 1 (text/plain, inline)]
Hi,

On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>
>> I have no idea for how to fix automake for this situation, but it
>> feels like automake should add this line to src/Makefile.in here:
>>
>> $(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)

> 
> I confirm that this is an Automake issue.  After some digging I think
> 'automake' should call the 'require_build_directory' subroutine for the
> LIBOBJDIR variable.  However I don't have time to investigate more right
> now.

In this case let me come up with attached patch for now
(without deeper knowledge of automake internals though).

Thanks!
/haubi/
[0001-automake-Depend-on-LIBOBJDIR-for-LIBOBJS.patch (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Wed, 16 Aug 2017 23:31:01 GMT) Full text and rfc822 format available.

Message #16 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Thu, 17 Aug 2017 01:29:54 +0200
Hi,

Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>
>>> I have no idea for how to fix automake for this situation, but it
>>> feels like automake should add this line to src/Makefile.in here:
>>>
>>> $(LIBOBJS): $(LIBOBJDIR)$(am__dirstamp)
>
>> 
>> I confirm that this is an Automake issue.  After some digging I think
>> 'automake' should call the 'require_build_directory' subroutine for the
>> LIBOBJDIR variable.  However I don't have time to investigate more right
>> now.
>
> In this case let me come up with attached patch for now
> (without deeper knowledge of automake internals though).
>
> Thanks!
> /haubi/
>
> From c3d51adb53400fc8bf65c0e003d810b2e7166d0d Mon Sep 17 00:00:00 2001
> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
> Date: Wed, 16 Aug 2017 18:16:12 +0200
> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>
> This change fixes automake bug#27781.
>
> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
> each LIBOBJS/ALLOCA variable used.
> ---

Excellent!

To ensure this bug is not reintroduced later, I think it is important to
combine this patch with a test.  Are you willing to look into adding
one?

Thank you

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Added tag(s) patch. Request was from Mathieu Lirzin <mthl <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 16 Aug 2017 23:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Thu, 17 Aug 2017 12:36:01 GMT) Full text and rfc822 format available.

Message #21 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Thu, 17 Aug 2017 14:34:39 +0200
[Message part 1 (text/plain, inline)]

On 08/17/2017 01:29 AM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

>>
>> This change fixes automake bug#27781.
>>
>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>> each LIBOBJS/ALLOCA variable used.
>> ---
> 
> Excellent!
> 
> To ensure this bug is not reintroduced later, I think it is important to
> combine this patch with a test.  Are you willing to look into adding
> one?

Ok - like this one?

Thanks!
/haubi/
[0001-automake-add-test-for-PR-27781.patch (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Mon, 21 Aug 2017 22:25:01 GMT) Full text and rfc822 format available.

Message #24 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 22 Aug 2017 00:23:36 +0200
[Message part 1 (text/plain, inline)]
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/17/2017 01:29 AM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>
>>>
>>> This change fixes automake bug#27781.
>>>
>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>> each LIBOBJS/ALLOCA variable used.
>>> ---
>> 
>> Excellent!
>> 
>> To ensure this bug is not reintroduced later, I think it is important to
>> combine this patch with a test.  Are you willing to look into adding
>> one?
>
> Ok - like this one?
>
> Thanks!
> /haubi/
>

Yes, I have made some changes to your original patch (i.e. changing the
test name and the description).  If you are OK with those I will push it.

[0001-automake-Ensure-that-LIBOBJ_DIR-builddir-is-created.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Mon, 21 Aug 2017 22:41:01 GMT) Full text and rfc822 format available.

Message #27 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 22 Aug 2017 00:40:32 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> In this case let me come up with attached patch for now
> (without deeper knowledge of automake internals though).

I have tested this patch, and confirm that it fixes the bug.  However I
have on question regarding the added code.

> From c3d51adb53400fc8bf65c0e003d810b2e7166d0d Mon Sep 17 00:00:00 2001
> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
> Date: Wed, 16 Aug 2017 18:16:12 +0200
> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>
> This change fixes automake bug#27781.
>
> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
> each LIBOBJS/ALLOCA variable used.
> ---
>  bin/automake.in | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/bin/automake.in b/bin/automake.in
> index 9c4cb86..b82e8c5 100644
> --- a/bin/automake.in
> +++ b/bin/automake.in
> @@ -2153,10 +2153,19 @@ sub handle_LIBOBJS_or_ALLOCA
>        $dir = backname ($relative_dir) . "/$dir"
>          if $relative_dir ne '.';
>        define_variable ('LIBOBJDIR', "$dir", INTERNAL);
> +      my $dirstamp = '';
> +      # Abusing $clean_files{"$(VAR)"} as indicator for whether
> +      # we have added the "$(VAR): $dirstamp" dependency already.

I am not sure to understand what this comment really means.  Can you
explain it in other words?
        
> +      $dirstamp = require_build_directory ($dir)
> +	if ! defined $clean_files{"\$($var)"};
>        $clean_files{"\$($var)"} = MOSTLY_CLEAN;
> +      $output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>        # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>        # be created by libtool as a side-effect of creating LTLIBOBJS).
> -      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
> +      if ($var =~ s/^LT//) {
> +	$clean_files{"\$($var)"} = MOSTLY_CLEAN;
> +	$output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
> +      }
>      }
>  
>    return $dir;

Thank you.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Tue, 22 Aug 2017 07:05:02 GMT) Full text and rfc822 format available.

Message #30 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 22 Aug 2017 09:03:37 +0200

On 08/22/2017 12:23 AM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/17/2017 01:29 AM, Mathieu Lirzin wrote:
>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>> On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
>>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>>
>>>> This change fixes automake bug#27781.
>>>>
>>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>>> each LIBOBJS/ALLOCA variable used.
>>>> ---
>>>
>>> Excellent!
>>>
>>> To ensure this bug is not reintroduced later, I think it is important to
>>> combine this patch with a test.  Are you willing to look into adding
>>> one?
>>
>> Ok - like this one?
> 
> Yes, I have made some changes to your original patch (i.e. changing the
> test name and the description).  If you are OK with those I will push it.
> 

YesPlease!

Thanks!
/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Tue, 22 Aug 2017 07:31:02 GMT) Full text and rfc822 format available.

Message #33 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 22 Aug 2017 09:30:02 +0200

On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
> 
>> In this case let me come up with attached patch for now
>> (without deeper knowledge of automake internals though).
> 
> I have tested this patch, and confirm that it fixes the bug.  However I
> have on question regarding the added code.
> 
>> From c3d51adb53400fc8bf65c0e003d810b2e7166d0d Mon Sep 17 00:00:00 2001
>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>
>> This change fixes automake bug#27781.
>>
>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>> each LIBOBJS/ALLOCA variable used.
>> ---
>>  bin/automake.in | 11 ++++++++++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/bin/automake.in b/bin/automake.in
>> index 9c4cb86..b82e8c5 100644
>> --- a/bin/automake.in
>> +++ b/bin/automake.in
>> @@ -2153,10 +2153,19 @@ sub handle_LIBOBJS_or_ALLOCA
>>        $dir = backname ($relative_dir) . "/$dir"
>>          if $relative_dir ne '.';
>>        define_variable ('LIBOBJDIR', "$dir", INTERNAL);
>> +      my $dirstamp = '';
>> +      # Abusing $clean_files{"$(VAR)"} as indicator for whether
>> +      # we have added the "$(VAR): $dirstamp" dependency already.
> 
> I am not sure to understand what this comment really means.  Can you
> explain it in other words?
>         
>> +      $dirstamp = require_build_directory ($dir)

Thing is, $dirstamp is calculated only when ...

>> +	if ! defined $clean_files{"\$($var)"};

... $clean_files{} was defined, which is done ...

>>        $clean_files{"\$($var)"} = MOSTLY_CLEAN;

... here. Subsequently, $output_rules is extended only when $dirstamp was
calculated:

>> +      $output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);

But the name "clean_files" feels somewhat unrelated to the dirstamp dependency
(as in causing a different output by itself), because I use it to make sure
the dirstamp rule is added only once to $output_rules:
Within flex, I've seen handle_LIBOBJS_or_ALLOCA to be called thrice, but this
dirstamp rule is enough once, as "\$($var)" holds all three object files.
While I have also thought about adding this dependency for each explicit
object file separately - which would not need the "clean_files" indicator,
I've failed to identify where to get the correct object file name from.

>>        # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>        # be created by libtool as a side-effect of creating LTLIBOBJS).
>> -      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>> +      if ($var =~ s/^LT//) {
>> +	$clean_files{"\$($var)"} = MOSTLY_CLEAN;
>> +	$output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>> +      }
>>      }
>>  
>>    return $dir;

Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile line:
If I remember correctly, there have been (non-GNU) make implementations that
choke on this rule when LIBOBJS is an empty variable:
Am I wrong here, or is GNU make required anyway these days?

Thanks!
/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Wed, 23 Aug 2017 20:16:02 GMT) Full text and rfc822 format available.

Message #36 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Wed, 23 Aug 2017 22:15:13 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/22/2017 12:23 AM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> On 08/17/2017 01:29 AM, Mathieu Lirzin wrote:
>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>>> On 08/08/2017 11:17 PM, Mathieu Lirzin wrote:
>>>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>>>
>>>>> This change fixes automake bug#27781.
>>>>>
>>>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>>>> each LIBOBJS/ALLOCA variable used.
>>>>> ---
>>>>
>>>> Excellent!
>>>>
>>>> To ensure this bug is not reintroduced later, I think it is important to
>>>> combine this patch with a test.  Are you willing to look into adding
>>>> one?
>>>
>>> Ok - like this one?
>> 
>> Yes, I have made some changes to your original patch (i.e. changing the
>> test name and the description).  If you are OK with those I will push it.
>> 
>
> YesPlease!

pushed as commit 236cb06666a44f23157aa95adc26450fdec92126

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Wed, 23 Aug 2017 21:26:02 GMT) Full text and rfc822 format available.

Message #39 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Wed, 23 Aug 2017 23:24:56 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> 
>>> In this case let me come up with attached patch for now
>>> (without deeper knowledge of automake internals though).
>> 
>> I have tested this patch, and confirm that it fixes the bug.  However I
>> have on question regarding the added code.
>> 
>>> From c3d51adb53400fc8bf65c0e003d810b2e7166d0d Mon Sep 17 00:00:00 2001
>>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>>
>>> This change fixes automake bug#27781.
>>>
>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>> each LIBOBJS/ALLOCA variable used.
>>> ---
>>>  bin/automake.in | 11 ++++++++++-
>>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/bin/automake.in b/bin/automake.in
>>> index 9c4cb86..b82e8c5 100644
>>> --- a/bin/automake.in
>>> +++ b/bin/automake.in
>>> @@ -2153,10 +2153,19 @@ sub handle_LIBOBJS_or_ALLOCA
>>>        $dir = backname ($relative_dir) . "/$dir"
>>>          if $relative_dir ne '.';
>>>        define_variable ('LIBOBJDIR', "$dir", INTERNAL);
>>> +      my $dirstamp = '';
>>> +      # Abusing $clean_files{"$(VAR)"} as indicator for whether
>>> +      # we have added the "$(VAR): $dirstamp" dependency already.
>> 
>> I am not sure to understand what this comment really means.  Can you
>> explain it in other words?
>>         
>>> +      $dirstamp = require_build_directory ($dir)
>
> Thing is, $dirstamp is calculated only when ...
>
>>> +	if ! defined $clean_files{"\$($var)"};
>
> ... $clean_files{} was defined, which is done ...
>
>>>        $clean_files{"\$($var)"} = MOSTLY_CLEAN;
>
> ... here. Subsequently, $output_rules is extended only when $dirstamp was
> calculated:
>
>>> +      $output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>
> But the name "clean_files" feels somewhat unrelated to the dirstamp dependency
> (as in causing a different output by itself), because I use it to make sure
> the dirstamp rule is added only once to $output_rules:
> Within flex, I've seen handle_LIBOBJS_or_ALLOCA to be called thrice, but this
> dirstamp rule is enough once, as "\$($var)" holds all three object files.
> While I have also thought about adding this dependency for each explicit
> object file separately - which would not need the "clean_files" indicator,
> I've failed to identify where to get the correct object file name from.

OK so this is mostly an optimization, since having multiple time the
same line shouldn't hurt.  Let's first fix the without such optimization.

>
>>>        # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>>        # be created by libtool as a side-effect of creating LTLIBOBJS).
>>> -      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>>> +      if ($var =~ s/^LT//) {
>>> +	$clean_files{"\$($var)"} = MOSTLY_CLEAN;
>>> +	$output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>>> +      }
>>>      }
>>>  
>>>    return $dir;
>

Regarding that part of the code even before you made it seems to me that
the conditional second '$clean_files{"\$($var)"} = MOSTLY_CLEAN'
statement is useless.  Am I overlooking something?  Here is the snippet
of the code before your changed.

--8<---------------cut here---------------start------------->8---
	  define_variable ('LIBOBJDIR', "$dir", INTERNAL);
	  $clean_files{"\$($var)"} = MOSTLY_CLEAN;
	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
	  # be created by libtool as a side-effect of creating LTLIBOBJS).
	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
--8<---------------cut here---------------end--------------->8---

> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile line:
> If I remember correctly, there have been (non-GNU) make implementations that
> choke on this rule when LIBOBJS is an empty variable:
> Am I wrong here, or is GNU make required anyway these days?

GNU make is not required for current Automake version.  I didn't find
any reference of this issue with empty variable target in Autoconf
"Portable Make programming" section [1] but if it is actually the case
then it would be nice to find a solution for that.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Portable-Make.html




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Wed, 23 Aug 2017 22:06:02 GMT) Full text and rfc822 format available.

Message #42 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Nick Bowler <nbowler <at> draconx.ca>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org,
 Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Wed, 23 Aug 2017 18:05:02 -0400
On 8/23/17, Mathieu Lirzin <mthl <at> gnu.org> wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile
>> line: If I remember correctly, there have been (non-GNU) make
>> implementations thatchoke on this rule when LIBOBJS is an empty
>> variable: Am I wrong here, or is GNU make required anyway these days?
>
> GNU make is not required for current Automake version.  I didn't find
> any reference of this issue with empty variable target in Autoconf
> "Portable Make programming" section [1] but if it is actually the case
> then it would be nice to find a solution for that.

POSIX requires that target rules specify at least one target.  At least
dmake will fail to parse the makefile if it contains an target rule with
no targets:

  % cat >Makefile <<'EOF'
FOO =
dummy: ;
$(FOO): ;
EOF
  % dmake
  dmake:  Makefile:  line 3:  Error: -- Missing targets or attributes in rule

If the target list is a macro which can reasonably be empty then one
solution is to add a bogus target name that won't be used anywhere
else, along the lines of:

  gobbledegook $(FOO): ;

Cheers,
  Nick




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Thu, 24 Aug 2017 09:36:02 GMT) Full text and rfc822 format available.

Message #45 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Nick Bowler <nbowler <at> draconx.ca>
Cc: 27781 <at> debbugs.gnu.org,
 Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Thu, 24 Aug 2017 11:35:04 +0200
Nick Bowler <nbowler <at> draconx.ca> writes:

> On 8/23/17, Mathieu Lirzin <mthl <at> gnu.org> wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile
>>> line: If I remember correctly, there have been (non-GNU) make
>>> implementations thatchoke on this rule when LIBOBJS is an empty
>>> variable: Am I wrong here, or is GNU make required anyway these days?
>>
>> GNU make is not required for current Automake version.  I didn't find
>> any reference of this issue with empty variable target in Autoconf
>> "Portable Make programming" section [1] but if it is actually the case
>> then it would be nice to find a solution for that.
>
> POSIX requires that target rules specify at least one target.  At least
> dmake will fail to parse the makefile if it contains an target rule with
> no targets:
>
>   % cat >Makefile <<'EOF'
> FOO =
> dummy: ;
> $(FOO): ;
> EOF
>   % dmake
>   dmake:  Makefile:  line 3:  Error: -- Missing targets or attributes in rule
>
> If the target list is a macro which can reasonably be empty then one
> solution is to add a bogus target name that won't be used anywhere
> else, along the lines of:
>
>   gobbledegook $(FOO): ;

Instead of this dummy target, I would rather prefer adding the dirstamp
dependency for each explicit object file separately.  this should be computed
from the '%libsources' variable.  However after a quick look in the code, it
seems that this variable is not properly populated by the
'scan_autoconf_traces' subroutine.  It only contains the files that are
explicitely defined by scanning the AC_LIBSOURCE macro and not by AC_LIBOBJ or
AC_LIBSOURCES in 'configure.ac'.

Michael: Are you interested in looking into this?

Thanks for your input.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Thu, 24 Aug 2017 10:36:02 GMT) Full text and rfc822 format available.

Message #48 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Thu, 24 Aug 2017 12:35:39 +0200

On 08/23/2017 11:24 PM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>
>>>> In this case let me come up with attached patch for now
>>>> (without deeper knowledge of automake internals though).
>>>
>>> I have tested this patch, and confirm that it fixes the bug.  However I
>>> have on question regarding the added code.
>>>
>>>> From c3d51adb53400fc8bf65c0e003d810b2e7166d0d Mon Sep 17 00:00:00 2001
>>>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>>>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>>>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>>>
>>>> This change fixes automake bug#27781.
>>>>
>>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>>> each LIBOBJS/ALLOCA variable used.
>>>> ---
>>>>  bin/automake.in | 11 ++++++++++-
>>>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/bin/automake.in b/bin/automake.in
>>>> index 9c4cb86..b82e8c5 100644
>>>> --- a/bin/automake.in
>>>> +++ b/bin/automake.in
>>>> @@ -2153,10 +2153,19 @@ sub handle_LIBOBJS_or_ALLOCA
>>>>        $dir = backname ($relative_dir) . "/$dir"
>>>>          if $relative_dir ne '.';
>>>>        define_variable ('LIBOBJDIR', "$dir", INTERNAL);
>>>> +      my $dirstamp = '';
>>>> +      # Abusing $clean_files{"$(VAR)"} as indicator for whether
>>>> +      # we have added the "$(VAR): $dirstamp" dependency already.
>>>
>>> I am not sure to understand what this comment really means.  Can you
>>> explain it in other words?
>>>         
>>>> +      $dirstamp = require_build_directory ($dir)
>>
>> Thing is, $dirstamp is calculated only when ...
>>
>>>> +	if ! defined $clean_files{"\$($var)"};
>>
>> ... $clean_files{} was defined, which is done ...
>>
>>>>        $clean_files{"\$($var)"} = MOSTLY_CLEAN;
>>
>> ... here. Subsequently, $output_rules is extended only when $dirstamp was
>> calculated:
>>
>>>> +      $output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>>
>> But the name "clean_files" feels somewhat unrelated to the dirstamp dependency
>> (as in causing a different output by itself), because I use it to make sure
>> the dirstamp rule is added only once to $output_rules:
>> Within flex, I've seen handle_LIBOBJS_or_ALLOCA to be called thrice, but this
>> dirstamp rule is enough once, as "\$($var)" holds all three object files.
>> While I have also thought about adding this dependency for each explicit
>> object file separately - which would not need the "clean_files" indicator,
>> I've failed to identify where to get the correct object file name from.
> 
> OK so this is mostly an optimization, since having multiple time the
> same line shouldn't hurt.

Agreed.

> Let's first fix the without such optimization.

I'm going to look into the (other subthread's) AC_LIBOBJ thing,
for adding the rule per explicit object file instead.

>>
>>>>        # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>>>        # be created by libtool as a side-effect of creating LTLIBOBJS).
>>>> -      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>>>> +      if ($var =~ s/^LT//) {
>>>> +	$clean_files{"\$($var)"} = MOSTLY_CLEAN;
>>>> +	$output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>>>> +      }
>>>>      }
>>>>  
>>>>    return $dir;
>>
> 
> Regarding that part of the code even before you made it seems to me that
> the conditional second '$clean_files{"\$($var)"} = MOSTLY_CLEAN'
> statement is useless. Am I overlooking something?
It took a while for me too to understand what's going on here:

Consider $var = 'LTLIBOBJS';

> Here is the snippet of the code before your changed.
> 
> --8<---------------cut here---------------start------------->8---
> 	  define_variable ('LIBOBJDIR', "$dir", INTERNAL);
> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN;

here, unconditionally: $clean_files{'$(LTLIBOBJS)'} = MOSTLY_CLEAN;

> 	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
> 	  # be created by libtool as a side-effect of creating LTLIBOBJS).
> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;

Crucial here is that trailing { if $var =~ s/^LT// }:
First, leading 'LT' eventually is dropped: $var = 'LIBOBJS';
If the leading 'LT' was actually found: $clean_files{'LIBOBJS'} = MOSTLY_CLEAN;

> --8<---------------cut here---------------end--------------->8---
> 
>> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile line:
>> If I remember correctly, there have been (non-GNU) make implementations that
>> choke on this rule when LIBOBJS is an empty variable:
>> Am I wrong here, or is GNU make required anyway these days?
> 
> GNU make is not required for current Automake version.  I didn't find
> any reference of this issue with empty variable target in Autoconf
> "Portable Make programming" section [1] but if it is actually the case
> then it would be nice to find a solution for that.
> 

/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Thu, 24 Aug 2017 14:24:01 GMT) Full text and rfc822 format available.

Message #51 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>, Nick Bowler <nbowler <at> draconx.ca>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Thu, 24 Aug 2017 16:23:00 +0200
[Message part 1 (text/plain, inline)]

On 08/24/2017 11:35 AM, Mathieu Lirzin wrote:
> Nick Bowler <nbowler <at> draconx.ca> writes:
>> On 8/23/17, Mathieu Lirzin <mthl <at> gnu.org> wrote:
>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>> Another thought about the final "$(LIBOBJS): .../.dirstamp" Makefile
>>>> line: If I remember correctly, there have been (non-GNU) make
>>>> implementations thatchoke on this rule when LIBOBJS is an empty
>>>> variable: Am I wrong here, or is GNU make required anyway these days?
>>>
>>> GNU make is not required for current Automake version.  I didn't find
>>> any reference of this issue with empty variable target in Autoconf
>>> "Portable Make programming" section [1] but if it is actually the case
>>> then it would be nice to find a solution for that.
>>
>> POSIX requires that target rules specify at least one target.  At least
>> dmake will fail to parse the makefile if it contains an target rule with
>> no targets:
>>
>>   % cat >Makefile <<'EOF'
>> FOO =
>> dummy: ;
>> $(FOO): ;
>> EOF
>>   % dmake
>>   dmake:  Makefile:  line 3:  Error: -- Missing targets or attributes in rule
>>
>> If the target list is a macro which can reasonably be empty then one
>> solution is to add a bogus target name that won't be used anywhere
>> else, along the lines of:
>>
>>   gobbledegook $(FOO): ;
> 
> Instead of this dummy target, I would rather prefer adding the dirstamp
> dependency for each explicit object file separately.  this should be computed
> from the '%libsources' variable.  However after a quick look in the code, it
> seems that this variable is not properly populated by the
> 'scan_autoconf_traces' subroutine.  It only contains the files that are
> explicitely defined by scanning the AC_LIBSOURCE macro and not by AC_LIBOBJ or
> AC_LIBSOURCES in 'configure.ac'.
> 
> Michael: Are you interested in looking into this?
> 

Here's an attempt to use the explicit AC_LIBSOURCE values to depend on the
LIBOBJDIR dirstamp. IMHO, tracing AC_LIBOBJ would not provide additional
information over AC_LIBSOURCE, as AC_LIBOBJ by itself uses AC_LIBSOURCE.

But then there is _AC_LIBOBJS_NORMALIZE, adding $U to {,LT}LIBOBJS values
(seems referring to "Automake's ANSI2KNR"): What is this about?

/haubi/
[0001-automake-Depend-on-LIBOBJDIR-for-LIBOBJS.patch (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Sun, 27 Aug 2017 14:09:01 GMT) Full text and rfc822 format available.

Message #54 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Sun, 27 Aug 2017 16:07:58 +0200
[Message part 1 (text/plain, inline)]
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/23/2017 11:24 PM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>>
>>>>>        # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>>>>        # be created by libtool as a side-effect of creating LTLIBOBJS).
>>>>> -      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>>>>> +      if ($var =~ s/^LT//) {
>>>>> +	$clean_files{"\$($var)"} = MOSTLY_CLEAN;
>>>>> +	$output_rules .= "\$($var): $dirstamp\n" if ($dirstamp);
>>>>> +      }
>>>>>      }
>>>>>  
>>>>>    return $dir;
>>>
>> 
>> Regarding that part of the code even before you made it seems to me that
>> the conditional second '$clean_files{"\$($var)"} = MOSTLY_CLEAN'
>> statement is useless. Am I overlooking something?
> It took a while for me too to understand what's going on here:
>
> Consider $var = 'LTLIBOBJS';
>
>> Here is the snippet of the code before your changed.
>> 
>> --8<---------------cut here---------------start------------->8---
>> 	  define_variable ('LIBOBJDIR', "$dir", INTERNAL);
>> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN;
>
> here, unconditionally: $clean_files{'$(LTLIBOBJS)'} = MOSTLY_CLEAN;
>
>> 	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>> 	  # be created by libtool as a side-effect of creating LTLIBOBJS).
>> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>
> Crucial here is that trailing { if $var =~ s/^LT// }:
> First, leading 'LT' eventually is dropped: $var = 'LIBOBJS';
> If the leading 'LT' was actually found: $clean_files{'LIBOBJS'} = MOSTLY_CLEAN;

I overlooked the regexp substitution.  This code is too complex for what it
achieves.  I have pushed the following patch in commit
5521219348c55af354878583b99c5f9d66d6d38a

[0001-automake-Handle-LTLIBOBJS-more-specifically.patch (text/x-patch, inline)]
From 5521219348c55af354878583b99c5f9d66d6d38a Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <mthl <at> gnu.org>
Date: Sun, 27 Aug 2017 15:27:00 +0200
Subject: [PATCH] automake: Handle LTLIBOBJS more specifically

* bin/automake.in (handle_LIBOBJS_or_ALLOCA): Remove complex regexp
substitution when handling LTLIBOBJS.
---
 bin/automake.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/automake.in b/bin/automake.in
index d126836..cdea388 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -2306,9 +2306,8 @@ sub handle_LIBOBJS_or_ALLOCA
 	    if $relative_dir ne '.';
 	  define_variable ('LIBOBJDIR', "$dir", INTERNAL);
 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN;
-	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
-	  # be created by libtool as a side-effect of creating LTLIBOBJS).
-	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
+	  # libtool might create LIBOBJS as a side-effect of using LTLIBOBJS.
+	  $clean_files{"\$(LIBOBJS)"} = MOSTLY_CLEAN if $var eq "LTLIBOBJS";
 	}
       else
 	{
-- 
2.9.5

[Message part 3 (text/plain, inline)]
Thanks for the explanation.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Sun, 27 Aug 2017 15:25:01 GMT) Full text and rfc822 format available.

Message #57 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: Nick Bowler <nbowler <at> draconx.ca>, 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Sun, 27 Aug 2017 17:23:59 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/24/2017 11:35 AM, Mathieu Lirzin wrote:
> 
>> Instead of this dummy target, I would rather prefer adding the dirstamp
>> dependency for each explicit object file separately.  this should be computed
>> from the '%libsources' variable.  However after a quick look in the code, it
>> seems that this variable is not properly populated by the
>> 'scan_autoconf_traces' subroutine.  It only contains the files that are
>> explicitely defined by scanning the AC_LIBSOURCE macro and not by AC_LIBOBJ or
>> AC_LIBSOURCES in 'configure.ac'.
>> 
>> Michael: Are you interested in looking into this?
>> 
>
> Here's an attempt to use the explicit AC_LIBSOURCE values to depend on the
> LIBOBJDIR dirstamp. IMHO, tracing AC_LIBOBJ would not provide additional
> information over AC_LIBSOURCE, as AC_LIBOBJ by itself uses AC_LIBSOURCE.

I stand corrected.  This is indeed working properly since
'scan_autoconf_traces' doesn't simply scan "configure.ac" but the output
'autoconf --trace=...'.

> But then there is _AC_LIBOBJS_NORMALIZE, adding $U to {,LT}LIBOBJS values
> (seems referring to "Automake's ANSI2KNR"): What is this about?

Those are legacy features of Automake that were removed 6 years ago:

--8<---------------cut here---------------start------------->8---
[...]
commit 0cbcf393dbdaa2ff36b11cf2516675e78eada49f
Author: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date:   Sun Aug 28 15:06:59 2011 +0200

    docs: remove description of de-ANSI-fication support from manual
    
    * doc/automake.texi (Auxiliary Programs): Remove mention of
    `ansi2knr.c' and `ansi2knr.1'.
    (Obsolete Macros): Remove mention of `AM_C_PROTOTYPES'.  Do not
    index it nor variables `ANSI2KNR' and `U' anymore.
    (List of Automake options): Remove mention of `ansi2knr' option,
    and obsolete entries for concept and option indexes.
    (Optional): Remove entry about `AM_C_PROTOTYPES'.
    (@c LocalWords): Remove `ansi' and `knr'.
    (@menu, @detailmenu): Remove entries about de-ANSI-fication
    support.
[...]
--8<---------------cut here---------------end--------------->8---

So I guess you shouldn't worry about those thing.  ;)

>>From 4465bb9e31c12a8f59c199c61aaef17966e1ffc4 Mon Sep 17 00:00:00 2001
> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
> Date: Wed, 16 Aug 2017 18:16:12 +0200
> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>
> This change fixes automake bug#27781.
>
> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
> each LIBOBJS/ALLOCA source file found.
> ---

This patch can't be applied on the 'minor' branch, which corresponds to
the branch of the next release (I know this is confusing [1]).  Could
resend it after rebasing onto the 'minor' branch?

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?msg=199;bug=13578




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Mon, 28 Aug 2017 07:55:02 GMT) Full text and rfc822 format available.

Message #60 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Mon, 28 Aug 2017 09:54:33 +0200

On 08/27/2017 04:07 PM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/23/2017 11:24 PM, Mathieu Lirzin wrote:
>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>> On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
>>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

>>> --8<---------------cut here---------------start------------->8---
>>
>>> 	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>> 	  # be created by libtool as a side-effect of creating LTLIBOBJS).
>>> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>>
>> Crucial here is that trailing { if $var =~ s/^LT// }:
>> First, leading 'LT' eventually is dropped: $var = 'LIBOBJS';
>> If the leading 'LT' was actually found: $clean_files{'LIBOBJS'} = MOSTLY_CLEAN;
> 
> I overlooked the regexp substitution.  This code is too complex for what it
> achieves.  I have pushed the following patch in commit
> 5521219348c55af354878583b99c5f9d66d6d38a
> 

> -	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
> +	  $clean_files{"\$(LIBOBJS)"} = MOSTLY_CLEAN if $var eq "LTLIBOBJS";

One more note: IMHO, the idea was to also support "LTALLOCA" here - even
if AC_FUNC_ALLOCA does not (yet?).

/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Tue, 05 Sep 2017 09:18:02 GMT) Full text and rfc822 format available.

Message #63 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: Nick Bowler <nbowler <at> draconx.ca>, 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Tue, 5 Sep 2017 11:16:16 +0200
[Message part 1 (text/plain, inline)]
On 08/27/2017 05:23 PM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/24/2017 11:35 AM, Mathieu Lirzin wrote:
>>
>>> Instead of this dummy target, I would rather prefer adding the dirstamp
>>> dependency for each explicit object file separately.  this should be computed
>>> from the '%libsources' variable.  However after a quick look in the code, it
>>> seems that this variable is not properly populated by the
>>> 'scan_autoconf_traces' subroutine.  It only contains the files that are
>>> explicitely defined by scanning the AC_LIBSOURCE macro and not by AC_LIBOBJ or
>>> AC_LIBSOURCES in 'configure.ac'.
>>>
>>> Michael: Are you interested in looking into this?
>>>
>>
>> Here's an attempt to use the explicit AC_LIBSOURCE values to depend on the
>> LIBOBJDIR dirstamp. IMHO, tracing AC_LIBOBJ would not provide additional
>> information over AC_LIBSOURCE, as AC_LIBOBJ by itself uses AC_LIBSOURCE.
> 
> I stand corrected.  This is indeed working properly since
> 'scan_autoconf_traces' doesn't simply scan "configure.ac" but the output
> 'autoconf --trace=...'.
> 
>> >From 4465bb9e31c12a8f59c199c61aaef17966e1ffc4 Mon Sep 17 00:00:00 2001
>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>
>> This change fixes automake bug#27781.
>>
>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>> each LIBOBJS/ALLOCA source file found.
>> ---
> 
> This patch can't be applied on the 'minor' branch, which corresponds to
> the branch of the next release (I know this is confusing [1]).  Could
> resend it after rebasing onto the 'minor' branch?
> 

Here we go, also removing t/libobj-no-dependency-tracking.sh from XFAIL_TESTS.

Thanks,
/haubi/
[0001-automake-Depend-on-LIBOBJDIR-for-LIBOBJS.patch (text/x-patch, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Fri, 15 Sep 2017 08:50:01 GMT) Full text and rfc822 format available.

Message #66 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Fri, 15 Sep 2017 10:49:43 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/27/2017 04:07 PM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> On 08/23/2017 11:24 PM, Mathieu Lirzin wrote:
>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>>>> On 08/22/2017 12:40 AM, Mathieu Lirzin wrote:
>>>>>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>
>>>> --8<---------------cut here---------------start------------->8---
>>>
>>>> 	  # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
>>>> 	  # be created by libtool as a side-effect of creating LTLIBOBJS).
>>>> 	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>>>
>>> Crucial here is that trailing { if $var =~ s/^LT// }:
>>> First, leading 'LT' eventually is dropped: $var = 'LIBOBJS';
>>> If the leading 'LT' was actually found: $clean_files{'LIBOBJS'} = MOSTLY_CLEAN;
>> 
>> I overlooked the regexp substitution.  This code is too complex for what it
>> achieves.  I have pushed the following patch in commit
>> 5521219348c55af354878583b99c5f9d66d6d38a
>> 
>
>> -	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
>> +	  $clean_files{"\$(LIBOBJS)"} = MOSTLY_CLEAN if $var eq "LTLIBOBJS";
>
> One more note: IMHO, the idea was to also support "LTALLOCA" here - even
> if AC_FUNC_ALLOCA does not (yet?).
>
> /haubi/

I stand corrected.

I have reverted commit 5521219348c55af354878583b99c5f9d66d6d38a

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Fri, 15 Sep 2017 09:02:01 GMT) Full text and rfc822 format available.

Message #69 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: Nick Bowler <nbowler <at> draconx.ca>, 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Fri, 15 Sep 2017 11:00:28 +0200
[Message part 1 (text/plain, inline)]
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 08/27/2017 05:23 PM, Mathieu Lirzin wrote:
>
>>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>>
>>> This change fixes automake bug#27781.
>>>
>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>> each LIBOBJS/ALLOCA source file found.
>>> ---
>> 
>> This patch can't be applied on the 'minor' branch, which corresponds to
>> the branch of the next release (I know this is confusing [1]).  Could
>> resend it after rebasing onto the 'minor' branch?
>> 
>
> Here we go, also removing t/libobj-no-dependency-tracking.sh from XFAIL_TESTS.

I would like to apply this slightly modified patch which adds a NEWS entry,
and adapt to the revert of commit 5521219348c55af354878583b99c5f9d66d6d38a

[0001-automake-Depend-on-LIBOBJDIR-for-LIBOBJS-and-ALLOCA.patch (text/x-patch, inline)]
From 333b98f2d108111e9a99e7ede17de7f0a1adba03 Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Date: Wed, 16 Aug 2017 18:16:12 +0200
Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS and ALLOCA

This change fixes automake bug#27781.

* bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
each LIBOBJS/ALLOCA source file found.
* t/list-of-tests.mk (XFAIL_TESTS): Drop
t/libobj-no-dependency-tracking.sh.
* NEWS: Announce bug fix.
---
 NEWS               |  5 +++++
 bin/automake.in    | 31 ++++++++++++++++++++-----------
 t/list-of-tests.mk |  1 -
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index eb0a415..e50a955 100644
--- a/NEWS
+++ b/NEWS
@@ -113,6 +113,11 @@ New in ?.?.?:
   - Installed 'aclocal' m4 macros can now accept installation directories
     containing '@' characters (automake bug#20903)
 
+  - When combining AC_LIBOBJ or AC_FUNC_ALLOCA with the
+    "--disable-dependency-tracking" configure option in an out of source
+    build, the build sub-directory defined by AC_CONFIG_LIBOBJ_DIR is now
+    properly created.  (automake bug#27781)
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 New in 1.15.1:
diff --git a/bin/automake.in b/bin/automake.in
index 4294736..9709f06 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -2329,13 +2329,14 @@ sub handle_lib_objects
   return $seen_libobjs;
 }
 
-# handle_LIBOBJS_or_ALLOCA ($VAR)
-# -------------------------------
+# handle_LIBOBJS_or_ALLOCA ($VAR, $BASE)
+# --------------------------------------
 # Definitions common to LIBOBJS and ALLOCA.
 # VAR should be one of LIBOBJS, LTLIBOBJS, ALLOCA, or LTALLOCA.
+# BASE should be one base file name from AC_LIBSOURCE, or alloca.
 sub handle_LIBOBJS_or_ALLOCA
 {
-  my ($var) = @_;
+  my ($var, $base) = @_;
 
   my $dir = '';
 
@@ -2357,10 +2358,18 @@ sub handle_LIBOBJS_or_ALLOCA
 	  $dir = backname ($relative_dir) . "/$dir"
 	    if $relative_dir ne '.';
 	  define_variable ('LIBOBJDIR', "$dir", INTERNAL);
-	  $clean_files{"\$($var)"} = MOSTLY_CLEAN;
-	  # libtool might create LIBOBJS or ALLOCA as a side-effect of using
+	  if ($dir && !defined $clean_files{"$dir$base.\$(OBJEXT)"})
+	    {
+	      my $dirstamp = require_build_directory ($dir);
+	      $output_rules .= "$dir$base.\$(OBJEXT): $dirstamp\n";
+	      $output_rules .= "$dir$base.lo: $dirstamp\n"
+		if ($var =~ /^LT/);
+	    }
+	  # libtool might create .$(OBJEXT) as a side-effect of using
 	  # LTLIBOBJS or LTALLOCA.
-	  $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
+	  $clean_files{"$dir$base.\$(OBJEXT)"} = MOSTLY_CLEAN;
+	  $clean_files{"$dir$base.lo"} = MOSTLY_CLEAN
+	    if ($var =~ /^LT/);
 	}
       else
 	{
@@ -2381,14 +2390,14 @@ sub handle_LIBOBJS
   $var->requires_variables ("\@${lt}LIBOBJS\@ used", $lt . 'LIBOBJS')
     if ! keys %libsources;
 
-  my $dir = handle_LIBOBJS_or_ALLOCA "${lt}LIBOBJS";
-
   foreach my $iter (keys %libsources)
     {
-      if ($iter =~ /\.[cly]$/)
+      my $dir = '';
+      if ($iter =~ /^(.*)(\.[cly])$/)
 	{
-	  saw_extension ($&);
+	  saw_extension ($2);
 	  saw_extension ('.c');
+	  $dir = handle_LIBOBJS_or_ALLOCA ("${lt}LIBOBJS", $1);
 	}
 
       if ($iter =~ /\.h$/)
@@ -2416,7 +2425,7 @@ sub handle_ALLOCA
   my ($var, $cond, $lt) = @_;
   my $myobjext = $lt ? 'lo' : 'o';
   $lt ||= '';
-  my $dir = handle_LIBOBJS_or_ALLOCA "${lt}ALLOCA";
+  my $dir = handle_LIBOBJS_or_ALLOCA ("${lt}ALLOCA", "alloca");
 
   $dir eq '' and $dir = './';
   $var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA');
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index dab4a7c..ebf9651 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -38,7 +38,6 @@ t/override-conditional-pr13940.sh \
 t/dist-pr109765.sh \
 t/instdir-cond2.sh \
 t/java-nobase.sh \
-t/libobj-no-dependency-tracking.sh \
 t/objext-pr10128.sh \
 t/remake-timing-bug-pr8365.sh \
 t/lex-subobj-nodep.sh \
-- 
2.9.5

[Message part 3 (text/plain, inline)]
Tell me if that's OK with you.

Sorry for the delay.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Fri, 15 Sep 2017 09:18:02 GMT) Full text and rfc822 format available.

Message #72 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: Nick Bowler <nbowler <at> draconx.ca>, 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Fri, 15 Sep 2017 11:17:11 +0200
On 09/15/2017 11:00 AM, Mathieu Lirzin wrote:
> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>> On 08/27/2017 05:23 PM, Mathieu Lirzin wrote:
>>>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>>>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>>>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>>>
>>>> This change fixes automake bug#27781.
>>>>
>>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>>> each LIBOBJS/ALLOCA source file found.
>>>> ---
>>>
>>> This patch can't be applied on the 'minor' branch, which corresponds to
>>> the branch of the next release (I know this is confusing [1]).  Could
>>> resend it after rebasing onto the 'minor' branch?
>>>
>>
>> Here we go, also removing t/libobj-no-dependency-tracking.sh from XFAIL_TESTS.
> 
> I would like to apply this slightly modified patch which adds a NEWS entry,
> and adapt to the revert of commit 5521219348c55af354878583b99c5f9d66d6d38a

> Tell me if that's OK with you.

Ack, thanks!
/haubi/




Information forwarded to bug-automake <at> gnu.org:
bug#27781; Package automake. (Fri, 15 Sep 2017 09:21:01 GMT) Full text and rfc822 format available.

Message #75 received at 27781 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
Cc: Nick Bowler <nbowler <at> draconx.ca>, 27781 <at> debbugs.gnu.org
Subject: Re: bug#27781: LIBOBJS should depend on LIBOBJDIR
Date: Fri, 15 Sep 2017 11:20:37 +0200
Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:

> On 09/15/2017 11:00 AM, Mathieu Lirzin wrote:
>> Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> writes:
>>> On 08/27/2017 05:23 PM, Mathieu Lirzin wrote:
>>>>> From: Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com>
>>>>> Date: Wed, 16 Aug 2017 18:16:12 +0200
>>>>> Subject: [PATCH] automake: Depend on LIBOBJDIR for LIBOBJS.
>>>>>
>>>>> This change fixes automake bug#27781.
>>>>>
>>>>> * bin/automake.in: Add Makefile dependency on LIBOBJDIR/dirstamp for
>>>>> each LIBOBJS/ALLOCA source file found.
>>>>> ---
>>>>
>>>> This patch can't be applied on the 'minor' branch, which corresponds to
>>>> the branch of the next release (I know this is confusing [1]).  Could
>>>> resend it after rebasing onto the 'minor' branch?
>>>>
>>>
>>> Here we go, also removing t/libobj-no-dependency-tracking.sh from XFAIL_TESTS.
>> 
>> I would like to apply this slightly modified patch which adds a NEWS entry,
>> and adapt to the revert of commit 5521219348c55af354878583b99c5f9d66d6d38a
>
>> Tell me if that's OK with you.
>
> Ack, thanks!
> /haubi/

Applied as commit 333b98f2d108111e9a99e7ede17de7f0a1adba03.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37




Added tag(s) fixed. Request was from Mathieu Lirzin <mthl <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 15 Sep 2017 09:22:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 27781 <at> debbugs.gnu.org and Michael Haubenwallner <michael.haubenwallner <at> ssi-schaefer.com> Request was from Mathieu Lirzin <mthl <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 15 Sep 2017 09:22:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Oct 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.