Configure et al: cleanups
[openssl.git] / Configurations / 10-main.conf
index 9b4c78f..1bdb723 100644 (file)
@@ -53,14 +53,14 @@ my $vc_wince_info = {};
 sub vc_wince_info {
     unless (%$vc_wince_info) {
         # sanity check
-        $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
-        $die->('%PLATFORM% is not defined')  if (!defined($ENV{'PLATFORM'}));
-        $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
+        $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
+        $die->('%PLATFORM% is not defined')  if (!defined(env('PLATFORM')));
+        $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
 
         #
         # Idea behind this is to mimic flags set by eVC++ IDE...
         #
-        my $wcevers = $ENV{'OSVERSION'};                    # WCENNN
+        my $wcevers = env('OSVERSION');                     # WCENNN
        my $wcevernum;
        my $wceverdotnum;
        if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
@@ -74,12 +74,12 @@ sub vc_wince_info {
         my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
         my $wcelflag = "/subsystem:windowsce,$wceverdotnum";        # ...,N.NN
 
-        my $wceplatf =  $ENV{'PLATFORM'};
+        my $wceplatf =  env('PLATFORM');
 
         $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
         $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
 
-        my $wcetgt = $ENV{'TARGETCPU'};                     # just shorter name...
+        my $wcetgt = env('TARGETCPU');                      # just shorter name...
       SWITCH: for($wcetgt) {
           /^X86/        && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
                                 $wcelflag.=" /machine:X86";     last; };
@@ -144,7 +144,7 @@ sub vms_info {
     return $vms_info;
 }
 
-%targets = (
+my %targets = (
 
 #### Basic configs that should work on any 32-bit box
     "gcc" => {
@@ -179,22 +179,20 @@ sub vms_info {
         inherit_from     => [ "BASE_unix" ],
         template         => 1,
         cflags           => "-DFILIO_H",
-        ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
+        ex_libs          => add("-lsocket -lnsl -ldl"),
         dso_scheme       => "dlfcn",
         thread_scheme    => "pthreads",
         shared_target    => "solaris-shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
 #### Solaris x86 with GNU C setups
     "solaris-x86-gcc" => {
-        # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
-        # to do it here because whenever GNU C instantiates an assembler
-        # template it surrounds it with #APP #NO_APP comment pair which
-        # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
-        # with "Illegal mnemonic" error message.
+        # NB. GNU C has to be configured to use GNU assembler, and not
+        # /usr/ccs/bin/as. Failure to comply will result in compile
+        # failures [at least] in 32-bit build.
         inherit_from     => [ "solaris-common", asm("x86_elf_asm") ],
         cc               => "gcc",
-        cflags           => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
+        cflags           => add_before(picker(default => "-Wall -DL_ENDIAN",
                                               debug   => "-O0 -g",
                                               release => "-O3 -fomit-frame-pointer"),
                                        threads("-pthread")),
@@ -210,7 +208,7 @@ sub vms_info {
         # gcc shared build with Sun C. Given that gcc generates faster
         # code [thanks to inline assembler], I would actually recommend
         # to consider using gcc shared build even with vendor compiler:-)
-        #                                      <appro@fy.chalmers.se>
+        #                        -- <appro@openssl.org>
         inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
         cc               => "gcc",
         cflags           => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
@@ -220,7 +218,7 @@ sub vms_info {
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         perlasm_scheme   => "elf",
         shared_cflag     => "-fPIC",
-        shared_ldflag    => "-m64 -shared -static-libgcc",
+        shared_ldflag    => "-shared -static-libgcc",
         multilib         => "/64",
     },
 
@@ -245,12 +243,12 @@ sub vms_info {
                                               release => "-xO5 -xdepend -xbuiltin"),
                                        threads("-D_REENTRANT")),
         thread_scheme    => "pthreads",
-        lflags           => add("-xarch=generic64",threads("-mt")),
+        lflags           => add(threads("-mt")),
         ex_libs          => add(threads("-lpthread")),
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         perlasm_scheme   => "elf",
         shared_cflag     => "-KPIC",
-        shared_ldflag    => "-xarch=generic64 -G -dy -z text",
+        shared_ldflag    => "-G -dy -z text",
         multilib         => "/64",
     },
 
@@ -280,7 +278,6 @@ sub vms_info {
         inherit_from     => [ "solaris-sparcv9-gcc" ],
         cflags           => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
         bn_ops           => "BN_LLONG RC4_CHAR",
-        shared_ldflag    => "-m64 -shared",
         multilib         => "/64",
     },
 
@@ -313,9 +310,7 @@ sub vms_info {
     "solaris64-sparcv9-cc" => {
         inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
         cflags           => add_before("-xarch=v9"),
-        lflags           => add_before("-xarch=v9"),
         bn_ops           => "BN_LLONG RC4_CHAR",
-        shared_ldflag    => "-xarch=v9 -G -dy -z text",
         multilib         => "/64",
     },
 
@@ -334,8 +329,7 @@ sub vms_info {
         perlasm_scheme   => "n32",
         dso_scheme       => "dlfcn",
         shared_target    => "irix-shared",
-        shared_ldflag    => "-mabi=n32",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "32",
     },
     "irix-mips3-cc" => {
@@ -351,8 +345,7 @@ sub vms_info {
         perlasm_scheme   => "n32",
         dso_scheme       => "dlfcn",
         shared_target    => "irix-shared",
-        shared_ldflag    => "-n32",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "32",
     },
     # N64 ABI builds.
@@ -369,8 +362,7 @@ sub vms_info {
         perlasm_scheme   => "64",
         dso_scheme       => "dlfcn",
         shared_target    => "irix-shared",
-        shared_ldflag    => "-mabi=64",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "64",
     },
     "irix64-mips4-cc" => {
@@ -386,8 +378,7 @@ sub vms_info {
         perlasm_scheme   => "64",
         dso_scheme       => "dlfcn",
         shared_target    => "irix-shared",
-        shared_ldflag    => "-64",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "64",
     },
 
@@ -418,7 +409,6 @@ sub vms_info {
 #   targets; b) performance-critical 32-bit assembly modules implement
 #   even PA-RISC 2.0-specific code paths, which are chosen at run-time,
 #   thus adequate performance is provided even with PA-RISC 1.1 build.
-#                                      <appro@fy.chalmers.se>
     "hpux-parisc-gcc" => {
         inherit_from     => [ "BASE_unix" ],
         cc               => "gcc",
@@ -433,7 +423,7 @@ sub vms_info {
         shared_target    => "hpux-shared",
         shared_cflag     => "-fPIC",
         shared_ldflag    => "-shared",
-        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
     },
     "hpux-parisc1_1-gcc" => {
         inherit_from     => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
@@ -453,14 +443,11 @@ sub vms_info {
         shared_target    => "hpux-shared",
         shared_cflag     => "-fpic",
         shared_ldflag    => "-shared",
-        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/pa20_64",
     },
 
     # More attempts at unified 10.X and 11.X targets for HP C compiler.
-    #
-    # Chris Ruemmler <ruemmler@cup.hp.com>
-    # Kevin Steves <ks@hp.se>
     "hpux-parisc-cc" => {
         inherit_from     => [ "BASE_unix" ],
         cc               => "cc",
@@ -475,7 +462,7 @@ sub vms_info {
         shared_target    => "hpux-shared",
         shared_cflag     => "+Z",
         shared_ldflag    => "-b",
-        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
     },
     "hpux-parisc1_1-cc" => {
         inherit_from     => [ "hpux-parisc-cc", asm("parisc11_asm") ],
@@ -495,8 +482,8 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "hpux-shared",
         shared_cflag     => "+Z",
-        shared_ldflag    => "+DD64 -b",
-        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-b",
+        shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/pa20_64",
     },
 
@@ -514,12 +501,10 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "hpux-shared",
         shared_cflag     => "+Z",
-        shared_ldflag    => "+DD32 -b",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-b",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/hpux32",
     },
-    # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
-    # with debugging of the following config.
     "hpux64-ia64-cc" => {
         inherit_from     => [ "BASE_unix", asm("ia64_asm") ],
         cc               => "cc",
@@ -533,8 +518,8 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "hpux-shared",
         shared_cflag     => "+Z",
-        shared_ldflag    => "+DD64 -b",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-b",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/hpux64",
     },
     # GCC builds...
@@ -552,7 +537,7 @@ sub vms_info {
         shared_target    => "hpux-shared",
         shared_cflag     => "-fpic",
         shared_ldflag    => "-shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/hpux32",
     },
     "hpux64-ia64-gcc" => {
@@ -568,8 +553,8 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "hpux-shared",
         shared_cflag     => "-fpic",
-        shared_ldflag    => "-mlp64 -shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-shared",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         multilib         => "/hpux64",
     },
 
@@ -632,8 +617,9 @@ sub vms_info {
         thread_scheme    => "pthreads",
         dso_scheme       => "dlfcn",
         shared_target    => "linux-shared",
-        shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_cflag     => "-fPIC -DOPENSSL_USE_NODELETE",
+        shared_ldflag    => "-Wl,-znodelete",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
     "linux-generic64" => {
         inherit_from     => [ "linux-generic32" ],
@@ -648,14 +634,12 @@ sub vms_info {
         inherit_from     => [ "linux-generic64", asm("ppc64_asm") ],
         cflags           => add("-m64 -DB_ENDIAN"),
         perlasm_scheme   => "linux64",
-        shared_ldflag    => "-m64",
         multilib         => "64",
     },
     "linux-ppc64le" => {
         inherit_from     => [ "linux-generic64", asm("ppc64_asm") ],
         cflags           => add("-m64 -DL_ENDIAN"),
         perlasm_scheme   => "linux64le",
-        shared_ldflag    => "-m64",
     },
 
     "linux-armv4" => {
@@ -702,7 +686,6 @@ sub vms_info {
         cflags           => add("-mabi=ilp32"),
         bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
         perlasm_scheme   => "linux64",
-        shared_ldflag    => "-mabi=ilp32",
     },
 
     "linux-mips32" => {
@@ -711,7 +694,6 @@ sub vms_info {
         inherit_from     => [ "linux-generic32", asm("mips32_asm") ],
         cflags           => add("-mabi=32 -DBN_DIV3W"),
         perlasm_scheme   => "o32",
-        shared_ldflag    => "-mabi=32",
     },
     # mips32 and mips64 below refer to contemporary MIPS Architecture
     # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
@@ -720,18 +702,18 @@ sub vms_info {
         cflags           => add("-mabi=n32 -DBN_DIV3W"),
         bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
         perlasm_scheme   => "n32",
-        shared_ldflag    => "-mabi=n32",
         multilib         => "32",
     },
     "linux64-mips64" => {
         inherit_from     => [ "linux-generic64", asm("mips64_asm") ],
         cflags           => add("-mabi=64 -DBN_DIV3W"),
         perlasm_scheme   => "64",
-        shared_ldflag    => "-mabi=64",
         multilib         => "64",
     },
 
     #### IA-32 targets...
+    #### These two targets are a bit aged and are to be used on older Linux
+    #### machines where gcc doesn't understand -m32 and -m64
     "linux-elf" => {
         inherit_from     => [ "linux-generic32", asm("x86_elf_asm") ],
         cflags           => add(picker(default => "-DL_ENDIAN",
@@ -749,26 +731,38 @@ sub vms_info {
         perlasm_scheme   => "a.out",
     },
 
+    #### X86 / X86_64 targets
+    "linux-x86" => {
+        inherit_from     => [ "linux-generic32", asm("x86_asm") ],
+        cflags           => add(picker(default => "-m32 -DL_ENDIAN",
+                                       release => "-fomit-frame-pointer")),
+        bn_ops           => "BN_LLONG",
+        perlasm_scheme   => "elf",
+    },
+    "linux-x86-clang" => {
+        inherit_from     => [ "linux-x86" ],
+        cc               => "clang",
+        cxx              => "clang++",
+        cflags           => add("-Wextra"),
+    },
     "linux-x86_64" => {
         inherit_from     => [ "linux-generic64", asm("x86_64_asm") ],
         cflags           => add("-m64 -DL_ENDIAN"),
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         perlasm_scheme   => "elf",
-        shared_ldflag    => "-m64",
         multilib         => "64",
     },
     "linux-x86_64-clang" => {
         inherit_from     => [ "linux-x86_64" ],
         cc               => "clang",
         cxx              => "clang++",
-        cflags           => add("-Wextra -Qunused-arguments"),
+        cflags           => add("-Wextra"),
     },
     "linux-x32" => {
         inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
         cflags           => add("-mx32 -DL_ENDIAN"),
         bn_ops           => "SIXTY_FOUR_BIT",
         perlasm_scheme   => "elf32",
-        shared_ldflag    => "-mx32",
         multilib         => "x32",
     },
 
@@ -781,7 +775,6 @@ sub vms_info {
         inherit_from     => [ "linux-generic64", asm("s390x_asm") ],
         cflags           => add("-m64 -DB_ENDIAN"),
         perlasm_scheme   => "64",
-        shared_ldflag    => "-m64",
         multilib         => "64",
     },
     "linux32-s390x" => {
@@ -805,13 +798,10 @@ sub vms_info {
         cflags           => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
         bn_asm_src       => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
         perlasm_scheme   => "31",
-        shared_ldflag    => "-m31",
         multilib         => "/highgprs",
     },
 
     #### SPARC Linux setups
-    # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
-    # patiently assisted with debugging of following two configs.
     "linux-sparcv8" => {
         inherit_from     => [ "linux-generic32", asm("sparcv8_asm") ],
         cflags           => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
@@ -821,14 +811,12 @@ sub vms_info {
         # but -Wa,-Av8plus should do the trick no matter what.
         inherit_from     => [ "linux-generic32", asm("sparcv9_asm") ],
         cflags           => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
-        shared_ldflag    => "-m32",
     },
     "linux64-sparcv9" => {
         # GCC 3.1 is a requirement
         inherit_from     => [ "linux-generic64", asm("sparcv9_asm") ],
         cflags           => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
         bn_ops           => "BN_LLONG RC4_CHAR",
-        shared_ldflag    => "-m64",
         multilib         => "64",
     },
 
@@ -857,8 +845,8 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "linux-shared",
         shared_cflag     => "--pic",
-        shared_ldflag    => "-z --sysv --shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => add("-z --sysv --shared"),
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         ranlib           => "true",
     },
 
@@ -968,12 +956,13 @@ sub vms_info {
                                            debug   => "-O0 -g",
                                            release => "-O3"),
                                     threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
+        enable           => add("devcryptoeng"),
         bn_ops           => "BN_LLONG",
         thread_scheme    => "pthreads",
         dso_scheme       => "dlfcn",
         shared_target    => "bsd-gcc-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
     "BSD-generic64" => {
         inherit_from     => [ "BSD-generic32" ],
@@ -1029,7 +1018,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "bsd-gcc-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
 
     "nextstep" => {
@@ -1063,7 +1052,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "bsd-gcc-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
     "QNX6-i386" => {
         inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
@@ -1073,7 +1062,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "bsd-gcc-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
 
 #### SCO/Caldera targets.
@@ -1084,8 +1073,7 @@ sub vms_info {
 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
 # Note that not all targets include assembler support. Mostly because of
 # lack of motivation to support out-of-date platforms with out-of-date
-# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
-# patiently assisted to debug most of it.
+# compiler drivers and assemblers.
 #
 # UnixWare 2.0x fails destest with -O.
     "unixware-2.0" => {
@@ -1116,7 +1104,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "svr5-shared",
         shared_cflag     => "-Kpic",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
     "unixware-7-gcc" => {
         inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
@@ -1130,9 +1118,9 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "gnu-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
-# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
+# SCO 5 - Ben Laurie says the -O breaks the SCO cc.
     "sco5-cc" => {
         inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
         cc               => "cc",
@@ -1143,7 +1131,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "svr3-shared",
         shared_cflag     => "-Kpic",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
     "sco5-gcc" => {
         inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
@@ -1156,7 +1144,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "svr3-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
 
 #### IBM's AIX.
@@ -1179,7 +1167,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
         shared_ldflag    => "-shared -static-libgcc -Wl,-G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X32",
     },
     "aix64-gcc" => {
@@ -1195,8 +1183,8 @@ sub vms_info {
         perlasm_scheme   => "aix64",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-maix64 -shared -static-libgcc -Wl,-G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X64",
     },
     "aix-cc" => {
@@ -1213,8 +1201,8 @@ sub vms_info {
         perlasm_scheme   => "aix32",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-q32 -G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-G",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X 32",
     },
     "aix64-cc" => {
@@ -1231,8 +1219,8 @@ sub vms_info {
         perlasm_scheme   => "aix64",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-q64 -G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-G",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X 64",
     },
 
@@ -1273,12 +1261,14 @@ sub vms_info {
         inherit_from     => [ "BASE_Windows" ],
         template         => 1,
         cc               => "cl",
-        cflags           => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
+        cflags           => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS",
         defines          => add(sub { my @defs = ();
                                       unless ($disabled{"zlib-dynamic"}) {
+                                          my $zlib =
+                                              $withargs{zlib_lib} // "ZLIB1";
                                           push @defs,
                                               quotify("perl",
-                                                      'LIBZ="' . $withargs{zlib_lib} . '"');
+                                                      'LIBZ="' . $zlib . '"');
                                       }
                                       return [ @defs ];
                                     }),
@@ -1370,6 +1360,7 @@ sub vms_info {
         # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
         inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
                               sub { $disabled{shared} ? () : "uplink_common" } ],
+        cflags           => add("-WX"),
         as               => sub { vc_win32_info()->{as} },
         asflags          => sub { vc_win32_info()->{asflags} },
         asoutflag        => sub { vc_win32_info()->{asoutflag} },
@@ -1396,9 +1387,9 @@ sub vms_info {
             picker(default =>
                    combine('/W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYS_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT',
                            sub { vc_wince_info()->{cflags}; },
-                           sub { defined($ENV{'WCECOMPAT'})
+                           sub { defined(env('WCECOMPAT'))
                                      ? '-I$(WCECOMPAT)/include' : (); },
-                           sub { defined($ENV{'PORTSDK_LIBPATH'})
+                           sub { defined(env('PORTSDK_LIBPATH'))
                                      ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
                            sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
                                      ? ($disabled{shared} ? " /MT" : " /MD")
@@ -1407,7 +1398,7 @@ sub vms_info {
                    release => "/O1i"),
         lflags           => combine("/nologo /opt:ref",
                                     sub { vc_wince_info()->{lflags}; },
-                                    sub { defined($ENV{PORTSDK_LIBPATH})
+                                    sub { defined(env('PORTSDK_LIBPATH'))
                                               ? "/entry:mainCRTstartup" : (); }),
         sys_id           => "WINCE",
         bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
@@ -1415,9 +1406,9 @@ sub vms_info {
             my @ex_libs = ();
             push @ex_libs, 'ws2.lib' unless $disabled{sock};
             push @ex_libs, 'crypt32.lib';
-            if (defined($ENV{WCECOMPAT})) {
+            if (defined(env('WCECOMPAT'))) {
                 my $x = '$(WCECOMPAT)/lib';
-                if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
+                if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
                     $x .= '/$(TARGETCPU)/wcecompatex.lib';
                 } else {
                     $x .= '/wcecompatex.lib';
@@ -1425,9 +1416,9 @@ sub vms_info {
                 push @ex_libs, $x;
             }
             push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
-                if (defined($ENV{'PORTSDK_LIBPATH'}));
+                if (defined(env('PORTSDK_LIBPATH')));
             push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
-                if ($ENV{'TARGETCPU'} eq "X86");
+                if (env('TARGETCPU') eq "X86");
             return @ex_libs;
         }),
         build_scheme     => add("VC-WCE", { separator => undef }),
@@ -1518,7 +1509,6 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "cygwin-shared",
         shared_cflag     => "-D_WINDLL",
-        shared_ldflag    => "-shared",
         shared_extension => ".dll",
     },
     "Cygwin-x86_64" => {
@@ -1534,7 +1524,6 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "cygwin-shared",
         shared_cflag     => "-D_WINDLL",
-        shared_ldflag    => "-shared",
         shared_extension => ".dll",
     },
     # Backward compatibility for those using this target
@@ -1573,8 +1562,7 @@ sub vms_info {
         ranlib           => "ranlib -c",
         shared_target    => "darwin-shared",
         shared_cflag     => "-fPIC",
-        shared_ldflag    => "-dynamiclib",
-        shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+        shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
     },
     # Option "freeze" such as -std=gnu9x can't negatively interfere
     # with future defaults for below two targets, because MacOS X
@@ -1583,14 +1571,12 @@ sub vms_info {
         inherit_from     => [ "darwin-common", asm("ppc32_asm") ],
         cflags           => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
         perlasm_scheme   => "osx32",
-        shared_ldflag    => "-arch ppc -dynamiclib",
     },
     "darwin64-ppc-cc" => {
         inherit_from     => [ "darwin-common", asm("ppc64_asm") ],
         cflags           => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
         perlasm_scheme   => "osx64",
-        shared_ldflag    => "-arch ppc64 -dynamiclib",
     },
     "darwin-i386-cc" => {
         inherit_from     => [ "darwin-common", asm("x86_asm") ],
@@ -1598,14 +1584,12 @@ sub vms_info {
                                        release => "-fomit-frame-pointer")),
         bn_ops           => "BN_LLONG RC4_INT",
         perlasm_scheme   => "macosx",
-        shared_ldflag    => "-arch i386 -dynamiclib",
     },
     "darwin64-x86_64-cc" => {
         inherit_from     => [ "darwin-common", asm("x86_64_asm") ],
         cflags           => add("-arch x86_64 -DL_ENDIAN -Wall"),
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         perlasm_scheme   => "macosx",
-        shared_ldflag    => "-arch x86_64 -dynamiclib",
     },
 
 #### iPhoneOS/iOS
@@ -1658,7 +1642,7 @@ sub vms_info {
         dso_scheme       => "dlfcn",
         shared_target    => "linux-shared",
         shared_cflag     => "-fPIC",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
     },
 
 ##### VxWorks for various targets
@@ -1727,35 +1711,33 @@ sub vms_info {
 #### uClinux
     "uClinux-dist" => {
         inherit_from     => [ "BASE_unix" ],
-        cc               => "$ENV{'CC'}",
+        cc               => sub { env('CC') },
         cflags           => combine("\$(CFLAGS)",
                                     threads("-D_REENTRANT")),
         plib_lflags      => "\$(LDFLAGS)",
         ex_libs          => add("\$(LDLIBS)"),
         bn_ops           => "BN_LLONG",
         thread_scheme    => "pthreads",
-        dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
+        dso_scheme       => sub { env('LIBSSL_dlfcn') },
         shared_target    => "linux-shared",
         shared_cflag     => "-fPIC",
-        shared_ldflag    => "-shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-        ranlib           => "$ENV{'RANLIB'}",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
+        ranlib           => sub { env('RANLIB') },
     },
     "uClinux-dist64" => {
         inherit_from     => [ "BASE_unix" ],
-        cc               => "$ENV{'CC'}",
+        cc               => sub { env('CC') },
         cflags           => combine("\$(CFLAGS)",
                                     threads("-D_REENTRANT")),
         plib_lflags      => "\$(LDFLAGS)",
         ex_libs          => add("\$(LDLIBS)"),
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         thread_scheme    => "pthreads",
-        dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
+        dso_scheme       => sub { env('LIBSSL_dlfcn') },
         shared_target    => "linux-shared",
         shared_cflag     => "-fPIC",
-        shared_ldflag    => "-shared",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-        ranlib           => "$ENV{'RANLIB'}",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
+        ranlib           => sub { env('RANLIB') },
     },
 
     ##### VMS
@@ -1766,13 +1748,14 @@ sub vms_info {
         cflags           => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
                                    debug   => "/NOOPTIMIZE/DEBUG",
                                    release => "/OPTIMIZE/NODEBUG"),
-        lflags           => picker(default => "/MAP",
+        defines          => add("OPENSSL_USE_NODELETE"),
+        lflags           => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
                                    debug   => "/DEBUG/TRACEBACK",
                                    release => "/NODEBUG/NOTRACEBACK"),
         lib_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
-        # no_inst_bin_cflags is used instead of bin_cflags by descrip.mms.tmpl
-        # for object files belonging to selected internal programs
-        no_inst_bin_cflags => "/NAMES=(AS_IS,SHORTENED)",
+        # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl
+        # for object files belonging to selected internal libraries
+        no_inst_lib_cflags => "",
         shared_target    => "vms-shared",
         dso_scheme       => "vms",
         thread_scheme    => "pthreads",