winebuild: Split output_static_lib into output_(import|static)_lib.

This commit is contained in:
Rémi Bernon 2022-10-02 22:08:36 +02:00 committed by Alexandre Julliard
parent f35fbc5be9
commit fd7cee3e31
Notes: Alexandre Julliard 2022-11-03 22:31:56 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/1230
3 changed files with 14 additions and 17 deletions

View file

@ -305,7 +305,8 @@ extern void output_module( DLLSPEC *spec );
extern void output_stubs( DLLSPEC *spec );
extern void output_syscalls( DLLSPEC *spec );
extern void output_imports( DLLSPEC *spec );
extern void output_static_lib( DLLSPEC *spec, struct strarray files );
extern void output_import_lib( DLLSPEC *spec, struct strarray files );
extern void output_static_lib( const char *output_name, struct strarray files, int create );
extern void output_exports( DLLSPEC *spec );
extern int load_res32_file( const char *name, DLLSPEC *spec );
extern void output_resources( DLLSPEC *spec );

View file

@ -1552,7 +1552,7 @@ static void assemble_files( const char *prefix )
}
/* build a library from the current asm files and any additional object files in argv */
static void build_library( const char *output_name, struct strarray files, int create )
void output_static_lib( const char *output_name, struct strarray files, int create )
{
struct strarray args;
@ -1582,7 +1582,7 @@ static void build_library( const char *output_name, struct strarray files, int c
}
/* create a Windows-style import library */
static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec )
static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struct strarray files )
{
struct strarray args;
char *def_file;
@ -1623,10 +1623,12 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec )
}
spawn( args );
if (files.count) output_static_lib( output_file_name, files, 0 );
}
/* create a Unix-style import library */
static void build_unix_import_lib( DLLSPEC *spec )
static void build_unix_import_lib( DLLSPEC *spec, struct strarray files )
{
int i, total;
const char *name, *prefix;
@ -1679,19 +1681,13 @@ static void build_unix_import_lib( DLLSPEC *spec )
assemble_files( spec->file_name );
free( dll_name );
output_static_lib( output_file_name, files, 1 );
}
/* output an import library for a Win32 module and additional object files */
void output_static_lib( DLLSPEC *spec, struct strarray files )
void output_import_lib( DLLSPEC *spec, struct strarray files )
{
if (is_pe())
{
if (spec) build_windows_import_lib( output_file_name, spec );
if (files.count || !spec) build_library( output_file_name, files, !spec );
}
else
{
if (spec) build_unix_import_lib( spec );
build_library( output_file_name, files, 1 );
}
if (!is_pe()) build_unix_import_lib( spec, files );
else build_windows_import_lib( output_file_name, spec, files );
}

View file

@ -669,10 +669,10 @@ int main(int argc, char **argv)
case MODE_IMPLIB:
if (!spec_file_name) fatal_error( "missing .spec file\n" );
if (!parse_input_file( spec )) break;
output_static_lib( spec, files );
output_import_lib( spec, files );
break;
case MODE_STATICLIB:
output_static_lib( NULL, files );
output_static_lib( output_file_name, files, 1 );
break;
case MODE_BUILTIN:
if (!files.count) fatal_error( "missing file argument for --builtin option\n" );