Bug#948248: opencv: Doesn't build on ports without java

Samuel Thibault sthibault at debian.org
Sat Jan 11 14:58:11 GMT 2020


Samuel Thibault, le ven. 10 janv. 2020 11:41:12 +0100, a ecrit:
> (as a side note, the build failure on hurd-i386 is being handled in
> https://github.com/opencv/opencv/pull/16302 )

Here is the patch applied upstream, could you apply it as well?

Thanks,
Samuel
-------------- next part --------------
commit e57ceea3d3769ef130465bcbe45e32d2cb2954ca
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Wed Jan 8 01:32:12 2020 +0100

    Fix build on non-Linux glibc-based systems
    
    dl functions are provided by all glibc-based systems (GNU/Linux, but
    also GNU/Hurd, GNU/kFreeBSD)

diff --git a/modules/videoio/src/backend_plugin.cpp b/modules/videoio/src/backend_plugin.cpp
index 617c3cda29..f73a9ad7ac 100644
--- a/modules/videoio/src/backend_plugin.cpp
+++ b/modules/videoio/src/backend_plugin.cpp
@@ -21,7 +21,7 @@ using namespace std;
 
 #if defined(_WIN32)
 #include <windows.h>
-#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__GLIBC__)
 #include <dlfcn.h>
 #endif
 
@@ -77,7 +77,7 @@ void* getSymbol_(LibHandle_t h, const char* symbolName)
 {
 #if defined(_WIN32)
     return (void*)GetProcAddress(h, symbolName);
-#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__GLIBC__)
     return dlsym(h, symbolName);
 #endif
 }
@@ -91,7 +91,7 @@ LibHandle_t libraryLoad_(const FileSystemPath_t& filename)
 # else
     return LoadLibraryW(filename.c_str());
 #endif
-#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__GLIBC__)
     return dlopen(filename.c_str(), RTLD_LAZY);
 #endif
 }
@@ -101,7 +101,7 @@ void libraryRelease_(LibHandle_t h)
 {
 #if defined(_WIN32)
     FreeLibrary(h);
-#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__GLIBC__)
     dlclose(h);
 #endif
 }


More information about the debian-science-maintainers mailing list