Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 2003 12:09:34 +0300 (EEST)
From:      Kostyuk Oleg <cub@cub.org.ua>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        freebsd-ports@freebsd.org
Subject:   libgnugetopt conflict : nmap upgrade (3.30 to 3.46) generate errors
Message-ID:  <200309260909.h8Q99YhI030329@demani.digma>

next in thread | raw e-mail | index | archive | help

>Submitter-Id:	current-users
>Originator:	Kostyuk Oleg
>Organization:	
>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
>Environment:
System: FreeBSD demani.digma 5.1-CURRENT FreeBSD 5.1-CURRENT #1: Sat Sep 20 14:46:13 EEST 2003 root@demani.digma:/usr/src/sys/i386/compile/CUB i386


>Description:
	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=\"http://www.insecure.org/nmap/\"
	-DNMAP_PLATFORM=\"i386-portbld-freebsd5.1\" -DNMAPDATADIR=\"/usr/local/share/nmap\"
	-Ilibpcap-possiblymodified main.cc -o main.o
	In file included from nbase/nbase.h:256,
	                 from nmap.h:109,
        	         from main.cc:87:
	/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.

>How-To-Repeat:
	Install from ports nmap-3.46 on FreeBSD 5.1 (gcc 3.3) with installed
	libgnugetopt (also from ports).

	Or (Nate Eldredge <neldredge@hmc.edu> method) :
	install libgnugetopt-1.2 (current now), and simply

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

>Fix:
	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 :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309260909.h8Q99YhI030329>