diff --git a/Make.rules.in b/Make.rules.in index 947419e2cb8..ec79531e376 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -11,7 +11,7 @@ # First some useful definitions -ALLCFLAGS = $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS) +ALLCFLAGS = $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) IDLFLAGS = $(EXTRAIDLFLAGS) RCFLAGS = --nostdinc $(PORCFLAGS) diff --git a/Make.vars.in b/Make.vars.in index 6bec69790ef..d7046877ba9 100644 --- a/Make.vars.in +++ b/Make.vars.in @@ -22,6 +22,7 @@ CROSSCC = @CROSSCC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ EXTRACFLAGS = @EXTRACFLAGS@ +MSVCRTFLAGS = @BUILTINFLAG@ TARGETFLAGS = @TARGETFLAGS@ LIBS = @LIBS@ BISON = @BISON@ diff --git a/configure b/configure index 4603d9553e1..b1449ac1944 100755 --- a/configure +++ b/configure @@ -14388,6 +14388,8 @@ install install-lib:: $wine_binary-preloader uninstall:: \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader + +preloader_EXTRADEFS = $BUILTINFLAG " ;; esac ;; diff --git a/configure.ac b/configure.ac index eb780fa505c..10e9921e90d 100644 --- a/configure.ac +++ b/configure.ac @@ -1994,6 +1994,8 @@ install install-lib:: $wine_binary-preloader uninstall:: \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader + +preloader_EXTRADEFS = $BUILTINFLAG "]) ;; esac ;; diff --git a/dlls/crtdll/Makefile.in b/dlls/crtdll/Makefile.in index 63e4e8fafce..3d99961ee09 100644 --- a/dlls/crtdll/Makefile.in +++ b/dlls/crtdll/Makefile.in @@ -1,8 +1,6 @@ MODULE = crtdll.dll IMPORTLIB = crtdll IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ crtdll_main.c diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 26261bcaf03..a5614129b52 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -17,7 +17,6 @@ */ #include "config.h" -#include "wine/port.h" #include diff --git a/dlls/msvcp100/Makefile.in b/dlls/msvcp100/Makefile.in index 56a1eeef2bc..07da90389bd 100644 --- a/dlls/msvcp100/Makefile.in +++ b/dlls/msvcp100/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp100.dll IMPORTS = msvcr100 -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRADEFS = -D_MSVCP_VER=100 PARENTSRC = ../msvcp90 diff --git a/dlls/msvcp100/tests/Makefile.in b/dlls/msvcp100/tests/Makefile.in index a215e26c6bd..3414a300fd0 100644 --- a/dlls/msvcp100/tests/Makefile.in +++ b/dlls/msvcp100/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcp100.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ misc.c \ diff --git a/dlls/msvcp110/Makefile.in b/dlls/msvcp110/Makefile.in index e8edd6cc58a..61de67022ec 100644 --- a/dlls/msvcp110/Makefile.in +++ b/dlls/msvcp110/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp110.dll IMPORTS = msvcr110 -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRADEFS = -D_MSVCP_VER=110 PARENTSRC = ../msvcp90 diff --git a/dlls/msvcp60/Makefile.in b/dlls/msvcp60/Makefile.in index 0509c122d2c..4a0ab0654b1 100644 --- a/dlls/msvcp60/Makefile.in +++ b/dlls/msvcp60/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp60.dll IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ exception.c \ diff --git a/dlls/msvcp60/tests/Makefile.in b/dlls/msvcp60/tests/Makefile.in index 366b0495b7f..037f00f6b1c 100644 --- a/dlls/msvcp60/tests/Makefile.in +++ b/dlls/msvcp60/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcp60.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ ios.c \ diff --git a/dlls/msvcp71/Makefile.in b/dlls/msvcp71/Makefile.in index 4d7d6f6db23..03ce2cbbd5c 100644 --- a/dlls/msvcp71/Makefile.in +++ b/dlls/msvcp71/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp71.dll IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRADEFS = -D_MSVCP_VER=71 PARENTSRC = ../msvcp90 diff --git a/dlls/msvcp80/Makefile.in b/dlls/msvcp80/Makefile.in index 5a6059d58a0..c541c1b0d11 100644 --- a/dlls/msvcp80/Makefile.in +++ b/dlls/msvcp80/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp80.dll IMPORTS = msvcr80 -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRADEFS = -D_MSVCP_VER=80 PARENTSRC = ../msvcp90 diff --git a/dlls/msvcp90/Makefile.in b/dlls/msvcp90/Makefile.in index 7fdaaa3f659..502b981a7c2 100644 --- a/dlls/msvcp90/Makefile.in +++ b/dlls/msvcp90/Makefile.in @@ -1,7 +1,5 @@ MODULE = msvcp90.dll IMPORTS = msvcr90 -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt EXTRADEFS = -D_MSVCP_VER=90 C_SRCS = \ diff --git a/dlls/msvcp90/tests/Makefile.in b/dlls/msvcp90/tests/Makefile.in index cc893674eac..59bfadac2be 100644 --- a/dlls/msvcp90/tests/Makefile.in +++ b/dlls/msvcp90/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcp90.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ ios.c \ diff --git a/dlls/msvcr100/Makefile.in b/dlls/msvcr100/Makefile.in index 23f4949de09..06c7a219897 100644 --- a/dlls/msvcr100/Makefile.in +++ b/dlls/msvcr100/Makefile.in @@ -1,8 +1,6 @@ MODULE = msvcr100.dll IMPORTLIB = msvcr100 IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr100.c diff --git a/dlls/msvcr100/tests/Makefile.in b/dlls/msvcr100/tests/Makefile.in index 8568c163eb4..97480bb6cc3 100644 --- a/dlls/msvcr100/tests/Makefile.in +++ b/dlls/msvcr100/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcr100.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr100.c diff --git a/dlls/msvcr110/Makefile.in b/dlls/msvcr110/Makefile.in index e2cd98979c5..e0a3c9cee63 100644 --- a/dlls/msvcr110/Makefile.in +++ b/dlls/msvcr110/Makefile.in @@ -1,8 +1,6 @@ MODULE = msvcr110.dll IMPORTLIB = msvcr110 IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr110.c diff --git a/dlls/msvcr80/Makefile.in b/dlls/msvcr80/Makefile.in index e6502e3fc99..deafe35e9d4 100644 --- a/dlls/msvcr80/Makefile.in +++ b/dlls/msvcr80/Makefile.in @@ -1,8 +1,6 @@ MODULE = msvcr80.dll IMPORTLIB = msvcr80 IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr80.c diff --git a/dlls/msvcr90/Makefile.in b/dlls/msvcr90/Makefile.in index b7634294e38..1de29fc441a 100644 --- a/dlls/msvcr90/Makefile.in +++ b/dlls/msvcr90/Makefile.in @@ -1,8 +1,6 @@ MODULE = msvcr90.dll IMPORTLIB = msvcr90 IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr90.c diff --git a/dlls/msvcr90/tests/Makefile.in b/dlls/msvcr90/tests/Makefile.in index c94c97ca3c3..172e14626f9 100644 --- a/dlls/msvcr90/tests/Makefile.in +++ b/dlls/msvcr90/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcr90.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ msvcr90.c diff --git a/dlls/msvcrt/tests/Makefile.in b/dlls/msvcrt/tests/Makefile.in index e5f601f06a9..2db553d7aec 100644 --- a/dlls/msvcrt/tests/Makefile.in +++ b/dlls/msvcrt/tests/Makefile.in @@ -1,7 +1,6 @@ TESTDLL = msvcrt.dll APPMODE = -mno-cygwin -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -I$(srcdir)/.. +EXTRAINCL = -I$(srcdir)/.. C_SRCS = \ cpp.c \ diff --git a/dlls/msvcrtd/Makefile.in b/dlls/msvcrtd/Makefile.in index b784dc86153..262d558af56 100644 --- a/dlls/msvcrtd/Makefile.in +++ b/dlls/msvcrtd/Makefile.in @@ -1,8 +1,6 @@ MODULE = msvcrtd.dll IMPORTLIB = msvcrtd IMPORTS = msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRAINCL = -I$(top_srcdir)/include/msvcrt C_SRCS = \ debug.c diff --git a/dlls/msvcrtd/tests/Makefile.in b/dlls/msvcrtd/tests/Makefile.in index 688938cf36d..d86815a8239 100644 --- a/dlls/msvcrtd/tests/Makefile.in +++ b/dlls/msvcrtd/tests/Makefile.in @@ -1,7 +1,5 @@ TESTDLL = msvcrtd.dll APPMODE = -mno-cygwin -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -MODCFLAGS = @BUILTINFLAG@ C_SRCS = \ debug.c diff --git a/loader/Makefile.in b/loader/Makefile.in index 2c81e26f154..48e41bbe4b4 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -1,4 +1,3 @@ -MODCFLAGS = @BUILTINFLAG@ EXTRALIBS = @LIBPTHREAD@ C_SRCS = \ diff --git a/programs/notepad/Makefile.in b/programs/notepad/Makefile.in index 90d0df3fa87..26e977d8e74 100644 --- a/programs/notepad/Makefile.in +++ b/programs/notepad/Makefile.in @@ -1,9 +1,6 @@ MODULE = notepad.exe APPMODE = -mwindows -mno-cygwin IMPORTS = comdlg32 shell32 shlwapi user32 gdi32 advapi32 -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -MODCFLAGS = @BUILTINFLAG@ -EXTRADEFS = -DNO_LIBWINE_PORT C_SRCS = \ dialog.c \ diff --git a/programs/regedit/Makefile.in b/programs/regedit/Makefile.in index 075fb96ecb5..c5dfd81f535 100644 --- a/programs/regedit/Makefile.in +++ b/programs/regedit/Makefile.in @@ -2,9 +2,6 @@ MODULE = regedit.exe APPMODE = -mwindows -mno-cygwin IMPORTS = advapi32 DELAYIMPORTS = shlwapi shell32 comdlg32 comctl32 user32 gdi32 -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -EXTRADEFS = -DNO_LIBWINE_PORT -MODCFLAGS = @BUILTINFLAG@ C_SRCS = \ about.c \ diff --git a/programs/taskmgr/Makefile.in b/programs/taskmgr/Makefile.in index 9f9b73da0df..17430249f74 100644 --- a/programs/taskmgr/Makefile.in +++ b/programs/taskmgr/Makefile.in @@ -1,9 +1,6 @@ MODULE = taskmgr.exe APPMODE = -mwindows -mno-cygwin IMPORTS = psapi shell32 comctl32 user32 gdi32 advapi32 -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -EXTRADEFS = -DNO_LIBWINE_PORT -MODCFLAGS = @BUILTINFLAG@ C_SRCS = \ about.c \ diff --git a/programs/wordpad/Makefile.in b/programs/wordpad/Makefile.in index f30443b500c..ff244349349 100644 --- a/programs/wordpad/Makefile.in +++ b/programs/wordpad/Makefile.in @@ -1,9 +1,6 @@ MODULE = wordpad.exe APPMODE = -mwindows -mno-cygwin IMPORTS = comdlg32 uuid ole32 shell32 user32 gdi32 advapi32 comctl32 -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -EXTRADEFS = -DNO_LIBWINE_PORT -MODCFLAGS = @BUILTINFLAG@ C_SRCS = \ olecallback.c \ diff --git a/programs/xcopy/Makefile.in b/programs/xcopy/Makefile.in index 4a2fd79e43d..05931c525d6 100644 --- a/programs/xcopy/Makefile.in +++ b/programs/xcopy/Makefile.in @@ -1,8 +1,6 @@ MODULE = xcopy.exe APPMODE = -mconsole -municode -mno-cygwin IMPORTS = shell32 user32 -EXTRAINCL = -I$(top_srcdir)/include/msvcrt -MODCFLAGS = @BUILTINFLAG@ C_SRCS = \ xcopy.c diff --git a/tools/makedep.c b/tools/makedep.c index 20b10644af2..3295359ab72 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -93,6 +93,9 @@ static const struct strarray empty_strarray; static struct strarray include_args; static struct strarray define_args; +static struct strarray appmode; +static struct strarray dllflags; +static struct strarray imports; static struct strarray make_vars; static struct strarray cmdline_vars; @@ -1393,8 +1396,6 @@ static struct strarray output_sources(void) struct strarray includes = empty_strarray; struct strarray subdirs = empty_strarray; struct strarray phony_targets = empty_strarray; - struct strarray dllflags = get_expanded_make_var_array( "DLLFLAGS" ); - struct strarray imports = get_expanded_make_var_array( "IMPORTS" ); struct strarray all_targets = get_expanded_make_var_array( "PROGRAMS" ); struct strarray targetflags = get_expanded_make_var_array( "TARGETFLAGS" ); struct strarray delayimports = get_expanded_make_var_array( "DELAYIMPORTS" ); @@ -1402,7 +1403,6 @@ static struct strarray output_sources(void) char *module = get_expanded_make_variable( "MODULE" ); char *exeext = get_expanded_make_variable( "EXEEXT" ); char *testdll = get_expanded_make_variable( "TESTDLL" ); - char *appmode = get_expanded_make_variable( "APPMODE" ); char *staticlib = get_expanded_make_variable( "STATICLIB" ); char *crosstarget = get_expanded_make_variable( "CROSSTARGET" ); @@ -1690,7 +1690,7 @@ static struct strarray output_sources(void) { char *importlib = get_expanded_make_variable( "IMPORTLIB" ); struct strarray all_libs = empty_strarray; - char *spec_file = appmode ? NULL : replace_extension( module, ".dll", ".spec" ); + char *spec_file = appmode.count ? NULL : replace_extension( module, ".dll", ".spec" ); if (spec_file && src_dir) spec_file = strmake( "%s/%s", src_dir, spec_file ); for (i = 0; i < delayimports.count; i++) @@ -1726,7 +1726,7 @@ static struct strarray output_sources(void) output( " -shared %s", spec_file ); output_filenames( extradllflags ); } - else output_filename( appmode ); + else output_filenames( appmode ); output_filenames( object_files ); output_filenames( res_files ); output_filenames( all_libs ); @@ -1857,7 +1857,7 @@ static struct strarray output_sources(void) output( "%s%s:\n", testmodule, dllext ); output( "\t$(WINEGCC) -o $@" ); output_filenames( targetflags ); - if (appmode) output_filename( appmode ); + output_filenames( appmode ); output_filenames( object_files ); output_filenames( res_files ); output_filenames( all_libs ); @@ -1867,7 +1867,7 @@ static struct strarray output_sources(void) output( "\t$(WINEGCC) -s -o $@" ); output_filenames( targetflags ); output_filename( strmake( "-Wb,-F,%s", testmodule )); - if (appmode) output_filename( appmode ); + output_filenames( appmode ); output_filenames( object_files ); output_filenames( res_files ); output_filenames( all_libs ); @@ -2101,6 +2101,7 @@ static void update_makefile( const char *path ) }; const char **var; unsigned int i; + int use_msvcrt = 0; struct strarray value; struct incl_file *file; @@ -2113,6 +2114,15 @@ static void update_makefile( const char *path ) top_obj_dir = get_expanded_make_variable( "top_builddir" ); parent_dir = get_expanded_make_variable( "PARENTSRC" ); + appmode = get_expanded_make_var_array( "APPMODE" ); + dllflags = get_expanded_make_var_array( "DLLFLAGS" ); + imports = get_expanded_make_var_array( "IMPORTS" ); + + for (i = 0; i < appmode.count && !use_msvcrt; i++) + use_msvcrt = !strcmp( appmode.str[i], "-mno-cygwin" ); + for (i = 0; i < imports.count && !use_msvcrt; i++) + use_msvcrt = !strncmp( imports.str[i], "msvcr", 5 ); + include_args = empty_strarray; define_args = empty_strarray; strarray_add( &define_args, "-D__WINESRC__" ); @@ -2127,6 +2137,13 @@ static void update_makefile( const char *path ) init_paths(); + if (use_msvcrt) + { + strarray_add( &dllflags, get_expanded_make_variable( "MSVCRTFLAGS" )); + strarray_add( &include_args, + strmake( "-I%s/include/msvcrt", top_src_dir ? top_src_dir : top_obj_dir )); + } + list_init( &sources ); list_init( &includes );