Bug 54037 - Ports collection : licq conflict with libgnugetopt
Summary: Ports collection : licq conflict with libgnugetopt
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-02 19:20 UTC by Kostyuk Oleg
Modified: 2003-09-30 13:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostyuk Oleg 2003-07-02 19:20:08 UTC
	`portupgrade :licq' generate errors :


	In file included from licq.cpp:29:
	/usr/local/include/getopt.h:115: declaration of C function `int getopt()'
	   conflicts with
	/usr/include/unistd.h:377: previous declaration `int getopt(int, char* const*,
	   const char*)' here
	/usr/local/include/getopt.h: In member function `bool CLicq::Init(int,
	   char**)':
	/usr/local/include/getopt.h:115: too many arguments to function `int getopt()'
	licq.cpp:189: at this point in file
	gmake[2]: *** [licq.o] ïÛÉÂËÁ 1
	gmake[2]: Leaving directory `/var/.0/tmp/mnt/digma/usr/ports/net/licq/work/licq-1.2.7/src'
	gmake[1]: *** [all-recursive] ïÛÉÂËÁ 1
	gmake[1]: Leaving directory `/var/.0/tmp/mnt/digma/usr/ports/net/licq/work/licq-1.2.7'
	gmake: *** [all] ïÛÉÂËÁ 2
	*** Error code 2

	Stop in /mnt/digma/usr/ports/net/licq.
	** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade35172.0 make
	** Fix the problem and try again.

Fix: 

/usr/local/include/getopt.h - file from libgnugetopt-1.2 package.
	When I deinstall libgnugetopt, compiling licq done well.
	But I need libgnugetopt (for other packages), and I don't know
	how to fix this error whitout deinstalling libgnugetopt.

	May be, change `configure' from licq to detect situation when both
	/usr/include/unistd.h and /usr/local/include/getopt.h present
	in system...

	I think, this error in configure (and, really, in autoconf),
	because I have an experience with so trouble in the last
	(with other ports, but I don't remember exactly packages).

	Note: I use cvsup and portupgrade packages, so I have up to
	date ports collection and installed software.
How-To-Repeat: 	Upgrade licq from 1.2.6 to 1.2.7 with installed libgnugetopt-1.2
Comment 1 Dirk Meyer freebsd_committer 2003-07-02 19:30:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

over to maintainer
Comment 2 Dirk Meyer freebsd_committer 2003-07-23 17:31:36 UTC
State Changed
From-To: open->feedback

I can't reproduce the problem. 

licq and modules builds 

1) without libgnugetopt installed  
2) with libgnugetopt installed  

Please check again.
Comment 3 Nate Eldredge 2003-07-24 18:09:27 UTC
It seems to me that this is (in part) really a bug in libgnugetopt, or at
least an incompatibility between it and the base system.

To reproduce without any other ports, install libgnugetopt-1.2 (current as
of this writing) on a 5.1-RELEASE system, and do

$ cat >foo.cc
#include <unistd.h>
#include <getopt.h>
^D
$ gcc -c -I /usr/local/include foo.cc
In file included from foo.cc:2:
/usr/local/include/getopt.h:115: declaration of C function `int getopt()'
   conflicts with
/usr/include/unistd.h:377: previous declaration `int getopt(int, char*
const*,
   const char*)' here

It would appear that the two headers have conflicting declarations of
getopt.  The only difference I see is that one has the second argument as
`char * const *' while the other has `char * const []'.  Apparently they
are close enough for C, but not for C++.

Note that this also stops the mjpegtools port from building.

-- 

Nate Eldredge
neldredge@hmc.edu
Comment 4 Dirk Meyer freebsd_committer 2003-07-25 18:46:46 UTC
State Changed
From-To: feedback->closed

this only happens with gcc33, a fix has been committed.
Comment 5 Pavel.Navratil 2003-09-30 13:29:43 UTC
I have the same problem with compilation of port nmap-3.46.
It ends with error:
---------------------------------------------------------
In file included from nbase/nbase.h:256,
                 from nmap.h:109,
                 from main.cc:87:
/usr/local/include/getopt.h:115: declaration of C function `int
getopt()'
   conflicts with
/usr/include/unistd.h:377: previous declaration `int getopt(int, char*
const*,
   const char*)' here
*** Error code 1

Stop in /usr/ports/security/nmap/work/nmap-3.46.
*** Error code 1

Stop in /usr/ports/security/nmap.
** Command failed [exit code 1]: /usr/bin/script -qa
/tmp/portupgrade95723.0 make
-----------------------------------------------------------
I also use 5.1-RELEASE system.
Please, let me know, when or where I can find patch for that.

Thank you

-------------------------------------------------------
Pavel Navratil
Cisco Certified Security Professional        =20
NEXTRA Czech Republic s.r.o.  - http://www.nextra.cz
V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic
Tel: +420/2/96 355 111
E-mail: pavel.navratil@nextra.cz

Contact address:
Wolkerova 1331 / CZ - 565 01 Chocen / Czech Republic
Tel.: +420/603/279069
See Disclaimer: http://www.nextra.cz/disclaimer/
-------------------------------------------------------


-------------------------------------------------------
Pavel Navratil
Cisco Certified Security Professional        =20
NEXTRA Czech Republic s.r.o.  - http://www.nextra.cz
V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic
Tel: +420/2/96 355 111
E-mail: pavel.navratil@nextra.cz

Contact address:
Wolkerova 1331 / CZ - 565 01 Chocen / Czech Republic
Tel.: +420/603/279069
See Disclaimer: http://www.nextra.cz/disclaimer/
-------------------------------------------------------