| Summary: | libgnugetopt incompatibility breaks mjpegtools build | ||
|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Nate Eldredge <neldredge> |
| Component: | Individual Port(s) | Assignee: | Michael Johnson <ahze> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Nate Eldredge
2003-07-25 21:30:17 UTC
Here is a patch to fix build on -current.
diff -urN /usr/ports/multimedia/mjpegtools/Makefile multimedia/mjpegtools/Makefile
--- /usr/ports/multimedia/mjpegtools/Makefile Sun Jun 29 08:19:25 2003
+++ multimedia/mjpegtools/Makefile Sat Jul 26 13:58:32 2003
@@ -18,13 +18,14 @@
LIB_DEPENDS= aviplay.0:${PORTSDIR}/multimedia/avifile \
jpeg.9:${PORTSDIR}/graphics/jpeg
-USE_GNOME= glib12
+USE_GETOPT_LONG= yes
+USE_GNOME= glib12 gnometarget
USE_GMAKE= yes
USE_LIBTOOL= yes
USE_REINPLACE= yes
USE_XLIB= yes
GNU_CONFIGURE= yes
-CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS}" \
+CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -DHAVE_DECL_GETOPT ${PTHREAD_CFLAGS}" \
LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS:S/"//g}" \
PTHREAD_LIBS="${PTHREAD_LIBS:S/"//g}"
WANT_GNOME= yes
@@ -63,11 +64,6 @@
.if exists(${LOCALBASE}/lib/libdv.so.3)
WITH_LIBDV= yes
.endif
-# LIBGNUGETOPT
-# -CURRENT after 500041 has getopt_long
-.if ${OSVERSION} < 500041
-WITH_LIBGNUGETOPT= yes
-.endif
# LIBMOVTAR
.if exists(${LOCALBASE}/lib/libmovtar.a)
WITH_LIBMOVTAR= yes
@@ -95,10 +91,6 @@
CONFIGURE_ARGS+= --with-dv=${LOCALBASE}
.endif
#
-.ifdef(WITH_LIBGNUGETOPT)
-USE_GETOPT_LONG= yes
-.endif
-#
.ifdef(WITH_LIBMOVTAR)
BUILD_DEPENDS+= ${LOCALBASE}/lib/libmovtar.a:${PORTSDIR}/multimedia/libmovtar
@@ -154,6 +146,8 @@
@${REINPLACE_CMD} -e 's|SDL/|SDL11/|' \
${WRKSRC}/lavtools/liblavplay.c \
${WRKSRC}/lavtools/yuvplay.c
+ @${REINPLACE_CMD} -e 's|-Werror||' \
+ ${WRKSRC}/yuvdenoise/Makefile.in
.ifdef(WITH_QUICKTIME)
@${REINPLACE_CMD} -E -e 's|^(have_openquicktime=).+$$|\1true|' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@@ -169,10 +163,6 @@
.if ${OPSYS:L} == "freebsd"
@${REINPLACE_CMD} -E -e 's|^(have_pthread=).+$$|\1true|' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
-.endif
-.ifdef(WITH_LIBGNUGETOPT)
- @${REINPLACE_CMD} -E -e 's|(AVIPLAY_LIBS \=.*)|\1 -lgnugetopt|' \
- ${WRKSRC}/lavtools/Makefile.in
.endif
# link to pthreads
@${REINPLACE_CMD} -E -e 's|(AVIPLAY_LIBS \=.*)|\1 ${PTHREAD_LIBS}|' \
diff -urN /usr/ports/multimedia/mjpegtools/files/patch-mplex::multplex.cc multimedia/mjpegtools/files/patch-mplex::multplex.cc
--- /usr/ports/multimedia/mjpegtools/files/patch-mplex::multplex.cc Thu Jan 1 09:00:00 1970
+++ multimedia/mjpegtools/files/patch-mplex::multplex.cc Sat Jul 26 13:49:38 2003
@@ -0,0 +1,10 @@
+--- mplex/multplex.cc.orig Mon Apr 29 23:36:00 2002
++++ mplex/multplex.cc Sat Jul 26 13:49:13 2003
+@@ -3,6 +3,7 @@
+ #include <math.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <assert.h>
+
+ #include <mjpeg_types.h>
+ #include <mjpeg_logging.h>
diff -urN /usr/ports/multimedia/mjpegtools/files/patch-mplex::stillsstream.cc multimedia/mjpegtools/files/patch-mplex::stillsstream.cc
--- /usr/ports/multimedia/mjpegtools/files/patch-mplex::stillsstream.cc Thu Jan 1 09:00:00 1970
+++ multimedia/mjpegtools/files/patch-mplex::stillsstream.cc Sat Jul 26 13:53:03 2003
@@ -0,0 +1,10 @@
+--- mplex/stillsstream.cc.orig Thu Apr 18 13:32:02 2002
++++ mplex/stillsstream.cc Sat Jul 26 13:52:37 2003
+@@ -21,6 +21,7 @@
+ */
+
+
++#include <assert.h>
+ #include <format_codes.h>
+
+ #include "stillsstream.hh"
diff -urN /usr/ports/multimedia/mjpegtools/files/patch-mplex::systems.cc multimedia/mjpegtools/files/patch-mplex::systems.cc
--- /usr/ports/multimedia/mjpegtools/files/patch-mplex::systems.cc Thu Jan 1 09:00:00 1970
+++ multimedia/mjpegtools/files/patch-mplex::systems.cc Sat Jul 26 13:51:38 2003
@@ -0,0 +1,10 @@
+--- mplex/systems.cc.orig Mon Apr 29 23:36:01 2002
++++ mplex/systems.cc Sat Jul 26 13:51:19 2003
+@@ -2,6 +2,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <assert.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include "systems.hh"
Responsible Changed From-To: freebsd-ports-bugs->lioux over to maintainer This is, indeed, a bug with libgnugetopt. The version of getopt.h that it
installs in /usr/local/include is incompatible with C++.
Specifically, if HAVE_DECL_GETOPT is not defined, libgnugetopt's
/usr/local/include/getopt.h declares getopt as
extern int getopt ();
which is fine for C ("function with unknown parameters"), but is broken for
C++ ("function taking zero parameters").
Compare /usr/local/include/getopt.h with /usr/src/contrib/gcc/getopt.h,
which is a more recent version of the same file. In that version, the
ifdefs are rearranged so that the trivial getopt prototype isn't defined if
__cplusplus.
The solution to this problem, therefore, is to update libgnugetopt (or at
least its include file) to match the latest version of the files from
libiberty.
Responsible Changed From-To: lioux->freebsd-port-bugs lioux no longer maintains this one. Responsible Changed From-To: freebsd-port-bugs->freebsd-ports-bugs Fix typo State Changed From-To: open->feedback I'm not sure devel/libgnugetopt is going to be updated. This PR is quite old now and Kato Tsuguru sent a patch to correct this behavior. Could you try it and say if it works for you? Responsible Changed From-To: freebsd-ports-bugs->flz Take replies. Responsible Changed From-To: flz->ahze I'm not sure why i took this one, over to maintainer. State Changed From-To: feedback->closed This should not be a problem with 5.3+ |