Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5068B7FC.1000803@barfooze.de>
Date: Sun, 30 Sep 2012 23:22:04 +0200
From: John Spencer <maillist-musl@...fooze.de>
To: musl@...ts.openwall.com
Subject: Re: better compatibility with bsd getopt()

On 09/30/2012 11:06 PM, Daniel Cegiełka wrote:
> 2012/9/30 John Spencer<maillist-musl@...fooze.de>:
>
>
>> an application that relies on non-posix getopt behaviour should come with a
>> configure check and use an alternate impl if the getopt detected is not
>> compatible.
>> almost any program does so already, but for those that don't (like iptables)
>> you can use https://github.com/rofl0r/gnu-getopt (tarball available on
>> sabotage mirror, or in downloads section of the page).
>> this bundles the netbsd getopt into a standalone library that can easily be
>> linked to programs.
> Without optreset support some BSD programs will not be able to
> compile, like patch:

gnu-getopt (which is in fact netbsd getopt) includes support for 
optreset, and is compatible with gnu and bsd.

from the readme:

gnu getopt compatibility package for musl

usage:
make; make prefix= DESTDIR= install

then to compile a package, add to
CFLAGS="-Dgetopt=gnu_getopt -Dgetopt_long=gnu_getopt_long 
-Dgetopt_long_only=gnu_getopt_long_only"
LDFLAGS="-lgnu_getopt"

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.