]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/cutils.c
meson, cutils: allow non-relocatable installs
[mirror_qemu.git] / util / cutils.c
index c99d26c5e2d2e45de1a19a9cc37207d2312e1690..64f817b477bbfa2f04a33b0948b6be7fa1a3a63d 100644 (file)
@@ -1178,9 +1178,11 @@ char *get_relocated_path(const char *dir)
 #else
         g_string_append(result, dir);
 #endif
-    } else if (!starts_with_prefix(dir) || !starts_with_prefix(bindir)) {
-        g_string_assign(result, dir);
-    } else {
+        goto out;
+    }
+
+    if (IS_ENABLED(CONFIG_RELOCATABLE) &&
+        starts_with_prefix(dir) && starts_with_prefix(bindir)) {
         g_string_assign(result, exec_dir);
 
         /* Advance over common components.  */
@@ -1203,7 +1205,10 @@ char *get_relocated_path(const char *dir)
             assert(G_IS_DIR_SEPARATOR(dir[-1]));
             g_string_append(result, dir - 1);
         }
+        goto out;
     }
 
+    g_string_assign(result, dir);
+out:
     return g_string_free(result, false);
 }