diff options
author | Andy Polyakov <appro@openssl.org> | 2005-07-24 21:48:04 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2005-07-24 21:48:04 +0000 |
commit | b3836ed3cbeb9a5d735597e8a79ffea5894cb470 (patch) | |
tree | 42c5dd3c0389ccd8cb1e90ebf6af476021cc3c57 /util/pl/VC-32.pl | |
parent | 47738cbad7fb27296dbb4f02393ba70854ce5cb7 (diff) |
Unify VC-32.pl and VC-CE.pl scripts and update INSTALL.W32.
Diffstat (limited to 'util/pl/VC-32.pl')
-rw-r--r-- | util/pl/VC-32.pl | 81 |
1 files changed, 63 insertions, 18 deletions
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl index d39715cdad..d2ec04eac1 100644 --- a/util/pl/VC-32.pl +++ b/util/pl/VC-32.pl @@ -1,5 +1,6 @@ #!/usr/local/bin/perl -# VCw32lib.pl - the file for Visual C++ 4.[01] for windows NT, static libraries +# VC-32.pl - unified script for Microsoft Visual C++, covering Win32, +# Win64 and WinCE [follow $FLAVOR variable to trace the differences]. # $ssl= "ssleay32"; @@ -21,30 +22,44 @@ if ($FLAVOR =~ /WIN64/) # # 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 + # per 0.9.8 release remaining warnings were explicitly examined 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'; + $base_cflags=' /W3 /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE'; + $opt_cflags=' /MD /Ox'; + $dbg_cflags=' /MDd /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; } -else +elsif ($FLAVOR =~ /CE/) + { + $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo $(WCETARGETDEFS) -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include'; + $opt_cflags=' /MD /Ox /O2 /Ob2'; + $dbg_clfags=' /MDd /Od -DDEBUG -D_DEBUG'; + $lflags='/nologo /subsystem:windowsce,$(WCELDVERSION) /machine:$(WCELDMACHINE) /opt:ref'; + } +else # Win32 { - $cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /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'; + $opt_cflags=' /MD /Ox /O2 /Ob2'; + $dbg_cflags=' /MDd /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; } $mlflags=''; -$out_def="out32"; -$tmp_def="tmp32"; +$out_def="out32"; $out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); +$tmp_def="tmp32"; $tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); $inc_def="inc32"; if ($debug) { - $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DOPENSSL_SYSNAME_WIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG -DDSO_WIN32"; + $cflags=$dbg_cflags.$base_cflags; $lflags.=" /debug"; $mlflags.=' /debug'; } -$cflags .= " -DOPENSSL_SYSNAME_WINNT" if $NT == 1; +else + { + $cflags=$opt_cflags.$base_cflags; + } $obj='.obj'; $ofile="/Fo"; @@ -54,10 +69,25 @@ $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/); +if ($no_sock) { $ex_libs=''; } +elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } +else { $ex_libs='wsock32.lib'; } + +if ($FLAVOR =~ /CE/) + { $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib $(WCELDFLAGS)'; } +else + { + $ex_libs.=' gdi32.lib advapi32.lib user32.lib'; + $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); + } + +# As native NT API is pure UNICODE, our WIN-NT build defaults to UNICODE, +# but gets linked with unicows.lib to ensure backward compatibility. +if ($FLAVOR =~ /NT/) + { + $cflags.=" -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE"; + $ex_libs="unicows.lib $ex_libs"; + } # static library stuff $mklib='lib'; @@ -68,7 +98,7 @@ $shlibp=($shlib)?".dll":".lib"; $lfile='/out:'; $shlib_ex_obj=""; -$app_ex_obj="setargv.obj"; +$app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/); if ($nasm) { $asm='nasmw -f win32'; $afile='-o '; @@ -108,7 +138,7 @@ if (!$no_asm) $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; } -if ($shlib) +if ($shlib && $FLAVOR !~ /CE/) { $mlflags.=" $lflags /dll"; # $cflags =~ s| /MD| /MT|; @@ -140,6 +170,13 @@ ___ CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ) ___ } +elsif ($shlib && $FLAVOR =~ /CE/) + { + $mlflags.=" $lflags /dll"; + $lib_cflag=" -D_WINDLL -D_DLL"; + $out_def='out32dll_$(TARGETCPU)'; + $tmp_def='tmp32dll_$(TARGETCPU)'; + } $cflags.=" /Fd$out_def"; @@ -156,14 +193,22 @@ sub do_lib_rule if (!$shlib) { # $ret.="\t\$(RM) \$(O_$Name)\n"; - $ex =' advapi32.lib'; + $ex =' '; $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n"; } else { local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; - $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib'; - $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); + if ($FLAVOR =~ /CE/) + { + $ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib'; + } + else + { + $ex.=' unicows.lib' if ($FLAVOR =~ /NT/); + $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"; |