win32: find plugin scanner in libexecdir subdir as configured
authorTim-Philipp Müller <tim@centricular.com>
Fri, 14 Jul 2017 15:12:25 +0000 (16:12 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 14 Jul 2017 15:13:12 +0000 (16:13 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=679115

configure.ac
gst/gstpluginloader.c
meson.build

index d8ce487..c0e6b09 100644 (file)
@@ -998,6 +998,23 @@ AC_DEFINE_UNQUOTED(GST_PLUGIN_SCANNER_INSTALLED,
     "$GST_PLUGIN_SCANNER_INSTALLED", [location of the installed gst-plugin-scanner])
 AC_SUBST(GST_PLUGIN_SCANNER_INSTALLED)
 
+case "${libexecdir}" in
+  *libexec)
+    GST_PLUGIN_SCANNER_SUBDIR="libexec";;
+  *lib)
+    GST_PLUGIN_SCANNER_SUBDIR="lib";;
+  *)
+    GST_PLUGIN_SCANNER_SUBDIR=`basename ${libexecdir}`;
+    if test -z "$GST_PLUGIN_SCANNER_SUBDIR"; then
+      AC_MSG_WARN([Couldn't determined libexecdir suffix, using "lib"])
+      GST_PLUGIN_SCANNER_SUBDIR="lib";
+    fi
+    ;;
+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])
+
+
 dnl completion helper locations
 AS_AC_EXPAND(GST_COMPLETION_HELPER_INSTALLED,${libexecdir}/gstreamer-$GST_API_VERSION/gst-completion-helper)
 AC_DEFINE_UNQUOTED(GST_COMPLETION_HELPER_INSTALLED,
index 430829d..be40cb5 100644 (file)
@@ -484,8 +484,8 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
           g_win32_get_package_installation_directory_of_module
           (_priv_gst_dll_handle);
       helper_bin =
-          g_build_filename (basedir, "lib", "gstreamer-" GST_API_VERSION,
-          "gst-plugin-scanner.exe", NULL);
+          g_build_filename (basedir, GST_PLUGIN_SCANNER_SUBDIR,
+          "gstreamer-" GST_API_VERSION, "gst-plugin-scanner.exe", NULL);
       g_free (basedir);
     }
 #else
index e17df40..5941d7a 100644 (file)
@@ -69,6 +69,8 @@ cdata.set_quoted('VERSION', gst_version)
 cdata.set('MEMORY_ALIGNMENT_MALLOC', 1)
 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_SCANNER_SUBDIR', libexecdir,
+  description: 'libexecdir path component, used to find plugin-scanner on relocatable builds on windows')
 
 if gst_version_nano > 0
     # Have GST_ERROR message printed when running from git