winebuild -N generalization

Dimitrie O. Paun dpaun at rogers.com
Mon Dec 23 14:10:29 CST 2002


We need to force the dll name when using temporary files from
tools such as winewrap. Besides, while it's good policy to not
use -N in general, I don't see a need to have the tool enforce
such policy. Moreover, it seems a bit clearer to use DLLName in
spec32.c instead of DLLFileName. If we need to enforce policy,
we should do it explicitly in main.c, rather then implicitly in
the code.

ChangeLog
  Support the -N option in all modes.

Index: tools/winebuild/main.c
===================================================================
RCS file: /var/cvs/wine/tools/winebuild/main.c,v
retrieving revision 1.43
diff -u -r1.43 main.c
--- tools/winebuild/main.c	12 Dec 2002 04:06:28 -0000	1.43
+++ tools/winebuild/main.c	23 Dec 2002 19:19:05 -0000
@@ -453,6 +453,13 @@
     output_file = stdout;
     parse_options( argv + 1 );
 
+    if (!DLLName[0])  /* set default name from file name */
+    {
+        char *p;
+        strcpy( DLLName, DLLFileName );
+        if ((p = strrchr( DLLName, '.' ))) *p = 0;
+    }
+
     switch(exec_mode)
     {
     case MODE_SPEC:
Index: tools/winebuild/spec16.c
===================================================================
RCS file: /var/cvs/wine/tools/winebuild/spec16.c,v
retrieving revision 1.38
diff -u -r1.38 spec16.c
--- tools/winebuild/spec16.c	18 Oct 2002 00:29:32 -0000	1.38
+++ tools/winebuild/spec16.c	23 Dec 2002 19:18:36 -0000
@@ -638,13 +638,6 @@
     memset( data, 0, 16 );
     data_offset = 16;
 
-    if (!DLLName[0])  /* set default name from file name */
-    {
-        char *p;
-        strcpy( DLLName, DLLFileName );
-        if ((p = strrchr( DLLName, '.' ))) *p = 0;
-    }
-
     output_stub_funcs( outfile );
 
     /* Build sorted list of all argument types, without duplicates */
Index: tools/winebuild/spec32.c
===================================================================
RCS file: /var/cvs/wine/tools/winebuild/spec32.c,v
retrieving revision 1.59
diff -u -r1.59 spec32.c
--- tools/winebuild/spec32.c	15 Dec 2002 01:22:40 -0000	1.59
+++ tools/winebuild/spec32.c	23 Dec 2002 19:17:44 -0000
@@ -53,13 +53,13 @@
     if (odp->name || odp->export_name)
     {
         char *p;
-        sprintf( buffer, "__wine_%s_%s_%s", prefix, DLLFileName,
+        sprintf( buffer, "__wine_%s_%s_%s", prefix, DLLName,
                  odp->name ? odp->name : odp->export_name );
         /* make sure name is a legal C identifier */
         for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break;
         if (!*p) return buffer;
     }
-    sprintf( buffer, "__wine_%s_%s_%d", prefix, make_c_identifier(DLLFileName), odp->ordinal );
+    sprintf( buffer, "__wine_%s_%s_%d", prefix, make_c_identifier(DLLName), odp->ordinal );
     return buffer;
 }
 
@@ -519,7 +519,7 @@
     fprintf( outfile, "}\n" );
     fprintf( outfile, "#endif\n" );
 
-    fprintf( outfile, "static const char dllname[] = \"%s\";\n\n", DLLFileName );
+    fprintf( outfile, "static const char dllname[] = \"%s\";\n\n", DLLName );
     fprintf( outfile, "extern int __wine_spec_exports[];\n\n" );
 
 #ifdef __i386__
@@ -797,7 +797,7 @@
 
     /* Output the DLL constructor */
 
-    sprintf( constructor, "__wine_spec_%s_init", make_c_identifier(DLLFileName) );
+    sprintf( constructor, "__wine_spec_%s_init", make_c_identifier(DLLName) );
     output_dll_init( outfile, constructor, NULL );
 
     fprintf( outfile,
@@ -807,7 +807,7 @@
              "    extern void *__wine_dbg_register( char * const *, int );\n"
              "    __wine_dll_register( &nt_header, \"%s\" );\n"
              "}\n",
-             constructor, DLLFileName );
+             constructor, DLLName );
 }
 
 
@@ -826,7 +826,7 @@
     fprintf(outfile, "; File generated automatically from %s; do not edit!\n\n",
             input_file_name );
 
-    fprintf(outfile, "LIBRARY %s\n\n", DLLFileName);
+    fprintf(outfile, "LIBRARY %s\n\n", DLLName);
 
     fprintf(outfile, "EXPORTS\n");
 


-- 
Dimi.




More information about the wine-patches mailing list