Subject: Re: best practise of adding dependency on getopt.h?
To: Packages Technical List NetBSD Discussion <tech-pkg@NetBSD.org>
From: Georg Schwarz <georg.schwarz@freenet.de>
List: tech-pkg
Date: 01/07/2007 20:21:21
Am 02.01.2007 um 10:58 schrieb Joerg Sonnenberger:

> Please check *first* whether it is actually using getopt_long or
> getopt_long_only. If it is only using getopt, it should include  
> unistd.h

For a test I simply exhanged getopt.h with unistd.h, and I now end up  
like this:

main.c: In function 'main':
main.c:166: error: array type has incomplete element type

Linie 166 in main.c has

        struct option long_options[]={

So getopt.h is needed to define struct option.


> and be patched accordingly. If it does not, the conditional version it
> ok.

it looks like I can do it even unconditionally as pkgsrc on its own  
is figuring out whether it is needed on a given platform.


-- 
Georg Schwarz    http://home.pages.de/~schwarz/
georg.schwarz@freenet.de  +49 151 11559652