On Sat, Nov 17, 2012 at 05:12:58PM +0100, Christian Weisgerber wrote:
> make: don't know how to make /usr/local/include/ansidecl.h (prerequisite of: 
> modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_gstreamer.o)
> 
> Looks like opencv picks up ansidecl.h during configure and later
> tries to use it.  However, since there is no explicit dependency,
> the file can go away anytime and if it does, the build fails.
> 
> (ansidecl.h is around if devel/gdb happens to be installed.)

Unfortunately it's deeper than opencv itself.

Look at 
/usr/ports/pobj/OpenCV-2.2.0/build-amd64/modules/highgui/CMakeFiles/opencv_highgui.dir/CXX.includecache:

---8<---

/usr/local/include/libxml2/libxml/xmlstring.h
stdarg.h
-
libxml/xmlversion.h
-

/usr/local/include/libxml2/libxml/xmlversion.h
libxml/xmlexports.h
-
ansidecl.h
-

---8<---

It comes from libxml.

Sadly, CMake is broken in this regard: if it sees this reference
and ansidecl.h is present, it will add a dependency upon it, even
if HAVE_ANSIDECL_H is never set.

The patch below should fix the problem (and I've applied the same
treatment to textproc/libxslt too, just to be sure).

I've googled the internet for other solutions, but found nothing.

Comments? OKs?
(CCing ports@ to wide the audience)

Cheers,
David

Index: libxml/Makefile
===================================================================
RCS file: /cvs/ports/textproc/libxml/Makefile,v
retrieving revision 1.146
diff -u -p -r1.146 Makefile
--- libxml/Makefile     30 Sep 2012 12:22:05 -0000      1.146
+++ libxml/Makefile     19 Nov 2012 09:05:32 -0000
@@ -7,6 +7,7 @@ VERSION=                2.8.0
 DISTNAME=              libxml2-${VERSION}
 PKGNAME-main=          libxml-${VERSION}
 PKGNAME-python=                py-libxml-${VERSION}
+REVISION-main=         0
 SHARED_LIBS += xml2                 14.0     # 10.0
 CATEGORIES=            textproc
 MASTER_SITES=          http://gd.tuwien.ac.at/pub/libxml/ \
Index: libxml/patches/patch-include_libxml_xmlversion_h_in
===================================================================
RCS file: libxml/patches/patch-include_libxml_xmlversion_h_in
diff -N libxml/patches/patch-include_libxml_xmlversion_h_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libxml/patches/patch-include_libxml_xmlversion_h_in 19 Nov 2012 09:05:32 
-0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+CMake is broken: if it sees this reference and ansidecl.h is present,
+it will add a dependency upon it, even if HAVE_ANSIDECL_H is never
+set.
+
+--- include/libxml/xmlversion.h.in.orig        Mon Nov 19 09:47:08 2012
++++ include/libxml/xmlversion.h.in     Mon Nov 19 09:47:35 2012
+@@ -401,9 +401,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
+ #endif
+ 
+ #ifdef __GNUC__
+-#ifdef HAVE_ANSIDECL_H
+-#include <ansidecl.h>
+-#endif
+ 
+ /**
+  * ATTRIBUTE_UNUSED:
Index: libxslt/Makefile
===================================================================
RCS file: /cvs/ports/textproc/libxslt/Makefile,v
retrieving revision 1.72
diff -u -p -r1.72 Makefile
--- libxslt/Makefile    30 Sep 2012 12:21:34 -0000      1.72
+++ libxslt/Makefile    19 Nov 2012 09:05:32 -0000
@@ -7,6 +7,7 @@ VERSION=                1.1.27
 DISTNAME=              libxslt-${VERSION}
 PKGNAME-main=          libxslt-${VERSION}
 PKGNAME-python=        py-libxslt-${VERSION}
+REVISION-main=         0
 SHARED_LIBS=           exslt   9.8 \
                        xslt    3.8
 
Index: libxslt/patches/patch-libexslt_exsltconfig_h_in
===================================================================
RCS file: libxslt/patches/patch-libexslt_exsltconfig_h_in
diff -N libxslt/patches/patch-libexslt_exsltconfig_h_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libxslt/patches/patch-libexslt_exsltconfig_h_in     19 Nov 2012 09:05:32 
-0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+CMake is broken: if it sees this reference and ansidecl.h is present,
+it will add a dependency upon it, even if HAVE_ANSIDECL_H is never
+set.
+
+--- libexslt/exsltconfig.h.in.orig     Mon Nov 19 09:56:23 2012
++++ libexslt/exsltconfig.h.in  Mon Nov 19 09:56:34 2012
+@@ -56,9 +56,6 @@ extern "C" {
+  * This macro is used to flag unused function parameters to GCC
+  */
+ #ifdef __GNUC__
+-#ifdef HAVE_ANSIDECL_H
+-#include <ansidecl.h>
+-#endif
+ #ifndef ATTRIBUTE_UNUSED
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
+ #endif
Index: libxslt/patches/patch-libxslt_xsltconfig_h_in
===================================================================
RCS file: libxslt/patches/patch-libxslt_xsltconfig_h_in
diff -N libxslt/patches/patch-libxslt_xsltconfig_h_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libxslt/patches/patch-libxslt_xsltconfig_h_in       19 Nov 2012 09:05:32 
-0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+CMake is broken: if it sees this reference and ansidecl.h is present,
+it will add a dependency upon it, even if HAVE_ANSIDECL_H is never
+set.
+
+--- libxslt/xsltconfig.h.in.orig       Mon Nov 19 09:55:46 2012
++++ libxslt/xsltconfig.h.in    Mon Nov 19 09:56:08 2012
+@@ -142,9 +142,6 @@ extern "C" {
+  * This macro is used to flag unused function parameters to GCC
+  */
+ #ifdef __GNUC__
+-#ifdef HAVE_ANSIDECL_H
+-#include <ansidecl.h>
+-#endif
+ #ifndef ATTRIBUTE_UNUSED
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
+ #endif

Reply via email to