From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2032 Path: news.gmane.org!not-for-mail From: John Spencer Newsgroups: gmane.linux.lib.musl.general Subject: Re: better compatibility with bsd getopt() Date: Sun, 30 Sep 2012 23:22:04 +0200 Message-ID: <5068B7FC.1000803@barfooze.de> References: <5068B362.5070408@barfooze.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1349039625 21233 80.91.229.3 (30 Sep 2012 21:13:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2012 21:13:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2033-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 30 23:13:46 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TIQpe-0002To-Nf for gllmg-musl@plane.gmane.org; Sun, 30 Sep 2012 23:13:46 +0200 Original-Received: (qmail 13679 invoked by uid 550); 30 Sep 2012 21:13:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 13671 invoked from network); 30 Sep 2012 21:13:41 -0000 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Mail/1.0 In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:2032 Archived-At: On 09/30/2012 11:06 PM, Daniel Cegiełka wrote: > 2012/9/30 John Spencer: > > >> 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"