MSVC: link dynamically to the CRT
Dynamic linking is generally preferred over static linking, and MSVCRT.dll has been integral part of Windows for a long time. This also fixes linker warnings for _malloc and _free in zlib.lib, which seems to be compiled for MSVCRT.dll already. The DLL version also exports some of the CRT initialization functions, which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by subsequent Unicode patches). Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Stepan Kasal <kasal@ucw.cz> Acked-by: Sebastian Schuberth <sschuberth@gmail.com> Acked-by: Marat Radchenko <marat@slonopotamus.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees committed
Jan 7, 2011 at 17:20 UTC
a08e803d76dff22d8c2b428a725be247425963af
1 file changed
+3
-3
config.mak.uname
+3
-3
@@ -358,16 +358,16 @@ ifeq ($(uname_S),Windows)
358
compat/win32/pthread.o compat/win32/syslog.o \
359
compat/win32/dirent.o
360
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
361
- BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
361
+ BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
362
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
363
PTHREAD_LIBS =
364
lib =
365
ifndef DEBUG
366
- BASIC_CFLAGS += -GL -Os -MT
366
+ BASIC_CFLAGS += -GL -Os -MD
367
BASIC_LDFLAGS += -LTCG
368
AR += -LTCG
369
else
370
- BASIC_CFLAGS += -Zi -MTd
370
+ BASIC_CFLAGS += -Zi -MDd
371
endif
372
X = .exe
373
endif