X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=util%2Fpl%2FVC-32.pl;h=d39715cdad62db25d27bc0afad681adff0e44d75;hb=dabaea8048988709af709e7d329dff311635ff84;hp=d6e3a11530f1e56f64c2c15a8902a13671fa43d4;hpb=05086644c4afcd245ab3ef9be87a2750d7b01379;p=openssl.git diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl index d6e3a11530..d39715cdad 100644 --- a/util/pl/VC-32.pl +++ b/util/pl/VC-32.pl @@ -11,8 +11,27 @@ $rm='del'; # C compiler stuff $cc='cl'; -$cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32'; -$lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; +if ($FLAVOR =~ /WIN64/) + { + # Note that we currently don't have /WX on Win64! There is a lot of + # warnings, but only of two types: + # + # C4344: conversion from '__int64' to 'int/long', possible loss of data + # C4267: conversion from 'size_t' to 'int/long', possible loss of data + # + # Amount of latter type is minimized by aliasing strlen to function of + # own desing and limiting its return value to 2GB-1 (see e_os.h). As + # per 0.9.8 release remaining warnings were explicitly examines and + # considered safe to ignore. + # + $cflags=' /MD /W3 /Ox /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE'; + $lflags="/nologo /subsystem:console /opt:ref"; + } +else + { + $cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32'; + $lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; + } $mlflags=''; $out_def="out32"; @@ -32,11 +51,13 @@ $ofile="/Fo"; # EXE linking stuff $link="link"; +$rsc="rc"; $efile="/out:"; $exep='.exe'; if ($no_sock) { $ex_libs=""; } else { $ex_libs="wsock32.lib user32.lib gdi32.lib"; } +$ex_libs="$ex_libs bufferoverflowu.lib" if ($FLAVOR =~ /WIN64/); # static library stuff $mklib='lib'; @@ -91,9 +112,33 @@ if ($shlib) { $mlflags.=" $lflags /dll"; # $cflags =~ s| /MD| /MT|; - $lib_cflag=" -D_WINDLL -D_DLL"; + $lib_cflag=" -D_WINDLL"; $out_def="out32dll"; $tmp_def="tmp32dll"; + # + # Engage Applink... + # + $app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib"; + $cflags.=" -DOPENSSL_USE_APPLINK -I."; + # I'm open for better suggestions than overriding $banner... + $banner=<<'___'; + @echo Building OpenSSL + +$(OBJ_D)\applink.obj: ms\applink.c + $(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c +$(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c + $(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c +$(INCO_D)\applink.c: ms\applink.c + $(CP) ms\applink.c $(INCO_D)\applink.c + +EXHEADER= $(EXHEADER) $(INCO_D)\applink.c + +LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj +CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ) +___ + $banner.=<<'___' if ($FLAVOR =~ /WIN64/); +CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ) +___ } $cflags.=" /Fd$out_def"; @@ -117,7 +162,8 @@ sub do_lib_rule else { local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; - $ex.=' wsock32.lib gdi32.lib advapi32.lib'; + $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib'; + $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; } $ret.="\n";