libgnugetopt conflict : nmap upgrade (3.30 to 3.46) generate errors

Kostyuk Oleg cub at
Fri Sep 26 02:09:58 PDT 2003

>Submitter-Id:	current-users
>Originator:	Kostyuk Oleg
>Confidential:	no 
>Synopsis:	libgnugetopt conflict : nmap upgrade (3.30 to 3.46) generate errors
>Severity:	serious
>Priority:	medium
>Category:	ports
>Class:		sw-bug
>Release:	FreeBSD 5.1-CURRENT i386
System: FreeBSD demani.digma 5.1-CURRENT FreeBSD 5.1-CURRENT #1: Sat Sep 20 14:46:13 EEST 2003 root at demani.digma:/usr/src/sys/i386/compile/CUB i386

	Upgrading nmap to version 3.46 produce errors:

	c++ -c  -I/usr/local/include -O -pipe -march=pentium3 -fmemoize-lookups
	-fsave-memoized -Wall  -I/usr/local/include -Ilibpcap-possiblymodified
	-Inbase -Insock/include  -DHAVE_CONFIG_H -DNMAP_VERSION=\"3.46\"
	-DNMAP_NAME=\"nmap\" -DNMAP_URL=\"\"
	-DNMAP_PLATFORM=\"i386-portbld-freebsd5.1\" -DNMAPDATADIR=\"/usr/local/share/nmap\"
	-Ilibpcap-possiblymodified -o main.o
	In file included from nbase/nbase.h:256,
	                 from nmap.h:109,
	/usr/local/include/getopt.h:115: error: declaration of C function `int getopt()
	   ' conflicts with
	/usr/include/unistd.h:377: error: previous declaration `int getopt(int, char*
	   const*, const char*)' here
	*** Error code 1

	Stop in /var/.0/tmp/mnt/digma0/ports/security/nmap/work/nmap-3.46.
	*** Error code 1

	Stop in /mnt/digma0/ports/security/nmap.

	Install from ports nmap-3.46 on FreeBSD 5.1 (gcc 3.3) with installed
	libgnugetopt (also from ports).

	Or (Nate Eldredge <neldredge at> method) :
	install libgnugetopt-1.2 (current now), and simply

		$ cat >
		#include <unistd.h>
		#include <getopt.h>
		$ gcc -c -I /usr/local/include

	This problem detail explained in PR/54037.
	At this moment, I know about this problem with next ports :

		nmap, licq, postgres, mjpegtools

	Some of this ports now have patched Makefile's to
	avoid this problem, but IMHO this is wrong way.
	Problem with libgnugetopt still exists, and by patching
	port Makefile's we do not resolve it globally.

	I think, we must patch libgnugetopt, or (as last resort) -
	path gcc 3.3, but not isolated Makefile's in each port, who
	have dependecy to libgnugetopt. This will be right way.

	PS : sorry for my english :)

More information about the freebsd-ports mailing list