Have all relevant config targets use the env() function rather than $ENV
[openssl.git] / Configurations / 10-main.conf
index ea1c9ab9d9e7ed6e95034f794d5de9e132855489..28cfd30021d83b8e5f442c1cb60841e8555c98d4 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; };
@@ -208,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",
@@ -416,7 +416,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",
@@ -456,9 +455,6 @@ sub vms_info {
     },
 
     # 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",
@@ -516,8 +512,6 @@ sub vms_info {
         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",
@@ -763,7 +757,7 @@ sub vms_info {
         inherit_from     => [ "linux-x86" ],
         cc               => "clang",
         cxx              => "clang++",
-        cflags           => add("-Wextra -Qunused-arguments"),
+        cflags           => add("-Wextra"),
     },
     "linux-x86_64" => {
         inherit_from     => [ "linux-generic64", asm("x86_64_asm") ],
@@ -777,7 +771,7 @@ sub vms_info {
         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") ],
@@ -826,8 +820,6 @@ sub vms_info {
     },
 
     #### 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"),
@@ -1101,8 +1093,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" => {
@@ -1149,7 +1140,7 @@ sub vms_info {
         shared_cflag     => "-fPIC",
         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",
@@ -1290,7 +1281,7 @@ 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 =
@@ -1389,6 +1380,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} },
@@ -1415,9 +1407,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")
@@ -1426,7 +1418,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",
@@ -1434,9 +1426,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';
@@ -1444,9 +1436,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 }),
@@ -1746,35 +1738,35 @@ 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_VERSION_NUMBER)",
-        ranlib           => "$ENV{'RANLIB'}",
+        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_VERSION_NUMBER)",
-        ranlib           => "$ENV{'RANLIB'}",
+        ranlib           => sub { env('RANLIB') },
     },
 
     ##### VMS