]> granicus.if.org Git - yasm/commitdiff
Prepend "lib" on plugin name only on Unix.
authorPeter Johnson <peter@tortall.net>
Fri, 23 May 2008 06:30:38 +0000 (06:30 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 23 May 2008 06:30:38 +0000 (06:30 -0000)
svn path=/trunk/yasm/; revision=2099

frontends/yasm/yasm-plugin.c
frontends/yasm/yasm.c

index 55b3f75d10fecd7e705e15a5d3f1aae8b36f3674..e23a807a22cbf7c20bdd20f1b991766453e60141 100644 (file)
@@ -61,14 +61,21 @@ load_plugin(const char *name)
 
     /* Load library */
 
-    path = yasm_xmalloc(strlen(name)+5);
-    strcpy(path, name);
+    path = yasm_xmalloc(strlen(name)+10);
 #if defined(_MSC_VER)
+    strcpy(path, name);
     strcat(path, ".dll");
     lib = load_dll(path);
 #elif defined(__GNUC__)
+    strcpy(path, "lib");
+    strcat(path, name);
     strcat(path, ".so");
     lib = load_dll(path);
+    if (!lib) {
+        strcpy(path, name);
+        strcat(path, ".so");
+        lib = load_dll(path);
+    }
 #endif
     yasm_xfree(path);
     if (!lib)
index bf3121f24943ea607f214f0c5c0a043a7f54c54a..832940690012c842ecf2318510d2a78d4cd975e6 100644 (file)
@@ -583,7 +583,7 @@ main(int argc, char *argv[])
 
 #ifdef CMAKE_BUILD
     /* Load standard modules */
-    if (!load_plugin("libyasmstd")) {
+    if (!load_plugin("yasmstd")) {
         print_error(_("%s: could not load standard modules"), _("FATAL"));
         return EXIT_FAILURE;
     }