mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
parent
f77f7e987c
commit
01a966eec3
1 changed files with 33 additions and 1 deletions
|
@ -129,13 +129,21 @@ unmangle_libtool (gchar ** dir, gchar ** base)
|
||||||
if (!*base)
|
if (!*base)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* we assume libtool when base starts with lt- and dir ends with .libs */
|
/* We assume libtool when base starts with "lt-" and dir ends with ".libs".
|
||||||
|
* On Windows libtool doesn't seem to be adding "lt-" prefix. */
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
if (!g_str_has_prefix (*base, "lt-"))
|
if (!g_str_has_prefix (*base, "lt-"))
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!g_str_has_suffix (*dir, ".libs"))
|
if (!g_str_has_suffix (*dir, ".libs"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
new_base = g_strdup (&((*base)[3]));
|
new_base = g_strdup (&((*base)[3]));
|
||||||
|
#else
|
||||||
|
new_base = g_strdup (*base);
|
||||||
|
#endif
|
||||||
new_dir = g_path_get_dirname (*dir);
|
new_dir = g_path_get_dirname (*dir);
|
||||||
g_free (*base);
|
g_free (*base);
|
||||||
g_free (*dir);
|
g_free (*dir);
|
||||||
|
@ -163,6 +171,23 @@ get_dir_of_binary (const gchar * binary)
|
||||||
* specified which caused get_basename to return "." */
|
* specified which caused get_basename to return "." */
|
||||||
full = g_build_filename (dir, base, NULL);
|
full = g_build_filename (dir, base, NULL);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
|
||||||
|
/* g_build_filename() should be using the last path separator used in the
|
||||||
|
* input according to the docs, but doesn't actually do that, so we have
|
||||||
|
* to fix up the result. */
|
||||||
|
{
|
||||||
|
gchar *tmp;
|
||||||
|
|
||||||
|
for (tmp = (gchar *) binary + strlen (binary) - 1; tmp >= binary; tmp--) {
|
||||||
|
if (*tmp == '/' || *tmp == '\\') {
|
||||||
|
full[strlen (dir)] = *tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (strcmp (full, binary) != 0) {
|
if (strcmp (full, binary) != 0) {
|
||||||
if (strcmp (dir, ".") != 0) {
|
if (strcmp (dir, ".") != 0) {
|
||||||
g_warning ("This should not happen, g_path_get_dirname () has changed.");
|
g_warning ("This should not happen, g_path_get_dirname () has changed.");
|
||||||
|
@ -320,6 +345,13 @@ main (int argc, char **argv)
|
||||||
/* unmangle libtool if necessary */
|
/* unmangle libtool if necessary */
|
||||||
unmangle_libtool (&dir, &base);
|
unmangle_libtool (&dir, &base);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
/* remove .exe suffix, otherwise we'll be looking for gst-blah.exe-*.* */
|
||||||
|
if (strlen (base) > 4 && g_str_has_suffix (base, ".exe")) {
|
||||||
|
base[strlen (base) - 4] = '\0';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* get all candidate binaries */
|
/* get all candidate binaries */
|
||||||
candidates = get_candidates (dir, base);
|
candidates = get_candidates (dir, base);
|
||||||
g_free (dir);
|
g_free (dir);
|
||||||
|
|
Loading…
Reference in a new issue