makefiles: Use the STATICLIB variable for static import libraries.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-10-06 10:20:26 +02:00
parent c60d604544
commit 518f9a12c1
14 changed files with 24 additions and 26 deletions

View File

@ -1,4 +1,4 @@
MODULE = libadsiid.a
STATICLIB = libadsiid.a
C_SRCS = \
adsiid.c

View File

@ -1,4 +1,4 @@
MODULE = libdmoguids.a
STATICLIB = libdmoguids.a
C_SRCS = \
dmoguids.c

View File

@ -1,4 +1,4 @@
MODULE = libdxerr8.a
STATICLIB = libdxerr8.a
C_SRCS = \
dxerr8.c

View File

@ -1,4 +1,4 @@
MODULE = libdxerr9.a
STATICLIB = libdxerr9.a
C_SRCS = \
dxerr9.c

View File

@ -1,4 +1,4 @@
MODULE = libdxguid.a
STATICLIB = libdxguid.a
C_SRCS = \
dx10guid.c \

View File

@ -1,4 +1,4 @@
MODULE = libmfuuid.a
STATICLIB = libmfuuid.a
C_SRCS = \
mfplay.c \

View File

@ -1,4 +1,4 @@
MODULE = libstrmbase.a
STATICLIB = libstrmbase.a
C_SRCS = \
dispatch.c \

View File

@ -1,4 +1,4 @@
MODULE = libstrmiids.a
STATICLIB = libstrmiids.a
C_SRCS = \
evr.c \

View File

@ -1,4 +1,4 @@
MODULE = libuuid.a
STATICLIB = libuuid.a
C_SRCS = \
d2d.c \

View File

@ -1,4 +1,4 @@
MODULE = libwbemuuid.a
STATICLIB = libwbemuuid.a
C_SRCS = \
wbemuuid.c

View File

@ -1,4 +1,4 @@
MODULE = libwinecrt0.a
STATICLIB = libwinecrt0.a
C_SRCS = \
crt_dllmain.c \

View File

@ -1,4 +1,4 @@
MODULE = libwmcodecdspuuid.a
STATICLIB = libwmcodecdspuuid.a
C_SRCS = \
wmcodecdspuuid.c

View File

@ -229,7 +229,7 @@ sub parse_makefile($)
{
die "Configure substitution is not allowed in $file" unless $file eq "Makefile";
}
if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE|EXTRADLLFLAGS)\s*=\s*(.*)/)
if (/^\s*(MODULE|IMPORTLIB|TESTDLL|STATICLIB|PARENTSRC|EXTRADLLFLAGS)\s*=\s*(.*)/)
{
my $var = $1;
$make{$var} = $2;
@ -433,17 +433,16 @@ sub update_makefiles(@)
die "MODULE should not be defined in $file" if defined $make{"MODULE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
}
elsif (defined($make{"MODULE"}) && $make{"MODULE"} =~ /\.a$/) # import lib
elsif (defined($make{"STATICLIB"}))
{
die "MODULE should not be defined as static lib in $file" unless $file =~ /^dlls\//;
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
die "MODULE should not be defined in $file" if defined $make{"MODULE"};
die "invalid STATICLIB name" unless $make{"STATICLIB"} =~ /\.a$/;
}
elsif (defined($make{"MODULE"})) # dll or program
{
(my $name = $file) =~ s/^(dlls|programs)\/(.*)\/Makefile/$2/;
my $dllflags = $make{"EXTRADLLFLAGS"} || "";
if (defined $make{"APPMODE"}) { $dllflags .= " " . $make{"APPMODE"}; }
die "invalid MODULE name" if $make{"MODULE"} =~ /\.a$/;
die "MODULE should not be defined in $file" unless $file =~ /^(dlls|programs)\//;
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
if ($file =~ /^programs\//)
@ -454,7 +453,6 @@ sub update_makefiles(@)
}
else
{
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"} ;
die "EXTRADLLFLAGS should not contain -mconsole or -mwindows in $file" if $dllflags =~ /-m(console|windows)/;
die "Invalid MODULE in $file" unless ($name =~ /\./ && $make{"MODULE"} eq $name) || $make{"MODULE"} eq "$name.dll";
}
@ -467,9 +465,9 @@ sub update_makefiles(@)
}
elsif ($file =~ /^tools.*\/Makefile$/)
{
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"};
die "EXTRADLLFLAGS should not be defined in $file" if defined $make{"EXTRADLLFLAGS"};
die "MODULE should not be defined in $file" if defined $make{"MODULE"};
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
die "EXTRADLLFLAGS should not be defined in $file" if defined $make{"EXTRADLLFLAGS"};
$args = ",,[test \"x\$enable_tools\" = xno]";
}
push @lines, "WINE_CONFIG_MAKEFILE($dir$args)\n";

View File

@ -2965,12 +2965,12 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
find_src_file( make, replace_extension( source->name, ".c", ".spec" )));
int need_cross = (crosstarget &&
!(source->file->flags & FLAG_C_UNIX) &&
(make->is_cross || (make->module && make->staticlib) ||
(make->is_cross || make->staticlib ||
(source->file->flags & FLAG_C_IMPLIB)));
int need_obj = ((*dll_ext || !(source->file->flags & FLAG_C_UNIX)) &&
(!need_cross ||
(source->file->flags & FLAG_C_IMPLIB) ||
(make->module && make->staticlib)));
make->staticlib));
if ((source->file->flags & FLAG_GENERATED) &&
(!make->testdll || !strendswith( source->filename, "testlist.c" )))
@ -2988,11 +2988,11 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
output( "%s.o: %s\n", obj_dir_path( make, obj ), source->filename );
output( "\t%s$(CC) -c -o $@ %s", cmd_prefix( "CC" ), source->filename );
output_filenames( defines );
if (make->sharedlib || (make->staticlib && !make->module) || (source->file->flags & FLAG_C_UNIX))
if (make->sharedlib || (source->file->flags & FLAG_C_UNIX))
{
output_filenames( unix_dllflags );
}
else if (make->module || make->staticlib || make->testdll)
else if (make->module || make->testdll)
{
output_filenames( dll_flags );
if (source->use_msvcrt) output_filenames( msvcrt_flags );
@ -4084,7 +4084,7 @@ static void load_sources( struct makefile *make )
make->install_dev = get_expanded_make_var_array( make, "INSTALL_DEV" );
make->extra_targets = get_expanded_make_var_array( make, "EXTRA_TARGETS" );
if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module;
if (make->staticlib) make->module = make->staticlib;
make->disabled = make->obj_dir && strarray_exists( &disabled_dirs, make->obj_dir );
make->is_win16 = strarray_exists( &make->extradllflags, "-m16" );