makefiles: Allow using EXTRADLLFLAGS instead of APPMODE.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-04-24 11:27:39 +02:00
parent 7118bfedd8
commit a58f4abc08
7 changed files with 19 additions and 9 deletions

View File

@ -1,7 +1,8 @@
MODULE = notepad.exe
APPMODE = -mwindows -mno-cygwin
IMPORTS = comdlg32 shell32 shlwapi user32 gdi32 advapi32
EXTRADLLFLAGS = -mwindows -mno-cygwin
C_SRCS = \
dialog.c \
main.c

View File

@ -1,8 +1,9 @@
MODULE = reg.exe
APPMODE = -mconsole -municode -mno-cygwin
IMPORTS = advapi32
DELAYIMPORTS = user32
EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
C_SRCS = \
export.c \
import.c \

View File

@ -1,8 +1,9 @@
MODULE = regedit.exe
APPMODE = -mwindows -municode -mno-cygwin
IMPORTS = advapi32
DELAYIMPORTS = shlwapi shell32 comdlg32 comctl32 user32 gdi32
EXTRADLLFLAGS = -mwindows -municode -mno-cygwin
C_SRCS = \
about.c \
childwnd.c \

View File

@ -1,7 +1,8 @@
MODULE = taskmgr.exe
APPMODE = -mwindows -mno-cygwin
IMPORTS = shell32 shlwapi comctl32 user32 gdi32 advapi32
EXTRADLLFLAGS = -mwindows -mno-cygwin
C_SRCS = \
about.c \
affinity.c \

View File

@ -1,7 +1,8 @@
MODULE = wordpad.exe
APPMODE = -mwindows -mno-cygwin
IMPORTS = comdlg32 uuid ole32 shell32 user32 gdi32 advapi32 comctl32
EXTRADLLFLAGS = -mwindows -mno-cygwin
C_SRCS = \
olecallback.c \
print.c \

View File

@ -1,7 +1,8 @@
MODULE = xcopy.exe
APPMODE = -mconsole -municode -mno-cygwin
IMPORTS = shell32 user32
EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
C_SRCS = \
xcopy.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)\s*=\s*(.*)/)
if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE|EXTRADLLFLAGS)\s*=\s*(.*)/)
{
my $var = $1;
$make{$var} = $2;
@ -438,18 +438,21 @@ sub update_makefiles(@)
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 "MODULE should not be defined in $file" unless $file =~ /^(dlls|programs)\//;
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
die "Invalid MODULE in $file" if $name =~ /\./ && $make{"MODULE"} ne $name;
if ($file =~ /^programs\//)
{
die "APPMODE should be defined in $file" unless defined $make{"APPMODE"} ;
die "APPMODE should contain -mconsole or -mwindows in $file" unless $make{"APPMODE"} =~ /-m(console|windows)/;
die "EXTRADLLFLAGS should be defined in $file" unless $dllflags;
die "EXTRADLLFLAGS should contain -mconsole or -mwindows in $file" unless $dllflags =~ /-m(console|windows)/;
die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.exe";
}
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.dll";
}
if (defined $make{"IMPORTLIB"})
@ -462,6 +465,7 @@ 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 "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
$args = ",,[test \"x\$enable_tools\" = xno]";
}