Commit c0467a14 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winebuild: Add an option to build a static library.

parent d4736114
...@@ -303,7 +303,7 @@ extern void output_get_pc_thunk(void); ...@@ -303,7 +303,7 @@ extern void output_get_pc_thunk(void);
extern void output_module( DLLSPEC *spec ); extern void output_module( DLLSPEC *spec );
extern void output_stubs( DLLSPEC *spec ); extern void output_stubs( DLLSPEC *spec );
extern void output_imports( DLLSPEC *spec ); extern void output_imports( DLLSPEC *spec );
extern void output_import_lib( DLLSPEC *spec, char **argv ); extern void output_static_lib( DLLSPEC *spec, char **argv );
extern void output_exports( DLLSPEC *spec ); extern void output_exports( DLLSPEC *spec );
extern int load_res32_file( const char *name, DLLSPEC *spec ); extern int load_res32_file( const char *name, DLLSPEC *spec );
extern void output_resources( DLLSPEC *spec ); extern void output_resources( DLLSPEC *spec );
......
...@@ -1539,16 +1539,16 @@ static void build_unix_import_lib( DLLSPEC *spec ) ...@@ -1539,16 +1539,16 @@ static void build_unix_import_lib( DLLSPEC *spec )
} }
/* output an import library for a Win32 module and additional object files */ /* output an import library for a Win32 module and additional object files */
void output_import_lib( DLLSPEC *spec, char **argv ) void output_static_lib( DLLSPEC *spec, char **argv )
{ {
if (target_platform == PLATFORM_WINDOWS) if (target_platform == PLATFORM_WINDOWS)
{ {
build_windows_import_lib( spec ); if (spec) build_windows_import_lib( spec );
if (argv[0]) build_library( output_file_name, argv, 0 ); if (argv[0] || !spec) build_library( output_file_name, argv, !spec );
} }
else else
{ {
build_unix_import_lib( spec ); if (spec) build_unix_import_lib( spec );
build_library( output_file_name, argv, 1 ); build_library( output_file_name, argv, 1 );
} }
} }
...@@ -113,6 +113,7 @@ enum exec_mode_values ...@@ -113,6 +113,7 @@ enum exec_mode_values
MODE_EXE, MODE_EXE,
MODE_DEF, MODE_DEF,
MODE_IMPLIB, MODE_IMPLIB,
MODE_STATICLIB,
MODE_BUILTIN, MODE_BUILTIN,
MODE_RESOURCES MODE_RESOURCES
}; };
...@@ -299,6 +300,7 @@ static const char usage_str[] = ...@@ -299,6 +300,7 @@ static const char usage_str[] =
" --def Build a .def file from a .spec file\n" " --def Build a .def file from a .spec file\n"
" --exe Build an executable from object files\n" " --exe Build an executable from object files\n"
" --implib Build an import library\n" " --implib Build an import library\n"
" --staticlib Build a static library\n"
" --builtin Mark a library as a Wine builtin\n" " --builtin Mark a library as a Wine builtin\n"
" --resources Build a .o or .res file for the resource files\n\n" " --resources Build a .o or .res file for the resource files\n\n"
"The mode options are mutually exclusive; you must specify one and only one.\n\n"; "The mode options are mutually exclusive; you must specify one and only one.\n\n";
...@@ -320,6 +322,7 @@ enum long_options_values ...@@ -320,6 +322,7 @@ enum long_options_values
LONG_OPT_NXCOMPAT, LONG_OPT_NXCOMPAT,
LONG_OPT_RESOURCES, LONG_OPT_RESOURCES,
LONG_OPT_SAVE_TEMPS, LONG_OPT_SAVE_TEMPS,
LONG_OPT_STATICLIB,
LONG_OPT_SUBSYSTEM, LONG_OPT_SUBSYSTEM,
LONG_OPT_VERSION LONG_OPT_VERSION
}; };
...@@ -332,6 +335,7 @@ static const struct option long_options[] = ...@@ -332,6 +335,7 @@ static const struct option long_options[] =
{ "def", 0, 0, LONG_OPT_DEF }, { "def", 0, 0, LONG_OPT_DEF },
{ "exe", 0, 0, LONG_OPT_EXE }, { "exe", 0, 0, LONG_OPT_EXE },
{ "implib", 0, 0, LONG_OPT_IMPLIB }, { "implib", 0, 0, LONG_OPT_IMPLIB },
{ "staticlib", 0, 0, LONG_OPT_STATICLIB },
{ "builtin", 0, 0, LONG_OPT_BUILTIN }, { "builtin", 0, 0, LONG_OPT_BUILTIN },
{ "as-cmd", 1, 0, LONG_OPT_ASCMD }, { "as-cmd", 1, 0, LONG_OPT_ASCMD },
{ "cc-cmd", 1, 0, LONG_OPT_CCCMD }, { "cc-cmd", 1, 0, LONG_OPT_CCCMD },
...@@ -501,6 +505,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) ...@@ -501,6 +505,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
case LONG_OPT_IMPLIB: case LONG_OPT_IMPLIB:
set_exec_mode( MODE_IMPLIB ); set_exec_mode( MODE_IMPLIB );
break; break;
case LONG_OPT_STATICLIB:
set_exec_mode( MODE_STATICLIB );
break;
case LONG_OPT_BUILTIN: case LONG_OPT_BUILTIN:
set_exec_mode( MODE_BUILTIN ); set_exec_mode( MODE_BUILTIN );
break; break;
...@@ -685,7 +692,10 @@ int main(int argc, char **argv) ...@@ -685,7 +692,10 @@ int main(int argc, char **argv)
case MODE_IMPLIB: case MODE_IMPLIB:
if (!spec_file_name) fatal_error( "missing .spec file\n" ); if (!spec_file_name) fatal_error( "missing .spec file\n" );
if (!parse_input_file( spec )) break; if (!parse_input_file( spec )) break;
output_import_lib( spec, argv ); output_static_lib( spec, argv );
break;
case MODE_STATICLIB:
output_static_lib( NULL, argv );
break; break;
case MODE_BUILTIN: case MODE_BUILTIN:
if (!argv[0]) fatal_error( "missing file argument for --builtin option\n" ); if (!argv[0]) fatal_error( "missing file argument for --builtin option\n" );
......
...@@ -51,6 +51,9 @@ Build a .a import library from a spec file. The .spec file is ...@@ -51,6 +51,9 @@ Build a .a import library from a spec file. The .spec file is
specified via the \fB-E\fR option. If the output library name ends specified via the \fB-E\fR option. If the output library name ends
in .delay.a, a delayed import library is built. in .delay.a, a delayed import library is built.
.TP .TP
.BI \--staticlib
Build a .a static library from object files.
.TP
.BI \--builtin .BI \--builtin
Mark a PE module as a Wine builtin module, by adding the "Wine builtin Mark a PE module as a Wine builtin module, by adding the "Wine builtin
DLL" signature string after the DOS header. DLL" signature string after the DOS header.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment