Subject: Re: best practise of adding dependency on getopt.h?
To: Packages Technical List NetBSD Discussion <>
From: Georg Schwarz <>
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  +49 151 11559652