Subject: pkg/28597: devel/libgetopt compiling problems
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <georg.schwarz@freenet.de>
List: pkgsrc-bugs
Date: 12/09/2004 22:30:00
>Number:         28597
>Category:       pkg
>Synopsis:       devel/libgetopt compiling problems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 09 22:30:00 +0000 2004
>Originator:     Georg Schwarz
>Release:        current pkgsrc
>Organization:
>Environment:
>Description:
IRIX 5 comes with /usr/include/getopt.h, but it is pretty much nonstandard, so it makes sense to install devel/libgetopt.
In getopt_long.c optreset is being used even if REPLACE_GETOPT is undefined, in which case however it is not defined.
>How-To-Repeat:

>Fix:
I changed Makefile like this:

--- Makefile.orig       Thu Dec  9 23:07:59 2004
+++ Makefile    Thu Dec  9 23:09:06 2004
@@ -15,7 +15,8 @@
 
 WRKSRC=                ${WRKDIR}/libgetopt
 
-.if exists(/usr/include/getopt.h)
+.include "../../mk/bsd.prefs.mk"
+.if exists(/usr/include/getopt.h) && empty(LOWER_OPSYS:Mirix5*)
 PKG_SKIP_REASON= "${PKGNAME} is part of your ${OPSYS} distribution"
 .endif



In getopt_long.c add
int    optreset;
also if REPLACE_GETOPT is not defined.