makefiles: Allow using EXTRADLLFLAGS instead of APPMODE.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
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 MODULE = notepad.exe
APPMODE = -mwindows -mno-cygwin
IMPORTS = comdlg32 shell32 shlwapi user32 gdi32 advapi32 IMPORTS = comdlg32 shell32 shlwapi user32 gdi32 advapi32
EXTRADLLFLAGS = -mwindows -mno-cygwin
C_SRCS = \ C_SRCS = \
dialog.c \ dialog.c \
main.c main.c

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,8 @@
MODULE = xcopy.exe MODULE = xcopy.exe
APPMODE = -mconsole -municode -mno-cygwin
IMPORTS = shell32 user32 IMPORTS = shell32 user32
EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
C_SRCS = \ C_SRCS = \
xcopy.c xcopy.c

View File

@ -229,7 +229,7 @@ sub parse_makefile($)
{ {
die "Configure substitution is not allowed in $file" unless $file eq "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; my $var = $1;
$make{$var} = $2; $make{$var} = $2;
@ -438,18 +438,21 @@ sub update_makefiles(@)
elsif (defined($make{"MODULE"})) # dll or program elsif (defined($make{"MODULE"})) # dll or program
{ {
(my $name = $file) =~ s/^(dlls|programs)\/(.*)\/Makefile/$2/; (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 "MODULE should not be defined in $file" unless $file =~ /^(dlls|programs)\//;
die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
die "Invalid MODULE in $file" if $name =~ /\./ && $make{"MODULE"} ne $name; die "Invalid MODULE in $file" if $name =~ /\./ && $make{"MODULE"} ne $name;
if ($file =~ /^programs\//) if ($file =~ /^programs\//)
{ {
die "APPMODE should be defined in $file" unless defined $make{"APPMODE"} ; die "EXTRADLLFLAGS should be defined in $file" unless $dllflags;
die "APPMODE should contain -mconsole or -mwindows in $file" unless $make{"APPMODE"} =~ /-m(console|windows)/; 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"; die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.exe";
} }
else else
{ {
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"} ; 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"; die "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.dll";
} }
if (defined $make{"IMPORTLIB"}) if (defined $make{"IMPORTLIB"})
@ -462,6 +465,7 @@ sub update_makefiles(@)
elsif ($file =~ /^tools.*\/Makefile$/) elsif ($file =~ /^tools.*\/Makefile$/)
{ {
die "APPMODE should not be defined in $file" if defined $make{"APPMODE"}; 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"}; die "STATICLIB should not be defined in $file" if defined $make{"STATICLIB"};
$args = ",,[test \"x\$enable_tools\" = xno]"; $args = ",,[test \"x\$enable_tools\" = xno]";
} }