The branch master has been updated
       via  c32cbe97873bf919dc4d1bc332e4758ee6caea78 (commit)
       via  d237d6991461ae55b22df22b42d4771d8ea1b261 (commit)
      from  02b91dcf1cdd2fc75ecdb47d2fba2936e840ed3c (commit)


- Log -----------------------------------------------------------------
commit c32cbe97873bf919dc4d1bc332e4758ee6caea78
Author: Andy Polyakov <[email protected]>
Date:   Wed Apr 6 17:33:03 2016 +0200

    Configurations/10-main.conf: omit now redundant -D_WINDLL.
    
    ... and refine /MT vs. /MD flag handling.
    
    Reviewed-by: Richard Levitte <[email protected]>

commit d237d6991461ae55b22df22b42d4771d8ea1b261
Author: Andy Polyakov <[email protected]>
Date:   Wed Apr 6 17:27:01 2016 +0200

    windows-makefile.tmpl: clean up after DLL link failure.
    
    Without proper cleanup after DLL link failure second attempt to
    run nmake would actually proceed and failure will be "shifted" to
    run time. This is because libcrypto.lib import library is generated
    even if DLL link fails.
    
    Reviewed-by: Richard Levitte <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 Configurations/10-main.conf          | 26 +++++++++++++++++++-------
 Configurations/windows-makefile.tmpl |  2 +-
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index 1b32b10..a36109c 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1238,13 +1238,10 @@ sub vms_info {
         coutflag         => "/Fo",
         rc               => "rc",
         rcoutflag        => "/fo",
-        lib_cflags       => sub { join(" ",
-                                       ($disabled{shared} ? "/Zl" : ()),
-                                       "/Zi /Fdlib") },
+        lib_cflags       => add("/Zi /Fdlib"),
         dso_cflags       => "/Zi",
         bin_cflags       => "/Zi /Fdapp",
         lflags           => add("/debug"),
-        shared_cflag     => "-D_WINDLL",
         shared_ldflag    => "/dll",
         shared_target    => "win-shared", # meaningless except it gives 
Configure a hint
         thread_scheme    => "winthreads",
@@ -1255,14 +1252,29 @@ sub vms_info {
         cflags           => add(picker(default => "-DUNICODE -D_UNICODE",
                                        debug   =>
                                        sub {
-                                           ($disabled{shared} ? "/MT" : "/MD")
-                                               ."d /Od -DDEBUG -D_DEBUG";
+                                           ($disabled{shared} ? "" : "/MDd")
+                                               ." /Od -DDEBUG -D_DEBUG";
                                        },
                                        release =>
                                        sub {
-                                           ($disabled{shared} ? "/MT" : "/MD")
+                                           ($disabled{shared} ? "" : "/MD")
                                                ." /Ox /O2 /Ob2";
                                        })),
+        lib_cflags       => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
+        # Following might/should appears controversial, i.e. defining
+        # /MDd without evaluating $disabled{shared}. It works in
+        # non-shared build because static library is compiled with /Zl
+        # and bares no reference to specific RTL. And it works in
+        # shared build because multiple /MDd options are not prohibited.
+        # But why /MDd in static build? Well, basically this is just a
+        # reference point, which allows to catch eventual errors that
+        # would prevent those who want to wrap OpenSSL into own .DLL.
+        # Why not /MD in release build then? Well, some are likely to
+        # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
+        # redistributable.
+        bin_cflags       => add(picker(debug   => "/MDd",
+                                       release => sub { $disabled{shared} ? 
"/MT" : () },
+                                      )),
         bin_lflags       => add("/subsystem:console /opt:ref"),
         ex_libs          => sub {
             my @ex_libs = ();
diff --git a/Configurations/windows-makefile.tmpl 
b/Configurations/windows-makefile.tmpl
index b4672ab..c67ff83 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -360,7 +360,7 @@ $target: $deps $ordinalsfile $mkdef_pl
        \$(PERL) $mkrc_pl $shlib$shlibext > $shlib.rc
        \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc
        \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
-               /implib:$target \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<<
+               /implib:\$@ \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< || 
(DEL /Q \$(\@B).* $shlib.* && EXIT 1)
 $objs $shlib.res$linklibs \$(EX_LIBS)
 <<
        DEL /F apps\\$shlib$shlibext
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to