Make it possible to link VC static lib with either /MT or /MD application
[from HEAD]. PR: 1230
This commit is contained in:
		
							
								
								
									
										8
									
								
								e_os.h
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								e_os.h
									
									
									
									
									
								
							@@ -277,6 +277,14 @@ static unsigned int _strlen31(const char *str)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
#    endif
 | 
					#    endif
 | 
				
			||||||
#    include <malloc.h>
 | 
					#    include <malloc.h>
 | 
				
			||||||
 | 
					#    if defined(_MSC_VER) && _MSC_VER<=1200 && defined(_MT) && defined(isspace)
 | 
				
			||||||
 | 
					       /* compensate for bug is VC6 ctype.h */
 | 
				
			||||||
 | 
					#      undef isspace
 | 
				
			||||||
 | 
					#      undef isdigit
 | 
				
			||||||
 | 
					#      undef isalnum
 | 
				
			||||||
 | 
					#      undef isupper
 | 
				
			||||||
 | 
					#      undef isxdigit
 | 
				
			||||||
 | 
					#    endif
 | 
				
			||||||
#  endif
 | 
					#  endif
 | 
				
			||||||
#  include <io.h>
 | 
					#  include <io.h>
 | 
				
			||||||
#  include <fcntl.h>
 | 
					#  include <fcntl.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,8 +31,10 @@ if ($FLAVOR =~ /WIN64/)
 | 
				
			|||||||
    $base_cflags=' /W3 /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE';
 | 
					    $base_cflags=' /W3 /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE';
 | 
				
			||||||
    $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE';	# shut up VC8
 | 
					    $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE';	# shut up VC8
 | 
				
			||||||
    $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE';	# shut up VC8
 | 
					    $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE';	# shut up VC8
 | 
				
			||||||
    $opt_cflags=' /MD /Ox';
 | 
					    my $f = $shlib?' /MD':' /MT';
 | 
				
			||||||
    $dbg_cflags=' /MDd /Od -DDEBUG -D_DEBUG';
 | 
					    $lib_cflag='/Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
 | 
				
			||||||
 | 
					    $opt_cflags=$f.' /Ox';
 | 
				
			||||||
 | 
					    $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
 | 
				
			||||||
    $lflags="/nologo /subsystem:console /opt:ref";
 | 
					    $lflags="/nologo /subsystem:console /opt:ref";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
elsif ($FLAVOR =~ /CE/)
 | 
					elsif ($FLAVOR =~ /CE/)
 | 
				
			||||||
@@ -94,8 +96,10 @@ else	# Win32
 | 
				
			|||||||
    $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
 | 
					    $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
 | 
				
			||||||
    $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE';	# shut up VC8
 | 
					    $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE';	# shut up VC8
 | 
				
			||||||
    $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE';	# shut up VC8
 | 
					    $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE';	# shut up VC8
 | 
				
			||||||
    $opt_cflags=' /MD /Ox /O2 /Ob2';
 | 
					    my $f = $shlib?' /MD':' /MT';
 | 
				
			||||||
    $dbg_cflags=' /MDd /Od -DDEBUG -D_DEBUG';
 | 
					    $lib_cflag='/Zl' if (!$shlib);	# remove /DEFAULTLIBs from static lib
 | 
				
			||||||
 | 
					    $opt_cflags=$f.' /Ox /O2 /Ob2';
 | 
				
			||||||
 | 
					    $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
 | 
				
			||||||
    $lflags="/nologo /subsystem:console /opt:ref";
 | 
					    $lflags="/nologo /subsystem:console /opt:ref";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
$mlflags='';
 | 
					$mlflags='';
 | 
				
			||||||
@@ -203,7 +207,6 @@ if (!$no_asm)
 | 
				
			|||||||
if ($shlib && $FLAVOR !~ /CE/)
 | 
					if ($shlib && $FLAVOR !~ /CE/)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	$mlflags.=" $lflags /dll";
 | 
						$mlflags.=" $lflags /dll";
 | 
				
			||||||
#	$cflags =~ s| /MD| /MT|;
 | 
					 | 
				
			||||||
	$lib_cflag=" -D_WINDLL";
 | 
						$lib_cflag=" -D_WINDLL";
 | 
				
			||||||
	$out_def="out32dll";
 | 
						$out_def="out32dll";
 | 
				
			||||||
	$tmp_def="tmp32dll";
 | 
						$tmp_def="tmp32dll";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user