Configure et al: cleanups
[openssl.git] / Configurations / 10-main.conf
index 62e659e..1bdb723 100644 (file)
@@ -14,7 +14,10 @@ sub vc_win64a_info {
                                 asflags   => "/c /Cp /Cx /Zi",
                                 asoutflag => "/Fo" };
         } else {
-            die "NASM not found - please read INSTALL and NOTES.WIN for further details\n";
+            $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
+            $vc_win64a_info = { as        => "{unknown}",
+                                asflags   => "",
+                                asoutflag => "" };
         }
     }
     return $vc_win64a_info;
@@ -36,7 +39,11 @@ sub vc_win32_info {
                                asoutflag => "/Fo",
                                perlasm_scheme => "win32" };
         } else {
-            die "NASM not found - please read INSTALL and NOTES.WIN for further details\n";
+            $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
+            $vc_win32_info = { as        => "{unknown}",
+                               asflags   => "",
+                               asoutflag => "",
+                               perlasm_scheme => "win32" };
         }
     }
     return $vc_win32_info;
@@ -46,25 +53,33 @@ 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
-        die '%OSVERSION% value is insane'
-            if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
-        my $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
-        my $wcelflag = "/subsystem:windowsce,$1.$2";        # ...,N.NN
+        my $wcevers = env('OSVERSION');                     # WCENNN
+       my $wcevernum;
+       my $wceverdotnum;
+       if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
+           $wcevernum = "$1$2";
+           $wceverdotnum = "$1.$2";
+       } else {
+           $die->('%OSVERSION% value is insane');
+           $wcevernum = "{unknown}";
+           $wceverdotnum = "{unknown}";
+       }
+        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; };
@@ -129,7 +144,7 @@ sub vms_info {
     return $vms_info;
 }
 
-%targets = (
+my %targets = (
 
 #### Basic configs that should work on any 32-bit box
     "gcc" => {
@@ -164,28 +179,26 @@ 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")),
         bn_ops           => "BN_LLONG",
         shared_cflag     => "-fPIC",
-        shared_ldflag    => "-shared",
+        shared_ldflag    => "-shared -static-libgcc",
     },
     "solaris64-x86_64-gcc" => {
         # -shared -static-libgcc might appear controversial, but modules
@@ -195,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",
@@ -205,24 +218,23 @@ 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",
     },
 
 #### Solaris x86 with Sun C setups
-    "solaris-x86-cc" => {
-        inherit_from     => [ "solaris-common" ],
-        cc               => "cc",
-        cflags           => add_before(picker(default => "-xarch=generic -xstrconst -Xa -DL_ENDIAN",
-                                              debug   => "-g",
-                                              release => "-xO5 -xregs=frameptr -xdepend -xbuiltin"),
-                                       threads("-D_REENTRANT")),
-        lflags           => add(threads("-mt")),
-        ex_libs          => add(threads("-lpthread")),
-        bn_ops           => "BN_LLONG RC4_CHAR",
-        shared_cflag     => "-KPIC",
-        shared_ldflag    => "-G -dy -z text",
-    },
+    # There used to be solaris-x86-cc target, but it was removed,
+    # primarily because vendor assembler can't assemble our modules
+    # with -KPIC flag. As result it, assembly support, was not even
+    # available as option. But its lack means lack of side-channel
+    # resistant code, which is incompatible with security by todays
+    # standards. Fortunately gcc is readily available prepackaged
+    # option, which we can firmly point at...
+    #
+    # On related note, solaris64-x86_64-cc target won't compile code
+    # paths utilizing AVX and post-Haswell instruction extensions.
+    # Consider switching to solaris64-x86_64-gcc even here...
+    #
     "solaris64-x86_64-cc" => {
         inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
         cc               => "cc",
@@ -236,7 +248,7 @@ sub vms_info {
         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",
     },
 
@@ -266,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",
     },
 
@@ -294,13 +305,12 @@ sub vms_info {
     },
     "solaris-sparcv9-cc" => {
         inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
-        cflags           => add_before("-xarch=v8plus -xtarget=ultra"),
+        cflags           => add_before("-xarch=v8plus"),
     },
     "solaris64-sparcv9-cc" => {
         inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
-        cflags           => add_before("-xarch=v9 -xtarget=ultra"),
+        cflags           => add_before("-xarch=v9"),
         bn_ops           => "BN_LLONG RC4_CHAR",
-        shared_ldflag    => "-xarch=v9 -G -dy -z text",
         multilib         => "/64",
     },
 
@@ -319,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" => {
@@ -336,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.
@@ -354,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" => {
@@ -371,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",
     },
 
@@ -403,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",
@@ -418,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") ],
@@ -438,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",
@@ -460,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") ],
@@ -480,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",
     },
 
@@ -499,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",
@@ -518,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...
@@ -537,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" => {
@@ -553,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",
     },
 
@@ -607,6 +607,7 @@ sub vms_info {
     "linux-generic32" => {
         inherit_from     => [ "BASE_unix" ],
         cc               => "gcc",
+        cxx              => "g++",
         cflags           => combine(picker(default => "-Wall",
                                            debug   => "-O0 -g",
                                            release => "-O3"),
@@ -616,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" ],
@@ -632,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" => {
@@ -686,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" => {
@@ -695,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.
@@ -704,23 +702,22 @@ 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",
                                        release => "-fomit-frame-pointer")),
-        ex_libs          => add(picker(debug => "-lefence")),
         bn_ops           => "BN_LLONG",
     },
     "linux-aout" => {
@@ -734,25 +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",
-        cflags           => add("-Wextra -Qunused-arguments"),
+        cxx              => "clang++",
+        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",
     },
 
@@ -765,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" => {
@@ -789,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"),
@@ -805,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",
     },
 
@@ -841,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",
     },
 
@@ -850,7 +854,7 @@ sub vms_info {
     #
     # It takes pair of prior-set environment variables to make it work:
     #
-    # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<
+    # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
     # CROSS_COMPILE=<prefix>
     #
     # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
@@ -859,7 +863,7 @@ sub vms_info {
     # ANDROID_NDK=/some/where/android-ndk-10d
     # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
     # CROSS_COMPILE=arm-linux-adroideabi-
-    # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/
+    # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
     #
     "android" => {
         inherit_from     => [ "linux-generic32" ],
@@ -919,6 +923,23 @@ sub vms_info {
         inherit_from     => [ "android64", asm("aarch64_asm") ],
         perlasm_scheme   => "linux64",
     },
+    "android64-x86_64" => {
+        inherit_from     => [ "android64", asm("x86_64_asm") ],
+        perlasm_scheme   => "elf",
+    },
+    "android64-mips64" => {
+        ############################################################
+        # You are more than likely have to specify target processor
+        # on ./Configure command line. Trouble is that toolchain's
+        # default is MIPS64r6 (at least in r10d), but there are no
+        # such processors around (or they are too rare to spot one).
+        # Actual problem is that MIPS64r6 is binary incompatible
+        # with previous MIPS ISA versions, in sense that unlike
+        # prior versions original MIPS binary code will fail.
+        #
+        inherit_from     => [ "android64", asm("mips64_asm") ],
+        perlasm_scheme   => "64",
+    },
 
 #### *BSD
     "BSD-generic32" => {
@@ -935,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" ],
@@ -996,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" => {
@@ -1030,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") ],
@@ -1040,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.
@@ -1051,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" => {
@@ -1083,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") ],
@@ -1097,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",
@@ -1110,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") ],
@@ -1123,10 +1144,15 @@ 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.
+    # Below targets assume AIX >=5. Caveat lector. If you are accustomed
+    # to control compilation "bitness" by setting $OBJECT_MODE environment
+    # variable, then you should know that in OpenSSL case it's considered
+    # only in ./config. Once configured, build procedure remains "deaf" to
+    # current value of $OBJECT_MODE.
     "aix-gcc" => {
         inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
         cc               => "gcc",
@@ -1140,8 +1166,8 @@ sub vms_info {
         perlasm_scheme   => "aix32",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-shared -Wl,-G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X32",
     },
     "aix64-gcc" => {
@@ -1157,13 +1183,10 @@ sub vms_info {
         perlasm_scheme   => "aix64",
         dso_scheme       => "dlfcn",
         shared_target    => "aix-shared",
-        shared_ldflag    => "-maix64 -shared -Wl,-G",
-        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
+        shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
         arflags          => "-X64",
     },
-    # Below targets assume AIX 5. Idea is to effectively disregard
-    # $OBJECT_MODE at build time. $OBJECT_MODE is respected at
-    # ./config stage!
     "aix-cc" => {
         inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
         cc               => "cc",
@@ -1174,11 +1197,12 @@ sub vms_info {
         sys_id           => "AIX",
         bn_ops           => "BN_LLONG RC4_CHAR",
         thread_scheme    => "pthreads",
+        ex_libs          => threads("-lpthreads"),
         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" => {
@@ -1191,11 +1215,12 @@ sub vms_info {
         sys_id           => "AIX",
         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
         thread_scheme    => "pthreads",
+        ex_libs          => threads("-lpthreads"),
         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",
     },
 
@@ -1236,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 ];
                                     }),
@@ -1254,9 +1281,11 @@ sub vms_info {
         shared_target    => "win-shared", # meaningless except it gives Configure a hint
         thread_scheme    => "winthreads",
         dso_scheme       => "win32",
+        apps_aux_src     => add("win32_init.c"),
     },
     "VC-noCE-common" => {
         inherit_from     => [ "VC-common" ],
+        template         => 1,
         cflags           => add(picker(default => "-DUNICODE -D_UNICODE",
                                        debug   =>
                                        sub {
@@ -1293,6 +1322,7 @@ sub vms_info {
     },
     "VC-WIN64-common" => {
         inherit_from     => [ "VC-noCE-common" ],
+        template         => 1,
         ex_libs          => add(sub {
             my @ex_libs = ();
             push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
@@ -1330,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} },
@@ -1356,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")
@@ -1367,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",
@@ -1375,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';
@@ -1385,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 }),
@@ -1414,6 +1445,7 @@ sub vms_info {
         shared_rcflag    => "--target=pe-i386",
         shared_extension => ".dll",
         multilib         => "",
+        apps_aux_src     => add("win32_init.c"),
     },
     "mingw64" => {
         # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
@@ -1442,6 +1474,7 @@ sub vms_info {
         shared_rcflag    => "--target=pe-x86-64",
         shared_extension => ".dll",
         multilib         => "64",
+        apps_aux_src     => add("win32_init.c"),
     },
 
 #### UEFI
@@ -1476,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" => {
@@ -1492,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
@@ -1531,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
@@ -1541,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") ],
@@ -1556,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
@@ -1616,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
@@ -1685,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
@@ -1721,19 +1745,22 @@ sub vms_info {
         inherit_from     => [ "BASE_VMS" ],
         template         => 1,
         cc               => "CC/DECC",
-        cflags           => picker(default => "/STANDARD=RELAXED/NOLIST/PREFIX=ALL",
+        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)"),
-        dso_cflags       => add("/NAMES=(AS_IS,SHORTENED)"),
+        lib_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
+        # 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",
 
-        apps_aux_src     => "vms_decc_init.c",
+        apps_aux_src     => "vms_decc_init.c vms_term_sock.c",
     },
 
     "vms-alpha" => {
@@ -1752,7 +1779,7 @@ sub vms_info {
         #as               => "???",
         #debug_aflags     => "/NOOPTIMIZE/DEBUG",
         #release_aflags   => "/OPTIMIZE/NODEBUG",
-        bn_opts          => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
+        bn_opts          => "SIXTY_FOUR_BIT RC4_INT",
     },
     "vms-alpha-p32" => {
         inherit_from     => [ "vms-generic" ],
@@ -1804,7 +1831,7 @@ sub vms_info {
         #as               => "I4S",
         #debug_aflags     => "/NOOPTIMIZE/DEBUG",
         #release_aflags   => "/OPTIMIZE/NODEBUG",
-        bn_opts          => "SIXTY_FOUR_BIT RC4_INT RC4_CHUNK_LL DES_PTR BF_PTR",
+        bn_opts          => "SIXTY_FOUR_BIT RC4_INT",
     },
     "vms-ia64-p32" => {
         inherit_from     => [ "vms-generic" ],