Subject: Re: getprogname vs. AIX [was: new snapshot available: grep-2.25.92-f3e9

From: Jim Meyering <[email-masked]>
Date: Thu, 22 Sep 2016 09:14:39 -0700

On Thu, Sep 22, 2016 at 7:49 AM, Assaf Gordon <[email-masked]> wrote:
> Hello Jim,
>
> On 09/22/2016 12:25 AM, Jim Meyering wrote:
>>
>> Gordon reported this off-list:
>>
>>>>>> On AIX-7.1 32bit, compilation fails due to gnulib's new 'getprogname'
>>>>>> module:
>>>>>>  CC       getprogname.o
>>>>>>  getprogname.c: In function 'getprogname':
>>>>>>  getprogname.c:45:4: error: #error "getprogname module not ported to
>>>>>> this
>>>>>> OS"
>>>>>>  #  error "getprogname module not ported to this OS"
>>
>>
>> Thanks again for that report.
>> Here is a tentative patch (let's call it "pragmatic" -- it tests
>> explicitly for _AIX rather than a feature-test macro like
>> HAVE_GETPROCS64 and an additional macro from an autoconf test for the
>> existence of the procinfo.h header).
>>
>> Can someone let me know if this solves the problem?
>
>
> Sorry for not following up on that...
>
> The patch does not apply cleanly, I suspect you have a newer gnulib version
> than what's in
> grep's git repo (the patch's ChangeLog has an entry from Sep 16):
>
>   $ git id
>   v2.25-93-gdd6936c
>   $ cd gnulib
>   $ git id
>   v0.1-880-ga512e04
>   $ git am < ~/Downloads/gnulib-AIX-getprogname.diff
>   Applying: getprogname: port to AIX
>   error: patch failed: ChangeLog:1
>   error: ChangeLog: patch does not apply
>   Patch failed at 0001 getprogname: port to AIX
>   The copy of the patch that failed is found in:
> /home/gordon/projects/grep/.git/modules/gnulib/rebase-apply/patch
>   When you have resolved this problem, run "git am --continue".
>   If you prefer to skip this patch, run "git am --skip" instead.
>
> I patched 'lib/getprogname.c' directly, and compilation (on AIX) fails with:
>
>     CC       getprogname.o
>   getprogname.c:74:1: error: expected identifier or '(' before '}' token
>    }
>    ^
>   make: 1254-004 The error code from the last command is 1.
>
> Indeed there's an extra closing braces in line 74.
> After removing it, compilation succeeds with AIX 32bit (haven't been able to
> compile in 64bit yet, but that's not due to grep's code. I'll try again
> later tonight).

Thank you, Assaf.
Good catch. I've made that correction and pushed to gnulib.