registry: enable relocatable builds for anywhere with dladdr()
authorMatthew Waters <matthew@centricular.com>
Tue, 8 Feb 2022 01:58:52 +0000 (12:58 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 8 Feb 2022 17:35:24 +0000 (17:35 +0000)
Such as Linux/BSD's.

Matches the Windows/macOS behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1662>

subprojects/gstreamer/gst/gstregistry.c

index 3b1906e..a0b5b17 100644 (file)
@@ -1569,7 +1569,7 @@ priv_gst_get_relocated_libgstreamer (void)
 
     g_free (base_dir);
   }
-#elif defined(__APPLE__) && defined(HAVE_DLADDR)
+#elif defined(HAVE_DLADDR)
   {
     Dl_info info;
 
@@ -1589,6 +1589,11 @@ priv_gst_get_relocated_libgstreamer (void)
       return NULL;
     }
   }
+#else
+#warning "Unsupported platform for retrieving the current location of a\
+ shared library. Relocatable builds will not work."
+  GST_WARNING ("Don't know how to retrieve the location of the shared "
+      "library libgstreamer-" GST_API_VERSION);
 #endif
 
   return dir;