Alexandre Julliard : makefiles: Unify APPMODE and EXTRADLLFLAGS variables.
Alexandre Julliard
julliard at winehq.org
Tue Apr 9 16:31:02 CDT 2019
Module: wine
Branch: master
Commit: 1d6a4102444f0f2dfd9f131ad4dc9811343cbd0d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1d6a4102444f0f2dfd9f131ad4dc9811343cbd0d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Apr 9 10:13:37 2019 +0200
makefiles: Unify APPMODE and EXTRADLLFLAGS variables.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/rundll.exe16/Makefile.in | 2 +-
programs/svchost/Makefile.in | 2 +-
programs/winhelp.exe16/Makefile.in | 2 +-
programs/winoldap.mod16/Makefile.in | 2 +-
tools/make_makefiles | 1 +
tools/makedep.c | 29 +++++++++++++++--------------
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/programs/rundll.exe16/Makefile.in b/programs/rundll.exe16/Makefile.in
index fe08104..4ea0fe9 100644
--- a/programs/rundll.exe16/Makefile.in
+++ b/programs/rundll.exe16/Makefile.in
@@ -1,4 +1,4 @@
MODULE = rundll.exe16
-APPMODE = -m16
+APPMODE = -mconsole -m16
C_SRCS = rundll.c
diff --git a/programs/svchost/Makefile.in b/programs/svchost/Makefile.in
index b24af3b..0cbf5be 100644
--- a/programs/svchost/Makefile.in
+++ b/programs/svchost/Makefile.in
@@ -1,5 +1,5 @@
MODULE = svchost.exe
-APPMODE = -municode
+APPMODE = -mconsole -municode
IMPORTS = advapi32
C_SRCS = \
diff --git a/programs/winhelp.exe16/Makefile.in b/programs/winhelp.exe16/Makefile.in
index ad1695b..a9deacb 100644
--- a/programs/winhelp.exe16/Makefile.in
+++ b/programs/winhelp.exe16/Makefile.in
@@ -1,4 +1,4 @@
MODULE = winhelp.exe16
-APPMODE = -m16
+APPMODE = -mconsole -m16
C_SRCS = winhelp.c
diff --git a/programs/winoldap.mod16/Makefile.in b/programs/winoldap.mod16/Makefile.in
index cedf378..01fbf78 100644
--- a/programs/winoldap.mod16/Makefile.in
+++ b/programs/winoldap.mod16/Makefile.in
@@ -1,4 +1,4 @@
MODULE = winoldap.mod16
-APPMODE = -m16
+APPMODE = -mconsole -m16
C_SRCS = winoldap.c
diff --git a/tools/make_makefiles b/tools/make_makefiles
index 455ff9e..3936310 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -445,6 +445,7 @@ sub update_makefiles(@)
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 "Invalid MODULE in $file" unless $name =~ /\./ || $make{"MODULE"} eq "$name.exe";
}
else
diff --git a/tools/makedep.c b/tools/makedep.c
index 20fec7f..227d589 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -170,7 +170,6 @@ struct makefile
struct strarray define_args;
struct strarray programs;
struct strarray scripts;
- struct strarray appmode;
struct strarray imports;
struct strarray subdirs;
struct strarray delayimports;
@@ -195,6 +194,7 @@ struct makefile
int disabled;
int use_msvcrt;
int is_win16;
+ int is_exe;
struct makefile **submakes;
/* values generated at output time */
@@ -2143,11 +2143,11 @@ static struct strarray get_default_imports( const struct makefile *make )
struct strarray ret = empty_strarray;
if (strarray_exists( &make->extradllflags, "-nodefaultlibs" )) return ret;
- if (strarray_exists( &make->appmode, "-mno-cygwin" )) strarray_add( &ret, "msvcrt" );
+ if (strarray_exists( &make->extradllflags, "-mno-cygwin" )) strarray_add( &ret, "msvcrt" );
+ strarray_add( &ret, "winecrt0" );
if (make->is_win16) strarray_add( &ret, "kernel" );
strarray_add( &ret, "kernel32" );
strarray_add( &ret, "ntdll" );
- strarray_add( &ret, "winecrt0" );
return ret;
}
@@ -3070,8 +3070,7 @@ static void output_module( struct makefile *make )
char *spec_file = NULL;
unsigned int i;
- if (!make->appmode.count)
- spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" ));
+ if (!make->is_exe) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" ));
strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->delayimports, 0 ));
strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->imports, 0 ));
add_import_libs( make, &dep_libs, get_default_imports( make ), 0 ); /* dependencies only */
@@ -3106,10 +3105,10 @@ static void output_module( struct makefile *make )
output_winegcc_command( make, 0 );
if (spec_file)
{
- output( " -shared %s", spec_file );
- output_filenames( make->extradllflags );
+ output_filename( "-shared" );
+ output_filename( spec_file );
}
- else output_filenames( make->appmode );
+ output_filenames( make->extradllflags );
output_filenames_obj_dir( make, make->object_files );
output_filenames_obj_dir( make, make->res_files );
output_filenames( all_libs );
@@ -3257,7 +3256,7 @@ static void output_test_module( struct makefile *make )
strarray_add( &make->clean_files, strmake( "%s%s", stripped, ext ));
output( "%s%s:\n", obj_dir_path( make, testmodule ), ext );
output_winegcc_command( make, !!crosstarget );
- output_filenames( make->appmode );
+ output_filenames( make->extradllflags );
output_filenames_obj_dir( make, crosstarget ? make->crossobj_files : make->object_files );
output_filenames_obj_dir( make, make->res_files );
output_filenames( all_libs );
@@ -3267,7 +3266,7 @@ static void output_test_module( struct makefile *make )
output_winegcc_command( make, !!crosstarget );
output_filename( "-s" );
output_filename( strmake( "-Wb,-F,%s", testmodule ));
- output_filenames( make->appmode );
+ output_filenames( make->extradllflags );
output_filenames_obj_dir( make, crosstarget ? make->crossobj_files : make->object_files );
output_filenames_obj_dir( make, make->res_files );
output_filenames( all_libs );
@@ -3469,7 +3468,7 @@ static void output_subdirs( struct makefile *make )
if (!submake->staticlib)
{
strarray_add( &builddeps_deps, subdir );
- if (!submake->appmode.count)
+ if (!submake->is_exe)
{
output( "manpages htmlpages sgmlpages xmlpages::\n" );
output( "\t at cd %s && $(MAKE) $@\n", subdir );
@@ -3977,7 +3976,6 @@ static void load_sources( struct makefile *make )
make->programs = get_expanded_make_var_array( make, "PROGRAMS" );
make->scripts = get_expanded_make_var_array( make, "SCRIPTS" );
- make->appmode = get_expanded_make_var_array( make, "APPMODE" );
make->imports = get_expanded_make_var_array( make, "IMPORTS" );
make->delayimports = get_expanded_make_var_array( make, "DELAYIMPORTS" );
make->extradllflags = get_expanded_make_var_array( make, "EXTRADLLFLAGS" );
@@ -3987,9 +3985,12 @@ static void load_sources( struct makefile *make )
if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module;
+ strarray_addall( &make->extradllflags, get_expanded_make_var_array( make, "APPMODE" ));
make->disabled = make->base_dir && strarray_exists( &disabled_dirs, make->base_dir );
- make->is_win16 = strarray_exists( &make->extradllflags, "-m16" ) || strarray_exists( &make->appmode, "-m16" );
- make->use_msvcrt = strarray_exists( &make->appmode, "-mno-cygwin" );
+ make->is_win16 = strarray_exists( &make->extradllflags, "-m16" );
+ make->use_msvcrt = strarray_exists( &make->extradllflags, "-mno-cygwin" );
+ make->is_exe = strarray_exists( &make->extradllflags, "-mconsole" ) ||
+ strarray_exists( &make->extradllflags, "-mwindows" );
for (i = 0; i < make->imports.count && !make->use_msvcrt; i++)
make->use_msvcrt = !strncmp( make->imports.str[i], "msvcr", 5 ) ||
More information about the wine-cvs
mailing list