GNU bug report logs - #76706
[PATCH] build: fix compile errors on platforms without getopt.h

Previous Next

Package: sed;

Reported by: Collin Funk <collin.funk1 <at> gmail.com>

Date: Mon, 3 Mar 2025 06:34:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 76706 AT debbugs.gnu.org.

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-sed <at> gnu.org:
bug#76706; Package sed. (Mon, 03 Mar 2025 06:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Collin Funk <collin.funk1 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Mon, 03 Mar 2025 06:34:02 GMT) Full text and rfc822 format available.

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

From: Collin Funk <collin.funk1 <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: [PATCH] build: fix compile errors on platforms without getopt.h
Date: Sun, 02 Mar 2025 22:32:48 -0800
[Message part 1 (text/plain, inline)]
Hi,

I found that GNU sed does not compile on platforms with <getopt.h> or
getopt_long. For example on AIX:

    make[2]: Entering directory '/home/collinfunk/sed-4.9.51-0f74-modified'
      CC       sed/sed-sed.o
    sed/sed.c:20:10: fatal error: getopt.h: No such file or directory
       20 | #include <getopt.h>
          |          ^~~~~~~~~~
    compilation terminated.
    make[2]: *** [Makefile:6188: sed/sed-sed.o] Error 1
    make[2]: Leaving directory '/home/collinfunk/sed-4.9.51-0f74-modified'
    make[1]: *** [Makefile:6425: all-recursive] Error 1
    make[1]: Leaving directory '/home/collinfunk/sed-4.9.51-0f74-modified'
    make: *** [Makefile:3595: all] Error 2

This is because the following commit:

    commit 71de42fd346688b131e7364d7ea7be4e973fb0c3
    Author:     Assaf Gordon <assafgordon <at> gmail.com>
    AuthorDate: Sat Jan 2 23:41:51 2021 -0700
    Commit:     Assaf Gordon <assafgordon <at> gmail.com>
    CommitDate: Tue Jan 5 17:02:10 2021 -0700
    
        maint: update all copyright year number ranges
        
        Run "make update-copyright" and then...
        [...]
        * bootstrap.conf (gnulib_modules): Remove getopt module, depracated in
        https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=0abc38bd2a1398f0
        [...]

The deprecation of getopt was because it split into getopt-posix and
getopt-gnu. GNU sed uses <getopt.h> and getopt_long, so we need
getopt-gnu.

I have attached a patch that fixes this. I added a note in NEWS since
the 4.9 was released after that commit so the tarball won't build on
platforms like AIX.

Collin

[0001-build-fix-compile-errors-on-platforms-without-getopt.patch (text/x-patch, attachment)]

Information forwarded to bug-sed <at> gnu.org:
bug#76706; Package sed. (Mon, 03 Mar 2025 17:38:01 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Collin Funk <collin.funk1 <at> gmail.com>
Cc: 76706 <at> debbugs.gnu.org
Subject: Re: bug#76706: [PATCH] build: fix compile errors on platforms without
 getopt.h
Date: Mon, 3 Mar 2025 09:37:29 -0800
On Sun, Mar 2, 2025 at 10:34 PM Collin Funk <collin.funk1 <at> gmail.com> wrote:
> I found that GNU sed does not compile on platforms with <getopt.h> or
> getopt_long. For example on AIX:
>
>     make[2]: Entering directory '/home/collinfunk/sed-4.9.51-0f74-modified'
>       CC       sed/sed-sed.o
>     sed/sed.c:20:10: fatal error: getopt.h: No such file or directory
>        20 | #include <getopt.h>
>           |          ^~~~~~~~~~
...
> I have attached a patch that fixes this. I added a note in NEWS since
> the 4.9 was released after that commit so the tarball won't build on
> platforms like AIX.

Hi Colin,
Thank you. Applied and pushed.




Information forwarded to bug-sed <at> gnu.org:
bug#76706; Package sed. (Mon, 03 Mar 2025 19:54:01 GMT) Full text and rfc822 format available.

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

From: Collin Funk <collin.funk1 <at> gmail.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 76706 <at> debbugs.gnu.org
Subject: Re: bug#76706: [PATCH] build: fix compile errors on platforms
 without getopt.h
Date: Mon, 03 Mar 2025 11:52:49 -0800
Hi Jim,

Jim Meyering <jim <at> meyering.net> writes:

> Thank you. Applied and pushed.

Thanks! But I think you forgot to push.

Collin




Information forwarded to bug-sed <at> gnu.org:
bug#76706; Package sed. (Mon, 03 Mar 2025 23:00:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Collin Funk <collin.funk1 <at> gmail.com>
Cc: 76706 <at> debbugs.gnu.org
Subject: Re: bug#76706: [PATCH] build: fix compile errors on platforms without
 getopt.h
Date: Mon, 3 Mar 2025 14:58:39 -0800
On Mon, Mar 3, 2025 at 11:52 AM Collin Funk <collin.funk1 <at> gmail.com> wrote:
>
> Hi Jim,
>
> Jim Meyering <jim <at> meyering.net> writes:
>
> > Thank you. Applied and pushed.
>
> Thanks! But I think you forgot to push.

Hmph! I know I ran the command. But didn't wait/watch for successful
completion, and was on a very poor connection from 38,000 ft. I now
see that it failed. I've just redone it, and this time it went
through.




This bug report was last modified 107 days ago.

Previous Next


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