ports/54866: libgnugetopt incompatibility breaks mjpegtools build
Nate Eldredge
neldredge at hmc.edu
Fri Jul 25 20:30:19 UTC 2003
>Number: 54866
>Category: ports
>Synopsis: libgnugetopt incompatibility breaks mjpegtools build
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Jul 25 13:30:17 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Nate Eldredge
>Release: FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD mercury 5.1-RELEASE FreeBSD 5.1-RELEASE #1: Tue Jul 22 11:48:12 PDT 2003 nate at mercury:/medium/obj/medium/src/sys/MERCURY i386
>Description:
Seems that libgnugetopt's getopt.h and FreeBSD's unistd.h define
`getopt' slightly differently. (As far as I can tell, one has
the second arg as `char * const *' while the other has `char * const []'.)
So a C++ program that tries to include both will fail to compile.
This prevents the multimedia/mjpegtools port from building.
This also apparently affected licq; see
http://www.freebsd.org/cgi/query-pr.cgi?pr=54037
It was fixed there by patching the licq makefile; see
http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/licq/Makefile.diff?r1=1.47&r2=1.48
In that pr, dinoex claims that it only happens with gcc33, but I am using
the gcc 3.2.2 that comes with 5.1-RELEASE.
$ gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.2.2 [FreeBSD] 20030205 (release)
>How-To-Repeat:
Install the libgnugetopt port, then
$ 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
Or try to build multimedia/libmjpegtools.
===> Building for mjpegtools-1.6.1
gmake all-recursive
gmake[1]: Entering directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1'
Making all in utils
gmake[2]: Entering directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/utils'
gmake[3]: Entering directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/utils'
gmake[3]: Nothing to be done for `all-am'.
gmake[3]: Leaving directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/utils'
gmake[2]: Leaving directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/utils'
Making all in lavtools
gmake[2]: Entering directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/lavtools'
source='lav2divx.cpp' object='lav2divx.o' libtool=no \
depfile='.deps/lav2divx.Po' tmpdepfile='.deps/lav2divx.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/local/include -DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.1\" -I/usr/X11R6/include -I /usr/X11R6/include -I../utils -I/usr/local/include/avifile -I/usr/X11R6/include/gtk12 -I/usr/local/include/glib12 -I/usr/local/include -I/usr/X11R6/include -D_THREAD_SAFE -O -pipe -mcpu=pentiumpro -c -o lav2divx.o `test -f 'lav2divx.cpp' || echo './'`lav2divx.cpp
In file included from lav2divx.cpp:80:
/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
In file included from libavifile.h:51,
from lav2divx.cpp:92:
/usr/local/include/avifile/fourcc.h:4:2: warning: #warning Use #include "avm_fourcc.h" instead
gmake[2]: *** [lav2divx.o] Error 1
gmake[2]: Leaving directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1/lavtools'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/big/ports/multimedia/mjpegtools/work/mjpegtools-1.6.1'
gmake: *** [all] Error 2
*** Error code 2
Stop in /big/ports/multimedia/mjpegtools.
>Fix:
Don't know. I'm not sure whether this should be fixed in libmjpegtools,
libgnugetopt or unistd.h.
--
Nate Eldredge
neldredge at hmc.edu
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list