summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-08-08 13:49:07 +0300
committerTim-Philipp Müller <tim@centricular.com>2019-08-09 12:29:37 +0100
commit684796f45afdb8a28ec9f8911977bb574e36b51c (patch)
treeb517861184325a36cffdd254f1726465ca6f0372
parentdc7b9cec1e04dc2af9bf5613c417393a11095b14 (diff)
registry: Use plugin directory from the build system for relocateable Windows builds
Instead of guessing something based on preprocessor defines and magic.
-rw-r--r--configure.ac17
-rw-r--r--gst/gstregistry.c7
-rw-r--r--meson.build2
3 files changed, 21 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 479a7a0ed..8474e3467 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1069,6 +1069,23 @@ esac
AC_DEFINE_UNQUOTED(GST_PLUGIN_SCANNER_SUBDIR,
"$GST_PLUGIN_SCANNER_SUBDIR", [libexecdir path component, used to find plugin-scanner on relocatable builds on windows])
+case "${libdir}" in
+ *lib64)
+ GST_PLUGIN_SUBDIR="lib64";;
+ *lib32)
+ GST_PLUGIN_SUBDIR="lib32";;
+ *lib)
+ GST_PLUGIN_SUBDIR="lib";;
+ *)
+ GST_PLUGIN_SUBDIR=`basename ${libdir}`;
+ if test -z "$GST_PLUGIN_SUBDIR"; then
+ AC_MSG_WARN([Couldn't determined libdir suffix, using "lib"])
+ GST_PLUGIN_SUBDIR="lib";
+ fi
+ ;;
+esac
+AC_DEFINE_UNQUOTED(GST_PLUGIN_SUBDIR,
+ "$GST_PLUGIN_SUBDIR", [plugin directory path component, used to find plugins on relocatable builds on windows])
dnl completion helper locations
AS_AC_EXPAND(GST_COMPLETION_HELPER_INSTALLED,${libexecdir}/gstreamer-$GST_API_VERSION/gst-completion-helper)
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 32153ff87..a8b2f51ca 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -1643,11 +1643,8 @@ scan_and_update_registry (GstRegistry * default_registry,
g_win32_get_package_installation_directory_of_module
(_priv_gst_dll_handle);
- dir = g_build_filename (base_dir,
-#ifdef _DEBUG
- "debug"
-#endif
- "lib", "gstreamer-" GST_API_VERSION, NULL);
+ dir = g_build_filename (base_dir, GST_PLUGIN_SUBDIR,
+ "gstreamer-" GST_API_VERSION, NULL);
GST_DEBUG ("scanning DLL dir %s", dir);
changed |= gst_registry_scan_path_internal (&context, dir);
diff --git a/meson.build b/meson.build
index e738c557f..ca2fdefe2 100644
--- a/meson.build
+++ b/meson.build
@@ -114,6 +114,8 @@ cdata.set_quoted('PLUGINDIR', join_paths(get_option('prefix'), get_option('libdi
cdata.set_quoted('VERSION', gst_version)
cdata.set_quoted('GST_PLUGIN_SCANNER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-plugin-scanner'))
cdata.set_quoted('GST_PTP_HELPER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-ptp-helper'))
+cdata.set_quoted('GST_PLUGIN_SUBDIR', get_option('libdir'),
+ description: 'plugin directory path component, used to find plugins on relocatable builds on windows')
cdata.set_quoted('GST_PLUGIN_SCANNER_SUBDIR', libexecdir,
description: 'libexecdir path component, used to find plugin-scanner on relocatable builds on windows')
cdata.set('GST_DISABLE_OPTION_PARSING', not get_option('option-parsing'))