Commit 3e40fea9 authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Automatically add the necessary msvcrt flags to the generated rules.

parent ddc7f300
......@@ -11,7 +11,7 @@
# First some useful definitions
ALLCFLAGS = $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
ALLCFLAGS = $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS)
IDLFLAGS = $(EXTRAIDLFLAGS)
RCFLAGS = --nostdinc $(PORCFLAGS)
......
......@@ -22,6 +22,7 @@ CROSSCC = @CROSSCC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
EXTRACFLAGS = @EXTRACFLAGS@
MSVCRTFLAGS = @BUILTINFLAG@
TARGETFLAGS = @TARGETFLAGS@
LIBS = @LIBS@
BISON = @BISON@
......
......@@ -14388,6 +14388,8 @@ install install-lib:: $wine_binary-preloader
uninstall::
\$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader
preloader_EXTRADEFS = $BUILTINFLAG
" ;;
esac
;;
......
......@@ -1994,6 +1994,8 @@ install install-lib:: $wine_binary-preloader
uninstall::
\$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader
preloader_EXTRADEFS = $BUILTINFLAG
"]) ;;
esac
;;
......
MODULE = crtdll.dll
IMPORTLIB = crtdll
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
crtdll_main.c
......@@ -17,7 +17,6 @@
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
......
MODULE = msvcp100.dll
IMPORTS = msvcr100
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -D_MSVCP_VER=100
PARENTSRC = ../msvcp90
......
TESTDLL = msvcp100.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
misc.c \
......
MODULE = msvcp110.dll
IMPORTS = msvcr110
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -D_MSVCP_VER=110
PARENTSRC = ../msvcp90
......
MODULE = msvcp60.dll
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
exception.c \
......
TESTDLL = msvcp60.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
ios.c \
......
MODULE = msvcp71.dll
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -D_MSVCP_VER=71
PARENTSRC = ../msvcp90
......
MODULE = msvcp80.dll
IMPORTS = msvcr80
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -D_MSVCP_VER=80
PARENTSRC = ../msvcp90
......
MODULE = msvcp90.dll
IMPORTS = msvcr90
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
EXTRADEFS = -D_MSVCP_VER=90
C_SRCS = \
......
TESTDLL = msvcp90.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
ios.c \
......
MODULE = msvcr100.dll
IMPORTLIB = msvcr100
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr100.c
......
TESTDLL = msvcr100.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr100.c
MODULE = msvcr110.dll
IMPORTLIB = msvcr110
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr110.c
MODULE = msvcr80.dll
IMPORTLIB = msvcr80
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr80.c
......
MODULE = msvcr90.dll
IMPORTLIB = msvcr90
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr90.c
......
TESTDLL = msvcr90.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
msvcr90.c
......
TESTDLL = msvcrt.dll
APPMODE = -mno-cygwin
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt -I$(srcdir)/..
EXTRAINCL = -I$(srcdir)/..
C_SRCS = \
cpp.c \
......
MODULE = msvcrtd.dll
IMPORTLIB = msvcrtd
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = \
debug.c
TESTDLL = msvcrtd.dll
APPMODE = -mno-cygwin
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
MODCFLAGS = @BUILTINFLAG@
C_SRCS = \
debug.c
MODCFLAGS = @BUILTINFLAG@
EXTRALIBS = @LIBPTHREAD@
C_SRCS = \
......
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 \
......
......@@ -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 \
......
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 \
......
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 \
......
MODULE = xcopy.exe
APPMODE = -mconsole -municode -mno-cygwin
IMPORTS = shell32 user32
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
MODCFLAGS = @BUILTINFLAG@
C_SRCS = \
xcopy.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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment