? getopt_long(), iopl() and ioperm() ?

Dan Nelson dnelson at allantgroup.com
Sun Oct 19 10:23:01 PDT 2003


In the last episode (Oct 19), Roman Neuhauser said:
> # pcc at gmx.net / 2003-10-19 01:59:45 +0200:
> > I'm hacking at a piece of code that I want to turn into a port. It's from
> > Linux and uses libpci and some other 'strange' functions. 
> > While I think that I've managed to modify the libpci port to install the
> > required lib, I'm more or less lost at getopt_long() which I 
> > assume is in the libgnugetopt port. However, for some reason, even if I
> > include it explicitly (#include "/usr/local/include/getopt.h"), I 
> > run into problems. Please note that I'm not a programmer at all, so it's
> > very much hacking along, so I may look for someone patient 
> > to bear with me ;-) But I am willing to learn. 
> 
>     AFAICT you need to tell the compiler about the library. The rule in
>     your Makefile needs to have "-L /usr/local/lib -lgnugetopt".

The best way is to set USE_GETOPT_LONG=yes in your port Makefile.

# USE_GETOPT_LONG - Says that the port uses getopt_long. If OSVERSION
#                   less than 500041, automatically adds devel/libgnugeopt
#                   to LIB_DEPENDS, and pass adjusted values of 
#                   CPPFLAGS and LDFLAGS in CONFIGURE_ENV.
#                   Default: not set.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list