Home | History | Annotate | Line # | Download | only in Configurations
      1       1.1  christos ## -*- mode: perl; -*-
      2       1.1  christos ## Standard openssl configuration targets.
      3       1.1  christos 
      4       1.1  christos # Helper functions for the Windows configs
      5       1.1  christos my $vc_win64a_info = {};
      6       1.1  christos sub vc_win64a_info {
      7       1.1  christos     unless (%$vc_win64a_info) {
      8       1.1  christos         if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
      9   1.1.1.4  christos             $vc_win64a_info = { AS        => "nasm",
     10   1.1.1.4  christos                                 ASFLAGS   => "-g",
     11   1.1.1.4  christos                                 asflags   => "-Ox -f win64 -DNEAR",
     12  1.1.1.15  christos                                 asoutflag => "-o ",
     13  1.1.1.15  christos                                 perlasm_scheme => "nasm" };
     14       1.1  christos         } elsif ($disabled{asm}) {
     15   1.1.1.4  christos             # assembler is still used to compile uplink shim
     16   1.1.1.4  christos             $vc_win64a_info = { AS        => "ml64",
     17   1.1.1.4  christos                                 ASFLAGS   => "/nologo /Zi",
     18   1.1.1.4  christos                                 asflags   => "/c /Cp /Cx",
     19  1.1.1.15  christos                                 asoutflag => "/Fo",
     20  1.1.1.15  christos                                 perlasm_scheme => "masm" };
     21       1.1  christos         } else {
     22   1.1.1.3  christos             $die->("NASM not found - make sure it's installed and available on %PATH%\n");
     23   1.1.1.4  christos             $vc_win64a_info = { AS        => "{unknown}",
     24   1.1.1.4  christos                                 ASFLAGS   => "",
     25       1.1  christos                                 asflags   => "",
     26  1.1.1.15  christos                                 asoutflag => "",
     27  1.1.1.15  christos                                 perlasm_scheme => "auto" };
     28       1.1  christos         }
     29       1.1  christos     }
     30       1.1  christos     return $vc_win64a_info;
     31       1.1  christos }
     32       1.1  christos 
     33       1.1  christos my $vc_win32_info = {};
     34       1.1  christos sub vc_win32_info {
     35       1.1  christos     unless (%$vc_win32_info) {
     36       1.1  christos         my $ver=`nasm -v 2>NUL`;
     37       1.1  christos         my $vew=`nasmw -v 2>NUL`;
     38       1.1  christos         if ($ver ne "" || $vew ne "") {
     39   1.1.1.4  christos             $vc_win32_info = { AS        => $ver ge $vew ? "nasm" : "nasmw",
     40   1.1.1.4  christos                                ASFLAGS   => "",
     41       1.1  christos                                asflags   => "-f win32",
     42   1.1.1.4  christos                                asoutflag => "-o ",
     43       1.1  christos                                perlasm_scheme => "win32n" };
     44       1.1  christos         } elsif ($disabled{asm}) {
     45   1.1.1.4  christos             # not actually used, uplink shim is inlined into C code
     46   1.1.1.4  christos             $vc_win32_info = { AS        => "ml",
     47   1.1.1.4  christos                                ASFLAGS   => "/nologo /Zi",
     48   1.1.1.4  christos                                asflags   => "/Cp /coff /c /Cx",
     49       1.1  christos                                asoutflag => "/Fo",
     50       1.1  christos                                perlasm_scheme => "win32" };
     51       1.1  christos         } else {
     52   1.1.1.3  christos             $die->("NASM not found - make sure it's installed and available on %PATH%\n");
     53   1.1.1.4  christos             $vc_win32_info = { AS        => "{unknown}",
     54   1.1.1.4  christos                                ASFLAGS   => "",
     55       1.1  christos                                asflags   => "",
     56       1.1  christos                                asoutflag => "",
     57       1.1  christos                                perlasm_scheme => "win32" };
     58       1.1  christos         }
     59       1.1  christos     }
     60       1.1  christos     return $vc_win32_info;
     61       1.1  christos }
     62       1.1  christos 
     63       1.1  christos my $vc_wince_info = {};
     64       1.1  christos sub vc_wince_info {
     65       1.1  christos     unless (%$vc_wince_info) {
     66       1.1  christos         # sanity check
     67   1.1.1.4  christos         $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
     68   1.1.1.4  christos         $die->('%PLATFORM% is not defined')  if (!defined(env('PLATFORM')));
     69   1.1.1.4  christos         $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
     70       1.1  christos 
     71       1.1  christos         #
     72       1.1  christos         # Idea behind this is to mimic flags set by eVC++ IDE...
     73       1.1  christos         #
     74   1.1.1.4  christos         my $wcevers = env('OSVERSION');                     # WCENNN
     75       1.1  christos 	my $wcevernum;
     76       1.1  christos 	my $wceverdotnum;
     77       1.1  christos 	if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
     78       1.1  christos 	    $wcevernum = "$1$2";
     79       1.1  christos 	    $wceverdotnum = "$1.$2";
     80       1.1  christos 	} else {
     81       1.1  christos 	    $die->('%OSVERSION% value is insane');
     82       1.1  christos 	    $wcevernum = "{unknown}";
     83       1.1  christos 	    $wceverdotnum = "{unknown}";
     84       1.1  christos 	}
     85       1.1  christos         my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
     86       1.1  christos         my $wcelflag = "/subsystem:windowsce,$wceverdotnum";        # ...,N.NN
     87       1.1  christos 
     88   1.1.1.4  christos         my $wceplatf =  env('PLATFORM');
     89       1.1  christos 
     90       1.1  christos         $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
     91       1.1  christos         $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
     92       1.1  christos 
     93   1.1.1.4  christos         my $wcetgt = env('TARGETCPU');                      # just shorter name...
     94       1.1  christos       SWITCH: for($wcetgt) {
     95       1.1  christos           /^X86/        && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
     96       1.1  christos                                 $wcelflag.=" /machine:X86";     last; };
     97       1.1  christos           /^ARMV4[IT]/  && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
     98       1.1  christos                                 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
     99       1.1  christos                                 $wcecdefs.=" -QRarch4T -QRinterwork-return";
    100       1.1  christos                                 $wcelflag.=" /machine:THUMB";   last; };
    101       1.1  christos           /^ARM/        && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
    102       1.1  christos                                 $wcelflag.=" /machine:ARM";     last; };
    103       1.1  christos           /^MIPSIV/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
    104       1.1  christos                                 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
    105       1.1  christos                                 $wcelflag.=" /machine:MIPSFPU"; last; };
    106       1.1  christos           /^MIPS16/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
    107       1.1  christos                                 $wcecdefs.=" -DMIPSII -QMmips16";
    108       1.1  christos                                 $wcelflag.=" /machine:MIPS16";  last; };
    109       1.1  christos           /^MIPSII/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
    110       1.1  christos                                 $wcecdefs.=" -QMmips2";
    111       1.1  christos                                 $wcelflag.=" /machine:MIPS";    last; };
    112       1.1  christos           /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
    113       1.1  christos                                 $wcelflag.=" /machine:MIPS";    last; };
    114       1.1  christos           /^SH[0-9]/    && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
    115       1.1  christos                                 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
    116       1.1  christos                                 $wcelflag.=" /machine:$wcetgt"; last; };
    117       1.1  christos           { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
    118       1.1  christos             $wcelflag.=" /machine:$wcetgt";                     last; };
    119       1.1  christos       }
    120       1.1  christos 
    121   1.1.1.4  christos         $vc_wince_info = { cppflags => $wcecdefs,
    122       1.1  christos                            lflags => $wcelflag };
    123       1.1  christos     }
    124       1.1  christos     return $vc_wince_info;
    125       1.1  christos }
    126       1.1  christos 
    127       1.1  christos # Helper functions for the VMS configs
    128       1.1  christos my $vms_info = {};
    129       1.1  christos sub vms_info {
    130   1.1.1.4  christos     my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
    131   1.1.1.4  christos 
    132   1.1.1.4  christos     # For the case where Configure iterate through all config targets, such
    133   1.1.1.4  christos     # as when listing them and their details, we reset info if the pointer
    134   1.1.1.4  christos     # size changes.
    135   1.1.1.4  christos     if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
    136   1.1.1.4  christos         $vms_info = {};
    137   1.1.1.4  christos     }
    138       1.1  christos 
    139   1.1.1.4  christos     unless (%$vms_info) {
    140  1.1.1.13  christos         $vms_info->{disable_warns} = [
    141  1.1.1.13  christos             "CXXPRAGMANA",      # Shut up about unknown / unsupported pragmas
    142  1.1.1.13  christos         ];
    143       1.1  christos         $vms_info->{pointer_size} = $pointer_size_str;
    144   1.1.1.4  christos         if ($pointer_size_str eq "64") {
    145       1.1  christos             `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
    146       1.1  christos             if ($? == 0) {
    147       1.1  christos                 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
    148       1.1  christos             }
    149       1.1  christos         }
    150       1.1  christos 
    151       1.1  christos         unless ($disabled{zlib}) {
    152       1.1  christos             my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
    153       1.1  christos             if (defined($disabled{"zlib-dynamic"})) {
    154       1.1  christos                 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
    155       1.1  christos             } else {
    156       1.1  christos                 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
    157       1.1  christos                 # In case the --with-zlib-lib value contains something like
    158       1.1  christos                 # /SHARE or /LIB or so at the end, remove it.
    159       1.1  christos                 $vms_info->{def_zlib} =~ s|/.*$||g;
    160       1.1  christos             }
    161       1.1  christos         }
    162   1.1.1.4  christos 
    163   1.1.1.4  christos         if ($config{target} =~ /-ia64/) {
    164   1.1.1.4  christos             `PIPE ias -H 2> NL:`;
    165   1.1.1.4  christos             if ($? == 0) {
    166   1.1.1.4  christos                 $vms_info->{AS} = "ias";
    167   1.1.1.4  christos                 $vms_info->{ASFLAGS} = '-d debug';
    168   1.1.1.4  christos                 $vms_info->{asflags} = '"-N" vms_upcase';
    169   1.1.1.4  christos                 $vms_info->{asoutflag} = "-o ";
    170   1.1.1.4  christos                 $vms_info->{perlasm_scheme} = "ias";
    171   1.1.1.4  christos             }
    172   1.1.1.4  christos         }
    173       1.1  christos     }
    174       1.1  christos     return $vms_info;
    175       1.1  christos }
    176       1.1  christos 
    177   1.1.1.4  christos my %targets = (
    178       1.1  christos 
    179       1.1  christos #### Basic configs that should work on any 32-bit box
    180       1.1  christos     "gcc" => {
    181   1.1.1.4  christos         inherit_from     => [ "BASE_unix" ],
    182   1.1.1.4  christos         CC               => "gcc",
    183   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
    184       1.1  christos                                    release => "-O3"),
    185       1.1  christos         thread_scheme    => "(unknown)",
    186       1.1  christos         bn_ops           => "BN_LLONG",
    187       1.1  christos     },
    188       1.1  christos     "cc" => {
    189   1.1.1.4  christos         inherit_from     => [ "BASE_unix" ],
    190   1.1.1.4  christos         CC               => "cc",
    191   1.1.1.4  christos         CFLAGS           => "-O",
    192       1.1  christos         thread_scheme    => "(unknown)",
    193       1.1  christos     },
    194       1.1  christos 
    195       1.1  christos #### VOS Configurations
    196       1.1  christos     "vos-gcc" => {
    197       1.1  christos         inherit_from     => [ "BASE_unix" ],
    198   1.1.1.4  christos         CC               => "gcc",
    199   1.1.1.4  christos         CFLAGS           => picker(default => "-Wall",
    200       1.1  christos                                    debug   => "-O0 -g",
    201       1.1  christos                                    release => "-O3"),
    202   1.1.1.4  christos         cppflags         => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
    203   1.1.1.4  christos         lib_cppflags     => "-DB_ENDIAN",
    204       1.1  christos         thread_scheme    => "(unknown)",
    205       1.1  christos         sys_id           => "VOS",
    206   1.1.1.4  christos         lflags           => add("-Wl,-map"),
    207       1.1  christos         bn_ops           => "BN_LLONG",
    208       1.1  christos         shared_extension => ".so",
    209       1.1  christos     },
    210       1.1  christos 
    211       1.1  christos #### Solaris configurations
    212       1.1  christos     "solaris-common" => {
    213       1.1  christos         inherit_from     => [ "BASE_unix" ],
    214       1.1  christos         template         => 1,
    215   1.1.1.4  christos         lib_cppflags     => "-DFILIO_H",
    216       1.1  christos         ex_libs          => add("-lsocket -lnsl -ldl"),
    217       1.1  christos         dso_scheme       => "dlfcn",
    218       1.1  christos         thread_scheme    => "pthreads",
    219  1.1.1.13  christos     },
    220  1.1.1.13  christos #### Solaris common with Sun C setups
    221  1.1.1.13  christos     "solaris-common-cc" => {
    222  1.1.1.13  christos         inherit_from     => [ "solaris-common" ],
    223  1.1.1.13  christos         template         => 1,
    224  1.1.1.13  christos         shared_target    => "solaris",
    225   1.1.1.4  christos         shared_ldflag    => "-Wl,-Bsymbolic",
    226   1.1.1.4  christos         shared_defflag   => "-Wl,-M,",
    227   1.1.1.4  christos         shared_sonameflag=> "-Wl,-h,",
    228       1.1  christos     },
    229  1.1.1.13  christos #### Solaris common with GNU C setups
    230  1.1.1.13  christos     "solaris-common-gcc" => {
    231  1.1.1.13  christos         inherit_from     => [ "solaris-common" ],
    232  1.1.1.13  christos         template         => 1,
    233  1.1.1.13  christos         shared_target    => "solaris-gcc-shared", # The rest is on shared_info.pl
    234  1.1.1.13  christos     },
    235       1.1  christos #### Solaris x86 with GNU C setups
    236       1.1  christos     "solaris-x86-gcc" => {
    237       1.1  christos         # NB. GNU C has to be configured to use GNU assembler, and not
    238       1.1  christos         # /usr/ccs/bin/as. Failure to comply will result in compile
    239       1.1  christos         # failures [at least] in 32-bit build.
    240  1.1.1.13  christos         inherit_from     => [ "solaris-common-gcc" ],
    241   1.1.1.4  christos         CC               => "gcc",
    242   1.1.1.4  christos         CFLAGS           => add_before(picker(default => "-Wall",
    243       1.1  christos                                               debug   => "-O0 -g",
    244   1.1.1.4  christos                                               release => "-O3 -fomit-frame-pointer")),
    245   1.1.1.4  christos         cflags           => add(threads("-pthread")),
    246   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    247   1.1.1.2  christos         ex_libs          => add(threads("-pthread")),
    248       1.1  christos         bn_ops           => "BN_LLONG",
    249       1.1  christos         shared_cflag     => "-fPIC",
    250   1.1.1.4  christos         shared_ldflag    => add_before("-shared -static-libgcc"),
    251  1.1.1.13  christos         asm_arch         => 'x86',
    252  1.1.1.13  christos         perlasm_scheme   => 'elf',
    253       1.1  christos     },
    254       1.1  christos     "solaris64-x86_64-gcc" => {
    255       1.1  christos         # -shared -static-libgcc might appear controversial, but modules
    256       1.1  christos         # taken from static libgcc do not have relocations and linking
    257       1.1  christos         # them into our shared objects doesn't have any negative side
    258       1.1  christos         # effects. On the contrary, doing so makes it possible to use
    259       1.1  christos         # gcc shared build with Sun C. Given that gcc generates faster
    260       1.1  christos         # code [thanks to inline assembler], I would actually recommend
    261       1.1  christos         # to consider using gcc shared build even with vendor compiler:-)
    262   1.1.1.4  christos         #                        -- <appro (at] openssl.org>
    263  1.1.1.13  christos         inherit_from     => [ "solaris-common-gcc" ],
    264   1.1.1.4  christos         CC               => "gcc",
    265   1.1.1.4  christos         CFLAGS           => add_before(picker(default => "-Wall",
    266       1.1  christos                                               debug   => "-O0 -g",
    267   1.1.1.4  christos                                               release => "-O3")),
    268   1.1.1.4  christos         cflags           => add_before("-m64", threads("-pthread")),
    269   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    270   1.1.1.2  christos         ex_libs          => add(threads("-pthread")),
    271       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    272  1.1.1.13  christos         asm_arch         => 'x86_64',
    273       1.1  christos         perlasm_scheme   => "elf",
    274       1.1  christos         shared_cflag     => "-fPIC",
    275   1.1.1.4  christos         shared_ldflag    => add_before("-shared -static-libgcc"),
    276       1.1  christos         multilib         => "/64",
    277       1.1  christos     },
    278       1.1  christos 
    279       1.1  christos #### Solaris x86 with Sun C setups
    280       1.1  christos     # There used to be solaris-x86-cc target, but it was removed,
    281       1.1  christos     # primarily because vendor assembler can't assemble our modules
    282       1.1  christos     # with -KPIC flag. As result it, assembly support, was not even
    283       1.1  christos     # available as option. But its lack means lack of side-channel
    284   1.1.1.7  christos     # resistant code, which is incompatible with security by today's
    285       1.1  christos     # standards. Fortunately gcc is readily available prepackaged
    286       1.1  christos     # option, which we can firmly point at...
    287       1.1  christos     #
    288       1.1  christos     # On related note, solaris64-x86_64-cc target won't compile code
    289       1.1  christos     # paths utilizing AVX and post-Haswell instruction extensions.
    290       1.1  christos     # Consider switching to solaris64-x86_64-gcc even here...
    291       1.1  christos     #
    292       1.1  christos     "solaris64-x86_64-cc" => {
    293  1.1.1.13  christos         inherit_from     => [ "solaris-common-cc" ],
    294   1.1.1.4  christos         CC               => "cc",
    295   1.1.1.4  christos         CFLAGS           => add_before(picker(debug   => "-g",
    296   1.1.1.4  christos                                               release => "-xO5 -xdepend -xbuiltin")),
    297   1.1.1.4  christos         cflags           => add_before("-xarch=generic64 -xstrconst -Xa"),
    298   1.1.1.4  christos         cppflags         => add(threads("-D_REENTRANT")),
    299   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    300       1.1  christos         thread_scheme    => "pthreads",
    301   1.1.1.4  christos         lflags           => add(threads("-mt")),
    302       1.1  christos         ex_libs          => add(threads("-lpthread")),
    303       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    304  1.1.1.13  christos         asm_arch         => 'x86_64',
    305       1.1  christos         perlasm_scheme   => "elf",
    306       1.1  christos         shared_cflag     => "-KPIC",
    307   1.1.1.4  christos         shared_ldflag    => add_before("-G -dy -z text"),
    308       1.1  christos         multilib         => "/64",
    309       1.1  christos     },
    310       1.1  christos 
    311       1.1  christos #### SPARC Solaris with GNU C setups
    312       1.1  christos     "solaris-sparcv7-gcc" => {
    313  1.1.1.13  christos         inherit_from     => [ "solaris-common-gcc" ],
    314   1.1.1.4  christos         CC               => "gcc",
    315   1.1.1.4  christos         CFLAGS           => add_before(picker(default => "-Wall",
    316       1.1  christos                                               debug   => "-O0 -g",
    317   1.1.1.4  christos                                               release => "-O3")),
    318   1.1.1.4  christos         cflags           => add(threads("-pthread")),
    319   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN -DBN_DIV2W"),
    320   1.1.1.2  christos         ex_libs          => add(threads("-pthread")),
    321       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    322       1.1  christos         shared_cflag     => "-fPIC",
    323   1.1.1.4  christos         shared_ldflag    => add_before("-shared"),
    324       1.1  christos     },
    325       1.1  christos     "solaris-sparcv8-gcc" => {
    326  1.1.1.13  christos         inherit_from     => [ "solaris-sparcv7-gcc" ],
    327       1.1  christos         cflags           => add_before("-mcpu=v8"),
    328  1.1.1.13  christos         asm_arch         => 'sparcv8',
    329  1.1.1.13  christos         perlasm_scheme   => 'void',
    330       1.1  christos     },
    331       1.1  christos     "solaris-sparcv9-gcc" => {
    332       1.1  christos         # -m32 should be safe to add as long as driver recognizes
    333       1.1  christos         # -mcpu=ultrasparc
    334  1.1.1.13  christos         inherit_from     => [ "solaris-sparcv7-gcc" ],
    335       1.1  christos         cflags           => add_before("-m32 -mcpu=ultrasparc"),
    336  1.1.1.13  christos         asm_arch         => 'sparcv9',
    337  1.1.1.13  christos         perlasm_scheme   => 'void',
    338       1.1  christos     },
    339       1.1  christos     "solaris64-sparcv9-gcc" => {
    340       1.1  christos         inherit_from     => [ "solaris-sparcv9-gcc" ],
    341       1.1  christos         cflags           => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
    342       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    343       1.1  christos         multilib         => "/64",
    344       1.1  christos     },
    345       1.1  christos 
    346       1.1  christos #### SPARC Solaris with Sun C setups
    347       1.1  christos # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
    348       1.1  christos # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
    349       1.1  christos # SC5.0 note: Compiler common patch 107357-01 or later is required!
    350       1.1  christos     "solaris-sparcv7-cc" => {
    351  1.1.1.13  christos         inherit_from     => [ "solaris-common-cc" ],
    352   1.1.1.4  christos         CC               => "cc",
    353   1.1.1.4  christos         CFLAGS           => add_before(picker(debug   => "-g",
    354   1.1.1.4  christos                                               release => "-xO5 -xdepend")),
    355   1.1.1.4  christos         cflags           => add_before("-xstrconst -Xa"),
    356   1.1.1.4  christos         cppflags         => add(threads("-D_REENTRANT")),
    357   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN -DBN_DIV2W"),
    358       1.1  christos         lflags           => add(threads("-mt")),
    359       1.1  christos         ex_libs          => add(threads("-lpthread")),
    360       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    361       1.1  christos         shared_cflag     => "-KPIC",
    362   1.1.1.4  christos         shared_ldflag    => add_before("-G -dy -z text"),
    363       1.1  christos     },
    364       1.1  christos ####
    365       1.1  christos     "solaris-sparcv8-cc" => {
    366  1.1.1.13  christos         inherit_from     => [ "solaris-sparcv7-cc" ],
    367       1.1  christos         cflags           => add_before("-xarch=v8"),
    368  1.1.1.13  christos         asm_arch         => 'sparcv8',
    369  1.1.1.13  christos         perlasm_scheme   => 'void',
    370       1.1  christos     },
    371       1.1  christos     "solaris-sparcv9-cc" => {
    372  1.1.1.13  christos         inherit_from     => [ "solaris-sparcv7-cc" ],
    373       1.1  christos         cflags           => add_before("-xarch=v8plus"),
    374  1.1.1.13  christos         asm_arch         => 'sparcv9',
    375  1.1.1.13  christos         perlasm_scheme   => 'void',
    376       1.1  christos     },
    377       1.1  christos     "solaris64-sparcv9-cc" => {
    378  1.1.1.13  christos         inherit_from     => [ "solaris-sparcv7-cc" ],
    379  1.1.1.13  christos         cflags           => add_before("-m64 -xarch=sparc"),
    380       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    381  1.1.1.13  christos         asm_arch         => 'sparcv9',
    382  1.1.1.13  christos         perlasm_scheme   => 'void',
    383       1.1  christos         multilib         => "/64",
    384       1.1  christos     },
    385       1.1  christos 
    386       1.1  christos #### IRIX 6.x configs
    387       1.1  christos # Only N32 and N64 ABIs are supported.
    388   1.1.1.4  christos     "irix-common" => {
    389   1.1.1.4  christos         inherit_from     => [ "BASE_unix" ],
    390   1.1.1.4  christos         template         => 1,
    391   1.1.1.4  christos         cppflags         => threads("-D_SGI_MP_SOURCE"),
    392   1.1.1.5  christos         lib_cppflags     => "-DB_ENDIAN",
    393       1.1  christos         ex_libs          => add(threads("-lpthread")),
    394       1.1  christos         thread_scheme    => "pthreads",
    395       1.1  christos         dso_scheme       => "dlfcn",
    396   1.1.1.4  christos         shared_target    => "self",
    397   1.1.1.4  christos         shared_ldflag    => "-shared -Wl,-Bsymbolic",
    398   1.1.1.4  christos         shared_sonameflag=> "-Wl,-soname,",
    399   1.1.1.4  christos     },
    400   1.1.1.4  christos     "irix-mips3-gcc" => {
    401  1.1.1.13  christos         inherit_from     => [ "irix-common" ],
    402   1.1.1.4  christos         CC               => "gcc",
    403   1.1.1.4  christos         CFLAGS           => picker(debug   => "-g -O0",
    404   1.1.1.4  christos                                    release => "-O3"),
    405   1.1.1.4  christos         LDFLAGS          => "-static-libgcc",
    406   1.1.1.4  christos         cflags           => "-mabi=n32",
    407   1.1.1.4  christos         bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT",
    408  1.1.1.13  christos         asm_arch         => 'mips64',
    409   1.1.1.4  christos         perlasm_scheme   => "n32",
    410       1.1  christos         multilib         => "32",
    411       1.1  christos     },
    412       1.1  christos     "irix-mips3-cc" => {
    413  1.1.1.13  christos         inherit_from     => [ "irix-common" ],
    414   1.1.1.4  christos         CC               => "cc",
    415   1.1.1.4  christos         CFLAGS           => picker(debug   => "-g -O0",
    416   1.1.1.4  christos                                    release => "-O2"),
    417   1.1.1.4  christos         cflags           => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
    418       1.1  christos         bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT",
    419  1.1.1.13  christos         asm_arch         => 'mips64',
    420       1.1  christos         perlasm_scheme   => "n32",
    421       1.1  christos         multilib         => "32",
    422       1.1  christos     },
    423       1.1  christos     # N64 ABI builds.
    424       1.1  christos     "irix64-mips4-gcc" => {
    425  1.1.1.13  christos         inherit_from     => [ "irix-common" ],
    426   1.1.1.4  christos         CC               => "gcc",
    427   1.1.1.4  christos         CFLAGS           => picker(debug   => "-g -O0",
    428   1.1.1.4  christos                                    release => "-O3"),
    429   1.1.1.4  christos         LDFLAGS          => "-static-libgcc",
    430   1.1.1.4  christos         cflags           => "-mabi=64 -mips4",
    431       1.1  christos         bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
    432  1.1.1.13  christos         asm_arch         => 'mips64',
    433       1.1  christos         perlasm_scheme   => "64",
    434       1.1  christos         multilib         => "64",
    435       1.1  christos     },
    436       1.1  christos     "irix64-mips4-cc" => {
    437  1.1.1.13  christos         inherit_from     => [ "irix-common" ],
    438   1.1.1.4  christos         CC               => "cc",
    439   1.1.1.4  christos         CFLAGS           => picker(debug   => "-g -O0",
    440   1.1.1.4  christos                                    release => "-O2"),
    441   1.1.1.4  christos         cflags           => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
    442       1.1  christos         bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
    443  1.1.1.13  christos         asm_arch         => 'mips64',
    444       1.1  christos         perlasm_scheme   => "64",
    445       1.1  christos         multilib         => "64",
    446       1.1  christos     },
    447       1.1  christos 
    448       1.1  christos #### Unified HP-UX ANSI C configs.
    449       1.1  christos # Special notes:
    450       1.1  christos # - Originally we were optimizing at +O4 level. It should be noted
    451       1.1  christos #   that the only difference between +O3 and +O4 is global inter-
    452       1.1  christos #   procedural analysis. As it has to be performed during the link
    453       1.1  christos #   stage the compiler leaves behind certain pseudo-code in lib*.a
    454       1.1  christos #   which might be release or even patch level specific. Generating
    455       1.1  christos #   the machine code for and analyzing the *whole* program appears
    456       1.1  christos #   to be *extremely* memory demanding while the performance gain is
    457       1.1  christos #   actually questionable. The situation is intensified by the default
    458       1.1  christos #   HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
    459       1.1  christos #   which is way too low for +O4. In other words, doesn't +O3 make
    460       1.1  christos #   more sense?
    461       1.1  christos # - Keep in mind that the HP compiler by default generates code
    462       1.1  christos #   suitable for execution on the host you're currently compiling at.
    463       1.1  christos #   If the toolkit is meant to be used on various PA-RISC processors
    464       1.1  christos #   consider './Configure hpux-parisc-[g]cc +DAportable'.
    465       1.1  christos # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
    466       1.1  christos #   32-bit message digests. (For the moment of this writing) HP C
    467       1.1  christos #   doesn't seem to "digest" too many local variables (they make "him"
    468       1.1  christos #   chew forever:-). For more details look-up MD32_XARRAY comment in
    469   1.1.1.7  christos #   crypto/sha/sha_local.h.
    470       1.1  christos # - originally there were 32-bit hpux-parisc2-* targets. They were
    471       1.1  christos #   scrapped, because a) they were not interchangeable with other 32-bit
    472       1.1  christos #   targets; b) performance-critical 32-bit assembly modules implement
    473       1.1  christos #   even PA-RISC 2.0-specific code paths, which are chosen at run-time,
    474       1.1  christos #   thus adequate performance is provided even with PA-RISC 1.1 build.
    475   1.1.1.3  christos     "hpux-common" => {
    476       1.1  christos         inherit_from     => [ "BASE_unix" ],
    477   1.1.1.3  christos         template         => 1,
    478   1.1.1.3  christos         defines          => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
    479   1.1.1.3  christos                                 "_HPUX_ALT_XOPEN_SOCKET_API"),
    480   1.1.1.4  christos         lib_cppflags     => "-DB_ENDIAN",
    481   1.1.1.3  christos         thread_scheme    => "pthreads",
    482   1.1.1.3  christos         dso_scheme       => "dlfcn",    # overridden in 32-bit PA-RISC builds
    483   1.1.1.4  christos         shared_target    => "self",
    484   1.1.1.4  christos         bin_lflags       => "-Wl,+s,+cdp,../:,+cdp,./:",
    485   1.1.1.4  christos         shared_ldflag    => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
    486   1.1.1.4  christos         shared_sonameflag=> "-Wl,+h,",
    487   1.1.1.3  christos     },
    488   1.1.1.3  christos     "hpux-parisc-gcc" => {
    489   1.1.1.3  christos         inherit_from     => [ "hpux-common" ],
    490   1.1.1.4  christos         CC               => "gcc",
    491   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
    492   1.1.1.4  christos                                    release => "-O3"),
    493   1.1.1.4  christos         cflags           => add(threads("-pthread")),
    494   1.1.1.4  christos         lib_cppflags     => add("-DBN_DIV2W"),
    495   1.1.1.4  christos         ex_libs          => add("-ldld", threads("-pthread")),
    496   1.1.1.4  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    497       1.1  christos         dso_scheme       => "dl",
    498       1.1  christos         shared_cflag     => "-fPIC",
    499   1.1.1.4  christos         shared_ldflag    => add_before("-shared"),
    500   1.1.1.4  christos         shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
    501       1.1  christos     },
    502       1.1  christos     "hpux-parisc1_1-gcc" => {
    503  1.1.1.13  christos         inherit_from     => [ "hpux-parisc-gcc" ],
    504  1.1.1.13  christos         asm_arch         => 'parisc11',
    505  1.1.1.13  christos         perlasm_scheme   => "32",
    506       1.1  christos         multilib         => "/pa1.1",
    507       1.1  christos     },
    508       1.1  christos     "hpux64-parisc2-gcc" => {
    509  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    510   1.1.1.4  christos         CC               => "gcc",
    511   1.1.1.4  christos         CFLAGS           => combine(picker(debug   => "-O0 -g",
    512   1.1.1.4  christos                                            release => "-O3")),
    513   1.1.1.4  christos         cflags           => add(threads("-pthread")),
    514   1.1.1.4  christos         ex_libs          => add("-ldl", threads("-pthread")),
    515       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
    516  1.1.1.13  christos         asm_arch         => 'parisc20_64',
    517  1.1.1.13  christos         perlasm_scheme   => "64",
    518       1.1  christos         shared_cflag     => "-fpic",
    519   1.1.1.4  christos         shared_ldflag    => add_before("-shared"),
    520   1.1.1.4  christos         shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
    521       1.1  christos         multilib         => "/pa20_64",
    522       1.1  christos     },
    523       1.1  christos 
    524       1.1  christos     # More attempts at unified 10.X and 11.X targets for HP C compiler.
    525       1.1  christos     "hpux-parisc-cc" => {
    526   1.1.1.3  christos         inherit_from     => [ "hpux-common" ],
    527   1.1.1.4  christos         CC               => "cc",
    528   1.1.1.4  christos         CFLAGS           => picker(debug   => "+O0 +d -g",
    529   1.1.1.4  christos                                    release => "+O3"),
    530   1.1.1.4  christos         cflags           => "+Optrs_strongly_typed -Ae +ESlit",
    531   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT"),
    532   1.1.1.4  christos         lib_cppflags     => add("-DBN_DIV2W -DMD32_XARRAY"),
    533   1.1.1.4  christos         ex_libs          => add("-ldld", threads("-lpthread")),
    534       1.1  christos         bn_ops           => "RC4_CHAR",
    535       1.1  christos         dso_scheme       => "dl",
    536       1.1  christos         shared_cflag     => "+Z",
    537   1.1.1.4  christos         shared_ldflag    => add_before("-b"),
    538   1.1.1.4  christos         shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
    539       1.1  christos     },
    540       1.1  christos     "hpux-parisc1_1-cc" => {
    541  1.1.1.13  christos         inherit_from     => [ "hpux-parisc-cc" ],
    542       1.1  christos         cflags           => add_before("+DA1.1"),
    543  1.1.1.13  christos         asm_arch         => 'parisc11',
    544  1.1.1.13  christos         perlasm_scheme   => "32",
    545       1.1  christos         multilib         => "/pa1.1",
    546       1.1  christos     },
    547       1.1  christos     "hpux64-parisc2-cc" => {
    548  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    549   1.1.1.4  christos         CC               => "cc",
    550   1.1.1.4  christos         CFLAGS           => picker(debug   => "+O0 +d -g",
    551   1.1.1.4  christos                                    release => "+O3") ,
    552   1.1.1.4  christos         cflags           => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
    553   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT") ,
    554   1.1.1.4  christos         lib_cppflags     => add("-DMD32_XARRAY"),
    555   1.1.1.4  christos         ex_libs          => add("-ldl", threads("-lpthread")),
    556       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
    557  1.1.1.13  christos         asm_arch         => 'parisc20_64',
    558  1.1.1.13  christos         perlasm_scheme   => "64",
    559       1.1  christos         shared_cflag     => "+Z",
    560   1.1.1.4  christos         shared_ldflag    => add_before("-b"),
    561   1.1.1.4  christos         shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
    562       1.1  christos         multilib         => "/pa20_64",
    563       1.1  christos     },
    564       1.1  christos 
    565       1.1  christos     # HP/UX IA-64 targets
    566       1.1  christos     "hpux-ia64-cc" => {
    567  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    568   1.1.1.4  christos         CC               => "cc",
    569   1.1.1.4  christos         CFLAGS           => picker(debug   => "+O0 +d -g",
    570   1.1.1.4  christos                                    release => "+O2"),
    571   1.1.1.4  christos         cflags           => "-Ae +DD32 +Olit=all -z",
    572   1.1.1.4  christos         cppflags         => add(threads("-D_REENTRANT")),
    573   1.1.1.4  christos         ex_libs          => add("-ldl", threads("-lpthread")),
    574       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT",
    575  1.1.1.13  christos         asm_arch         => 'ia64',
    576  1.1.1.13  christos         perlasm_scheme   => 'void',
    577       1.1  christos         shared_cflag     => "+Z",
    578   1.1.1.4  christos         shared_ldflag    => add_before("-b"),
    579       1.1  christos         multilib         => "/hpux32",
    580       1.1  christos     },
    581       1.1  christos     "hpux64-ia64-cc" => {
    582  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    583   1.1.1.4  christos         CC               => "cc",
    584   1.1.1.4  christos         CFLAGS           => picker(debug   => "+O0 +d -g",
    585   1.1.1.4  christos                                    release => "+O3"),
    586   1.1.1.4  christos         cflags           => "-Ae +DD64 +Olit=all -z",
    587   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT"),
    588       1.1  christos         ex_libs          => add("-ldl", threads("-lpthread")),
    589       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    590  1.1.1.13  christos         asm_arch         => 'ia64',
    591  1.1.1.13  christos         perlasm_scheme   => 'void',
    592       1.1  christos         shared_cflag     => "+Z",
    593   1.1.1.4  christos         shared_ldflag    => add_before("-b"),
    594       1.1  christos         multilib         => "/hpux64",
    595       1.1  christos     },
    596       1.1  christos     # GCC builds...
    597       1.1  christos     "hpux-ia64-gcc" => {
    598  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    599   1.1.1.4  christos         CC               => "gcc",
    600   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
    601   1.1.1.4  christos                                    release => "-O3"),
    602   1.1.1.4  christos         cflags           => add(threads("-pthread")),
    603   1.1.1.2  christos         ex_libs          => add("-ldl", threads("-pthread")),
    604       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT",
    605  1.1.1.13  christos         asm_arch         => 'ia64',
    606  1.1.1.13  christos         perlasm_scheme   => 'void',
    607       1.1  christos         shared_cflag     => "-fpic",
    608   1.1.1.4  christos         shared_ldflag    => add_before("-shared"),
    609       1.1  christos         multilib         => "/hpux32",
    610       1.1  christos     },
    611       1.1  christos     "hpux64-ia64-gcc" => {
    612  1.1.1.13  christos         inherit_from     => [ "hpux-common" ],
    613   1.1.1.4  christos         CC               => "gcc",
    614   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
    615   1.1.1.4  christos                                    release => "-O3"),
    616   1.1.1.4  christos         cflags           => combine("-mlp64", threads("-pthread")),
    617   1.1.1.2  christos         ex_libs          => add("-ldl", threads("-pthread")),
    618       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    619  1.1.1.13  christos         asm_arch         => 'ia64',
    620  1.1.1.13  christos         perlasm_scheme   => 'void',
    621       1.1  christos         shared_cflag     => "-fpic",
    622   1.1.1.4  christos         shared_ldflag    => add_before("-shared"),
    623       1.1  christos         multilib         => "/hpux64",
    624       1.1  christos     },
    625       1.1  christos 
    626       1.1  christos #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
    627       1.1  christos     "MPE/iX-gcc" => {
    628       1.1  christos         inherit_from     => [ "BASE_unix" ],
    629   1.1.1.4  christos         CC               => "gcc",
    630   1.1.1.4  christos         CFLAGS           => "-O3",
    631   1.1.1.4  christos         cppflags         => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
    632   1.1.1.4  christos         includes         => [ "/SYSLOG/PUB" ],
    633   1.1.1.4  christos         lib_cppflags     => "-DBN_DIV2W",
    634       1.1  christos         sys_id           => "MPE",
    635   1.1.1.4  christos         lflags           => add("-L/SYSLOG/PUB"),
    636   1.1.1.4  christos         ex_libs          => add("-lsyslog -lsocket -lcurses"),
    637       1.1  christos         thread_scheme    => "(unknown)",
    638       1.1  christos         bn_ops           => "BN_LLONG",
    639       1.1  christos     },
    640       1.1  christos 
    641       1.1  christos #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
    642       1.1  christos #### and forward. In reality 'uname -s' still returns "OSF1". Originally
    643       1.1  christos #### there were even osf1-* configs targeting prior versions provided,
    644       1.1  christos #### but not anymore...
    645       1.1  christos     "tru64-alpha-gcc" => {
    646  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
    647   1.1.1.4  christos         CC               => "gcc",
    648   1.1.1.4  christos         CFLAGS           => "-O3",
    649   1.1.1.4  christos         cflags           => add("-std=c9x", threads("-pthread")),
    650   1.1.1.4  christos         cppflags         => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
    651   1.1.1.2  christos         ex_libs          => add("-lrt", threads("-pthread")), # for mlock(2)
    652       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    653  1.1.1.13  christos         asm_arch         => 'alpha',
    654  1.1.1.13  christos         perlasm_scheme   => "void",
    655       1.1  christos         thread_scheme    => "pthreads",
    656       1.1  christos         dso_scheme       => "dlfcn",
    657       1.1  christos         shared_target    => "alpha-osf1-shared",
    658       1.1  christos         shared_extension => ".so",
    659       1.1  christos     },
    660       1.1  christos     "tru64-alpha-cc" => {
    661  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
    662   1.1.1.4  christos         CC               => "cc",
    663   1.1.1.4  christos         CFLAGS           => "-tune host -fast",
    664   1.1.1.4  christos         cflags           => add("-std1 -readonly_strings",
    665   1.1.1.4  christos                                 threads("-pthread")),
    666   1.1.1.4  christos         cppflags         => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
    667   1.1.1.2  christos         ex_libs          => add("-lrt", threads("-pthread")), # for mlock(2)
    668       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    669  1.1.1.13  christos         asm_arch         => 'alpha',
    670  1.1.1.13  christos         perlasm_scheme   => "void",
    671       1.1  christos         thread_scheme    => "pthreads",
    672       1.1  christos         dso_scheme       => "dlfcn",
    673       1.1  christos         shared_target    => "alpha-osf1-shared",
    674       1.1  christos         shared_ldflag    => "-msym",
    675       1.1  christos         shared_extension => ".so",
    676       1.1  christos     },
    677       1.1  christos 
    678       1.1  christos ####
    679       1.1  christos #### Variety of LINUX:-)
    680       1.1  christos ####
    681       1.1  christos # *-generic* is endian-neutral target, but ./config is free to
    682       1.1  christos # throw in -D[BL]_ENDIAN, whichever appropriate...
    683       1.1  christos     "linux-generic32" => {
    684       1.1  christos         inherit_from     => [ "BASE_unix" ],
    685   1.1.1.4  christos         CC               => "gcc",
    686   1.1.1.4  christos         CXX              => "g++",
    687   1.1.1.4  christos         CFLAGS           => picker(default => "-Wall",
    688   1.1.1.4  christos                                    debug   => "-O0 -g",
    689   1.1.1.4  christos                                    release => "-O3"),
    690   1.1.1.4  christos         CXXFLAGS         => picker(default => "-Wall",
    691   1.1.1.4  christos                                    debug   => "-O0 -g",
    692   1.1.1.4  christos                                    release => "-O3"),
    693   1.1.1.4  christos         cflags           => threads("-pthread"),
    694   1.1.1.4  christos         cxxflags         => combine("-std=c++11", threads("-pthread")),
    695   1.1.1.4  christos         lib_cppflags     => "-DOPENSSL_USE_NODELETE",
    696   1.1.1.2  christos         ex_libs          => add("-ldl", threads("-pthread")),
    697       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    698       1.1  christos         thread_scheme    => "pthreads",
    699       1.1  christos         dso_scheme       => "dlfcn",
    700       1.1  christos         shared_target    => "linux-shared",
    701   1.1.1.4  christos         shared_cflag     => "-fPIC",
    702   1.1.1.5  christos         shared_ldflag    => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
    703   1.1.1.4  christos         enable           => [ "afalgeng" ],
    704       1.1  christos     },
    705  1.1.1.13  christos     "linux-latomic" => {
    706  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    707  1.1.1.13  christos         ex_libs          => add(threads("-latomic")),
    708  1.1.1.13  christos     },
    709       1.1  christos     "linux-generic64" => {
    710       1.1  christos         inherit_from     => [ "linux-generic32" ],
    711       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
    712       1.1  christos     },
    713       1.1  christos 
    714       1.1  christos     "linux-ppc" => {
    715  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    716  1.1.1.13  christos         asm_arch         => 'ppc32',
    717       1.1  christos         perlasm_scheme   => "linux32",
    718   1.1.1.9  christos         lib_cppflags     => add("-DB_ENDIAN"),
    719       1.1  christos     },
    720       1.1  christos     "linux-ppc64" => {
    721  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    722   1.1.1.4  christos         cflags           => add("-m64"),
    723   1.1.1.4  christos         cxxflags         => add("-m64"),
    724   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
    725  1.1.1.13  christos         asm_arch         => 'ppc64',
    726       1.1  christos         perlasm_scheme   => "linux64",
    727       1.1  christos         multilib         => "64",
    728       1.1  christos     },
    729       1.1  christos     "linux-ppc64le" => {
    730  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    731   1.1.1.4  christos         cflags           => add("-m64"),
    732   1.1.1.4  christos         cxxflags         => add("-m64"),
    733   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    734  1.1.1.13  christos         asm_arch         => 'ppc64',
    735       1.1  christos         perlasm_scheme   => "linux64le",
    736       1.1  christos     },
    737       1.1  christos 
    738       1.1  christos     "linux-armv4" => {
    739       1.1  christos         ################################################################
    740       1.1  christos         # Note that -march is not among compiler options in linux-armv4
    741       1.1  christos         # target description. Not specifying one is intentional to give
    742       1.1  christos         # you choice to:
    743       1.1  christos         #
    744       1.1  christos         # a) rely on your compiler default by not specifying one;
    745       1.1  christos         # b) specify your target platform explicitly for optimal
    746       1.1  christos         # performance, e.g. -march=armv6 or -march=armv7-a;
    747       1.1  christos         # c) build "universal" binary that targets *range* of platforms
    748       1.1  christos         # by specifying minimum and maximum supported architecture;
    749       1.1  christos         #
    750       1.1  christos         # As for c) option. It actually makes no sense to specify
    751       1.1  christos         # maximum to be less than ARMv7, because it's the least
    752       1.1  christos         # requirement for run-time switch between platform-specific
    753       1.1  christos         # code paths. And without run-time switch performance would be
    754       1.1  christos         # equivalent to one for minimum. Secondly, there are some
    755       1.1  christos         # natural limitations that you'd have to accept and respect.
    756       1.1  christos         # Most notably you can *not* build "universal" binary for
    757       1.1  christos         # big-endian platform. This is because ARMv7 processor always
    758       1.1  christos         # picks instructions in little-endian order. Another similar
    759       1.1  christos         # limitation is that -mthumb can't "cross" -march=armv6t2
    760       1.1  christos         # boundary, because that's where it became Thumb-2. Well, this
    761       1.1  christos         # limitation is a bit artificial, because it's not really
    762       1.1  christos         # impossible, but it's deemed too tricky to support. And of
    763       1.1  christos         # course you have to be sure that your binutils are actually
    764       1.1  christos         # up to the task of handling maximum target platform. With all
    765       1.1  christos         # this in mind here is an example of how to configure
    766       1.1  christos         # "universal" build:
    767       1.1  christos         #
    768       1.1  christos         # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
    769       1.1  christos         #
    770  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    771  1.1.1.13  christos         asm_arch         => 'armv4',
    772       1.1  christos         perlasm_scheme   => "linux32",
    773       1.1  christos     },
    774       1.1  christos     "linux-aarch64" => {
    775  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    776  1.1.1.13  christos         asm_arch         => 'aarch64',
    777       1.1  christos         perlasm_scheme   => "linux64",
    778       1.1  christos     },
    779       1.1  christos     "linux-arm64ilp32" => {  # https://wiki.linaro.org/Platform/arm64-ilp32
    780  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    781       1.1  christos         cflags           => add("-mabi=ilp32"),
    782   1.1.1.4  christos         cxxflags         => add("-mabi=ilp32"),
    783       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
    784  1.1.1.13  christos         asm_arch         => 'aarch64',
    785       1.1  christos         perlasm_scheme   => "linux64",
    786       1.1  christos     },
    787  1.1.1.16  christos     "linux-arm64ilp32-clang" => {  # clang config abi by --target
    788  1.1.1.16  christos         inherit_from     => [ "linux-generic32" ],
    789  1.1.1.16  christos         CC               => "clang",
    790  1.1.1.16  christos         CXX              => "clang++",
    791  1.1.1.16  christos         bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
    792  1.1.1.16  christos         asm_arch         => 'aarch64',
    793  1.1.1.16  christos         perlasm_scheme   => "linux64",
    794  1.1.1.16  christos     },
    795       1.1  christos     "linux-mips32" => {
    796       1.1  christos         # Configure script adds minimally required -march for assembly
    797       1.1  christos         # support, if no -march was specified at command line.
    798  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    799   1.1.1.4  christos         cflags           => add("-mabi=32"),
    800   1.1.1.4  christos         cxxflags         => add("-mabi=32"),
    801  1.1.1.13  christos         asm_arch         => 'mips32',
    802       1.1  christos         perlasm_scheme   => "o32",
    803       1.1  christos     },
    804       1.1  christos     # mips32 and mips64 below refer to contemporary MIPS Architecture
    805       1.1  christos     # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
    806       1.1  christos     "linux-mips64" => {
    807  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    808   1.1.1.4  christos         cflags           => add("-mabi=n32"),
    809   1.1.1.4  christos         cxxflags         => add("-mabi=n32"),
    810  1.1.1.12  christos         bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT",
    811  1.1.1.13  christos         asm_arch         => 'mips64',
    812       1.1  christos         perlasm_scheme   => "n32",
    813       1.1  christos         multilib         => "32",
    814       1.1  christos     },
    815       1.1  christos     "linux64-mips64" => {
    816  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    817   1.1.1.4  christos         cflags           => add("-mabi=64"),
    818   1.1.1.4  christos         cxxflags         => add("-mabi=64"),
    819  1.1.1.13  christos         asm_arch         => 'mips64',
    820       1.1  christos         perlasm_scheme   => "64",
    821       1.1  christos         multilib         => "64",
    822       1.1  christos     },
    823       1.1  christos 
    824  1.1.1.10  christos     # riscv64 below refers to contemporary RISCV Architecture
    825  1.1.1.10  christos     # specifications,
    826  1.1.1.10  christos     "linux64-riscv64" => {
    827  1.1.1.10  christos         inherit_from     => [ "linux-generic64"],
    828  1.1.1.10  christos         perlasm_scheme   => "linux64",
    829  1.1.1.10  christos     },
    830  1.1.1.10  christos 
    831  1.1.1.12  christos     # loongarch64 below refers to contemporary LoongArch Architecture
    832  1.1.1.12  christos     # specifications,
    833  1.1.1.12  christos     "linux64-loongarch64" => {
    834  1.1.1.12  christos         inherit_from     => [ "linux-generic64"],
    835  1.1.1.12  christos         perlasm_scheme   => "linux64",
    836  1.1.1.12  christos     },
    837  1.1.1.12  christos 
    838       1.1  christos     #### IA-32 targets...
    839       1.1  christos     #### These two targets are a bit aged and are to be used on older Linux
    840       1.1  christos     #### machines where gcc doesn't understand -m32 and -m64
    841       1.1  christos     "linux-elf" => {
    842  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    843   1.1.1.4  christos         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
    844   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    845       1.1  christos         bn_ops           => "BN_LLONG",
    846  1.1.1.13  christos         asm_arch         => 'x86',
    847  1.1.1.13  christos         perlasm_scheme   => "elf",
    848       1.1  christos     },
    849       1.1  christos     "linux-aout" => {
    850  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
    851   1.1.1.4  christos         CC               => "gcc",
    852   1.1.1.4  christos         CFLAGS           => add(picker(default => "-Wall",
    853       1.1  christos                                        debug   => "-O0 -g",
    854       1.1  christos                                        release => "-O3 -fomit-frame-pointer")),
    855   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    856       1.1  christos         bn_ops           => "BN_LLONG",
    857       1.1  christos         thread_scheme    => "(unknown)",
    858  1.1.1.13  christos         asm_arch         => 'x86',
    859       1.1  christos         perlasm_scheme   => "a.out",
    860       1.1  christos     },
    861       1.1  christos 
    862       1.1  christos     #### X86 / X86_64 targets
    863       1.1  christos     "linux-x86" => {
    864  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    865   1.1.1.4  christos         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
    866   1.1.1.4  christos         cflags           => add("-m32"),
    867   1.1.1.4  christos         cxxflags         => add("-m32"),
    868   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    869       1.1  christos         bn_ops           => "BN_LLONG",
    870  1.1.1.13  christos         asm_arch         => 'x86',
    871       1.1  christos         perlasm_scheme   => "elf",
    872       1.1  christos     },
    873       1.1  christos     "linux-x86-clang" => {
    874       1.1  christos         inherit_from     => [ "linux-x86" ],
    875   1.1.1.4  christos         CC               => "clang",
    876   1.1.1.4  christos         CXX              => "clang++",
    877  1.1.1.13  christos         ex_libs          => add(threads("-latomic")),
    878       1.1  christos     },
    879       1.1  christos     "linux-x86_64" => {
    880  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    881   1.1.1.4  christos         cflags           => add("-m64"),
    882   1.1.1.4  christos         cxxflags         => add("-m64"),
    883   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    884       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    885  1.1.1.13  christos         asm_arch         => 'x86_64',
    886       1.1  christos         perlasm_scheme   => "elf",
    887       1.1  christos         multilib         => "64",
    888       1.1  christos     },
    889       1.1  christos     "linux-x86_64-clang" => {
    890       1.1  christos         inherit_from     => [ "linux-x86_64" ],
    891   1.1.1.4  christos         CC               => "clang",
    892   1.1.1.4  christos         CXX              => "clang++",
    893       1.1  christos     },
    894       1.1  christos     "linux-x32" => {
    895  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    896   1.1.1.4  christos         cflags           => add("-mx32"),
    897   1.1.1.4  christos         cxxflags         => add("-mx32"),
    898   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    899       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT",
    900  1.1.1.13  christos         asm_arch         => 'x86_64',
    901       1.1  christos         perlasm_scheme   => "elf32",
    902       1.1  christos         multilib         => "x32",
    903       1.1  christos     },
    904       1.1  christos 
    905       1.1  christos     "linux-ia64" => {
    906  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    907       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    908  1.1.1.13  christos         asm_arch         => 'ia64',
    909  1.1.1.13  christos         perlasm_scheme   => 'void',
    910       1.1  christos     },
    911       1.1  christos 
    912       1.1  christos     "linux64-s390x" => {
    913  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    914   1.1.1.4  christos         cflags           => add("-m64"),
    915   1.1.1.4  christos         cxxflags         => add("-m64"),
    916   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
    917  1.1.1.13  christos         asm_arch         => 's390x',
    918       1.1  christos         perlasm_scheme   => "64",
    919       1.1  christos         multilib         => "64",
    920       1.1  christos     },
    921       1.1  christos     "linux32-s390x" => {
    922       1.1  christos         #### So called "highgprs" target for z/Architecture CPUs
    923       1.1  christos         # "Highgprs" is kernel feature first implemented in Linux
    924       1.1  christos         # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
    925       1.1  christos         # significant bits of general purpose registers not only
    926       1.1  christos         # upon 32-bit process context switch, but even on
    927       1.1  christos         # asynchronous signal delivery to such process. This makes
    928       1.1  christos         # it possible to deploy 64-bit instructions even in legacy
    929       1.1  christos         # application context and achieve better [or should we say
    930       1.1  christos         # adequate] performance. The build is binary compatible with
    931       1.1  christos         # linux-generic32, and the idea is to be able to install the
    932       1.1  christos         # resulting libcrypto.so alongside generic one, e.g. as
    933       1.1  christos         # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
    934       1.1  christos         # linker to autodiscover. Unfortunately it doesn't work just
    935       1.1  christos         # yet, because of couple of bugs in glibc
    936       1.1  christos         # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
    937       1.1  christos         #
    938  1.1.1.13  christos         inherit_from     => [ "linux-generic32" ],
    939   1.1.1.4  christos         cflags           => add("-m31 -Wa,-mzarch"),
    940   1.1.1.4  christos         cxxflags         => add("-m31 -Wa,-mzarch"),
    941   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
    942  1.1.1.13  christos         asm_arch         => 's390x',
    943       1.1  christos         perlasm_scheme   => "31",
    944       1.1  christos         multilib         => "/highgprs",
    945       1.1  christos     },
    946       1.1  christos 
    947       1.1  christos     #### SPARC Linux setups
    948       1.1  christos     "linux-sparcv8" => {
    949  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    950   1.1.1.4  christos         cflags           => add("-mcpu=v8"),
    951   1.1.1.4  christos         cxxflags         => add("-mcpu=v8"),
    952   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN -DBN_DIV2W"),
    953  1.1.1.13  christos         asm_arch         => 'sparcv8',
    954  1.1.1.13  christos         perlasm_scheme   => 'void',
    955       1.1  christos     },
    956       1.1  christos     "linux-sparcv9" => {
    957       1.1  christos         # it's a real mess with -mcpu=ultrasparc option under Linux,
    958       1.1  christos         # but -Wa,-Av8plus should do the trick no matter what.
    959  1.1.1.13  christos         inherit_from     => [ "linux-latomic" ],
    960   1.1.1.4  christos         cflags           => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
    961   1.1.1.4  christos         cxxflags         => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
    962   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN -DBN_DIV2W"),
    963  1.1.1.13  christos         asm_arch         => 'sparcv9',
    964  1.1.1.13  christos         perlasm_scheme   => 'void',
    965       1.1  christos     },
    966       1.1  christos     "linux64-sparcv9" => {
    967       1.1  christos         # GCC 3.1 is a requirement
    968  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    969   1.1.1.4  christos         cflags           => add("-m64 -mcpu=ultrasparc"),
    970   1.1.1.4  christos         cxxflags         => add("-m64 -mcpu=ultrasparc"),
    971   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
    972  1.1.1.13  christos         ex_libs          => add(threads("-latomic")),
    973       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
    974  1.1.1.13  christos         asm_arch         => 'sparcv9',
    975  1.1.1.13  christos         perlasm_scheme   => 'void',
    976       1.1  christos         multilib         => "64",
    977       1.1  christos     },
    978       1.1  christos 
    979       1.1  christos     "linux-alpha-gcc" => {
    980  1.1.1.13  christos         inherit_from     => [ "linux-generic64" ],
    981   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
    982       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
    983  1.1.1.13  christos         asm_arch         => 'alpha',
    984  1.1.1.13  christos         perlasm_scheme   => "void",
    985       1.1  christos     },
    986       1.1  christos     "linux-c64xplus" => {
    987       1.1  christos         inherit_from     => [ "BASE_unix" ],
    988       1.1  christos         # TI_CGT_C6000_7.3.x is a requirement
    989   1.1.1.4  christos         CC               => "cl6x",
    990   1.1.1.4  christos         CFLAGS           => "-o2 -ox -ms",
    991   1.1.1.4  christos         cflags           => "--linux -ea=.s -eo=.o -mv6400+ -pden",
    992   1.1.1.4  christos         cxxflags         => "--linux -ea=.s -eo=.o -mv6400+ -pden",
    993   1.1.1.4  christos         cppflags         => combine("-DOPENSSL_SMALL_FOOTPRINT",
    994       1.1  christos                                     threads("-D_REENTRANT")),
    995       1.1  christos         bn_ops           => "BN_LLONG",
    996       1.1  christos         thread_scheme    => "pthreads",
    997  1.1.1.13  christos         asm_arch         => 'c64xplus',
    998       1.1  christos         perlasm_scheme   => "void",
    999       1.1  christos         dso_scheme       => "dlfcn",
   1000       1.1  christos         shared_target    => "linux-shared",
   1001       1.1  christos         shared_cflag     => "--pic",
   1002       1.1  christos         shared_ldflag    => add("-z --sysv --shared"),
   1003       1.1  christos         ranlib           => "true",
   1004       1.1  christos     },
   1005       1.1  christos 
   1006       1.1  christos #### *BSD
   1007       1.1  christos     "BSD-generic32" => {
   1008       1.1  christos         # As for thread cflag. Idea is to maintain "collective" set of
   1009       1.1  christos         # flags, which would cover all BSD flavors. -pthread applies
   1010       1.1  christos         # to them all, but is treated differently. OpenBSD expands is
   1011       1.1  christos         # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
   1012       1.1  christos         # expands it as -lc_r, which has to be accompanied by explicit
   1013       1.1  christos         # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
   1014       1.1  christos         # expands it as -lc_r, which seems to be sufficient?
   1015       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1016   1.1.1.4  christos         CC               => "cc",
   1017   1.1.1.4  christos         CFLAGS           => picker(default => "-Wall",
   1018   1.1.1.4  christos                                    debug   => "-O0 -g",
   1019   1.1.1.4  christos                                    release => "-O3"),
   1020   1.1.1.4  christos         cflags           => threads("-pthread"),
   1021   1.1.1.4  christos         cppflags         => threads("-D_THREAD_SAFE -D_REENTRANT"),
   1022   1.1.1.4  christos         ex_libs          => add(threads("-pthread")),
   1023   1.1.1.4  christos         enable           => add("devcryptoeng"),
   1024       1.1  christos         bn_ops           => "BN_LLONG",
   1025       1.1  christos         thread_scheme    => "pthreads",
   1026       1.1  christos         dso_scheme       => "dlfcn",
   1027       1.1  christos         shared_target    => "bsd-gcc-shared",
   1028       1.1  christos         shared_cflag     => "-fPIC",
   1029       1.1  christos     },
   1030       1.1  christos     "BSD-generic64" => {
   1031       1.1  christos         inherit_from     => [ "BSD-generic32" ],
   1032       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1033       1.1  christos     },
   1034       1.1  christos 
   1035       1.1  christos     "BSD-x86" => {
   1036  1.1.1.13  christos         inherit_from     => [ "BSD-generic32" ],
   1037   1.1.1.4  christos         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
   1038   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1039       1.1  christos         bn_ops           => "BN_LLONG",
   1040  1.1.1.13  christos         asm_arch         => 'x86',
   1041       1.1  christos         perlasm_scheme   => "a.out",
   1042       1.1  christos     },
   1043       1.1  christos     "BSD-x86-elf" => {
   1044       1.1  christos         inherit_from     => [ "BSD-x86" ],
   1045       1.1  christos         perlasm_scheme   => "elf",
   1046       1.1  christos     },
   1047       1.1  christos 
   1048       1.1  christos     "BSD-sparcv8" => {
   1049  1.1.1.13  christos         inherit_from     => [ "BSD-generic32" ],
   1050   1.1.1.4  christos         cflags           => add("-mcpu=v8"),
   1051   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
   1052  1.1.1.13  christos         asm_arch         => 'sparcv8',
   1053  1.1.1.13  christos         perlasm_scheme   => 'void',
   1054       1.1  christos     },
   1055       1.1  christos     "BSD-sparc64" => {
   1056       1.1  christos         # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
   1057       1.1  christos         # simply *happens* to work around a compiler bug in gcc 3.3.3,
   1058       1.1  christos         # triggered by RIPEMD160 code.
   1059  1.1.1.13  christos         inherit_from     => [ "BSD-generic64" ],
   1060   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN -DMD32_REG_T=int"),
   1061       1.1  christos         bn_ops           => "BN_LLONG",
   1062  1.1.1.13  christos         asm_arch         => 'sparcv9',
   1063  1.1.1.13  christos         perlasm_scheme   => 'void',
   1064       1.1  christos     },
   1065       1.1  christos 
   1066       1.1  christos     "BSD-ia64" => {
   1067  1.1.1.13  christos         inherit_from     => [ "BSD-generic64" ],
   1068   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1069       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1070  1.1.1.13  christos         asm_arch         => 'ia64',
   1071  1.1.1.13  christos         perlasm_scheme   => 'void',
   1072       1.1  christos     },
   1073       1.1  christos 
   1074       1.1  christos     "BSD-x86_64" => {
   1075  1.1.1.13  christos         inherit_from     => [ "BSD-generic64" ],
   1076   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1077       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1078  1.1.1.13  christos         asm_arch         => 'x86_64',
   1079       1.1  christos         perlasm_scheme   => "elf",
   1080       1.1  christos     },
   1081       1.1  christos 
   1082  1.1.1.13  christos     "BSD-aarch64" => {
   1083  1.1.1.13  christos         inherit_from     => [ "BSD-generic64" ],
   1084  1.1.1.13  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1085  1.1.1.13  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1086  1.1.1.13  christos         asm_arch         => 'aarch64',
   1087  1.1.1.13  christos         perlasm_scheme   => "linux64",
   1088  1.1.1.13  christos     },
   1089  1.1.1.13  christos 
   1090  1.1.1.11  christos     # riscv64 below refers to contemporary RISCV Architecture
   1091  1.1.1.11  christos     # specifications,
   1092  1.1.1.11  christos     "BSD-riscv64" => {
   1093  1.1.1.11  christos         inherit_from     => [ "BSD-generic64"],
   1094  1.1.1.11  christos         perlasm_scheme   => "linux64",
   1095  1.1.1.11  christos     },
   1096  1.1.1.11  christos 
   1097       1.1  christos     "bsdi-elf-gcc" => {
   1098  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1099   1.1.1.4  christos         CC               => "gcc",
   1100   1.1.1.4  christos         CFLAGS           => "-fomit-frame-pointer -O3 -Wall",
   1101   1.1.1.4  christos         lib_cppflags     => "-DPERL5 -DL_ENDIAN",
   1102       1.1  christos         ex_libs          => add("-ldl"),
   1103       1.1  christos         bn_ops           => "BN_LLONG",
   1104  1.1.1.13  christos         asm_arch         => 'x86',
   1105  1.1.1.13  christos         perlasm_scheme   => "elf",
   1106       1.1  christos         thread_scheme    => "(unknown)",
   1107       1.1  christos         dso_scheme       => "dlfcn",
   1108       1.1  christos         shared_target    => "bsd-gcc-shared",
   1109       1.1  christos         shared_cflag     => "-fPIC",
   1110       1.1  christos     },
   1111       1.1  christos 
   1112       1.1  christos #### SCO/Caldera targets.
   1113       1.1  christos #
   1114       1.1  christos # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
   1115       1.1  christos # Now we only have blended unixware-* as it's the only one used by ./config.
   1116       1.1  christos # If you want to optimize for particular microarchitecture, bypass ./config
   1117       1.1  christos # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
   1118       1.1  christos # Note that not all targets include assembler support. Mostly because of
   1119       1.1  christos # lack of motivation to support out-of-date platforms with out-of-date
   1120   1.1.1.4  christos # compiler drivers and assemblers.
   1121       1.1  christos #
   1122       1.1  christos # UnixWare 2.0x fails destest with -O.
   1123       1.1  christos     "unixware-2.0" => {
   1124       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1125   1.1.1.4  christos         CC               => "cc",
   1126   1.1.1.4  christos         cflags           => threads("-Kthread"),
   1127   1.1.1.4  christos         lib_cppflags     => "-DFILIO_H -DNO_STRINGS_H",
   1128       1.1  christos         ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
   1129       1.1  christos         thread_scheme    => "uithreads",
   1130       1.1  christos     },
   1131       1.1  christos     "unixware-2.1" => {
   1132       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1133   1.1.1.4  christos         CC               => "cc",
   1134   1.1.1.4  christos         CFLAGS           => "-O",
   1135   1.1.1.4  christos         cflags           => threads("-Kthread"),
   1136   1.1.1.4  christos         lib_cppflags     => "-DFILIO_H",
   1137       1.1  christos         ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
   1138       1.1  christos         thread_scheme    => "uithreads",
   1139       1.1  christos     },
   1140       1.1  christos     "unixware-7" => {
   1141  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1142   1.1.1.4  christos         CC               => "cc",
   1143   1.1.1.4  christos         CFLAGS           => "-O",
   1144   1.1.1.4  christos         cflags           => combine("-Kalloca", threads("-Kthread")),
   1145   1.1.1.4  christos         lib_cppflags     => "-DFILIO_H",
   1146       1.1  christos         ex_libs          => add("-lsocket -lnsl"),
   1147       1.1  christos         thread_scheme    => "uithreads",
   1148       1.1  christos         bn_ops           => "BN_LLONG",
   1149  1.1.1.13  christos         asm_arch         => 'x86',
   1150       1.1  christos         perlasm_scheme   => "elf-1",
   1151       1.1  christos         dso_scheme       => "dlfcn",
   1152       1.1  christos         shared_target    => "svr5-shared",
   1153       1.1  christos         shared_cflag     => "-Kpic",
   1154       1.1  christos     },
   1155       1.1  christos     "unixware-7-gcc" => {
   1156  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1157   1.1.1.4  christos         CC               => "gcc",
   1158   1.1.1.4  christos         CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
   1159   1.1.1.4  christos         cppflags         => add(threads("-D_REENTRANT")),
   1160   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN -DFILIO_H"),
   1161       1.1  christos         ex_libs          => add("-lsocket -lnsl"),
   1162       1.1  christos         bn_ops           => "BN_LLONG",
   1163       1.1  christos         thread_scheme    => "pthreads",
   1164  1.1.1.13  christos         asm_arch         => 'x86',
   1165       1.1  christos         perlasm_scheme   => "elf-1",
   1166       1.1  christos         dso_scheme       => "dlfcn",
   1167       1.1  christos         shared_target    => "gnu-shared",
   1168       1.1  christos         shared_cflag     => "-fPIC",
   1169       1.1  christos     },
   1170   1.1.1.4  christos # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
   1171       1.1  christos     "sco5-cc" => {
   1172  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1173       1.1  christos         cc               => "cc",
   1174       1.1  christos         cflags           => "-belf",
   1175       1.1  christos         ex_libs          => add("-lsocket -lnsl"),
   1176       1.1  christos         thread_scheme    => "(unknown)",
   1177  1.1.1.13  christos         asm_arch         => 'x86',
   1178       1.1  christos         perlasm_scheme   => "elf-1",
   1179       1.1  christos         dso_scheme       => "dlfcn",
   1180       1.1  christos         shared_target    => "svr3-shared",
   1181       1.1  christos         shared_cflag     => "-Kpic",
   1182       1.1  christos     },
   1183       1.1  christos     "sco5-gcc" => {
   1184  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1185       1.1  christos         cc               => "gcc",
   1186       1.1  christos         cflags           => "-O3 -fomit-frame-pointer",
   1187       1.1  christos         ex_libs          => add("-lsocket -lnsl"),
   1188       1.1  christos         bn_ops           => "BN_LLONG",
   1189       1.1  christos         thread_scheme    => "(unknown)",
   1190  1.1.1.13  christos         asm_arch         => 'x86',
   1191       1.1  christos         perlasm_scheme   => "elf-1",
   1192       1.1  christos         dso_scheme       => "dlfcn",
   1193       1.1  christos         shared_target    => "svr3-shared",
   1194       1.1  christos         shared_cflag     => "-fPIC",
   1195       1.1  christos     },
   1196       1.1  christos 
   1197       1.1  christos #### IBM's AIX.
   1198       1.1  christos     # Below targets assume AIX >=5. Caveat lector. If you are accustomed
   1199       1.1  christos     # to control compilation "bitness" by setting $OBJECT_MODE environment
   1200       1.1  christos     # variable, then you should know that in OpenSSL case it's considered
   1201       1.1  christos     # only in ./config. Once configured, build procedure remains "deaf" to
   1202       1.1  christos     # current value of $OBJECT_MODE.
   1203   1.1.1.4  christos     "aix-common" => {
   1204   1.1.1.4  christos         inherit_from     => [ "BASE_unix" ],
   1205   1.1.1.4  christos         template         => 1,
   1206       1.1  christos         sys_id           => "AIX",
   1207   1.1.1.4  christos         lib_cppflags     => "-DB_ENDIAN",
   1208   1.1.1.4  christos         lflags           => "-Wl,-bsvr4",
   1209       1.1  christos         thread_scheme    => "pthreads",
   1210       1.1  christos         dso_scheme       => "dlfcn",
   1211  1.1.1.13  christos         shared_target    => "aix",
   1212   1.1.1.6  christos         module_ldflags   => "-Wl,-G,-bsymbolic,-bnoentry",
   1213   1.1.1.5  christos         shared_ldflag    => "-Wl,-G,-bsymbolic,-bnoentry",
   1214   1.1.1.4  christos         shared_defflag   => "-Wl,-bE:",
   1215  1.1.1.13  christos         shared_fipsflag  => "-Wl,-binitfini:_init:_cleanup",
   1216  1.1.1.13  christos         perl_platform    => 'AIX',
   1217   1.1.1.4  christos     },
   1218   1.1.1.4  christos     "aix-gcc" => {
   1219  1.1.1.13  christos         inherit_from     => [ "aix-common" ],
   1220   1.1.1.4  christos         CC               => "gcc",
   1221   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1222   1.1.1.4  christos                                    release => "-O"),
   1223   1.1.1.4  christos         cflags           => add(threads("-pthread")),
   1224   1.1.1.8  christos         ex_libs          => add(threads("-pthread")),
   1225   1.1.1.4  christos         bn_ops           => "BN_LLONG RC4_CHAR",
   1226  1.1.1.13  christos         asm_arch         => 'ppc32',
   1227   1.1.1.4  christos         perlasm_scheme   => "aix32",
   1228   1.1.1.4  christos         shared_ldflag    => add_before("-shared -static-libgcc"),
   1229   1.1.1.4  christos         AR               => add("-X32"),
   1230   1.1.1.4  christos         RANLIB           => add("-X32"),
   1231       1.1  christos     },
   1232       1.1  christos     "aix64-gcc" => {
   1233  1.1.1.13  christos         inherit_from     => [ "aix-common" ],
   1234   1.1.1.4  christos         CC               => "gcc",
   1235   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1236   1.1.1.4  christos                                    release => "-O"),
   1237   1.1.1.4  christos         cflags           => combine("-maix64", threads("-pthread")),
   1238   1.1.1.8  christos         ex_libs          => add(threads("-pthread")),
   1239       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
   1240  1.1.1.13  christos         asm_arch         => 'ppc64',
   1241       1.1  christos         perlasm_scheme   => "aix64",
   1242   1.1.1.4  christos         shared_ldflag    => add_before("-shared -static-libgcc"),
   1243   1.1.1.4  christos         shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
   1244   1.1.1.4  christos         AR               => add("-X64"),
   1245   1.1.1.4  christos         RANLIB           => add("-X64"),
   1246       1.1  christos     },
   1247  1.1.1.13  christos     "aix64-gcc-as" => {
   1248  1.1.1.13  christos         inherit_from     => [ "aix64-gcc" ],
   1249  1.1.1.13  christos         perlasm_scheme   => "aix64-as",
   1250  1.1.1.13  christos     },
   1251       1.1  christos     "aix-cc" => {
   1252  1.1.1.13  christos         inherit_from     => [ "aix-common" ],
   1253   1.1.1.4  christos         CC               => "cc",
   1254   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1255   1.1.1.4  christos                                    release => "-O"),
   1256   1.1.1.4  christos         cflags           => combine("-q32 -qmaxmem=16384 -qro -qroconst",
   1257   1.1.1.4  christos                                     threads("-qthreaded")),
   1258   1.1.1.4  christos         cppflags         => threads("-D_THREAD_SAFE"),
   1259   1.1.1.8  christos         ex_libs          => add(threads("-lpthreads")),
   1260   1.1.1.4  christos         bn_ops           => "BN_LLONG RC4_CHAR",
   1261  1.1.1.13  christos         asm_arch         => 'ppc32',
   1262       1.1  christos         perlasm_scheme   => "aix32",
   1263   1.1.1.3  christos         shared_cflag     => "-qpic",
   1264   1.1.1.4  christos         AR               => add("-X32"),
   1265   1.1.1.4  christos         RANLIB           => add("-X32"),
   1266       1.1  christos     },
   1267  1.1.1.17  christos     # To enable openxl compiler for aix
   1268  1.1.1.17  christos     # If 17.1 openxl runtime is available, -latomic can be used
   1269  1.1.1.17  christos     # instead of -DBROKEN_CLANG_ATOMICS
   1270  1.1.1.17  christos     "aix-clang" => {
   1271  1.1.1.17  christos         inherit_from     => [ "aix-common" ],
   1272  1.1.1.17  christos         CC               => "ibm-clang",
   1273  1.1.1.17  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1274  1.1.1.17  christos                                    release => "-O"),
   1275  1.1.1.17  christos         cflags           => combine("-Wno-implicit-function-declaration -mcmodel=large -DBROKEN_CLANG_ATOMICS",
   1276  1.1.1.17  christos                             threads("-pthread")),
   1277  1.1.1.17  christos         ex_libs          => add(threads("-pthread")),
   1278  1.1.1.17  christos         bn_ops           => "BN_LLONG RC4_CHAR",
   1279  1.1.1.17  christos         asm_arch         => 'ppc32',
   1280  1.1.1.17  christos         perlasm_scheme   => "aix32",
   1281  1.1.1.17  christos         shared_cflag     => "-fpic",
   1282  1.1.1.17  christos         shared_ldflag    => add("-shared"),
   1283  1.1.1.17  christos         AR               => add("-X32"),
   1284  1.1.1.17  christos         RANLIB           => add("-X32"),
   1285  1.1.1.17  christos     },
   1286       1.1  christos     "aix64-cc" => {
   1287  1.1.1.13  christos         inherit_from     => [ "aix-common" ],
   1288   1.1.1.4  christos         CC               => "cc",
   1289   1.1.1.4  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1290   1.1.1.4  christos                                    release => "-O"),
   1291   1.1.1.4  christos         cflags           => combine("-q64 -qmaxmem=16384 -qro -qroconst",
   1292   1.1.1.4  christos                                     threads("-qthreaded")),
   1293   1.1.1.4  christos         cppflags         => threads("-D_THREAD_SAFE"),
   1294   1.1.1.8  christos         ex_libs          => add(threads("-lpthreads")),
   1295   1.1.1.4  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
   1296  1.1.1.13  christos         asm_arch         => 'ppc64',
   1297       1.1  christos         perlasm_scheme   => "aix64",
   1298       1.1  christos         dso_scheme       => "dlfcn",
   1299   1.1.1.3  christos         shared_cflag     => "-qpic",
   1300   1.1.1.4  christos         shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
   1301   1.1.1.4  christos         AR               => add("-X64"),
   1302   1.1.1.4  christos         RANLIB           => add("-X64"),
   1303       1.1  christos     },
   1304  1.1.1.17  christos     "aix64-clang" => {
   1305  1.1.1.17  christos         inherit_from     => [ "aix-common" ],
   1306  1.1.1.17  christos         CC               => "ibm-clang",
   1307  1.1.1.17  christos         CFLAGS           => picker(debug   => "-O0 -g",
   1308  1.1.1.17  christos                                    release => "-O"),
   1309  1.1.1.17  christos         cflags           => combine("-maix64 -Wno-implicit-function-declaration -mcmodel=large",
   1310  1.1.1.17  christos                             threads("-pthread")),
   1311  1.1.1.17  christos         ex_libs          => add(threads("-pthread")),
   1312  1.1.1.17  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
   1313  1.1.1.17  christos         asm_arch         => 'ppc64',
   1314  1.1.1.17  christos         perlasm_scheme   => "aix64",
   1315  1.1.1.17  christos         shared_cflag     => "-fpic",
   1316  1.1.1.17  christos         shared_ldflag    => add("-shared"),
   1317  1.1.1.17  christos         shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
   1318  1.1.1.17  christos         AR               => add("-X64"),
   1319  1.1.1.17  christos         RANLIB           => add("-X64"),
   1320  1.1.1.17  christos     },
   1321       1.1  christos 
   1322       1.1  christos # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
   1323       1.1  christos     "BS2000-OSD" => {
   1324       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1325   1.1.1.4  christos         CC               => "c89",
   1326   1.1.1.4  christos         CFLAGS           => "-O",
   1327   1.1.1.4  christos         cflags           => "-XLLML -XLLMK -XL",
   1328   1.1.1.4  christos         cppflags         => "-DCHARSET_EBCDIC",
   1329   1.1.1.4  christos         lib_cppflags     => "-DB_ENDIAN",
   1330       1.1  christos         ex_libs          => add("-lsocket -lnsl"),
   1331       1.1  christos         bn_ops           => "THIRTY_TWO_BIT RC4_CHAR",
   1332       1.1  christos         thread_scheme    => "(unknown)",
   1333       1.1  christos     },
   1334       1.1  christos 
   1335       1.1  christos #### Visual C targets
   1336       1.1  christos #
   1337   1.1.1.4  christos # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
   1338       1.1  christos #
   1339   1.1.1.4  christos # Note about /wd4090, disable warning C4090. This warning returns false
   1340       1.1  christos # positives in some situations. Disabling it altogether masks both
   1341       1.1  christos # legitimate and false cases, but as we compile on multiple platforms,
   1342       1.1  christos # we rely on other compilers to catch legitimate cases.
   1343       1.1  christos #
   1344       1.1  christos # Also note that we force threads no matter what.  Configuring "no-threads"
   1345       1.1  christos # is ignored.
   1346   1.1.1.4  christos #
   1347   1.1.1.4  christos # UNICODE is defined in VC-common and applies to all targets. It used to
   1348   1.1.1.4  christos # be an opt-in option for VC-WIN32, but not anymore. The original reason
   1349   1.1.1.4  christos # was because ANSI API was *native* system interface for no longer
   1350   1.1.1.4  christos # supported Windows 9x. Keep in mind that UNICODE only affects how
   1351   1.1.1.4  christos # OpenSSL libraries interact with underlying OS, it doesn't affect API
   1352   1.1.1.4  christos # that OpenSSL presents to application.
   1353   1.1.1.4  christos 
   1354       1.1  christos     "VC-common" => {
   1355       1.1  christos         inherit_from     => [ "BASE_Windows" ],
   1356       1.1  christos         template         => 1,
   1357   1.1.1.4  christos         CC               => "cl",
   1358   1.1.1.4  christos         CPP              => '$(CC) /EP /C',
   1359   1.1.1.4  christos         CFLAGS           => "/W3 /wd4090 /nologo",
   1360       1.1  christos         coutflag         => "/Fo",
   1361  1.1.1.13  christos         LD               => "link",
   1362  1.1.1.13  christos         LDFLAGS          => "/nologo /debug",
   1363  1.1.1.13  christos         ldoutflag        => "/out:",
   1364  1.1.1.13  christos         ldpostoutflag    => "",
   1365  1.1.1.13  christos         ld_resp_delim    => "\n",
   1366  1.1.1.13  christos         bin_lflags       => "setargv.obj",
   1367  1.1.1.13  christos         makedepcmd       => '$(CC) /Zs /showIncludes',
   1368  1.1.1.13  christos         makedep_scheme   => 'VC',
   1369  1.1.1.13  christos         AR               => "lib",
   1370  1.1.1.13  christos         ARFLAGS          => "/nologo",
   1371  1.1.1.13  christos         aroutflag        => "/out:",
   1372  1.1.1.13  christos         ar_resp_delim    => "\n",
   1373  1.1.1.13  christos         RC               => "rc",
   1374  1.1.1.13  christos         rcoutflag        => "/fo",
   1375   1.1.1.4  christos         defines          => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
   1376   1.1.1.4  christos                                 "UNICODE", "_UNICODE",
   1377   1.1.1.4  christos                                 "_CRT_SECURE_NO_DEPRECATE",
   1378   1.1.1.4  christos                                 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
   1379   1.1.1.4  christos         lib_cflags       => add("/Zi /Fdossl_static.pdb"),
   1380   1.1.1.4  christos         lib_defines      => add("L_ENDIAN"),
   1381   1.1.1.4  christos         dso_cflags       => "/Zi /Fddso.pdb",
   1382   1.1.1.4  christos         bin_cflags       => "/Zi /Fdapp.pdb",
   1383  1.1.1.13  christos         # def_flag made to empty string so a .def file gets generated
   1384  1.1.1.13  christos         shared_defflag   => '',
   1385       1.1  christos         shared_ldflag    => "/dll",
   1386       1.1  christos         shared_target    => "win-shared", # meaningless except it gives Configure a hint
   1387  1.1.1.13  christos         lddefflag        => "/def:",
   1388  1.1.1.13  christos         ldresflag        => " ",
   1389  1.1.1.13  christos         ld_implib_flag   => "/implib:",
   1390       1.1  christos         thread_scheme    => "winthreads",
   1391       1.1  christos         dso_scheme       => "win32",
   1392  1.1.1.13  christos         perl_platform    => 'Windows::MSVC',
   1393   1.1.1.4  christos         # additional parameter to build_scheme denotes install-path "flavour"
   1394   1.1.1.4  christos         build_scheme     => add("VC-common", { separator => undef }),
   1395       1.1  christos     },
   1396       1.1  christos     "VC-noCE-common" => {
   1397       1.1  christos         inherit_from     => [ "VC-common" ],
   1398       1.1  christos         template         => 1,
   1399   1.1.1.4  christos         CFLAGS           => add(picker(debug   => '/Od',
   1400   1.1.1.4  christos                                        release => '/O2')),
   1401   1.1.1.4  christos         cflags           => add(picker(default => '/Gs0 /GF /Gy',
   1402       1.1  christos                                        debug   =>
   1403       1.1  christos                                        sub {
   1404   1.1.1.4  christos                                            ($disabled{shared} ? "" : "/MDd");
   1405       1.1  christos                                        },
   1406       1.1  christos                                        release =>
   1407       1.1  christos                                        sub {
   1408   1.1.1.4  christos                                            ($disabled{shared} ? "" : "/MD");
   1409       1.1  christos                                        })),
   1410   1.1.1.4  christos         defines          => add(picker(default => [], # works as type cast
   1411   1.1.1.4  christos                                        debug   => [ "DEBUG", "_DEBUG" ])),
   1412       1.1  christos         lib_cflags       => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
   1413       1.1  christos         # Following might/should appears controversial, i.e. defining
   1414       1.1  christos         # /MDd without evaluating $disabled{shared}. It works in
   1415       1.1  christos         # non-shared build because static library is compiled with /Zl
   1416       1.1  christos         # and bares no reference to specific RTL. And it works in
   1417       1.1  christos         # shared build because multiple /MDd options are not prohibited.
   1418       1.1  christos         # But why /MDd in static build? Well, basically this is just a
   1419       1.1  christos         # reference point, which allows to catch eventual errors that
   1420       1.1  christos         # would prevent those who want to wrap OpenSSL into own .DLL.
   1421       1.1  christos         # Why not /MD in release build then? Well, some are likely to
   1422       1.1  christos         # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
   1423       1.1  christos         # redistributable.
   1424       1.1  christos         bin_cflags       => add(picker(debug   => "/MDd",
   1425       1.1  christos                                        release => sub { $disabled{shared} ? "/MT" : () },
   1426       1.1  christos                                       )),
   1427       1.1  christos         bin_lflags       => add("/subsystem:console /opt:ref"),
   1428       1.1  christos         ex_libs          => add(sub {
   1429       1.1  christos             my @ex_libs = ();
   1430       1.1  christos             push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
   1431       1.1  christos             push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
   1432       1.1  christos             return join(" ", @ex_libs);
   1433       1.1  christos         }),
   1434       1.1  christos     },
   1435       1.1  christos     "VC-WIN64-common" => {
   1436       1.1  christos         inherit_from     => [ "VC-noCE-common" ],
   1437       1.1  christos         template         => 1,
   1438       1.1  christos         ex_libs          => add(sub {
   1439       1.1  christos             my @ex_libs = ();
   1440       1.1  christos             push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
   1441       1.1  christos             return join(" ", @_, @ex_libs);
   1442       1.1  christos         }),
   1443   1.1.1.4  christos         bn_ops           => add("SIXTY_FOUR_BIT"),
   1444       1.1  christos     },
   1445       1.1  christos     "VC-WIN64I" => {
   1446  1.1.1.13  christos         inherit_from     => [ "VC-WIN64-common" ],
   1447   1.1.1.4  christos         AS               => "ias",
   1448   1.1.1.4  christos         ASFLAGS          => "-d debug",
   1449   1.1.1.4  christos         asoutflag        => "-o ",
   1450       1.1  christos         sys_id           => "WIN64I",
   1451  1.1.1.13  christos         uplink_arch      => 'ia64',
   1452  1.1.1.13  christos         asm_arch         => 'ia64',
   1453       1.1  christos         perlasm_scheme   => "ias",
   1454       1.1  christos         multilib         => "-ia64",
   1455       1.1  christos     },
   1456       1.1  christos     "VC-WIN64A" => {
   1457  1.1.1.13  christos         inherit_from     => [ "VC-WIN64-common" ],
   1458   1.1.1.4  christos         AS               => sub { vc_win64a_info()->{AS} },
   1459   1.1.1.4  christos         ASFLAGS          => sub { vc_win64a_info()->{ASFLAGS} },
   1460       1.1  christos         asoutflag        => sub { vc_win64a_info()->{asoutflag} },
   1461   1.1.1.4  christos         asflags          => sub { vc_win64a_info()->{asflags} },
   1462       1.1  christos         sys_id           => "WIN64A",
   1463  1.1.1.13  christos         uplink_arch      => 'x86_64',
   1464  1.1.1.13  christos         asm_arch         => 'x86_64',
   1465  1.1.1.15  christos         perlasm_scheme   => sub { vc_win64a_info()->{perlasm_scheme} },
   1466       1.1  christos         multilib         => "-x64",
   1467       1.1  christos     },
   1468       1.1  christos     "VC-WIN32" => {
   1469  1.1.1.13  christos         inherit_from     => [ "VC-noCE-common" ],
   1470   1.1.1.4  christos         AS               => sub { vc_win32_info()->{AS} },
   1471   1.1.1.4  christos         ASFLAGS          => sub { vc_win32_info()->{ASFLAGS} },
   1472       1.1  christos         asoutflag        => sub { vc_win32_info()->{asoutflag} },
   1473   1.1.1.4  christos         asflags          => sub { vc_win32_info()->{asflags} },
   1474       1.1  christos         sys_id           => "WIN32",
   1475   1.1.1.4  christos         bn_ops           => add("BN_LLONG"),
   1476  1.1.1.13  christos         uplink_arch      => 'common',
   1477  1.1.1.13  christos         asm_arch         => 'x86',
   1478       1.1  christos         perlasm_scheme   => sub { vc_win32_info()->{perlasm_scheme} },
   1479   1.1.1.4  christos         # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
   1480   1.1.1.4  christos         # some installation path heuristics in windows-makefile.tmpl...
   1481   1.1.1.4  christos         build_scheme     => add("VC-WOW", { separator => undef }),
   1482       1.1  christos     },
   1483       1.1  christos     "VC-CE" => {
   1484       1.1  christos         inherit_from     => [ "VC-common" ],
   1485   1.1.1.4  christos         CFLAGS           => add(picker(debug   => "/Od",
   1486   1.1.1.4  christos                                        release => "/O1i")),
   1487   1.1.1.4  christos         CPPDEFINES       => picker(debug   => [ "DEBUG", "_DEBUG" ]),
   1488   1.1.1.4  christos         LDFLAGS          => add("/nologo /opt:ref"),
   1489       1.1  christos         cflags           =>
   1490   1.1.1.4  christos             combine('/GF /Gy',
   1491   1.1.1.4  christos                     sub { vc_wince_info()->{cflags}; },
   1492   1.1.1.4  christos                     sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
   1493   1.1.1.4  christos                               ? ($disabled{shared} ? " /MT" : " /MD")
   1494   1.1.1.4  christos                               : " /MC"; }),
   1495   1.1.1.4  christos         cppflags         => sub { vc_wince_info()->{cppflags}; },
   1496   1.1.1.4  christos         lib_defines      => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
   1497   1.1.1.4  christos         lib_cppflags     => sub { vc_wince_info()->{cppflags}; },
   1498   1.1.1.4  christos         includes         =>
   1499   1.1.1.4  christos             add(combine(sub { defined(env('WCECOMPAT'))
   1500   1.1.1.4  christos                               ? '$(WCECOMPAT)/include' : (); },
   1501   1.1.1.4  christos                         sub { defined(env('PORTSDK_LIBPATH'))
   1502   1.1.1.4  christos                                   ? '$(PORTSDK_LIBPATH)/../../include'
   1503   1.1.1.4  christos                                   : (); })),
   1504   1.1.1.4  christos         lflags           => add(combine(sub { vc_wince_info()->{lflags}; },
   1505   1.1.1.4  christos                                         sub { defined(env('PORTSDK_LIBPATH'))
   1506   1.1.1.4  christos                                                   ? "/entry:mainCRTstartup" : (); })),
   1507       1.1  christos         sys_id           => "WINCE",
   1508   1.1.1.4  christos         bn_ops           => add("BN_LLONG"),
   1509       1.1  christos         ex_libs          => add(sub {
   1510       1.1  christos             my @ex_libs = ();
   1511       1.1  christos             push @ex_libs, 'ws2.lib' unless $disabled{sock};
   1512       1.1  christos             push @ex_libs, 'crypt32.lib';
   1513   1.1.1.4  christos             if (defined(env('WCECOMPAT'))) {
   1514       1.1  christos                 my $x = '$(WCECOMPAT)/lib';
   1515   1.1.1.4  christos                 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
   1516       1.1  christos                     $x .= '/$(TARGETCPU)/wcecompatex.lib';
   1517       1.1  christos                 } else {
   1518       1.1  christos                     $x .= '/wcecompatex.lib';
   1519       1.1  christos                 }
   1520       1.1  christos                 push @ex_libs, $x;
   1521       1.1  christos             }
   1522       1.1  christos             push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
   1523   1.1.1.4  christos                 if (defined(env('PORTSDK_LIBPATH')));
   1524   1.1.1.8  christos             push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
   1525   1.1.1.8  christos                 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
   1526   1.1.1.8  christos             return join(" ", @ex_libs);
   1527       1.1  christos         }),
   1528       1.1  christos     },
   1529       1.1  christos 
   1530       1.1  christos #### MinGW
   1531  1.1.1.13  christos     "mingw-common" => {
   1532  1.1.1.13  christos         inherit_from     => [ 'BASE_unix' ],
   1533  1.1.1.13  christos         template         => 1,
   1534   1.1.1.4  christos         CC               => "gcc",
   1535   1.1.1.4  christos         CFLAGS           => picker(default => "-Wall",
   1536   1.1.1.4  christos                                    debug   => "-g -O0",
   1537  1.1.1.13  christos                                    release => "-O3"),
   1538   1.1.1.4  christos         cppflags         => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
   1539       1.1  christos                                     threads("-D_MT")),
   1540   1.1.1.4  christos         lib_cppflags     => "-DL_ENDIAN",
   1541       1.1  christos         ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
   1542       1.1  christos         thread_scheme    => "winthreads",
   1543       1.1  christos         dso_scheme       => "win32",
   1544       1.1  christos         shared_target    => "mingw-shared",
   1545   1.1.1.4  christos         shared_cppflags  => add("_WINDLL"),
   1546       1.1  christos         shared_ldflag    => "-static-libgcc",
   1547  1.1.1.13  christos 
   1548  1.1.1.13  christos         perl_platform    => 'mingw',
   1549  1.1.1.13  christos     },
   1550  1.1.1.13  christos     "mingw" => {
   1551  1.1.1.13  christos         inherit_from     => [ "mingw-common" ],
   1552  1.1.1.13  christos         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
   1553  1.1.1.13  christos         cflags           => "-m32",
   1554  1.1.1.13  christos         sys_id           => "MINGW32",
   1555  1.1.1.13  christos         bn_ops           => add("BN_LLONG"),
   1556  1.1.1.13  christos         asm_arch         => 'x86',
   1557  1.1.1.13  christos         uplink_arch      => 'x86',
   1558  1.1.1.13  christos         perlasm_scheme   => "coff",
   1559       1.1  christos         shared_rcflag    => "--target=pe-i386",
   1560       1.1  christos         multilib         => "",
   1561       1.1  christos     },
   1562       1.1  christos     "mingw64" => {
   1563  1.1.1.13  christos         # As for uplink_arch. Applink makes it possible to use
   1564       1.1  christos         # .dll compiled with one compiler with application compiled with
   1565       1.1  christos         # another compiler. It's possible to engage Applink support in
   1566  1.1.1.13  christos         # mingw64 build, but it's not done, because until mingw64
   1567       1.1  christos         # supports structured exception handling, one can't seriously
   1568       1.1  christos         # consider its binaries for using with non-mingw64 run-time
   1569       1.1  christos         # environment. And as mingw64 is always consistent with itself,
   1570       1.1  christos         # Applink is never engaged and can as well be omitted.
   1571  1.1.1.13  christos         inherit_from     => [ "mingw-common" ],
   1572   1.1.1.4  christos         cflags           => "-m64",
   1573       1.1  christos         sys_id           => "MINGW64",
   1574  1.1.1.13  christos         bn_ops           => add("SIXTY_FOUR_BIT"),
   1575  1.1.1.13  christos         asm_arch         => 'x86_64',
   1576  1.1.1.13  christos         uplink_arch      => undef,
   1577       1.1  christos         perlasm_scheme   => "mingw64",
   1578       1.1  christos         shared_rcflag    => "--target=pe-x86-64",
   1579       1.1  christos         multilib         => "64",
   1580       1.1  christos     },
   1581       1.1  christos 
   1582       1.1  christos #### UEFI
   1583       1.1  christos     "UEFI" => {
   1584       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1585   1.1.1.4  christos         CC               => "cc",
   1586   1.1.1.4  christos         CFLAGS           => "-O",
   1587   1.1.1.4  christos         lib_cppflags     => "-DL_ENDIAN",
   1588       1.1  christos         sys_id           => "UEFI",
   1589       1.1  christos     },
   1590  1.1.1.13  christos     "UEFI-x86" => {
   1591  1.1.1.13  christos         inherit_from     => [ "UEFI" ],
   1592  1.1.1.13  christos         asm_arch         => 'x86',
   1593  1.1.1.13  christos         perlasm_scheme   => "win32n",
   1594  1.1.1.13  christos     },
   1595  1.1.1.13  christos     "UEFI-x86_64" => {
   1596  1.1.1.13  christos         inherit_from     => [ "UEFI" ],
   1597  1.1.1.13  christos         asm_arch         => 'x86_64',
   1598  1.1.1.13  christos         perlasm_scheme   => "nasm",
   1599  1.1.1.13  christos     },
   1600       1.1  christos 
   1601       1.1  christos #### UWIN
   1602       1.1  christos     "UWIN" => {
   1603       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1604   1.1.1.4  christos         CC               => "cc",
   1605   1.1.1.4  christos         CFLAGS           => "-O -Wall",
   1606   1.1.1.4  christos         lib_cppflags     => "-DTERMIOS -DL_ENDIAN",
   1607       1.1  christos         sys_id           => "UWIN",
   1608       1.1  christos         bn_ops           => "BN_LLONG",
   1609       1.1  christos         dso_scheme       => "win32",
   1610       1.1  christos     },
   1611       1.1  christos 
   1612       1.1  christos #### Cygwin
   1613  1.1.1.13  christos     "Cygwin-common" => {
   1614  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1615  1.1.1.13  christos         template         => 1,
   1616  1.1.1.13  christos 
   1617   1.1.1.4  christos         CC               => "gcc",
   1618   1.1.1.4  christos         CFLAGS           => picker(default => "-Wall",
   1619       1.1  christos                                    debug   => "-g -O0",
   1620  1.1.1.13  christos                                    release => "-O3"),
   1621   1.1.1.4  christos         lib_cppflags     => "-DTERMIOS -DL_ENDIAN",
   1622       1.1  christos         sys_id           => "CYGWIN",
   1623       1.1  christos         thread_scheme    => "pthread",
   1624       1.1  christos         dso_scheme       => "dlfcn",
   1625       1.1  christos         shared_target    => "cygwin-shared",
   1626   1.1.1.4  christos         shared_cppflags  => "-D_WINDLL",
   1627  1.1.1.13  christos 
   1628  1.1.1.13  christos         perl_platform    => 'Cygwin',
   1629  1.1.1.13  christos     },
   1630  1.1.1.13  christos     "Cygwin-x86" => {
   1631  1.1.1.13  christos         inherit_from     => [ "Cygwin-common" ],
   1632  1.1.1.13  christos         CFLAGS           => add(picker(release => "-O3 -fomit-frame-pointer")),
   1633  1.1.1.13  christos         bn_ops           => "BN_LLONG",
   1634  1.1.1.13  christos         asm_arch         => 'x86',
   1635  1.1.1.13  christos         perlasm_scheme   => "coff",
   1636       1.1  christos     },
   1637       1.1  christos     "Cygwin-x86_64" => {
   1638  1.1.1.13  christos         inherit_from     => [ "Cygwin-common" ],
   1639   1.1.1.4  christos         CC               => "gcc",
   1640       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1641  1.1.1.13  christos         asm_arch         => 'x86_64',
   1642       1.1  christos         perlasm_scheme   => "mingw64",
   1643       1.1  christos     },
   1644       1.1  christos     # Backward compatibility for those using this target
   1645       1.1  christos     "Cygwin" => {
   1646       1.1  christos 	inherit_from     => [ "Cygwin-x86" ]
   1647       1.1  christos     },
   1648       1.1  christos     # In case someone constructs the Cygwin target name themself
   1649       1.1  christos     "Cygwin-i386" => {
   1650       1.1  christos 	inherit_from     => [ "Cygwin-x86" ]
   1651       1.1  christos     },
   1652       1.1  christos     "Cygwin-i486" => {
   1653       1.1  christos 	inherit_from     => [ "Cygwin-x86" ]
   1654       1.1  christos     },
   1655       1.1  christos     "Cygwin-i586" => {
   1656       1.1  christos 	inherit_from     => [ "Cygwin-x86" ]
   1657       1.1  christos     },
   1658       1.1  christos     "Cygwin-i686" => {
   1659       1.1  christos 	inherit_from     => [ "Cygwin-x86" ]
   1660       1.1  christos     },
   1661       1.1  christos 
   1662       1.1  christos ##### MacOS X (a.k.a. Darwin) setup
   1663       1.1  christos     "darwin-common" => {
   1664       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1665       1.1  christos         template         => 1,
   1666   1.1.1.4  christos         CC               => "cc",
   1667   1.1.1.4  christos         CFLAGS           => picker(debug   => "-g -O0",
   1668   1.1.1.4  christos                                    release => "-O3"),
   1669   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT"),
   1670  1.1.1.13  christos         lflags           => add("-Wl,-search_paths_first"),
   1671       1.1  christos         sys_id           => "MACOSX",
   1672       1.1  christos         bn_ops           => "BN_LLONG RC4_CHAR",
   1673       1.1  christos         thread_scheme    => "pthreads",
   1674       1.1  christos         perlasm_scheme   => "osx32",
   1675       1.1  christos         dso_scheme       => "dlfcn",
   1676       1.1  christos         ranlib           => "ranlib -c",
   1677       1.1  christos         shared_target    => "darwin-shared",
   1678       1.1  christos         shared_cflag     => "-fPIC",
   1679   1.1.1.4  christos         shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
   1680       1.1  christos     },
   1681       1.1  christos     # Option "freeze" such as -std=gnu9x can't negatively interfere
   1682       1.1  christos     # with future defaults for below two targets, because MacOS X
   1683       1.1  christos     # for PPC has no future, it was discontinued by vendor in 2009.
   1684  1.1.1.13  christos     "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
   1685  1.1.1.13  christos     "darwin-ppc" => {
   1686  1.1.1.13  christos         inherit_from     => [ "darwin-common" ],
   1687   1.1.1.4  christos         cflags           => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
   1688   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
   1689   1.1.1.2  christos         shared_cflag     => add("-fno-common"),
   1690  1.1.1.13  christos         asm_arch         => 'ppc32',
   1691   1.1.1.4  christos         perlasm_scheme   => "osx32",
   1692       1.1  christos     },
   1693  1.1.1.13  christos     "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
   1694  1.1.1.13  christos     "darwin64-ppc" => {
   1695  1.1.1.13  christos         inherit_from     => [ "darwin-common" ],
   1696   1.1.1.4  christos         cflags           => add("-arch ppc64 -std=gnu9x"),
   1697   1.1.1.4  christos         lib_cppflags     => add("-DB_ENDIAN"),
   1698       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
   1699  1.1.1.13  christos         asm_arch         => 'ppc64',
   1700       1.1  christos         perlasm_scheme   => "osx64",
   1701       1.1  christos     },
   1702  1.1.1.13  christos     "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
   1703  1.1.1.13  christos     "darwin-i386" => {
   1704  1.1.1.13  christos         inherit_from     => [ "darwin-common" ],
   1705   1.1.1.4  christos         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
   1706   1.1.1.4  christos         cflags           => add("-arch i386"),
   1707   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1708       1.1  christos         bn_ops           => "BN_LLONG RC4_INT",
   1709  1.1.1.13  christos         asm_arch         => 'x86',
   1710       1.1  christos         perlasm_scheme   => "macosx",
   1711       1.1  christos     },
   1712  1.1.1.13  christos     "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
   1713  1.1.1.13  christos     "darwin64-x86_64" => {
   1714  1.1.1.13  christos         inherit_from     => [ "darwin-common" ],
   1715   1.1.1.4  christos         CFLAGS           => add("-Wall"),
   1716   1.1.1.4  christos         cflags           => add("-arch x86_64"),
   1717   1.1.1.4  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1718       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1719  1.1.1.13  christos         asm_arch         => 'x86_64',
   1720       1.1  christos         perlasm_scheme   => "macosx",
   1721       1.1  christos     },
   1722  1.1.1.13  christos     "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
   1723  1.1.1.13  christos     "darwin64-arm64" => {
   1724  1.1.1.13  christos         inherit_from     => [ "darwin-common" ],
   1725   1.1.1.8  christos         CFLAGS           => add("-Wall"),
   1726   1.1.1.8  christos         cflags           => add("-arch arm64"),
   1727   1.1.1.8  christos         lib_cppflags     => add("-DL_ENDIAN"),
   1728   1.1.1.8  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1729  1.1.1.13  christos         asm_arch         => 'aarch64',
   1730   1.1.1.8  christos         perlasm_scheme   => "ios64",
   1731   1.1.1.8  christos     },
   1732       1.1  christos 
   1733       1.1  christos ##### GNU Hurd
   1734       1.1  christos     "hurd-x86" => {
   1735       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1736   1.1.1.4  christos         CC               => "gcc",
   1737   1.1.1.4  christos         CFLAGS           => "-O3 -fomit-frame-pointer -Wall",
   1738   1.1.1.4  christos         cflags           => threads("-pthread"),
   1739   1.1.1.4  christos         lib_cppflags     => "-DL_ENDIAN",
   1740   1.1.1.2  christos         ex_libs          => add("-ldl", threads("-pthread")),
   1741       1.1  christos         bn_ops           => "BN_LLONG",
   1742  1.1.1.13  christos         asm_arch         => 'x86',
   1743  1.1.1.13  christos         perlasm_scheme   => 'elf',
   1744       1.1  christos         thread_scheme    => "pthreads",
   1745       1.1  christos         dso_scheme       => "dlfcn",
   1746       1.1  christos         shared_target    => "linux-shared",
   1747       1.1  christos         shared_cflag     => "-fPIC",
   1748       1.1  christos     },
   1749       1.1  christos 
   1750       1.1  christos ##### VxWorks for various targets
   1751       1.1  christos     "vxworks-ppc60x" => {
   1752       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1753   1.1.1.4  christos         CC               => "ccppc",
   1754   1.1.1.4  christos         CFLAGS           => "-O2 -Wall -fstrength-reduce",
   1755   1.1.1.4  christos         cflags           => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
   1756   1.1.1.4  christos         cppflags         => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
   1757   1.1.1.4  christos                                     "_DTOOL_FAMILY=gnu -DTOOL=gnu",
   1758   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/usr/h",
   1759   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
   1760       1.1  christos         sys_id           => "VXWORKS",
   1761   1.1.1.4  christos         lflags           => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
   1762   1.1.1.4  christos         ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
   1763       1.1  christos     },
   1764       1.1  christos     "vxworks-ppcgen" => {
   1765       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1766   1.1.1.4  christos         CC               => "ccppc",
   1767   1.1.1.4  christos         CFLAGS           => "-O1 -Wall",
   1768   1.1.1.4  christos         cflags           => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
   1769   1.1.1.4  christos         cppflags         => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
   1770   1.1.1.4  christos                                     "-DTOOL_FAMILY=gnu -DTOOL=gnu",
   1771   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/usr/h",
   1772   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
   1773       1.1  christos         sys_id           => "VXWORKS",
   1774   1.1.1.4  christos         lflags           => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
   1775   1.1.1.4  christos         ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
   1776       1.1  christos     },
   1777       1.1  christos     "vxworks-ppc405" => {
   1778       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1779   1.1.1.4  christos         CC               => "ccppc",
   1780   1.1.1.4  christos         CFLAGS           => "-g",
   1781   1.1.1.4  christos         cflags           => "-msoft-float -mlongcall",
   1782   1.1.1.4  christos         cppflags         => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
   1783   1.1.1.4  christos                                     "-DTOOL_FAMILY=gnu -DTOOL=gnu",
   1784   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h"),
   1785       1.1  christos         sys_id           => "VXWORKS",
   1786   1.1.1.4  christos         lflags           => add("-r"),
   1787       1.1  christos     },
   1788       1.1  christos     "vxworks-ppc750" => {
   1789       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1790   1.1.1.4  christos         CC               => "ccppc",
   1791   1.1.1.4  christos         CFLAGS           => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
   1792   1.1.1.4  christos         cflags           => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
   1793   1.1.1.4  christos         cppflags         => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
   1794   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h"),
   1795       1.1  christos         sys_id           => "VXWORKS",
   1796   1.1.1.4  christos         lflags           => add("-r"),
   1797       1.1  christos     },
   1798       1.1  christos     "vxworks-ppc750-debug" => {
   1799       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1800   1.1.1.4  christos         CC               => "ccppc",
   1801   1.1.1.4  christos         CFLAGS           => "-ansi -fvolatile -Wall -g",
   1802   1.1.1.4  christos         cflags           => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
   1803   1.1.1.4  christos         cppflags         => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
   1804   1.1.1.4  christos                                     "-DPEDANTIC -DDEBUG",
   1805   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h"),
   1806       1.1  christos         sys_id           => "VXWORKS",
   1807   1.1.1.4  christos         lflags           => add("-r"),
   1808       1.1  christos     },
   1809       1.1  christos     "vxworks-ppc860" => {
   1810       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1811   1.1.1.4  christos         CC               => "ccppc",
   1812   1.1.1.4  christos         cflags           => "-nostdinc -msoft-float",
   1813   1.1.1.4  christos         cppflags         => combine("-DCPU=PPC860 -DNO_STRINGS_H",
   1814   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h"),
   1815       1.1  christos         sys_id           => "VXWORKS",
   1816   1.1.1.4  christos         lflags           => add("-r"),
   1817       1.1  christos     },
   1818       1.1  christos     "vxworks-simlinux" => {
   1819       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1820   1.1.1.4  christos         CC               => "ccpentium",
   1821   1.1.1.4  christos         cflags           => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
   1822   1.1.1.4  christos         cppflags         => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
   1823   1.1.1.4  christos                                     "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
   1824   1.1.1.4  christos                                     "-DTOOL_FAMILY=gnu -DTOOL=gnu",
   1825   1.1.1.4  christos                                     "-DOPENSSL_NO_HW_PADLOCK",
   1826   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h",
   1827   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h/wrn/coreip"),
   1828       1.1  christos         sys_id           => "VXWORKS",
   1829   1.1.1.4  christos         lflags           => add("-r"),
   1830       1.1  christos         ranlib           => "ranlibpentium",
   1831       1.1  christos     },
   1832       1.1  christos     "vxworks-mips" => {
   1833  1.1.1.13  christos         inherit_from     => [ "BASE_unix" ],
   1834   1.1.1.4  christos         CC               => "ccmips",
   1835   1.1.1.4  christos         CFLAGS           => "-O -G 0",
   1836   1.1.1.4  christos         cflags           => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
   1837   1.1.1.4  christos         cppflags         => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
   1838   1.1.1.4  christos                                     "-DCPU=MIPS32 -DNO_STRINGS_H",
   1839   1.1.1.4  christos                                     "-DTOOL_FAMILY=gnu -DTOOL=gnu",
   1840   1.1.1.4  christos                                     "-DOPENSSL_NO_HW_PADLOCK",
   1841   1.1.1.4  christos                                     threads("-D_REENTRANT"),
   1842   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h",
   1843   1.1.1.4  christos                                     "-I\$(WIND_BASE)/target/h/wrn/coreip"),
   1844       1.1  christos         sys_id           => "VXWORKS",
   1845   1.1.1.4  christos         lflags           => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
   1846   1.1.1.4  christos         ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
   1847       1.1  christos         thread_scheme    => "pthreads",
   1848  1.1.1.13  christos         asm_arch         => 'mips32',
   1849       1.1  christos         perlasm_scheme   => "o32",
   1850       1.1  christos         ranlib           => "ranlibmips",
   1851       1.1  christos     },
   1852       1.1  christos 
   1853       1.1  christos #### uClinux
   1854       1.1  christos     "uClinux-dist" => {
   1855       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1856   1.1.1.4  christos         CC               => sub { env('CC') },
   1857   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT"),
   1858       1.1  christos         ex_libs          => add("\$(LDLIBS)"),
   1859       1.1  christos         bn_ops           => "BN_LLONG",
   1860       1.1  christos         thread_scheme    => "pthreads",
   1861   1.1.1.4  christos         dso_scheme       => sub { env('LIBSSL_dlfcn') },
   1862       1.1  christos         shared_target    => "linux-shared",
   1863       1.1  christos         shared_cflag     => "-fPIC",
   1864   1.1.1.4  christos         ranlib           => sub { env('RANLIB') },
   1865       1.1  christos     },
   1866       1.1  christos     "uClinux-dist64" => {
   1867       1.1  christos         inherit_from     => [ "BASE_unix" ],
   1868   1.1.1.4  christos         CC               => sub { env('CC') },
   1869   1.1.1.4  christos         cppflags         => threads("-D_REENTRANT"),
   1870       1.1  christos         ex_libs          => add("\$(LDLIBS)"),
   1871       1.1  christos         bn_ops           => "SIXTY_FOUR_BIT_LONG",
   1872       1.1  christos         thread_scheme    => "pthreads",
   1873   1.1.1.4  christos         dso_scheme       => sub { env('LIBSSL_dlfcn') },
   1874       1.1  christos         shared_target    => "linux-shared",
   1875       1.1  christos         shared_cflag     => "-fPIC",
   1876   1.1.1.4  christos         ranlib           => sub { env('RANLIB') },
   1877       1.1  christos     },
   1878       1.1  christos 
   1879       1.1  christos     ##### VMS
   1880   1.1.1.4  christos     # Most things happen in vms-generic.
   1881   1.1.1.4  christos     # Note that vms_info extracts the pointer size from the end of
   1882   1.1.1.4  christos     # the target name, and will assume that anything matching /-p\d+$/
   1883   1.1.1.4  christos     # indicates the pointer size setting for the desired target.
   1884       1.1  christos     "vms-generic" => {
   1885       1.1  christos         inherit_from     => [ "BASE_VMS" ],
   1886       1.1  christos         template         => 1,
   1887   1.1.1.4  christos         CC               => "CC/DECC",
   1888   1.1.1.4  christos         CPP              => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
   1889   1.1.1.4  christos         CFLAGS           =>
   1890   1.1.1.4  christos             combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
   1891   1.1.1.4  christos                            debug   => "/NOOPTIMIZE/DEBUG",
   1892   1.1.1.4  christos                            release => "/OPTIMIZE/NODEBUG"),
   1893   1.1.1.4  christos                     sub { my @warnings =
   1894   1.1.1.4  christos                               @{vms_info()->{disable_warns}};
   1895   1.1.1.4  christos                           @warnings
   1896   1.1.1.4  christos                               ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
   1897  1.1.1.13  christos         cflag_incfirst   => '/FIRST_INCLUDE=',
   1898   1.1.1.4  christos         lib_defines      =>
   1899   1.1.1.4  christos             add("OPENSSL_USE_NODELETE",
   1900   1.1.1.4  christos                 sub {
   1901   1.1.1.4  christos                     return vms_info()->{def_zlib}
   1902   1.1.1.4  christos                         ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
   1903   1.1.1.4  christos                 }),
   1904   1.1.1.4  christos         lflags           => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
   1905       1.1  christos                                    debug   => "/DEBUG/TRACEBACK",
   1906       1.1  christos                                    release => "/NODEBUG/NOTRACEBACK"),
   1907  1.1.1.13  christos         # Because of dso_cflags below, we can't set the generic |cflags| here,
   1908  1.1.1.13  christos         # as it can't be overridden, so we set separate C flags for libraries
   1909  1.1.1.13  christos         # and binaries instead.
   1910  1.1.1.13  christos         bin_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
   1911       1.1  christos         lib_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
   1912  1.1.1.13  christos         # Strictly speaking, DSOs should not need to have name shortening,
   1913  1.1.1.13  christos         # as all their exported symbols should be short enough to fit the
   1914  1.1.1.13  christos         # linker's 31 character per symbol name limit.  However, providers
   1915  1.1.1.13  christos         # may be composed of more than one object file, and internal symbols
   1916  1.1.1.13  christos         # may and do surpass the 31 character limit.
   1917  1.1.1.13  christos         dso_cflags       => add("/NAMES=(SHORTENED)"),
   1918   1.1.1.4  christos         ex_libs          => add(sub { return vms_info()->{zlib} || (); }),
   1919       1.1  christos         shared_target    => "vms-shared",
   1920  1.1.1.13  christos         # def_flag made to empty string so a .opt file gets generated
   1921  1.1.1.13  christos         shared_defflag   => '',
   1922       1.1  christos         dso_scheme       => "vms",
   1923       1.1  christos         thread_scheme    => "pthreads",
   1924       1.1  christos 
   1925  1.1.1.13  christos         makedep_scheme   => 'VMS C',
   1926   1.1.1.4  christos         AS               => sub { vms_info()->{AS} },
   1927   1.1.1.4  christos         ASFLAGS          => sub { vms_info()->{ASFLAGS} },
   1928   1.1.1.4  christos         asoutflag        => sub { vms_info()->{asoutflag} },
   1929   1.1.1.4  christos         asflags          => sub { vms_info()->{asflags} },
   1930   1.1.1.4  christos         perlasm_scheme   => sub { vms_info()->{perlasm_scheme} },
   1931   1.1.1.4  christos 
   1932  1.1.1.13  christos         disable          => add('pinshared', 'loadereng'),
   1933   1.1.1.5  christos 
   1934       1.1  christos     },
   1935       1.1  christos 
   1936   1.1.1.4  christos     # From HELP CC/POINTER_SIZE:
   1937   1.1.1.4  christos     #
   1938   1.1.1.4  christos     # ----------
   1939   1.1.1.4  christos     # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
   1940   1.1.1.4  christos     #             LONG or 64 is present, the main argument argv will be an
   1941   1.1.1.4  christos     #             array of long pointers instead of an array of short pointers.
   1942   1.1.1.4  christos     #
   1943   1.1.1.4  christos     # 64[=ARGV]   Same as LONG.
   1944   1.1.1.4  christos     # ----------
   1945   1.1.1.4  christos     #
   1946   1.1.1.4  christos     # We don't want the hassle of dealing with 32-bit pointers with argv, so
   1947   1.1.1.4  christos     # we force it to have 64-bit pointers, see the added cflags in the -p64
   1948   1.1.1.4  christos     # config targets below.
   1949   1.1.1.4  christos 
   1950       1.1  christos     "vms-alpha" => {
   1951       1.1  christos         inherit_from     => [ "vms-generic" ],
   1952   1.1.1.4  christos         bn_ops           => "SIXTY_FOUR_BIT RC4_INT",
   1953   1.1.1.4  christos         pointer_size     => "",
   1954       1.1  christos     },
   1955       1.1  christos     "vms-alpha-p32" => {
   1956   1.1.1.4  christos         inherit_from     => [ "vms-alpha" ],
   1957   1.1.1.4  christos         cflags           => add("/POINTER_SIZE=32"),
   1958   1.1.1.4  christos         pointer_size     => "32",
   1959       1.1  christos     },
   1960       1.1  christos     "vms-alpha-p64" => {
   1961   1.1.1.4  christos         inherit_from     => [ "vms-alpha" ],
   1962   1.1.1.4  christos         cflags           => add("/POINTER_SIZE=64=ARGV"),
   1963   1.1.1.4  christos         pointer_size     => "64",
   1964       1.1  christos     },
   1965       1.1  christos     "vms-ia64" => {
   1966  1.1.1.13  christos         inherit_from     => [ "vms-generic" ],
   1967   1.1.1.4  christos         bn_ops           => "SIXTY_FOUR_BIT RC4_INT",
   1968  1.1.1.13  christos         asm_arch         => sub { vms_info()->{AS} ? 'ia64' : undef },
   1969  1.1.1.13  christos         perlasm_scheme   => 'ias',
   1970   1.1.1.4  christos         pointer_size     => "",
   1971   1.1.1.4  christos 
   1972       1.1  christos     },
   1973       1.1  christos     "vms-ia64-p32" => {
   1974   1.1.1.4  christos         inherit_from     => [ "vms-ia64" ],
   1975   1.1.1.4  christos         cflags           => add("/POINTER_SIZE=32"),
   1976   1.1.1.4  christos         pointer_size     => "32",
   1977       1.1  christos     },
   1978       1.1  christos     "vms-ia64-p64" => {
   1979   1.1.1.4  christos         inherit_from     => [ "vms-ia64" ],
   1980   1.1.1.4  christos         cflags           => add("/POINTER_SIZE=64=ARGV"),
   1981   1.1.1.4  christos         pointer_size     => "64",
   1982       1.1  christos     },
   1983  1.1.1.14  christos     "vms-x86_64" => {
   1984  1.1.1.14  christos         inherit_from     => [ "vms-generic" ],
   1985  1.1.1.14  christos         bn_ops           => "SIXTY_FOUR_BIT",
   1986  1.1.1.14  christos         pointer_size     => "",
   1987  1.1.1.16  christos     },
   1988  1.1.1.16  christos     "vms-x86_64-p32" => {
   1989  1.1.1.16  christos         inherit_from     => [ "vms-x86_64" ],
   1990  1.1.1.16  christos         cflags           => add("/POINTER_SIZE=32"),
   1991  1.1.1.16  christos         pointer_size     => "32",
   1992  1.1.1.16  christos     },
   1993  1.1.1.16  christos     "vms-x86_64-p64" => {
   1994  1.1.1.16  christos         inherit_from     => [ "vms-x86_64" ],
   1995  1.1.1.16  christos         cflags           => add("/POINTER_SIZE=64=ARGV"),
   1996  1.1.1.16  christos         pointer_size     => "64",
   1997  1.1.1.14  christos     }
   1998       1.1  christos );
   1999