bug-sed
[Top][All Lists]
Advanced

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

bug#76706: [PATCH] build: fix compile errors on platforms without getopt


From: Collin Funk
Subject: bug#76706: [PATCH] build: fix compile errors on platforms without getopt.h
Date: Sun, 02 Mar 2025 22:32:48 -0800
User-agent: Gnus/5.13 (Gnus v5.13)

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@gmail.com>
    AuthorDate: Sat Jan 2 23:41:51 2021 -0700
    Commit:     Assaf Gordon <assafgordon@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

Attachment: 0001-build-fix-compile-errors-on-platforms-without-getopt.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]