Commit b9375920 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebuild: Introduce a new --without-dlltool winebuild flag.

Set it only when -Wl,--delay-load linker flag is not supported to keep using dlltool in LLVM builds, for MSVC-like import libs.
parent 2d5de1d9
......@@ -3404,6 +3404,7 @@ static void output_import_lib( struct makefile *make, unsigned int arch )
output_filenames_obj_dir( make, make->implib_files[arch] );
output( "\n" );
output( "\t%s%s -w --implib -o $@", cmd_prefix( "BUILD" ), tools_path( make, "winebuild" ) );
if (!delay_load_flags[arch]) output_filename( "--without-dlltool" );
output_filenames( target_flags[arch] );
if (make->is_win16) output_filename( "-m16" );
output_filename( "--export" );
......
......@@ -357,6 +357,7 @@ extern int verbose;
extern int link_ext_symbols;
extern int force_pointer_size;
extern int unwind_tables;
extern int use_dlltool;
extern int use_msvcrt;
extern int unix_lib;
extern int safe_seh;
......
......@@ -1581,8 +1581,8 @@ void output_static_lib( const char *output_name, struct strarray files, int crea
}
}
/* create a Windows-style import library */
static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struct strarray files )
/* create a Windows-style import library using dlltool */
static void build_dlltool_import_lib( const char *lib_name, DLLSPEC *spec, struct strarray files )
{
struct strarray args;
char *def_file;
......@@ -1627,6 +1627,13 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
if (files.count) output_static_lib( output_file_name, files, 0 );
}
/* create a Windows-style import library */
static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struct strarray files )
{
if (verbose) fprintf( stderr, "Not implemented, falling back to dlltool.\n" );
build_dlltool_import_lib( output_file_name, spec, files );
}
/* create a Unix-style import library */
static void build_unix_import_lib( DLLSPEC *spec, struct strarray files )
{
......@@ -1689,5 +1696,6 @@ static void build_unix_import_lib( DLLSPEC *spec, struct strarray files )
void output_import_lib( DLLSPEC *spec, struct strarray files )
{
if (!is_pe()) build_unix_import_lib( spec, files );
else if (use_dlltool) build_dlltool_import_lib( output_file_name, spec, files );
else build_windows_import_lib( output_file_name, spec, files );
}
......@@ -42,6 +42,7 @@ int verbose = 0;
int link_ext_symbols = 0;
int force_pointer_size = 0;
int unwind_tables = 0;
int use_dlltool = 1;
int use_msvcrt = 0;
int unix_lib = 0;
int safe_seh = 0;
......@@ -233,6 +234,7 @@ static const char usage_str[] =
" -v, --verbose Display the programs invoked\n"
" --version Print the version and exit\n"
" -w, --warnings Turn on warnings\n"
" --without-dlltool Generate import library without using dlltool\n"
"\nMode options:\n"
" --dll Build a library from a .spec file and object files\n"
" --def Build a .def file from a .spec file\n"
......@@ -268,7 +270,8 @@ enum long_options_values
LONG_OPT_STATICLIB,
LONG_OPT_SUBSYSTEM,
LONG_OPT_SYSCALL_TABLE,
LONG_OPT_VERSION
LONG_OPT_VERSION,
LONG_OPT_WITHOUT_DLLTOOL,
};
static const char short_options[] = "B:C:D:E:F:H:I:K:L:M:N:b:d:e:f:hkl:m:o:r:u:vw";
......@@ -300,6 +303,7 @@ static const struct long_option long_options[] =
{ "subsystem", 1, LONG_OPT_SUBSYSTEM },
{ "syscall-table", 1, LONG_OPT_SYSCALL_TABLE },
{ "version", 0, LONG_OPT_VERSION },
{ "without-dlltool", 0, LONG_OPT_WITHOUT_DLLTOOL },
/* aliases for short options */
{ "target", 1, 'b' },
{ "delay-lib", 1, 'd' },
......@@ -531,6 +535,9 @@ static void option_callback( int optc, char *optarg )
case LONG_OPT_VERSION:
printf( "winebuild version " PACKAGE_VERSION "\n" );
exit(0);
case LONG_OPT_WITHOUT_DLLTOOL:
use_dlltool = 0;
break;
case '?':
fprintf( stderr, "winebuild: %s\n\n", optarg );
usage(1);
......
......@@ -279,6 +279,9 @@ Display the program version and exit.
.TP
.B \-w, --warnings
Turn on warnings.
.TP
.B \--without-dlltool
Generate import library without using dlltool.
.SH "SPEC FILE SYNTAX"
.SS "General syntax"
A spec file should contain a list of ordinal declarations. The general
......
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