Changed builtin dlls file names to make it clear they are not normal
Unix libraries, and install them in $libdir/wine instead of $libdir to
avoid name conflicts in /usr/lib.

diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index e54d0dc..10ae35e 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -80,18 +80,21 @@
 /* open the .so library for a given dll in a specified path */
 static char *try_library_path( const char *path, const char *name )
 {
-    char *buffer, *p;
+    char *buffer;
     int fd;
 
-    buffer = xmalloc( strlen(path) + strlen(name) + 8 );
-    sprintf( buffer, "%s/lib%s", path, name );
-    p = buffer + strlen(buffer) - 4;
-    if (!strcmp( p, ".dll" )) *p = 0;
+    buffer = xmalloc( strlen(path) + strlen(name) + 9 );
+    sprintf( buffer, "%s/%s", path, name );
+    if (!strchr( name, '.' )) strcat( buffer, ".dll" );
     strcat( buffer, ".so" );
     /* check if the file exists */
-    if ((fd = open( buffer, O_RDONLY )) == -1) return NULL;
-    close( fd );
-    return buffer;
+    if ((fd = open( buffer, O_RDONLY )) != -1)
+    {
+        close( fd );
+        return buffer;
+    }
+    free( buffer );
+    return NULL;
 }
 
 /* open the .so library for a given dll */
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 06fdac9..5bf55da 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -790,7 +790,7 @@
     fprintf(outfile, "; File generated automatically from %s; do not edit!\n\n",
             input_file_name );
 
-    fprintf(outfile, "LIBRARY lib%s\n\n", DLLFileName);
+    fprintf(outfile, "LIBRARY %s\n\n", DLLFileName);
 
     fprintf(outfile, "EXPORTS\n");
 
@@ -833,7 +833,7 @@
             fprintf(outfile, "=%s", make_internal_name( odp, "stub" ));
             break;
         case TYPE_FORWARD:
-            fprintf(outfile, "=lib%s", odp->link_name);
+            fprintf(outfile, "=%s", odp->link_name);
             break;
         default:
             assert(0);