From 533fbf766e3f548ab38848bcb3bebbb545ed5b9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 8 Aug 2019 13:49:07 +0300 Subject: [PATCH] registry: Use plugin directory from the build system for relocateable Windows builds Instead of guessing something based on preprocessor defines and magic. --- configure.ac | 17 +++++++++++++++++ gst/gstregistry.c | 7 ++----- meson.build | 2 ++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 1c71afd..79f0bb2 100644 --- a/configure.ac +++ b/configure.ac @@ -1065,6 +1065,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 84d9d06..f299c4f 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -1648,11 +1648,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 f2386de..90d98d8 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')) -- 2.7.4