10-main.conf 84.2 KB
Newer Older
1
## -*- mode: perl; -*-
2 3
## Standard openssl configuration targets.

4 5 6 7 8 9 10 11
# Helper functions for the Windows configs
my $vc_win64a_info = {};
sub vc_win64a_info {
    unless (%$vc_win64a_info) {
        if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
            $vc_win64a_info = { as        => "nasm",
                                asflags   => "-f win64 -DNEAR -Ox -g",
                                asoutflag => "-o" };
12
        } elsif ($disabled{asm}) {
13 14 15
            $vc_win64a_info = { as        => "ml64",
                                asflags   => "/c /Cp /Cx /Zi",
                                asoutflag => "/Fo" };
16
        } else {
17 18 19 20
            $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
            $vc_win64a_info = { as        => "{unknown}",
                                asflags   => "",
                                asoutflag => "" };
21 22 23 24 25
        }
    }
    return $vc_win64a_info;
}

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
my $vc_win32_info = {};
sub vc_win32_info {
    unless (%$vc_win32_info) {
        my $ver=`nasm -v 2>NUL`;
        my $vew=`nasmw -v 2>NUL`;
        if ($ver ne "" || $vew ne "") {
            $vc_win32_info = { as        => $ver ge $vew ? "nasm" : "nasmw",
                               asflags   => "-f win32",
                               asoutflag => "-o",
                               perlasm_scheme => "win32n" };
        } elsif ($disabled{asm}) {
            $vc_win32_info = { as        => "ml",
                               asflags   => "/nologo /Cp /coff /c /Cx /Zi",
                               asoutflag => "/Fo",
                               perlasm_scheme => "win32" };
        } else {
42 43 44 45 46
            $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
            $vc_win32_info = { as        => "{unknown}",
                               asflags   => "",
                               asoutflag => "",
                               perlasm_scheme => "win32" };
47 48 49 50 51
        }
    }
    return $vc_win32_info;
}

52 53 54 55
my $vc_wince_info = {};
sub vc_wince_info {
    unless (%$vc_wince_info) {
        # sanity check
56 57 58
        $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
        $die->('%PLATFORM% is not defined')  if (!defined($ENV{'PLATFORM'}));
        $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
59 60 61 62 63

        #
        # Idea behind this is to mimic flags set by eVC++ IDE...
        #
        my $wcevers = $ENV{'OSVERSION'};                    # WCENNN
64 65 66 67 68 69 70 71 72 73 74 75
	my $wcevernum;
	my $wceverdotnum;
	if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
	    $wcevernum = "$1$2";
	    $wceverdotnum = "$1.$2";
	} else {
	    $die->('%OSVERSION% value is insane');
	    $wcevernum = "{unknown}";
	    $wceverdotnum = "{unknown}";
	}
        my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
        my $wcelflag = "/subsystem:windowsce,$wceverdotnum";        # ...,N.NN
76 77

        my $wceplatf =  $ENV{'PLATFORM'};
R
Richard Levitte 已提交
78 79 80

        $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
        $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

        my $wcetgt = $ENV{'TARGETCPU'};                     # just shorter name...
      SWITCH: for($wcetgt) {
          /^X86/        && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
                                $wcelflag.=" /machine:X86";     last; };
          /^ARMV4[IT]/  && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
                                $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
                                $wcecdefs.=" -QRarch4T -QRinterwork-return";
                                $wcelflag.=" /machine:THUMB";   last; };
          /^ARM/        && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
                                $wcelflag.=" /machine:ARM";     last; };
          /^MIPSIV/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
                                $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
                                $wcelflag.=" /machine:MIPSFPU"; last; };
          /^MIPS16/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
                                $wcecdefs.=" -DMIPSII -QMmips16";
                                $wcelflag.=" /machine:MIPS16";  last; };
          /^MIPSII/     && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
                                $wcecdefs.=" -QMmips2";
                                $wcelflag.=" /machine:MIPS";    last; };
          /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
                                $wcelflag.=" /machine:MIPS";    last; };
          /^SH[0-9]/    && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
                                $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
                                $wcelflag.=" /machine:$wcetgt"; last; };
          { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
            $wcelflag.=" /machine:$wcetgt";                     last; };
      }

        $vc_wince_info = { cflags => $wcecdefs,
                           lflags => $wcelflag };
    }
    return $vc_wince_info;
}

116 117 118 119
# Helper functions for the VMS configs
my $vms_info = {};
sub vms_info {
    unless (%$vms_info) {
120 121 122 123
        my $pointer_size = shift;
        my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";

        $vms_info->{disable_warns} = [ ];
124
        $vms_info->{pointer_size} = $pointer_size_str;
125 126 127 128 129 130
        if ($pointer_size == 64) {
            `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
            if ($? == 0) {
                push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
            }
        }
131 132

        unless ($disabled{zlib}) {
133
            my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
134
            if (defined($disabled{"zlib-dynamic"})) {
135
                $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
136
            } else {
137 138 139 140
                $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
                # In case the --with-zlib-lib value contains something like
                # /SHARE or /LIB or so at the end, remove it.
                $vms_info->{def_zlib} =~ s|/.*$||g;
141 142
            }
        }
143 144 145
    }
    return $vms_info;
}
146

147 148
%targets = (

149
#### Basic configs that should work on any 32-bit box
150 151
    "gcc" => {
        cc               => "gcc",
152 153
        cflags           => picker(debug   => "-O0 -g",
                                   release => "-O3"),
154
        thread_scheme    => "(unknown)",
155 156 157 158 159
        bn_ops           => "BN_LLONG",
    },
    "cc" => {
        cc               => "cc",
        cflags           => "-O",
160
        thread_scheme    => "(unknown)",
161
    },
162

163
#### VOS Configurations
164
    "vos-gcc" => {
165
        inherit_from     => [ "BASE_unix" ],
166
        cc               => "gcc",
167
        cflags           => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
A
Andy Polyakov 已提交
168
                                   debug   => "-O0 -g",
169
                                   release => "-O3"),
170
        thread_scheme    => "(unknown)",
171 172 173 174 175
        sys_id           => "VOS",
        lflags           => "-Wl,-map",
        bn_ops           => "BN_LLONG",
        shared_extension => ".so",
    },
176

R
Richard Levitte 已提交
177
#### Solaris configurations
178
    "solaris-common" => {
179
        inherit_from     => [ "BASE_unix" ],
180 181
        template         => 1,
        cflags           => "-DFILIO_H",
182
        ex_libs          => add("-lresolv -lsocket -lnsl -ldl"),
183
        dso_scheme       => "dlfcn",
184
        thread_scheme    => "pthreads",
185 186 187
        shared_target    => "solaris-shared",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
188
#### Solaris x86 with GNU C setups
189
    "solaris-x86-gcc" => {
190 191 192 193 194
        # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
        # to do it here because whenever GNU C instantiates an assembler
        # template it surrounds it with #APP #NO_APP comment pair which
        # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
        # with "Illegal mnemonic" error message.
195
        inherit_from     => [ "solaris-common", asm("x86_elf_asm") ],
196
        cc               => "gcc",
197 198
        cflags           => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
                                              debug   => "-O0 -g",
199 200
                                              release => "-O3 -fomit-frame-pointer"),
                                       threads("-pthread")),
R
Rich Salz 已提交
201
        bn_ops           => "BN_LLONG",
202
        shared_cflag     => "-fPIC",
203
        shared_ldflag    => "-shared -static-libgcc",
204 205
    },
    "solaris64-x86_64-gcc" => {
206 207 208 209 210 211 212 213
        # -shared -static-libgcc might appear controversial, but modules
        # taken from static libgcc do not have relocations and linking
        # them into our shared objects doesn't have any negative side
        # effects. On the contrary, doing so makes it possible to use
        # gcc shared build with Sun C. Given that gcc generates faster
        # code [thanks to inline assembler], I would actually recommend
        # to consider using gcc shared build even with vendor compiler:-)
        #					<appro@fy.chalmers.se>
214
        inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
215
        cc               => "gcc",
216 217
        cflags           => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
                                              debug   => "-O0 -g",
218 219
                                              release => "-O3"),
                                       threads("-pthread")),
220
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
221 222 223 224 225
        perlasm_scheme   => "elf",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-m64 -shared -static-libgcc",
        multilib         => "/64",
    },
226 227

#### Solaris x86 with Sun C setups
228 229 230 231 232 233 234 235 236 237 238 239
    # There used to be solaris-x86-cc target, but it was removed,
    # primarily because vendor assembler can't assemble our modules
    # with -KPIC flag. As result it, assembly support, was not even
    # available as option. But its lack means lack of side-channel
    # resistant code, which is incompatible with security by todays
    # standards. Fortunately gcc is readily available prepackaged
    # option, which we can firmly point at...
    #
    # On related note, solaris64-x86_64-cc target won't compile code
    # paths utilizing AVX and post-Haswell instruction extensions.
    # Consider switching to solaris64-x86_64-gcc even here...
    #
240
    "solaris64-x86_64-cc" => {
241
        inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
242
        cc               => "cc",
243 244
        cflags           => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
                                              debug   => "-g",
245 246 247
                                              release => "-xO5 -xdepend -xbuiltin"),
                                       threads("-D_REENTRANT")),
        thread_scheme    => "pthreads",
248
        lflags           => add("-xarch=generic64",threads("-mt")),
249
        ex_libs          => add(threads("-lpthread")),
250
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
251 252
        perlasm_scheme   => "elf",
        shared_cflag     => "-KPIC",
253
        shared_ldflag    => "-xarch=generic64 -G -dy -z text",
254 255
        multilib         => "/64",
    },
256 257

#### SPARC Solaris with GNU C setups
258
    "solaris-sparcv7-gcc" => {
259
        inherit_from     => [ "solaris-common" ],
260
        cc               => "gcc",
261 262
        cflags           => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
                                              debug   => "-O0 -g",
263 264
                                              release => "-O3"),
                                       threads("-pthread")),
265
        bn_ops           => "BN_LLONG RC4_CHAR",
266 267 268 269
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-shared",
    },
    "solaris-sparcv8-gcc" => {
270
        inherit_from     => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
271
        cflags           => add_before("-mcpu=v8"),
272 273
    },
    "solaris-sparcv9-gcc" => {
274
        # -m32 should be safe to add as long as driver recognizes
275
        # -mcpu=ultrasparc
276
        inherit_from     => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
A
Andy Polyakov 已提交
277
        cflags           => add_before("-m32 -mcpu=ultrasparc"),
278 279
    },
    "solaris64-sparcv9-gcc" => {
280
        inherit_from     => [ "solaris-sparcv9-gcc" ],
281
        cflags           => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
282
        bn_ops           => "BN_LLONG RC4_CHAR",
283 284 285
        shared_ldflag    => "-m64 -shared",
        multilib         => "/64",
    },
286 287 288 289 290

#### SPARC Solaris with Sun C setups
# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
# SC5.0 note: Compiler common patch 107357-01 or later is required!
291
    "solaris-sparcv7-cc" => {
292
        inherit_from     => [ "solaris-common" ],
293
        cc               => "cc",
294
        cflags           => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
A
Andy Polyakov 已提交
295
                                              debug   => "-g",
296 297 298 299
                                              release => "-xO5 -xdepend"),
                                       threads("-D_REENTRANT")),
        lflags           => add(threads("-mt")),
        ex_libs          => add(threads("-lpthread")),
300
        bn_ops           => "BN_LLONG RC4_CHAR",
301 302 303
        shared_cflag     => "-KPIC",
        shared_ldflag    => "-G -dy -z text",
    },
304
####
305
    "solaris-sparcv8-cc" => {
306
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
307
        cflags           => add_before("-xarch=v8"),
308 309
    },
    "solaris-sparcv9-cc" => {
310
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
311
        cflags           => add_before("-xarch=v8plus"),
312 313
    },
    "solaris64-sparcv9-cc" => {
314
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
315
        cflags           => add_before("-xarch=v9"),
316
        lflags           => add_before("-xarch=v9"),
317
        bn_ops           => "BN_LLONG RC4_CHAR",
318 319 320
        shared_ldflag    => "-xarch=v9 -G -dy -z text",
        multilib         => "/64",
    },
321 322

#### IRIX 6.x configs
A
Andy Polyakov 已提交
323
# Only N32 and N64 ABIs are supported.
324
    "irix-mips3-gcc" => {
325
        inherit_from     => [ "BASE_unix", asm("mips64_asm") ],
326
        cc               => "gcc",
327 328 329
        cflags           => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
                                           debug   => "-g -O0",
                                           release => "-O3"),
A
Andy Polyakov 已提交
330 331
                                    threads("-D_SGI_MP_SOURCE")),
        ex_libs          => add(threads("-lpthread")),
332
        bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT",
333
        thread_scheme    => "pthreads",
334 335 336 337 338 339 340 341
        perlasm_scheme   => "n32",
        dso_scheme       => "dlfcn",
        shared_target    => "irix-shared",
        shared_ldflag    => "-mabi=n32",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "32",
    },
    "irix-mips3-cc" => {
342
        inherit_from     => [ "BASE_unix", asm("mips64_asm") ],
343
        cc               => "cc",
344 345 346 347 348
        cflags           => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
                                           debug   => "-g -O0",
                                           release => "-O2"),
                                    threads("-D_SGI_MP_SOURCE")),
        ex_libs          => add(threads("-lpthread")),
349
        bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT",
350
        thread_scheme    => "pthreads",
351 352 353 354 355 356 357
        perlasm_scheme   => "n32",
        dso_scheme       => "dlfcn",
        shared_target    => "irix-shared",
        shared_ldflag    => "-n32",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "32",
    },
358
    # N64 ABI builds.
359
    "irix64-mips4-gcc" => {
360
        inherit_from     => [ "BASE_unix", asm("mips64_asm") ],
361
        cc               => "gcc",
362 363 364 365
        cflags           => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
                                           debug   => "-g -O0",
                                           release => "-O3"),
                                    threads("-D_SGI_MP_SOURCE")),
A
Andy Polyakov 已提交
366
        ex_libs          => add(threads("-lpthread")),
367
        bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
368
        thread_scheme    => "pthreads",
369 370 371 372 373 374 375 376
        perlasm_scheme   => "64",
        dso_scheme       => "dlfcn",
        shared_target    => "irix-shared",
        shared_ldflag    => "-mabi=64",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "64",
    },
    "irix64-mips4-cc" => {
377
        inherit_from     => [ "BASE_unix", asm("mips64_asm") ],
378
        cc               => "cc",
379 380 381 382 383
        cflags           => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
                                           debug   => "-g -O0",
                                           release => "-O2"),
                                    threads("-D_SGI_MP_SOURCE")),
        ex_libs          => add(threads("-lpthread")),
384
        bn_ops           => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
385
        thread_scheme    => "pthreads",
386 387 388 389 390 391 392
        perlasm_scheme   => "64",
        dso_scheme       => "dlfcn",
        shared_target    => "irix-shared",
        shared_ldflag    => "-64",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "64",
    },
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408

#### Unified HP-UX ANSI C configs.
# Special notes:
# - Originally we were optimizing at +O4 level. It should be noted
#   that the only difference between +O3 and +O4 is global inter-
#   procedural analysis. As it has to be performed during the link
#   stage the compiler leaves behind certain pseudo-code in lib*.a
#   which might be release or even patch level specific. Generating
#   the machine code for and analyzing the *whole* program appears
#   to be *extremely* memory demanding while the performance gain is
#   actually questionable. The situation is intensified by the default
#   HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
#   which is way too low for +O4. In other words, doesn't +O3 make
#   more sense?
# - Keep in mind that the HP compiler by default generates code
#   suitable for execution on the host you're currently compiling at.
F
FdaSilvaYY 已提交
409
#   If the toolkit is meant to be used on various PA-RISC processors
410
#   consider './Configure hpux-parisc-[g]cc +DAportable'.
411 412 413 414 415
# - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
#   32-bit message digests. (For the moment of this writing) HP C
#   doesn't seem to "digest" too many local variables (they make "him"
#   chew forever:-). For more details look-up MD32_XARRAY comment in
#   crypto/sha/sha_lcl.h.
416
# - originally there were 32-bit hpux-parisc2-* targets. They were
F
FdaSilvaYY 已提交
417
#   scrapped, because a) they were not interchangeable with other 32-bit
418 419 420
#   targets; b) performance-critical 32-bit assembly modules implement
#   even PA-RISC 2.0-specific code paths, which are chosen at run-time,
#   thus adequate performance is provided even with PA-RISC 1.1 build.
421
#					<appro@fy.chalmers.se>
422
    "hpux-parisc-gcc" => {
423
        inherit_from     => [ "BASE_unix" ],
424
        cc               => "gcc",
425 426 427 428
        cflags           => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread")),
429
        ex_libs          => add("-Wl,+s -ldld"),
430
        bn_ops           => "BN_LLONG",
431
        thread_scheme    => "pthreads",
432 433 434 435 436 437 438
        dso_scheme       => "dl",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-shared",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "hpux-parisc1_1-gcc" => {
439
        inherit_from     => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
440 441 442
        multilib         => "/pa1.1",
    },
    "hpux64-parisc2-gcc" => {
443
        inherit_from     => [ "BASE_unix", asm("parisc20_64_asm") ],
444
        cc               => "gcc",
445 446 447 448
        cflags           => combine(picker(default => "-DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-D_REENTRANT")),
449
        ex_libs          => add("-ldl"),
450
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
451
        thread_scheme    => "pthreads",
452 453 454 455 456 457 458
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fpic",
        shared_ldflag    => "-shared",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/pa20_64",
    },
459

460 461 462 463
    # More attempts at unified 10.X and 11.X targets for HP C compiler.
    #
    # Chris Ruemmler <ruemmler@cup.hp.com>
    # Kevin Steves <ks@hp.se>
464
    "hpux-parisc-cc" => {
465
        inherit_from     => [ "BASE_unix" ],
466
        cc               => "cc",
467 468 469 470 471
        cflags           => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
                                           debug   => "+O0 +d -g",
                                           release => "+O3"),
                                    threads("-D_REENTRANT")),
        ex_libs          => add("-Wl,+s -ldld",threads("-lpthread")),
472
        bn_ops           => "RC4_CHAR",
473
        thread_scheme    => "pthreads",
474 475 476 477 478 479 480
        dso_scheme       => "dl",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "-b",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "hpux-parisc1_1-cc" => {
481
        inherit_from     => [ "hpux-parisc-cc", asm("parisc11_asm") ],
482
        cflags           => add_before("+DA1.1"),
483 484 485
        multilib         => "/pa1.1",
    },
    "hpux64-parisc2-cc" => {
486
        inherit_from     => [ "BASE_unix", asm("parisc20_64_asm") ],
487
        cc               => "cc",
488 489 490 491 492
        cflags           => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
                                           debug   => "+O0 +d -g",
                                           release => "+O3"),
                                    threads("-D_REENTRANT")),
        ex_libs          => add("-ldl",threads("-lpthread")),
493
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
494
        thread_scheme    => "pthreads",
495 496 497 498 499 500 501
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "+DD64 -b",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/pa20_64",
    },
502

503
    # HP/UX IA-64 targets
504
    "hpux-ia64-cc" => {
505
        inherit_from     => [ "BASE_unix", asm("ia64_asm") ],
506
        cc               => "cc",
507 508 509 510 511
        cflags           => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
                                           debug   => "+O0 +d -g",
                                           release => "+O2"),
                                    threads("-D_REENTRANT")),
        ex_libs          => add("-ldl",threads("-lpthread")),
512
        bn_ops           => "SIXTY_FOUR_BIT",
513
        thread_scheme    => "pthreads",
514 515 516 517 518 519 520
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "+DD32 -b",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/hpux32",
    },
521 522
    # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
    # with debugging of the following config.
523
    "hpux64-ia64-cc" => {
524
        inherit_from     => [ "BASE_unix", asm("ia64_asm") ],
525
        cc               => "cc",
526 527 528 529 530
        cflags           => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
                                           debug   => "+O0 +d -g",
                                           release => "+O3"),
                                    threads("-D_REENTRANT")),
        ex_libs          => add("-ldl", threads("-lpthread")),
531
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
532
        thread_scheme    => "pthreads",
533 534 535 536 537 538 539
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "+DD64 -b",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/hpux64",
    },
540
    # GCC builds...
541
    "hpux-ia64-gcc" => {
542
        inherit_from     => [ "BASE_unix", asm("ia64_asm") ],
543
        cc               => "gcc",
544 545 546 547
        cflags           => combine(picker(default => "-DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread")),
548
        ex_libs          => add("-ldl"),
549
        bn_ops           => "SIXTY_FOUR_BIT",
550
        thread_scheme    => "pthreads",
551 552 553 554 555 556 557 558
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fpic",
        shared_ldflag    => "-shared",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/hpux32",
    },
    "hpux64-ia64-gcc" => {
559
        inherit_from     => [ "BASE_unix", asm("ia64_asm") ],
560
        cc               => "gcc",
R
Richard Levitte 已提交
561 562 563 564
        cflags           => combine(picker(default => "-mlp64 -DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread")),
565
        ex_libs          => add("-ldl"),
566
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
567
        thread_scheme    => "pthreads",
568 569 570 571 572 573 574
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fpic",
        shared_ldflag    => "-mlp64 -shared",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/hpux64",
    },
575 576

#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
577
    "MPE/iX-gcc" => {
578
        inherit_from     => [ "BASE_unix" ],
579 580 581
        cc               => "gcc",
        cflags           => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
        sys_id           => "MPE",
582
        ex_libs          => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
583
        thread_scheme    => "(unknown)",
584
        bn_ops           => "BN_LLONG",
585
    },
586

A
Andy Polyakov 已提交
587 588 589 590 591
#### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
#### and forward. In reality 'uname -s' still returns "OSF1". Originally
#### there were even osf1-* configs targeting prior versions provided,
#### but not anymore...
    "tru64-alpha-gcc" => {
592
        inherit_from     => [ "BASE_unix", asm("alpha_asm") ],
593
        cc               => "gcc",
A
Andy Polyakov 已提交
594 595 596
        cflags           => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
                                    threads("-pthread")),
        ex_libs          => "-lrt",    # for mlock(2)
597
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
A
Andy Polyakov 已提交
598
        thread_scheme    => "pthreads",
599 600 601 602 603
        dso_scheme       => "dlfcn",
        shared_target    => "alpha-osf1-shared",
        shared_extension => ".so",
    },
    "tru64-alpha-cc" => {
604
        inherit_from     => [ "BASE_unix", asm("alpha_asm") ],
605
        cc               => "cc",
A
Andy Polyakov 已提交
606
        cflags           => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
607
                                    threads("-pthread")),
A
Andy Polyakov 已提交
608
        ex_libs          => "-lrt",    # for mlock(2)
609
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
610
        thread_scheme    => "pthreads",
611 612 613 614 615
        dso_scheme       => "dlfcn",
        shared_target    => "alpha-osf1-shared",
        shared_ldflag    => "-msym",
        shared_extension => ".so",
    },
616 617 618 619 620 621

####
#### Variety of LINUX:-)
####
# *-generic* is endian-neutral target, but ./config is free to
# throw in -D[BL]_ENDIAN, whichever appropriate...
622
    "linux-generic32" => {
623
        inherit_from     => [ "BASE_unix" ],
624
        cc               => "gcc",
625
        cxx              => "g++",
626
        cflags           => combine(picker(default => "-Wall",
A
Andy Polyakov 已提交
627
                                           debug   => "-O0 -g",
628 629
                                           release => "-O3"),
                                    threads("-pthread")),
630
        ex_libs          => add("-ldl"),
631
        bn_ops           => "BN_LLONG RC4_CHAR",
632
        thread_scheme    => "pthreads",
633 634
        dso_scheme       => "dlfcn",
        shared_target    => "linux-shared",
M
Matt Caswell 已提交
635
        shared_cflag     => "-fPIC -DOPENSSL_USE_NODELETE",
636
        shared_ldflag    => "-Wl,-znodelete",
637 638
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
639 640
    "linux-generic64" => {
        inherit_from     => [ "linux-generic32" ],
641
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
642 643
    },

644
    "linux-ppc" => {
645
        inherit_from     => [ "linux-generic32", asm("ppc32_asm") ],
646
        perlasm_scheme   => "linux32",
647 648 649
    },
    "linux-ppc64" => {
        inherit_from     => [ "linux-generic64", asm("ppc64_asm") ],
650
        cflags           => add("-m64 -DB_ENDIAN"),
651
        perlasm_scheme   => "linux64",
M
Matt Caswell 已提交
652
        shared_ldflag    => add("-m64"),
653 654 655 656
        multilib         => "64",
    },
    "linux-ppc64le" => {
        inherit_from     => [ "linux-generic64", asm("ppc64_asm") ],
657
        cflags           => add("-m64 -DL_ENDIAN"),
658
        perlasm_scheme   => "linux64le",
M
Matt Caswell 已提交
659
        shared_ldflag    => add("-m64"),
660
    },
661

662
    "linux-armv4" => {
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
        ################################################################
        # Note that -march is not among compiler options in linux-armv4
        # target description. Not specifying one is intentional to give
        # you choice to:
        #
        # a) rely on your compiler default by not specifying one;
        # b) specify your target platform explicitly for optimal
        # performance, e.g. -march=armv6 or -march=armv7-a;
        # c) build "universal" binary that targets *range* of platforms
        # by specifying minimum and maximum supported architecture;
        #
        # As for c) option. It actually makes no sense to specify
        # maximum to be less than ARMv7, because it's the least
        # requirement for run-time switch between platform-specific
        # code paths. And without run-time switch performance would be
        # equivalent to one for minimum. Secondly, there are some
        # natural limitations that you'd have to accept and respect.
        # Most notably you can *not* build "universal" binary for
        # big-endian platform. This is because ARMv7 processor always
        # picks instructions in little-endian order. Another similar
        # limitation is that -mthumb can't "cross" -march=armv6t2
        # boundary, because that's where it became Thumb-2. Well, this
        # limitation is a bit artificial, because it's not really
        # impossible, but it's deemed too tricky to support. And of
        # course you have to be sure that your binutils are actually
        # up to the task of handling maximum target platform. With all
        # this in mind here is an example of how to configure
        # "universal" build:
        #
        # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
        #
        inherit_from     => [ "linux-generic32", asm("armv4_asm") ],
        perlasm_scheme   => "linux32",
696 697
    },
    "linux-aarch64" => {
698
        inherit_from     => [ "linux-generic64", asm("aarch64_asm") ],
699 700
        perlasm_scheme   => "linux64",
    },
701 702
    "linux-arm64ilp32" => {  # https://wiki.linaro.org/Platform/arm64-ilp32
        inherit_from     => [ "linux-generic32", asm("aarch64_asm") ],
703
        cflags           => add("-mabi=ilp32"),
704
        bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
705 706 707
        perlasm_scheme   => "linux64",
        shared_ldflag    => "-mabi=ilp32",
    },
708

709
    "linux-mips32" => {
710 711 712
        # Configure script adds minimally required -march for assembly
        # support, if no -march was specified at command line.
        inherit_from     => [ "linux-generic32", asm("mips32_asm") ],
713
        cflags           => add("-mabi=32 -DBN_DIV3W"),
714
        perlasm_scheme   => "o32",
M
Matt Caswell 已提交
715
        shared_ldflag    => add("-mabi=32"),
716
    },
717 718
    # mips32 and mips64 below refer to contemporary MIPS Architecture
    # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
719
    "linux-mips64" => {
720
        inherit_from     => [ "linux-generic32", asm("mips64_asm") ],
721
        cflags           => add("-mabi=n32 -DBN_DIV3W"),
722
        bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
723
        perlasm_scheme   => "n32",
M
Matt Caswell 已提交
724
        shared_ldflag    => add("-mabi=n32"),
725 726 727
        multilib         => "32",
    },
    "linux64-mips64" => {
728
        inherit_from     => [ "linux-generic64", asm("mips64_asm") ],
729
        cflags           => add("-mabi=64 -DBN_DIV3W"),
730
        perlasm_scheme   => "64",
M
Matt Caswell 已提交
731
        shared_ldflag    => add("-mabi=64"),
732 733
        multilib         => "64",
    },
734 735

    #### IA-32 targets...
736
    "linux-elf" => {
737
        inherit_from     => [ "linux-generic32", asm("x86_elf_asm") ],
738 739
        cflags           => add(picker(default => "-DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
R
Rich Salz 已提交
740
        bn_ops           => "BN_LLONG",
741 742
    },
    "linux-aout" => {
743
        inherit_from     => [ "BASE_unix", asm("x86_asm") ],
744
        cc               => "gcc",
745 746 747
        cflags           => add(picker(default => "-DL_ENDIAN -Wall",
                                       debug   => "-O0 -g",
                                       release => "-O3 -fomit-frame-pointer")),
R
Rich Salz 已提交
748
        bn_ops           => "BN_LLONG",
749
        thread_scheme    => "(unknown)",
750 751
        perlasm_scheme   => "a.out",
    },
752

753
    "linux-x86_64" => {
754
        inherit_from     => [ "linux-generic64", asm("x86_64_asm") ],
755
        cflags           => add("-m64 -DL_ENDIAN"),
756
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
757
        perlasm_scheme   => "elf",
M
Matt Caswell 已提交
758
        shared_ldflag    => add("-m64"),
759 760
        multilib         => "64",
    },
761 762 763
    "linux-x86_64-clang" => {
        inherit_from     => [ "linux-x86_64" ],
        cc               => "clang",
764
        cxx              => "clang++",
765
        cflags           => add("-Wextra -Qunused-arguments"),
766
    },
767
    "linux-x32" => {
768
        inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
769
        cflags           => add("-mx32 -DL_ENDIAN"),
770
        bn_ops           => "SIXTY_FOUR_BIT",
771
        perlasm_scheme   => "elf32",
772 773 774
        shared_ldflag    => "-mx32",
        multilib         => "x32",
    },
775 776 777

    "linux-ia64" => {
        inherit_from     => [ "linux-generic64", asm("ia64_asm") ],
778
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
779 780
    },

781
    "linux64-s390x" => {
782
        inherit_from     => [ "linux-generic64", asm("s390x_asm") ],
783
        cflags           => add("-m64 -DB_ENDIAN"),
784
        perlasm_scheme   => "64",
M
Matt Caswell 已提交
785
        shared_ldflag    => add("-m64"),
786 787 788
        multilib         => "64",
    },
    "linux32-s390x" => {
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805
        #### So called "highgprs" target for z/Architecture CPUs
        # "Highgprs" is kernel feature first implemented in Linux
        # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
        # significant bits of general purpose registers not only
        # upon 32-bit process context switch, but even on
        # asynchronous signal delivery to such process. This makes
        # it possible to deploy 64-bit instructions even in legacy
        # application context and achieve better [or should we say
        # adequate] performance. The build is binary compatible with
        # linux-generic32, and the idea is to be able to install the
        # resulting libcrypto.so alongside generic one, e.g. as
        # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
        # linker to autodiscover. Unfortunately it doesn't work just
        # yet, because of couple of bugs in glibc
        # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
        #
        inherit_from     => [ "linux-generic32", asm("s390x_asm") ],
806
        cflags           => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
807
        bn_asm_src       => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
808
        perlasm_scheme   => "31",
M
Matt Caswell 已提交
809
        shared_ldflag    => add("-m31"),
810 811
        multilib         => "/highgprs",
    },
812 813 814 815

    #### SPARC Linux setups
    # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
    # patiently assisted with debugging of following two configs.
816
    "linux-sparcv8" => {
817
        inherit_from     => [ "linux-generic32", asm("sparcv8_asm") ],
818
        cflags           => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
819 820
    },
    "linux-sparcv9" => {
821 822 823
        # it's a real mess with -mcpu=ultrasparc option under Linux,
        # but -Wa,-Av8plus should do the trick no matter what.
        inherit_from     => [ "linux-generic32", asm("sparcv9_asm") ],
824
        cflags           => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
M
Matt Caswell 已提交
825
        shared_ldflag    => add("-m32"),
826 827
    },
    "linux64-sparcv9" => {
828 829
        # GCC 3.1 is a requirement
        inherit_from     => [ "linux-generic64", asm("sparcv9_asm") ],
830
        cflags           => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
831
        bn_ops           => "BN_LLONG RC4_CHAR",
M
Matt Caswell 已提交
832
        shared_ldflag    => add("-m64"),
833 834
        multilib         => "64",
    },
835

836
    "linux-alpha-gcc" => {
837
        inherit_from     => [ "linux-generic64", asm("alpha_asm") ],
838
        cflags           => add("-DL_ENDIAN"),
839
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
840 841
    },
    "linux-c64xplus" => {
842
        inherit_from     => [ "BASE_unix" ],
843
        # TI_CGT_C6000_7.3.x is a requirement
844
        cc               => "cl6x",
845 846
        cflags           => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
                                    threads("-D_REENTRANT")),
847
        bn_ops           => "BN_LLONG",
848 849 850 851 852 853 854 855
        cpuid_asm_src    => "c64xpluscpuid.s",
        bn_asm_src       => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
        aes_asm_src      => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
        sha1_asm_src     => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
        rc4_asm_src      => "rc4-c64xplus.s",
        modes_asm_src    => "ghash-c64xplus.s",
        chacha_asm_src   => "chacha-c64xplus.s",
        poly1305_asm_src => "poly1305-c64xplus.s",
856
        thread_scheme    => "pthreads",
857 858 859 860
        perlasm_scheme   => "void",
        dso_scheme       => "dlfcn",
        shared_target    => "linux-shared",
        shared_cflag     => "--pic",
M
Matt Caswell 已提交
861
        shared_ldflag    => add("-z --sysv --shared"),
862 863 864
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        ranlib           => "true",
    },
865

866
#### Android: linux-* but without pointers to headers and libs.
A
Andy Polyakov 已提交
867 868 869
    #
    # It takes pair of prior-set environment variables to make it work:
    #
870
    # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
A
Andy Polyakov 已提交
871 872 873 874 875 876 877 878
    # CROSS_COMPILE=<prefix>
    #
    # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
    # For example to compile for ICS and ARM with NDK 10d, you'd:
    #
    # ANDROID_NDK=/some/where/android-ndk-10d
    # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
    # CROSS_COMPILE=arm-linux-adroideabi-
879
    # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
A
Andy Polyakov 已提交
880
    #
881
    "android" => {
882
        inherit_from     => [ "linux-generic32" ],
A
Andy Polyakov 已提交
883 884 885
        # Special note about unconditional -fPIC and -pie. The underlying
        # reason is that Lollipop refuses to run non-PIE. But what about
        # older systems and NDKs? -fPIC was never problem, so the only
A
Andy Polyakov 已提交
886
        # concern is -pie. Older toolchains, e.g. r4, appear to handle it
A
Andy Polyakov 已提交
887 888 889 890 891
        # and binaries turn mostly functional. "Mostly" means that oldest
        # Androids, such as Froyo, fail to handle executable, but newer
        # systems are perfectly capable of executing binaries targeting
        # Froyo. Keep in mind that in the nutshell Android builds are
        # about JNI, i.e. shared libraries, not applications.
A
Andy Polyakov 已提交
892 893
        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
        bin_cflags       => "-pie",
894 895
    },
    "android-x86" => {
896
        inherit_from     => [ "android", asm("x86_asm") ],
897
        cflags           => add(picker(release => "-fomit-frame-pointer")),
R
Rich Salz 已提交
898
        bn_ops           => "BN_LLONG",
899
        perlasm_scheme   => "android",
900
    },
A
Andy Polyakov 已提交
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922
    ################################################################
    # Contemporary Android applications can provide multiple JNI
    # providers in .apk, targeting multiple architectures. Among
    # them there is "place" for two ARM flavours: generic eabi and
    # armv7-a/hard-float. However, it should be noted that OpenSSL's
    # ability to engage NEON is not constrained by ABI choice, nor
    # is your ability to call OpenSSL from your application code
    # compiled with floating-point ABI other than default 'soft'.
    # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
    # This means that choice of ARM libraries you provide in .apk
    # is driven by application needs. For example if application
    # itself benefits from NEON or is floating-point intensive, then
    # it might be appropriate to provide both libraries. Otherwise
    # just generic eabi would do. But in latter case it would be
    # appropriate to
    #
    #   ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
    #
    # in order to build "universal" binary and allow OpenSSL take
    # advantage of NEON when it's available.
    #
    "android-armeabi" => {
923
        inherit_from     => [ "android", asm("armv4_asm") ],
A
Andy Polyakov 已提交
924
    },
925
    "android-mips" => {
926
        inherit_from     => [ "android", asm("mips32_asm") ],
927 928
        perlasm_scheme   => "o32",
    },
929

930 931
    "android64" => {
        inherit_from     => [ "linux-generic64" ],
A
Andy Polyakov 已提交
932 933
        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
        bin_cflags       => "-pie",
934 935 936 937
    },
    "android64-aarch64" => {
        inherit_from     => [ "android64", asm("aarch64_asm") ],
        perlasm_scheme   => "linux64",
938 939 940 941
    },
    "android64-x86_64" => {
        inherit_from     => [ "android64", asm("x86_64_asm") ],
        perlasm_scheme   => "elf",
942 943 944 945 946 947 948 949 950 951 952 953 954
    },
    "android64-mips64" => {
        ############################################################
        # You are more than likely have to specify target processor
        # on ./Configure command line. Trouble is that toolchain's
        # default is MIPS64r6 (at least in r10d), but there are no
        # such processors around (or they are too rare to spot one).
        # Actual problem is that MIPS64r6 is binary incompatible
        # with previous MIPS ISA versions, in sense that unlike
        # prior versions original MIPS binary code will fail.
        #
        inherit_from     => [ "android64", asm("mips64_asm") ],
        perlasm_scheme   => "64",
955 956
    },

957
#### *BSD
958
    "BSD-generic32" => {
959
        # As for thread cflag. Idea is to maintain "collective" set of
960 961 962 963 964 965
        # flags, which would cover all BSD flavors. -pthread applies
        # to them all, but is treated differently. OpenBSD expands is
        # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
        # expands it as -lc_r, which has to be accompanied by explicit
        # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
        # expands it as -lc_r, which seems to be sufficient?
966
        inherit_from     => [ "BASE_unix" ],
967
        cc               => "cc",
968 969 970 971
        cflags           => combine(picker(default => "-Wall",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
972
        bn_ops           => "BN_LLONG",
973
        thread_scheme    => "pthreads",
974 975 976 977 978
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
979 980
    "BSD-generic64" => {
        inherit_from     => [ "BSD-generic32" ],
981
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
982
    },
983 984 985

    "BSD-x86" => {
        inherit_from     => [ "BSD-generic32", asm("x86_asm") ],
986 987
        cflags           => add(picker(default => "-DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
R
Rich Salz 已提交
988
        bn_ops           => "BN_LLONG",
989
        shared_target    => "bsd-shared",
990
        perlasm_scheme   => "a.out",
991
    },
992 993 994
    "BSD-x86-elf" => {
        inherit_from     => [ "BSD-x86" ],
        perlasm_scheme   => "elf",
995
    },
996

997 998
    "BSD-sparcv8" => {
        inherit_from     => [ "BSD-generic32", asm("sparcv8_asm") ],
999
        cflags           => add("-mcpu=v8 -DB_ENDIAN"),
1000 1001
    },
    "BSD-sparc64" => {
1002 1003 1004 1005
        # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
        # simply *happens* to work around a compiler bug in gcc 3.3.3,
        # triggered by RIPEMD160 code.
        inherit_from     => [ "BSD-generic64", asm("sparcv9_asm") ],
1006
        cflags           => add("-DB_ENDIAN -DMD32_REG_T=int"),
1007
        bn_ops           => "BN_LLONG",
1008
    },
1009

1010
    "BSD-ia64" => {
1011
        inherit_from     => [ "BSD-generic64", asm("ia64_asm") ],
1012
        cflags           => add_before("-DL_ENDIAN"),
1013
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1014
    },
1015

1016
    "BSD-x86_64" => {
1017
        inherit_from     => [ "BSD-generic64", asm("x86_64_asm") ],
1018
        cflags           => add_before("-DL_ENDIAN"),
1019
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1020 1021
        perlasm_scheme   => "elf",
    },
1022

1023
    "bsdi-elf-gcc" => {
1024
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1025
        cc               => "gcc",
1026
        cflags           => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1027
        ex_libs          => add("-ldl"),
R
Rich Salz 已提交
1028
        bn_ops           => "BN_LLONG",
1029
        thread_scheme    => "(unknown)",
1030 1031 1032 1033 1034
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1035

1036
    "nextstep" => {
1037
        inherit_from     => [ "BASE_unix" ],
1038 1039 1040
        cc               => "cc",
        cflags           => "-O -Wall",
        unistd           => "<libc.h>",
R
Rich Salz 已提交
1041
        bn_ops           => "BN_LLONG",
1042
        thread_scheme    => "(unknown)",
1043 1044
    },
    "nextstep3.3" => {
1045
        inherit_from     => [ "BASE_unix" ],
1046 1047 1048
        cc               => "cc",
        cflags           => "-O3 -Wall",
        unistd           => "<libc.h>",
R
Rich Salz 已提交
1049
        bn_ops           => "BN_LLONG",
1050
        thread_scheme    => "(unknown)",
1051
    },
1052 1053

# QNX
1054
    "qnx4" => {
1055
        inherit_from     => [ "BASE_unix" ],
1056 1057
        cc               => "cc",
        cflags           => "-DL_ENDIAN -DTERMIO",
1058
        thread_scheme    => "(unknown)",
1059 1060
    },
    "QNX6" => {
1061
        inherit_from     => [ "BASE_unix" ],
1062
        cc               => "gcc",
1063
        ex_libs          => add("-lsocket"),
1064 1065 1066 1067 1068 1069
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "QNX6-i386" => {
1070
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1071 1072
        cc               => "gcc",
        cflags           => "-DL_ENDIAN -O2 -Wall",
1073
        ex_libs          => add("-lsocket"),
1074 1075 1076 1077 1078
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091

#### SCO/Caldera targets.
#
# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
# Now we only have blended unixware-* as it's the only one used by ./config.
# If you want to optimize for particular microarchitecture, bypass ./config
# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
# Note that not all targets include assembler support. Mostly because of
# lack of motivation to support out-of-date platforms with out-of-date
# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
# patiently assisted to debug most of it.
#
# UnixWare 2.0x fails destest with -O.
1092
    "unixware-2.0" => {
1093
        inherit_from     => [ "BASE_unix" ],
1094
        cc               => "cc",
1095 1096
        cflags           => combine("-DFILIO_H -DNO_STRINGS_H",
                                    threads("-Kthread")),
1097
        ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
1098
        thread_scheme    => "uithreads",
1099 1100
    },
    "unixware-2.1" => {
1101
        inherit_from     => [ "BASE_unix" ],
1102
        cc               => "cc",
1103 1104
        cflags           => combine("-O -DFILIO_H",
                                    threads("-Kthread")),
1105
        ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
1106
        thread_scheme    => "uithreads",
1107 1108
    },
    "unixware-7" => {
1109
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1110
        cc               => "cc",
1111 1112
        cflags           => combine("-O -DFILIO_H -Kalloca",
                                    threads("-Kthread")),
1113
        ex_libs          => add("-lsocket -lnsl"),
1114
        thread_scheme    => "uithreads",
R
Rich Salz 已提交
1115
        bn_ops           => "BN_LLONG",
1116 1117 1118 1119 1120 1121 1122
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr5-shared",
        shared_cflag     => "-Kpic",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "unixware-7-gcc" => {
1123
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1124
        cc               => "gcc",
1125 1126
        cflags           => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
                                    threads("-D_REENTRANT")),
1127
        ex_libs          => add("-lsocket -lnsl"),
R
Rich Salz 已提交
1128
        bn_ops           => "BN_LLONG",
1129
        thread_scheme    => "pthreads",
1130 1131 1132 1133 1134 1135
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "gnu-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1136
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1137
    "sco5-cc" => {
1138
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1139 1140
        cc               => "cc",
        cflags           => "-belf",
1141
        ex_libs          => add("-lsocket -lnsl"),
1142
        thread_scheme    => "(unknown)",
1143 1144 1145 1146 1147 1148 1149
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr3-shared",
        shared_cflag     => "-Kpic",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "sco5-gcc" => {
1150
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1151 1152
        cc               => "gcc",
        cflags           => "-O3 -fomit-frame-pointer",
1153
        ex_libs          => add("-lsocket -lnsl"),
R
Rich Salz 已提交
1154
        bn_ops           => "BN_LLONG",
1155
        thread_scheme    => "(unknown)",
1156 1157 1158 1159 1160 1161
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr3-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1162 1163

#### IBM's AIX.
1164 1165 1166 1167 1168
    # Below targets assume AIX >=5. Caveat lector. If you are accustomed
    # to control compilation "bitness" by setting $OBJECT_MODE environment
    # variable, then you should know that in OpenSSL case it's considered
    # only in ./config. Once configured, build procedure remains "deaf" to
    # current value of $OBJECT_MODE.
1169
    "aix-gcc" => {
1170
        inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
1171
        cc               => "gcc",
1172 1173 1174 1175
        cflags           => combine(picker(default => "-DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-pthread")),
1176 1177
        sys_id           => "AIX",
        bn_ops           => "BN_LLONG RC4_CHAR",
1178
        thread_scheme    => "pthreads",
1179 1180 1181
        perlasm_scheme   => "aix32",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
1182
        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
1183 1184 1185 1186
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X32",
    },
    "aix64-gcc" => {
1187
        inherit_from     => [ "BASE_unix", asm("ppc64_asm") ],
1188
        cc               => "gcc",
1189 1190 1191 1192
        cflags           => combine(picker(default => "-maix64 -DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-pthread")),
1193 1194
        sys_id           => "AIX",
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1195
        thread_scheme    => "pthreads",
1196 1197 1198
        perlasm_scheme   => "aix64",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
1199
        shared_ldflag    => "-maix64 -shared -static-libgcc -Wl,-G",
1200 1201 1202 1203
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X64",
    },
    "aix-cc" => {
1204
        inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
1205
        cc               => "cc",
1206 1207 1208 1209
        cflags           => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-qthreaded -D_THREAD_SAFE")),
1210 1211
        sys_id           => "AIX",
        bn_ops           => "BN_LLONG RC4_CHAR",
1212
        thread_scheme    => "pthreads",
1213
        ex_libs          => threads("-lpthreads"),
1214 1215 1216 1217 1218 1219 1220 1221
        perlasm_scheme   => "aix32",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
        shared_ldflag    => "-q32 -G",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X 32",
    },
    "aix64-cc" => {
1222
        inherit_from     => [ "BASE_unix", asm("ppc64_asm") ],
1223
        cc               => "cc",
1224 1225 1226 1227
        cflags           => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-qthreaded -D_THREAD_SAFE")),
1228 1229
        sys_id           => "AIX",
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1230
        thread_scheme    => "pthreads",
1231
        ex_libs          => threads("-lpthreads"),
1232 1233 1234 1235 1236 1237 1238
        perlasm_scheme   => "aix64",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
        shared_ldflag    => "-q64 -G",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X 64",
    },
1239 1240

# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1241
    "BS2000-OSD" => {
1242
        inherit_from     => [ "BASE_unix" ],
1243 1244
        cc               => "c89",
        cflags           => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1245
        ex_libs          => add("-lsocket -lnsl"),
1246
        bn_ops           => "THIRTY_TWO_BIT RC4_CHAR",
1247
        thread_scheme    => "(unknown)",
1248
    },
1249 1250 1251 1252 1253

# OS/390 Unix an EBCDIC-based Unix system on IBM mainframe
# You need to compile using the c89.sh wrapper in the tools directory, because the
# IBM compiler does not like the -L switch after any object modules.
#
1254
    "OS390-Unix" => {
1255
        inherit_from     => [ "BASE_unix" ],
1256 1257
        cc               => "c89.sh",
        cflags           => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H  -D_ALL_SOURCE",
1258
        bn_ops           => "THIRTY_TWO_BIT RC4_CHAR",
1259
        thread_scheme    => "(unknown)",
1260
    },
1261

1262
#### Visual C targets
1263 1264 1265 1266 1267 1268 1269
#
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
#
# Note about -wd4090, disable warning C4090. This warning returns false
# positives in some situations. Disabling it altogether masks both
# legitimate and false cases, but as we compile on multiple platforms,
# we rely on other compilers to catch legitimate cases.
1270 1271 1272
#
# Also note that we force threads no matter what.  Configuring "no-threads"
# is ignored.
1273
    "VC-common" => {
1274
        inherit_from     => [ "BASE_Windows" ],
1275
        template         => 1,
1276
        cc               => "cl",
1277
        cflags           => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1278 1279 1280 1281 1282 1283 1284 1285
        defines          => add(sub { my @defs = ();
                                      unless ($disabled{"zlib-dynamic"}) {
                                          push @defs,
                                              quotify("perl",
                                                      'LIBZ="' . $withargs{zlib_lib} . '"');
                                      }
                                      return [ @defs ];
                                    }),
1286
        coutflag         => "/Fo",
1287 1288
        lib_cflags       => add("/Zi /Fdossl_static"),
        dso_cflags       => "/Zi /Fddso",
1289 1290 1291
        bin_cflags       => "/Zi /Fdapp",
        lflags           => add("/debug"),
        shared_ldflag    => "/dll",
1292
        shared_target    => "win-shared", # meaningless except it gives Configure a hint
1293
        thread_scheme    => "winthreads",
1294
        dso_scheme       => "win32",
1295
        apps_aux_src     => add("win32_init.c"),
1296
    },
1297
    "VC-noCE-common" => {
1298
        inherit_from     => [ "VC-common" ],
R
Richard Levitte 已提交
1299
        template         => 1,
1300 1301 1302
        cflags           => add(picker(default => "-DUNICODE -D_UNICODE",
                                       debug   =>
                                       sub {
1303 1304
                                           ($disabled{shared} ? "" : "/MDd")
                                               ." /Od -DDEBUG -D_DEBUG";
1305 1306 1307
                                       },
                                       release =>
                                       sub {
1308
                                           ($disabled{shared} ? "" : "/MD")
R
Richard Levitte 已提交
1309
                                               ." /O2";
1310
                                       })),
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325
        lib_cflags       => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
        # Following might/should appears controversial, i.e. defining
        # /MDd without evaluating $disabled{shared}. It works in
        # non-shared build because static library is compiled with /Zl
        # and bares no reference to specific RTL. And it works in
        # shared build because multiple /MDd options are not prohibited.
        # But why /MDd in static build? Well, basically this is just a
        # reference point, which allows to catch eventual errors that
        # would prevent those who want to wrap OpenSSL into own .DLL.
        # Why not /MD in release build then? Well, some are likely to
        # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
        # redistributable.
        bin_cflags       => add(picker(debug   => "/MDd",
                                       release => sub { $disabled{shared} ? "/MT" : () },
                                      )),
1326
        bin_lflags       => add("/subsystem:console /opt:ref"),
1327
        ex_libs          => add(sub {
1328 1329 1330 1331
            my @ex_libs = ();
            push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
            push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
            return join(" ", @ex_libs);
1332
        }),
1333 1334 1335
    },
    "VC-WIN64-common" => {
        inherit_from     => [ "VC-noCE-common" ],
R
Richard Levitte 已提交
1336
        template         => 1,
1337
        ex_libs          => add(sub {
1338 1339 1340
            my @ex_libs = ();
            push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
            return join(" ", @_, @ex_libs);
1341
        }),
1342 1343 1344
        bn_ops           => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
        build_scheme     => add("VC-W64", { separator => undef }),
    },
1345
    "VC-WIN64I" => {
1346 1347
        inherit_from     => [ "VC-WIN64-common", asm("ia64_asm"),
                              sub { $disabled{shared} ? () : "ia64_uplink" } ],
1348 1349 1350
        as               => "ias",
        asflags          => "-d debug",
        asoutflag        => "-o",
1351
        sys_id           => "WIN64I",
A
Andy Polyakov 已提交
1352 1353
        bn_asm_src       => sub { return undef unless @_;
                                  my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1354
        perlasm_scheme   => "ias",
A
Andy Polyakov 已提交
1355
        multilib         => "-ia64",
1356 1357
    },
    "VC-WIN64A" => {
1358 1359
        inherit_from     => [ "VC-WIN64-common", asm("x86_64_asm"),
                              sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1360 1361 1362
        as               => sub { vc_win64a_info()->{as} },
        asflags          => sub { vc_win64a_info()->{asflags} },
        asoutflag        => sub { vc_win64a_info()->{asoutflag} },
1363
        sys_id           => "WIN64A",
1364 1365
        bn_asm_src       => sub { return undef unless @_;
                                  my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1366
        perlasm_scheme   => "auto",
A
Andy Polyakov 已提交
1367
        multilib         => "-x64",
1368 1369
    },
    "VC-WIN32" => {
1370 1371
        # x86 Win32 target defaults to ANSI API, if you want UNICODE,
        # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1372
        inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
1373
                              sub { $disabled{shared} ? () : "uplink_common" } ],
1374 1375 1376
        as               => sub { vc_win32_info()->{as} },
        asflags          => sub { vc_win32_info()->{asflags} },
        asoutflag        => sub { vc_win32_info()->{asoutflag} },
1377
        ex_libs          => add(sub {
1378 1379 1380 1381 1382 1383
            my @ex_libs = ();
            # WIN32 UNICODE build gets linked with unicows.lib for
            # backward compatibility with Win9x.
            push @ex_libs, 'unicows.lib'
                if (grep { $_ eq "UNICODE" } @user_defines);
            return join(" ", @ex_libs, @_);
1384
        }),
1385
        sys_id           => "WIN32",
R
Rich Salz 已提交
1386
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1387
        perlasm_scheme   => sub { vc_win32_info()->{perlasm_scheme} },
1388
        build_scheme     => add("VC-W32", { separator => undef }),
1389 1390
    },
    "VC-CE" => {
1391 1392 1393 1394
        inherit_from     => [ "VC-common" ],
        as               => "ml",
        asflags          => "/nologo /Cp /coff /c /Cx /Zi",
        asoutflag        => "/Fo",
1395
        cc               => "cl",
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
        cflags           =>
            picker(default =>
                   combine('/W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYS_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT',
                           sub { vc_wince_info()->{cflags}; },
                           sub { defined($ENV{'WCECOMPAT'})
                                     ? '-I$(WCECOMPAT)/include' : (); },
                           sub { defined($ENV{'PORTSDK_LIBPATH'})
                                     ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
                           sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
                                     ? ($disabled{shared} ? " /MT" : " /MD")
                                     : " /MC"; }),
                   debug   => "/Od -DDEBUG -D_DEBUG",
                   release => "/O1i"),
        lflags           => combine("/nologo /opt:ref",
                                    sub { vc_wince_info()->{lflags}; },
                                    sub { defined($ENV{PORTSDK_LIBPATH})
                                              ? "/entry:mainCRTstartup" : (); }),
1413
        sys_id           => "WINCE",
R
Rich Salz 已提交
1414
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1415
        ex_libs          => add(sub {
1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432
            my @ex_libs = ();
            push @ex_libs, 'ws2.lib' unless $disabled{sock};
            push @ex_libs, 'crypt32.lib';
            if (defined($ENV{WCECOMPAT})) {
                my $x = '$(WCECOMPAT)/lib';
                if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
                    $x .= '/$(TARGETCPU)/wcecompatex.lib';
                } else {
                    $x .= '/wcecompatex.lib';
                }
                push @ex_libs, $x;
            }
            push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
                if (defined($ENV{'PORTSDK_LIBPATH'}));
            push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
                if ($ENV{'TARGETCPU'} eq "X86");
            return @ex_libs;
1433
        }),
1434
        build_scheme     => add("VC-WCE", { separator => undef }),
1435
    },
1436

1437
#### MinGW
1438
    "mingw" => {
1439
        inherit_from     => [ "BASE_unix", asm("x86_asm"),
1440
                              sub { $disabled{shared} ? () : "x86_uplink" } ],
1441
        cc               => "gcc",
1442 1443 1444 1445
        cflags           => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
                                           debug   => "-g -O0",
                                           release => "-O3 -fomit-frame-pointer"),
                                    threads("-D_MT")),
1446
        sys_id           => "MINGW32",
1447
        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
R
Rich Salz 已提交
1448
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1449
        thread_scheme    => "winthreads",
1450 1451
        perlasm_scheme   => "coff",
        dso_scheme       => "win32",
1452
        shared_target    => "mingw-shared",
1453
        shared_cflag     => add("-D_WINDLL"),
1454
        shared_ldflag    => "-static-libgcc",
1455
        shared_rcflag    => "--target=pe-i386",
1456
        shared_extension => ".dll",
1457
        multilib         => "",
1458
        apps_aux_src     => add("win32_init.c"),
1459 1460
    },
    "mingw64" => {
1461 1462 1463 1464 1465 1466 1467 1468
        # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
        # .dll compiled with one compiler with application compiled with
        # another compiler. It's possible to engage Applink support in
        # mingw64 build, but it's not done, because till mingw64
        # supports structured exception handling, one can't seriously
        # consider its binaries for using with non-mingw64 run-time
        # environment. And as mingw64 is always consistent with itself,
        # Applink is never engaged and can as well be omitted.
1469
        inherit_from     => [ "BASE_unix", asm("x86_64_asm") ],
1470
        cc               => "gcc",
1471 1472 1473 1474
        cflags           => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
                                           debug   => "-g -O0",
                                           release => "-O3"),
                                    threads("-D_MT")),
1475
        sys_id           => "MINGW64",
1476
        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
1477
        bn_ops           => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1478
        thread_scheme    => "winthreads",
1479 1480
        perlasm_scheme   => "mingw64",
        dso_scheme       => "win32",
1481
        shared_target    => "mingw-shared",
1482
        shared_cflag     => add("-D_WINDLL"),
1483
        shared_ldflag    => "-static-libgcc",
1484
        shared_rcflag    => "--target=pe-x86-64",
1485
        shared_extension => ".dll",
1486
        multilib         => "64",
1487
        apps_aux_src     => add("win32_init.c"),
1488
    },
1489

D
David Woodhouse 已提交
1490 1491
#### UEFI
    "UEFI" => {
1492
        inherit_from     => [ "BASE_unix" ],
D
David Woodhouse 已提交
1493 1494 1495 1496 1497
        cc               => "cc",
        cflags           => "-DL_ENDIAN -O",
        sys_id           => "UEFI",
    },

1498
#### UWIN
1499
    "UWIN" => {
1500
        inherit_from     => [ "BASE_unix" ],
1501 1502 1503
        cc               => "cc",
        cflags           => "-DTERMIOS -DL_ENDIAN -O -Wall",
        sys_id           => "UWIN",
R
Rich Salz 已提交
1504
        bn_ops           => "BN_LLONG",
1505 1506
        dso_scheme       => "win32",
    },
1507

1508
#### Cygwin
1509
    "Cygwin-x86" => {
1510
        inherit_from     => [ "BASE_unix", asm("x86_asm") ],
1511
        cc               => "gcc",
1512 1513 1514
        cflags           => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
                                   debug   => "-g -O0",
                                   release => "-O3 -fomit-frame-pointer"),
1515
        sys_id           => "CYGWIN",
R
Rich Salz 已提交
1516
        bn_ops           => "BN_LLONG",
1517
        thread_scheme    => "pthread",
1518 1519 1520 1521 1522
        perlasm_scheme   => "coff",
        dso_scheme       => "dlfcn",
        shared_target    => "cygwin-shared",
        shared_cflag     => "-D_WINDLL",
        shared_ldflag    => "-shared",
1523
        shared_extension => ".dll",
1524 1525
    },
    "Cygwin-x86_64" => {
1526
        inherit_from     => [ "BASE_unix", asm("x86_64_asm") ],
1527
        cc               => "gcc",
1528 1529 1530
        cflags           => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
                                   debug   => "-g -O0",
                                   release => "-O3"),
1531
        sys_id           => "CYGWIN",
1532
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1533
        thread_scheme    => "pthread",
1534 1535 1536 1537 1538
        perlasm_scheme   => "mingw64",
        dso_scheme       => "dlfcn",
        shared_target    => "cygwin-shared",
        shared_cflag     => "-D_WINDLL",
        shared_ldflag    => "-shared",
1539
        shared_extension => ".dll",
1540
    },
1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557
    # Backward compatibility for those using this target
    "Cygwin" => {
	inherit_from     => [ "Cygwin-x86" ]
    },
    # In case someone constructs the Cygwin target name themself
    "Cygwin-i386" => {
	inherit_from     => [ "Cygwin-x86" ]
    },
    "Cygwin-i486" => {
	inherit_from     => [ "Cygwin-x86" ]
    },
    "Cygwin-i586" => {
	inherit_from     => [ "Cygwin-x86" ]
    },
    "Cygwin-i686" => {
	inherit_from     => [ "Cygwin-x86" ]
    },
1558 1559

##### MacOS X (a.k.a. Darwin) setup
1560
    "darwin-common" => {
1561
        inherit_from     => [ "BASE_unix" ],
1562
        template         => 1,
1563
        cc               => "cc",
1564 1565 1566 1567
        cflags           => combine(picker(default => "",
                                           debug   => "-g -O0",
                                           release => "-O3"),
                                   threads("-D_REENTRANT")),
1568
        sys_id           => "MACOSX",
1569
        plib_lflags      => "-Wl,-search_paths_first",
1570
        bn_ops           => "BN_LLONG RC4_CHAR",
1571
        thread_scheme    => "pthreads",
1572 1573
        perlasm_scheme   => "osx32",
        dso_scheme       => "dlfcn",
R
Richard Levitte 已提交
1574
        ranlib           => "ranlib -c",
1575
        shared_target    => "darwin-shared",
R
Richard Levitte 已提交
1576
        shared_cflag     => "-fPIC",
1577
        shared_ldflag    => "-dynamiclib",
1578 1579
        shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
    },
1580 1581 1582
    # Option "freeze" such as -std=gnu9x can't negatively interfere
    # with future defaults for below two targets, because MacOS X
    # for PPC has no future, it was discontinued by vendor in 2009.
1583 1584
    "darwin-ppc-cc" => {
        inherit_from     => [ "darwin-common", asm("ppc32_asm") ],
1585
        cflags           => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1586 1587 1588
        perlasm_scheme   => "osx32",
        shared_ldflag    => "-arch ppc -dynamiclib",
    },
1589
    "darwin64-ppc-cc" => {
1590
        inherit_from     => [ "darwin-common", asm("ppc64_asm") ],
1591
        cflags           => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1592
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1593 1594 1595 1596
        perlasm_scheme   => "osx64",
        shared_ldflag    => "-arch ppc64 -dynamiclib",
    },
    "darwin-i386-cc" => {
1597
        inherit_from     => [ "darwin-common", asm("x86_asm") ],
1598 1599
        cflags           => add(picker(default => "-arch i386 -DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
1600
        bn_ops           => "BN_LLONG RC4_INT",
1601 1602 1603 1604
        perlasm_scheme   => "macosx",
        shared_ldflag    => "-arch i386 -dynamiclib",
    },
    "darwin64-x86_64-cc" => {
1605
        inherit_from     => [ "darwin-common", asm("x86_64_asm") ],
1606
        cflags           => add("-arch x86_64 -DL_ENDIAN -Wall"),
1607
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1608 1609 1610
        perlasm_scheme   => "macosx",
        shared_ldflag    => "-arch x86_64 -dynamiclib",
    },
1611 1612

#### iPhoneOS/iOS
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
#
# It takes three prior-set environment variables to make it work:
#
# CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
# CROSS_TOP=/where/SDKs/are
# CROSS_SDK=iPhoneOSx.y.sdk
#
# Exact paths vary with Xcode releases, but for couple of last ones
# they would look like this:
#
# CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
# CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
1625
# CROSS_SDK=iPhoneOS.sdk
1626
#
1627
    "iphoneos-cross" => {
1628
        inherit_from     => [ "darwin-common" ],
1629
        cflags           => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1630 1631
        sys_id           => "iOS",
    },
1632 1633 1634 1635
    "ios-cross" => {
        inherit_from     => [ "darwin-common", asm("armv4_asm") ],
        # It should be possible to go below iOS 6 and even add -arch armv6,
        # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
1636
        # at this point.
1637
        cflags           => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1638 1639 1640
        sys_id           => "iOS",
        perlasm_scheme   => "ios32",
    },
1641
    "ios64-cross" => {
1642
        inherit_from     => [ "darwin-common", asm("aarch64_asm") ],
1643
        cflags           => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1644
        sys_id           => "iOS",
1645
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1646 1647
        perlasm_scheme   => "ios64",
    },
1648 1649

##### GNU Hurd
1650
    "hurd-x86" => {
1651
        inherit_from     => [ "BASE_unix" ],
1652
        inherit_from     => [ asm("x86_elf_asm") ],
1653
        cc               => "gcc",
1654 1655
        cflags           => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
                                    threads("-pthread")),
1656
        ex_libs          => add("-ldl"),
R
Rich Salz 已提交
1657
        bn_ops           => "BN_LLONG",
1658
        thread_scheme    => "pthreads",
1659 1660 1661
        dso_scheme       => "dlfcn",
        shared_target    => "linux-shared",
        shared_cflag     => "-fPIC",
K
Kurt Roeckx 已提交
1662
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1663
    },
1664 1665

##### VxWorks for various targets
1666
    "vxworks-ppc60x" => {
1667
        inherit_from     => [ "BASE_unix" ],
1668 1669 1670
        cc               => "ccppc",
        cflags           => "-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
        sys_id           => "VXWORKS",
1671
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1672 1673
    },
    "vxworks-ppcgen" => {
1674
        inherit_from     => [ "BASE_unix" ],
1675 1676 1677
        cc               => "ccppc",
        cflags           => "-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
        sys_id           => "VXWORKS",
1678
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1679 1680
    },
    "vxworks-ppc405" => {
1681
        inherit_from     => [ "BASE_unix" ],
1682 1683 1684 1685 1686 1687
        cc               => "ccppc",
        cflags           => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-ppc750" => {
1688
        inherit_from     => [ "BASE_unix" ],
1689 1690 1691 1692 1693 1694
        cc               => "ccppc",
        cflags           => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)",
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-ppc750-debug" => {
1695
        inherit_from     => [ "BASE_unix" ],
1696
        cc               => "ccppc",
A
Andy Polyakov 已提交
1697
        cflags           => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DPEDANTIC -DDEBUG -g",
1698 1699 1700 1701
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-ppc860" => {
1702
        inherit_from     => [ "BASE_unix" ],
1703 1704 1705 1706 1707 1708
        cc               => "ccppc",
        cflags           => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-simlinux" => {
1709
        inherit_from     => [ "BASE_unix" ],
1710 1711 1712 1713 1714 1715 1716
        cc               => "ccpentium",
        cflags           => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK",
        sys_id           => "VXWORKS",
        lflags           => "-r",
        ranlib           => "ranlibpentium",
    },
    "vxworks-mips" => {
1717
        inherit_from     => [ "BASE_unix", asm("mips32_asm") ],
1718
        cc               => "ccmips",
1719 1720
        cflags           => combine("-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip",
                                    threads("-D_REENTRANT")),
1721
        sys_id           => "VXWORKS",
1722
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1723
        thread_scheme    => "pthreads",
1724 1725 1726
        perlasm_scheme   => "o32",
        ranlib           => "ranlibmips",
    },
1727

1728
#### uClinux
1729
    "uClinux-dist" => {
1730
        inherit_from     => [ "BASE_unix" ],
1731
        cc               => "$ENV{'CC'}",
1732 1733
        cflags           => combine("\$(CFLAGS)",
                                    threads("-D_REENTRANT")),
1734
        plib_lflags      => "\$(LDFLAGS)",
1735
        ex_libs          => add("\$(LDLIBS)"),
1736
        bn_ops           => "BN_LLONG",
1737
        thread_scheme    => "pthreads",
1738 1739 1740 1741 1742 1743 1744 1745
        dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
        shared_target    => "linux-shared",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-shared",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        ranlib           => "$ENV{'RANLIB'}",
    },
    "uClinux-dist64" => {
1746
        inherit_from     => [ "BASE_unix" ],
1747
        cc               => "$ENV{'CC'}",
1748 1749
        cflags           => combine("\$(CFLAGS)",
                                    threads("-D_REENTRANT")),
1750
        plib_lflags      => "\$(LDFLAGS)",
1751
        ex_libs          => add("\$(LDLIBS)"),
1752
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1753
        thread_scheme    => "pthreads",
1754 1755 1756 1757 1758 1759 1760
        dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
        shared_target    => "linux-shared",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-shared",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        ranlib           => "$ENV{'RANLIB'}",
    },
1761

1762 1763
    ##### VMS
    "vms-generic" => {
1764
        inherit_from     => [ "BASE_VMS" ],
1765 1766
        template         => 1,
        cc               => "CC/DECC",
1767
        cflags           => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1768 1769
                                   debug   => "/NOOPTIMIZE/DEBUG",
                                   release => "/OPTIMIZE/NODEBUG"),
R
Richard Levitte 已提交
1770
        defines          => add("OPENSSL_USE_NODELETE"),
1771 1772 1773
        lflags           => picker(default => "/MAP",
                                   debug   => "/DEBUG/TRACEBACK",
                                   release => "/NODEBUG/NOTRACEBACK"),
1774
        lib_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1775 1776 1777
        # no_inst_bin_cflags is used instead of bin_cflags by descrip.mms.tmpl
        # for object files belonging to selected internal programs
        no_inst_bin_cflags => "/NAMES=(AS_IS,SHORTENED)",
1778
        shared_target    => "vms-shared",
R
Richard Levitte 已提交
1779
        dso_scheme       => "vms",
1780
        thread_scheme    => "pthreads",
1781

1782
        apps_aux_src     => "vms_decc_init.c vms_term_sock.c",
1783 1784 1785 1786
    },

    "vms-alpha" => {
        inherit_from     => [ "vms-generic" ],
1787
        cflags           => add(sub { my @warnings =
1788
                                          @{vms_info(0)->{disable_warns}};
1789 1790
                                      @warnings
                                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1791 1792
        defines          =>
                    add(sub {
1793 1794
                            return vms_info(0)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1795
                            }),
1796
        ex_libs          => add(sub { return vms_info(0)->{zlib} || (); }),
1797
        pointer_size     => sub { return vms_info(0)->{pointer_size} },
1798 1799 1800
        #as               => "???",
        #debug_aflags     => "/NOOPTIMIZE/DEBUG",
        #release_aflags   => "/OPTIMIZE/NODEBUG",
1801
        bn_opts          => "SIXTY_FOUR_BIT RC4_INT",
1802
    },
R
Richard Levitte 已提交
1803
    "vms-alpha-p32" => {
1804
        inherit_from     => [ "vms-generic" ],
1805 1806 1807
        cflags           =>
            add("/POINTER_SIZE=32",
                sub { my @warnings =
1808
                          @{vms_info(32)->{disable_warns}};
1809 1810 1811
                      @warnings
                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
                } ),
1812 1813
        defines          =>
                    add(sub {
1814 1815
                            return vms_info(32)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1816
                            }),
1817
        ex_libs          => add(sub { return vms_info(32)->{zlib} || (); }),
1818
        pointer_size     => sub { return vms_info(32)->{pointer_size} },
1819
    },
R
Richard Levitte 已提交
1820
    "vms-alpha-p64" => {
1821
        inherit_from     => [ "vms-generic" ],
1822
        cflags           =>
1823
            add("/POINTER_SIZE=64=ARGV",
1824
                sub { my @warnings =
1825
                          @{vms_info(64)->{disable_warns}};
1826 1827 1828
                      @warnings
                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
                } ),
1829 1830
        defines          =>
                    add(sub {
1831 1832
                            return vms_info(64)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1833
                            }),
1834
        ex_libs          => add(sub { return vms_info(64)->{zlib} || (); }),
1835
        pointer_size     => sub { return vms_info(64)->{pointer_size} },
1836 1837 1838
    },
    "vms-ia64" => {
        inherit_from     => [ "vms-generic" ],
1839
        cflags           => add(sub { my @warnings =
1840
                                          @{vms_info(0)->{disable_warns}};
1841 1842
                                      @warnings
                                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
1843 1844
        defines          =>
                    add(sub {
1845 1846
                            return vms_info(0)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
1847
                            }),
1848
        ex_libs          => add(sub { return vms_info(0)->{zlib} || (); }),
1849
        pointer_size     => sub { return vms_info(0)->{pointer_size} },
1850 1851 1852
        #as               => "I4S",
        #debug_aflags     => "/NOOPTIMIZE/DEBUG",
        #release_aflags   => "/OPTIMIZE/NODEBUG",
1853
        bn_opts          => "SIXTY_FOUR_BIT RC4_INT",
1854
    },
R
Richard Levitte 已提交
1855
    "vms-ia64-p32" => {
1856
        inherit_from     => [ "vms-generic" ],
1857 1858 1859
        cflags           =>
            add("/POINTER_SIZE=32",
                sub { my @warnings =
1860
                          @{vms_info(32)->{disable_warns}};
1861 1862 1863
                      @warnings
                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
                } ),
1864 1865
        defines          =>
                    add(sub {
1866 1867
                            return vms_info(32)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
1868
                            }),
1869
        ex_libs          => add(sub { return vms_info(32)->{zlib} || (); }),
1870
        pointer_size     => sub { return vms_info(32)->{pointer_size} },
1871
    },
R
Richard Levitte 已提交
1872
    "vms-ia64-p64" => {
1873
        inherit_from     => [ "vms-generic" ],
1874
        cflags           =>
1875
            add("/POINTER_SIZE=64=ARGV",
1876
                sub { my @warnings =
1877
                          @{vms_info(64)->{disable_warns}};
1878 1879 1880
                      @warnings
                          ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
                } ),
1881 1882
        defines          =>
                    add(sub {
1883 1884
                            return vms_info(64)->{def_zlib}
                                ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
1885
                            }),
1886
        ex_libs          => add(sub { return vms_info(64)->{zlib} || (); }),
1887
        pointer_size     => sub { return vms_info(64)->{pointer_size} },
1888 1889
    },

1890
);