Alexandre Julliard : makefiles: Add support for importing PE system libraries using the -l option.

Alexandre Julliard julliard at winehq.org
Mon Oct 25 16:30:06 CDT 2021


Module: wine
Branch: master
Commit: 30fb17bda0d96c1778d18015c5292580de25f486
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=30fb17bda0d96c1778d18015c5292580de25f486

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 25 11:05:07 2021 +0200

makefiles: Add support for importing PE system libraries using the -l option.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/makedep.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tools/makedep.c b/tools/makedep.c
index 3792a2b223b..b24acfa3053 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1411,6 +1411,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
     {
         if (!strcmp( pFile->name, "stdarg.h" )) return NULL;
         if (!strcmp( pFile->name, "x86intrin.h" )) return NULL;
+        if (make->include_paths.count) return NULL;
         fprintf( stderr, "%s:%d: error: system header %s cannot be used with msvcrt\n",
                  pFile->included_by->file->name, pFile->included_line, pFile->name );
         exit(1);
@@ -1961,6 +1962,7 @@ static struct strarray get_local_dependencies( const struct makefile *make, cons
 static const char *get_static_lib( const struct makefile *make, const char *name )
 {
     if (!make->staticlib) return NULL;
+    if (make->disabled) return NULL;
     if (strncmp( make->staticlib, "lib", 3 )) return NULL;
     if (strncmp( make->staticlib + 3, name, strlen(name) )) return NULL;
     if (strcmp( make->staticlib + 3 + strlen(name), ".a" )) return NULL;
@@ -2085,9 +2087,20 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
 
     for (i = 0; i < imports.count; i++)
     {
-        const char *name = get_base_name( imports.str[i] );
+        const char *name = imports.str[i];
         const char *lib = NULL;
 
+        if (name[0] == '-')
+        {
+            switch (name[1])
+            {
+            case 'L': strarray_add( &ret, name ); continue;
+            case 'l': name += 2; break;
+            default: continue;
+            }
+        }
+        else name = get_base_name( name );
+
         for (j = 0; j < subdirs.count; j++)
         {
             if (submakes[j]->importlib && !strcmp( submakes[j]->importlib, name ))




More information about the wine-cvs mailing list