Commit aa15f41d authored by Alexandre Julliard's avatar Alexandre Julliard

makedep: Make the spec file optional for native modules.

parent f1ff3179
MODULE = fltmgr.sys
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
SOURCES = \
fltmgr.sys.spec \
main.c
......@@ -2,7 +2,7 @@ MODULE = ksecdd.sys
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
main.c
RC_SRCS = version.rc
SOURCES = \
ksecdd.sys.spec \
main.c \
version.rc
......@@ -3,5 +3,6 @@ IMPORTS = advapi32 ntoskrnl iphlpapi
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
main.c
SOURCES = \
main.c \
ndis.sys.spec
......@@ -4,5 +4,6 @@ IMPORTS = ntoskrnl ws2_32
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
netio.c
SOURCES = \
netio.c \
netio.sys.spec
......@@ -3,5 +3,6 @@ IMPORTS = ntoskrnl
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
scsiport.c
SOURCES = \
scsiport.c \
scsiport.sys.spec
......@@ -2,5 +2,6 @@ MODULE = tdi.sys
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
main.c
SOURCES = \
main.c \
tdi.sys.spec
......@@ -4,5 +4,6 @@ IMPORTS = ntoskrnl
EXTRADLLFLAGS = -Wl,--subsystem,native
C_SRCS = \
usbd.c
SOURCES = \
usbd.c \
usbd.sys.spec
......@@ -382,7 +382,9 @@ sub assign_sources_to_makefiles(@)
elsif ($name =~ /\.spec$/)
{
my $dllflags = ${$make}{"EXTRADLLFLAGS"} || "";
next unless defined ${$make}{"TESTDLL"} || ($dllflags =~ /-Wb,--data-only/);
next unless defined ${$make}{"TESTDLL"} ||
($dllflags =~ /-Wb,--data-only/) ||
($dllflags =~ /-Wl,--subsystem,native/);
}
elsif ($name =~ /\.nls$/)
{
......
......@@ -3304,15 +3304,13 @@ static const struct
/*******************************************************************
* output_fake_module
*/
static void output_fake_module( struct makefile *make )
static void output_fake_module( struct makefile *make, const char *spec_file )
{
unsigned int arch = 0; /* fake modules are always native */
const char *spec_file = NULL, *name = strmake( "%s%s", arch_pe_dirs[arch], make->module );
const char *name = strmake( "%s%s", arch_pe_dirs[arch], make->module );
if (make->disabled[arch]) return;
if (!make->is_exe) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" ));
strarray_add( &make->all_targets[arch], name );
add_install_rule( make, make->module, arch, name, strmake( "d$(dlldir)/%s", name ));
......@@ -3324,11 +3322,8 @@ static void output_fake_module( struct makefile *make )
output( "\n" );
output_winegcc_command( make, arch );
output_filename( "-Wb,--fake-module" );
if (spec_file)
{
output_filename( "-shared" );
output_filename( spec_file );
}
if (!make->is_exe) output_filename( "-shared" );
if (spec_file) output_filename( spec_file );
output_filenames( make->extradllflags );
output_filenames_obj_dir( make, make->res_files[arch] );
output( "\n" );
......@@ -3353,7 +3348,7 @@ static void output_module( struct makefile *make, unsigned int arch )
if (!make->is_exe)
{
if (make->data_only)
if (make->data_only || strarray_exists( &make->extradllflags, "-Wl,--subsystem,native" ))
{
/* spec file is optional */
struct incl_file *spec = find_src_file( make, replace_extension( make->module, ".dll", ".spec" ));
......@@ -3415,7 +3410,7 @@ static void output_module( struct makefile *make, unsigned int arch )
output_filename( arch_make_variable( "LDFLAGS", arch ));
output( "\n" );
if (!make->data_only && !arch && unix_lib_supported) output_fake_module( make );
if (!make->data_only && !arch && unix_lib_supported) output_fake_module( make, spec_file );
}
......
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