10-main.conf 84.9 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("-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
        # NB. GNU C has to be configured to use GNU assembler, and not
        # /usr/ccs/bin/as. Failure to comply will result in compile
        # failures [at least] in 32-bit build.
193
        inherit_from     => [ "solaris-common", asm("x86_elf_asm") ],
194
        cc               => "gcc",
195
        cflags           => add_before(picker(default => "-Wall -DL_ENDIAN",
196
                                              debug   => "-O0 -g",
197 198
                                              release => "-O3 -fomit-frame-pointer"),
                                       threads("-pthread")),
R
Rich Salz 已提交
199
        bn_ops           => "BN_LLONG",
200
        shared_cflag     => "-fPIC",
201
        shared_ldflag    => "-shared -static-libgcc",
202 203
    },
    "solaris64-x86_64-gcc" => {
204 205 206 207 208 209 210 211
        # -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>
212
        inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
213
        cc               => "gcc",
214 215
        cflags           => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
                                              debug   => "-O0 -g",
216 217
                                              release => "-O3"),
                                       threads("-pthread")),
218
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
219 220 221 222 223
        perlasm_scheme   => "elf",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-m64 -shared -static-libgcc",
        multilib         => "/64",
    },
224 225

#### Solaris x86 with Sun C setups
226 227 228 229 230 231 232 233 234 235 236 237
    # 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...
    #
238
    "solaris64-x86_64-cc" => {
239
        inherit_from     => [ "solaris-common", asm("x86_64_asm") ],
240
        cc               => "cc",
241 242
        cflags           => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
                                              debug   => "-g",
243 244 245
                                              release => "-xO5 -xdepend -xbuiltin"),
                                       threads("-D_REENTRANT")),
        thread_scheme    => "pthreads",
246
        lflags           => add("-xarch=generic64",threads("-mt")),
247
        ex_libs          => add(threads("-lpthread")),
248
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
249 250
        perlasm_scheme   => "elf",
        shared_cflag     => "-KPIC",
251
        shared_ldflag    => "-xarch=generic64 -G -dy -z text",
252 253
        multilib         => "/64",
    },
254 255

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

#### 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!
289
    "solaris-sparcv7-cc" => {
290
        inherit_from     => [ "solaris-common" ],
291
        cc               => "cc",
292
        cflags           => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
A
Andy Polyakov 已提交
293
                                              debug   => "-g",
294 295 296 297
                                              release => "-xO5 -xdepend"),
                                       threads("-D_REENTRANT")),
        lflags           => add(threads("-mt")),
        ex_libs          => add(threads("-lpthread")),
298
        bn_ops           => "BN_LLONG RC4_CHAR",
299 300 301
        shared_cflag     => "-KPIC",
        shared_ldflag    => "-G -dy -z text",
    },
302
####
303
    "solaris-sparcv8-cc" => {
304
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
305
        cflags           => add_before("-xarch=v8"),
306 307
    },
    "solaris-sparcv9-cc" => {
308
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
309
        cflags           => add_before("-xarch=v8plus"),
310 311
    },
    "solaris64-sparcv9-cc" => {
312
        inherit_from     => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
313
        cflags           => add_before("-xarch=v9"),
314
        lflags           => add_before("-xarch=v9"),
315
        bn_ops           => "BN_LLONG RC4_CHAR",
316 317 318
        shared_ldflag    => "-xarch=v9 -G -dy -z text",
        multilib         => "/64",
    },
319 320

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

#### 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 已提交
407
#   If the toolkit is meant to be used on various PA-RISC processors
408
#   consider './Configure hpux-parisc-[g]cc +DAportable'.
409 410 411 412 413
# - -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.
414
# - originally there were 32-bit hpux-parisc2-* targets. They were
F
FdaSilvaYY 已提交
415
#   scrapped, because a) they were not interchangeable with other 32-bit
416 417 418
#   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.
419
#					<appro@fy.chalmers.se>
420
    "hpux-parisc-gcc" => {
421
        inherit_from     => [ "BASE_unix" ],
422
        cc               => "gcc",
423 424 425 426
        cflags           => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread")),
427
        ex_libs          => add("-Wl,+s -ldld"),
428
        bn_ops           => "BN_LLONG",
429
        thread_scheme    => "pthreads",
430 431 432 433 434 435 436
        dso_scheme       => "dl",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fPIC",
        shared_ldflag    => "-shared",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "hpux-parisc1_1-gcc" => {
437
        inherit_from     => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
438 439 440
        multilib         => "/pa1.1",
    },
    "hpux64-parisc2-gcc" => {
441
        inherit_from     => [ "BASE_unix", asm("parisc20_64_asm") ],
442
        cc               => "gcc",
443 444 445 446
        cflags           => combine(picker(default => "-DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-D_REENTRANT")),
447
        ex_libs          => add("-ldl"),
448
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
449
        thread_scheme    => "pthreads",
450 451 452 453 454 455 456
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "-fpic",
        shared_ldflag    => "-shared",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/pa20_64",
    },
457

458 459 460 461
    # 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>
462
    "hpux-parisc-cc" => {
463
        inherit_from     => [ "BASE_unix" ],
464
        cc               => "cc",
465 466 467 468 469
        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")),
470
        bn_ops           => "RC4_CHAR",
471
        thread_scheme    => "pthreads",
472 473 474 475 476 477 478
        dso_scheme       => "dl",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "-b",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "hpux-parisc1_1-cc" => {
479
        inherit_from     => [ "hpux-parisc-cc", asm("parisc11_asm") ],
480
        cflags           => add_before("+DA1.1"),
481 482 483
        multilib         => "/pa1.1",
    },
    "hpux64-parisc2-cc" => {
484
        inherit_from     => [ "BASE_unix", asm("parisc20_64_asm") ],
485
        cc               => "cc",
486 487 488 489 490
        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")),
491
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
492
        thread_scheme    => "pthreads",
493 494 495 496 497 498 499
        dso_scheme       => "dlfcn",
        shared_target    => "hpux-shared",
        shared_cflag     => "+Z",
        shared_ldflag    => "+DD64 -b",
        shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        multilib         => "/pa20_64",
    },
500

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

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

A
Andy Polyakov 已提交
585 586 587 588 589
#### 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" => {
590
        inherit_from     => [ "BASE_unix", asm("alpha_asm") ],
591
        cc               => "gcc",
A
Andy Polyakov 已提交
592 593 594
        cflags           => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
                                    threads("-pthread")),
        ex_libs          => "-lrt",    # for mlock(2)
595
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
A
Andy Polyakov 已提交
596
        thread_scheme    => "pthreads",
597 598 599 600 601
        dso_scheme       => "dlfcn",
        shared_target    => "alpha-osf1-shared",
        shared_extension => ".so",
    },
    "tru64-alpha-cc" => {
602
        inherit_from     => [ "BASE_unix", asm("alpha_asm") ],
603
        cc               => "cc",
A
Andy Polyakov 已提交
604
        cflags           => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
605
                                    threads("-pthread")),
A
Andy Polyakov 已提交
606
        ex_libs          => "-lrt",    # for mlock(2)
607
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
608
        thread_scheme    => "pthreads",
609 610 611 612 613
        dso_scheme       => "dlfcn",
        shared_target    => "alpha-osf1-shared",
        shared_ldflag    => "-msym",
        shared_extension => ".so",
    },
614 615 616 617 618 619

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

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

660
    "linux-armv4" => {
661 662 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
        ################################################################
        # 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",
694 695
    },
    "linux-aarch64" => {
696
        inherit_from     => [ "linux-generic64", asm("aarch64_asm") ],
697 698
        perlasm_scheme   => "linux64",
    },
699 700
    "linux-arm64ilp32" => {  # https://wiki.linaro.org/Platform/arm64-ilp32
        inherit_from     => [ "linux-generic32", asm("aarch64_asm") ],
701
        cflags           => add("-mabi=ilp32"),
702
        bn_ops           => "SIXTY_FOUR_BIT RC4_CHAR",
703
        perlasm_scheme   => "linux64",
704
        shared_ldflag    => add("-mabi=ilp32"),
705
    },
706

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

    #### IA-32 targets...
734 735
    #### These two targets are a bit aged and are to be used on older Linux
    #### machines where gcc doesn't understand -m32 and -m64
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 754 755 756 757 758 759 760 761 762 763 764 765 766 767
    #### X86 / X86_64 targets
    "linux-x86" => {
        inherit_from     => [ "linux-generic32", asm("x86_asm") ],
        cflags           => add(picker(default => "-m32 -DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
        bn_ops           => "BN_LLONG",
        perlasm_scheme   => "elf",
        shared_ldflag    => add("-m32"),
    },
    "linux-x86-clang" => {
        inherit_from     => [ "linux-x86" ],
        cc               => "clang",
        cxx              => "clang++",
        cflags           => add("-Wextra -Qunused-arguments"),
    },
768
    "linux-x86_64" => {
769
        inherit_from     => [ "linux-generic64", asm("x86_64_asm") ],
770
        cflags           => add("-m64 -DL_ENDIAN"),
771
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
772
        perlasm_scheme   => "elf",
M
Matt Caswell 已提交
773
        shared_ldflag    => add("-m64"),
774 775
        multilib         => "64",
    },
776 777 778
    "linux-x86_64-clang" => {
        inherit_from     => [ "linux-x86_64" ],
        cc               => "clang",
779
        cxx              => "clang++",
780
        cflags           => add("-Wextra -Qunused-arguments"),
781
    },
782
    "linux-x32" => {
783
        inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
784
        cflags           => add("-mx32 -DL_ENDIAN"),
785
        bn_ops           => "SIXTY_FOUR_BIT",
786
        perlasm_scheme   => "elf32",
787
        shared_ldflag    => add("-mx32"),
788 789
        multilib         => "x32",
    },
790 791 792

    "linux-ia64" => {
        inherit_from     => [ "linux-generic64", asm("ia64_asm") ],
793
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
794 795
    },

796
    "linux64-s390x" => {
797
        inherit_from     => [ "linux-generic64", asm("s390x_asm") ],
798
        cflags           => add("-m64 -DB_ENDIAN"),
799
        perlasm_scheme   => "64",
M
Matt Caswell 已提交
800
        shared_ldflag    => add("-m64"),
801 802 803
        multilib         => "64",
    },
    "linux32-s390x" => {
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820
        #### 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") ],
821
        cflags           => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
822
        bn_asm_src       => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
823
        perlasm_scheme   => "31",
M
Matt Caswell 已提交
824
        shared_ldflag    => add("-m31"),
825 826
        multilib         => "/highgprs",
    },
827 828 829 830

    #### SPARC Linux setups
    # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
    # patiently assisted with debugging of following two configs.
831
    "linux-sparcv8" => {
832
        inherit_from     => [ "linux-generic32", asm("sparcv8_asm") ],
833
        cflags           => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
834 835
    },
    "linux-sparcv9" => {
836 837 838
        # 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") ],
839
        cflags           => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
M
Matt Caswell 已提交
840
        shared_ldflag    => add("-m32"),
841 842
    },
    "linux64-sparcv9" => {
843 844
        # GCC 3.1 is a requirement
        inherit_from     => [ "linux-generic64", asm("sparcv9_asm") ],
845
        cflags           => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
846
        bn_ops           => "BN_LLONG RC4_CHAR",
M
Matt Caswell 已提交
847
        shared_ldflag    => add("-m64"),
848 849
        multilib         => "64",
    },
850

851
    "linux-alpha-gcc" => {
852
        inherit_from     => [ "linux-generic64", asm("alpha_asm") ],
853
        cflags           => add("-DL_ENDIAN"),
854
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
855 856
    },
    "linux-c64xplus" => {
857
        inherit_from     => [ "BASE_unix" ],
858
        # TI_CGT_C6000_7.3.x is a requirement
859
        cc               => "cl6x",
860 861
        cflags           => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
                                    threads("-D_REENTRANT")),
862
        bn_ops           => "BN_LLONG",
863 864 865 866 867 868 869 870
        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",
871
        thread_scheme    => "pthreads",
872 873 874 875
        perlasm_scheme   => "void",
        dso_scheme       => "dlfcn",
        shared_target    => "linux-shared",
        shared_cflag     => "--pic",
M
Matt Caswell 已提交
876
        shared_ldflag    => add("-z --sysv --shared"),
877 878 879
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        ranlib           => "true",
    },
880

881
#### Android: linux-* but without pointers to headers and libs.
A
Andy Polyakov 已提交
882 883 884
    #
    # It takes pair of prior-set environment variables to make it work:
    #
885
    # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
A
Andy Polyakov 已提交
886 887 888 889 890 891 892 893
    # 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-
894
    # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
A
Andy Polyakov 已提交
895
    #
896
    "android" => {
897
        inherit_from     => [ "linux-generic32" ],
A
Andy Polyakov 已提交
898 899 900
        # 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 已提交
901
        # concern is -pie. Older toolchains, e.g. r4, appear to handle it
A
Andy Polyakov 已提交
902 903 904 905 906
        # 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 已提交
907 908
        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
        bin_cflags       => "-pie",
909 910
    },
    "android-x86" => {
911
        inherit_from     => [ "android", asm("x86_asm") ],
912
        cflags           => add(picker(release => "-fomit-frame-pointer")),
R
Rich Salz 已提交
913
        bn_ops           => "BN_LLONG",
914
        perlasm_scheme   => "android",
915
    },
A
Andy Polyakov 已提交
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937
    ################################################################
    # 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" => {
938
        inherit_from     => [ "android", asm("armv4_asm") ],
A
Andy Polyakov 已提交
939
    },
940
    "android-mips" => {
941
        inherit_from     => [ "android", asm("mips32_asm") ],
942 943
        perlasm_scheme   => "o32",
    },
944

945 946
    "android64" => {
        inherit_from     => [ "linux-generic64" ],
A
Andy Polyakov 已提交
947 948
        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
        bin_cflags       => "-pie",
949 950 951 952
    },
    "android64-aarch64" => {
        inherit_from     => [ "android64", asm("aarch64_asm") ],
        perlasm_scheme   => "linux64",
953 954 955 956
    },
    "android64-x86_64" => {
        inherit_from     => [ "android64", asm("x86_64_asm") ],
        perlasm_scheme   => "elf",
957 958 959 960 961 962 963 964 965 966 967 968 969
    },
    "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",
970 971
    },

972
#### *BSD
973
    "BSD-generic32" => {
974
        # As for thread cflag. Idea is to maintain "collective" set of
975 976 977 978 979 980
        # 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?
981
        inherit_from     => [ "BASE_unix" ],
982
        cc               => "cc",
983 984 985 986
        cflags           => combine(picker(default => "-Wall",
                                           debug   => "-O0 -g",
                                           release => "-O3"),
                                    threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
987
        bn_ops           => "BN_LLONG",
988
        thread_scheme    => "pthreads",
989 990 991 992 993
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
994 995
    "BSD-generic64" => {
        inherit_from     => [ "BSD-generic32" ],
996
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
997
    },
998 999 1000

    "BSD-x86" => {
        inherit_from     => [ "BSD-generic32", asm("x86_asm") ],
1001 1002
        cflags           => add(picker(default => "-DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
R
Rich Salz 已提交
1003
        bn_ops           => "BN_LLONG",
1004
        shared_target    => "bsd-shared",
1005
        perlasm_scheme   => "a.out",
1006
    },
1007 1008 1009
    "BSD-x86-elf" => {
        inherit_from     => [ "BSD-x86" ],
        perlasm_scheme   => "elf",
1010
    },
1011

1012 1013
    "BSD-sparcv8" => {
        inherit_from     => [ "BSD-generic32", asm("sparcv8_asm") ],
1014
        cflags           => add("-mcpu=v8 -DB_ENDIAN"),
1015 1016
    },
    "BSD-sparc64" => {
1017 1018 1019 1020
        # -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") ],
1021
        cflags           => add("-DB_ENDIAN -DMD32_REG_T=int"),
1022
        bn_ops           => "BN_LLONG",
1023
    },
1024

1025
    "BSD-ia64" => {
1026
        inherit_from     => [ "BSD-generic64", asm("ia64_asm") ],
1027
        cflags           => add_before("-DL_ENDIAN"),
1028
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1029
    },
1030

1031
    "BSD-x86_64" => {
1032
        inherit_from     => [ "BSD-generic64", asm("x86_64_asm") ],
1033
        cflags           => add_before("-DL_ENDIAN"),
1034
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1035 1036
        perlasm_scheme   => "elf",
    },
1037

1038
    "bsdi-elf-gcc" => {
1039
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1040
        cc               => "gcc",
1041
        cflags           => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
1042
        ex_libs          => add("-ldl"),
R
Rich Salz 已提交
1043
        bn_ops           => "BN_LLONG",
1044
        thread_scheme    => "(unknown)",
1045 1046 1047 1048 1049
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1050

1051
    "nextstep" => {
1052
        inherit_from     => [ "BASE_unix" ],
1053 1054 1055
        cc               => "cc",
        cflags           => "-O -Wall",
        unistd           => "<libc.h>",
R
Rich Salz 已提交
1056
        bn_ops           => "BN_LLONG",
1057
        thread_scheme    => "(unknown)",
1058 1059
    },
    "nextstep3.3" => {
1060
        inherit_from     => [ "BASE_unix" ],
1061 1062 1063
        cc               => "cc",
        cflags           => "-O3 -Wall",
        unistd           => "<libc.h>",
R
Rich Salz 已提交
1064
        bn_ops           => "BN_LLONG",
1065
        thread_scheme    => "(unknown)",
1066
    },
1067 1068

# QNX
1069
    "qnx4" => {
1070
        inherit_from     => [ "BASE_unix" ],
1071 1072
        cc               => "cc",
        cflags           => "-DL_ENDIAN -DTERMIO",
1073
        thread_scheme    => "(unknown)",
1074 1075
    },
    "QNX6" => {
1076
        inherit_from     => [ "BASE_unix" ],
1077
        cc               => "gcc",
1078
        ex_libs          => add("-lsocket"),
1079 1080 1081 1082 1083 1084
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "QNX6-i386" => {
1085
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1086 1087
        cc               => "gcc",
        cflags           => "-DL_ENDIAN -O2 -Wall",
1088
        ex_libs          => add("-lsocket"),
1089 1090 1091 1092 1093
        dso_scheme       => "dlfcn",
        shared_target    => "bsd-gcc-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106

#### 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.
1107
    "unixware-2.0" => {
1108
        inherit_from     => [ "BASE_unix" ],
1109
        cc               => "cc",
1110 1111
        cflags           => combine("-DFILIO_H -DNO_STRINGS_H",
                                    threads("-Kthread")),
1112
        ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
1113
        thread_scheme    => "uithreads",
1114 1115
    },
    "unixware-2.1" => {
1116
        inherit_from     => [ "BASE_unix" ],
1117
        cc               => "cc",
1118 1119
        cflags           => combine("-O -DFILIO_H",
                                    threads("-Kthread")),
1120
        ex_libs          => add("-lsocket -lnsl -lresolv -lx"),
1121
        thread_scheme    => "uithreads",
1122 1123
    },
    "unixware-7" => {
1124
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1125
        cc               => "cc",
1126 1127
        cflags           => combine("-O -DFILIO_H -Kalloca",
                                    threads("-Kthread")),
1128
        ex_libs          => add("-lsocket -lnsl"),
1129
        thread_scheme    => "uithreads",
R
Rich Salz 已提交
1130
        bn_ops           => "BN_LLONG",
1131 1132 1133 1134 1135 1136 1137
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr5-shared",
        shared_cflag     => "-Kpic",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "unixware-7-gcc" => {
1138
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1139
        cc               => "gcc",
1140 1141
        cflags           => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
                                    threads("-D_REENTRANT")),
1142
        ex_libs          => add("-lsocket -lnsl"),
R
Rich Salz 已提交
1143
        bn_ops           => "BN_LLONG",
1144
        thread_scheme    => "pthreads",
1145 1146 1147 1148 1149 1150
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "gnu-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1151
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
1152
    "sco5-cc" => {
1153
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1154 1155
        cc               => "cc",
        cflags           => "-belf",
1156
        ex_libs          => add("-lsocket -lnsl"),
1157
        thread_scheme    => "(unknown)",
1158 1159 1160 1161 1162 1163 1164
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr3-shared",
        shared_cflag     => "-Kpic",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
    "sco5-gcc" => {
1165
        inherit_from     => [ "BASE_unix", asm("x86_elf_asm") ],
1166 1167
        cc               => "gcc",
        cflags           => "-O3 -fomit-frame-pointer",
1168
        ex_libs          => add("-lsocket -lnsl"),
R
Rich Salz 已提交
1169
        bn_ops           => "BN_LLONG",
1170
        thread_scheme    => "(unknown)",
1171 1172 1173 1174 1175 1176
        perlasm_scheme   => "elf-1",
        dso_scheme       => "dlfcn",
        shared_target    => "svr3-shared",
        shared_cflag     => "-fPIC",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
    },
1177 1178

#### IBM's AIX.
1179 1180 1181 1182 1183
    # 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.
1184
    "aix-gcc" => {
1185
        inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
1186
        cc               => "gcc",
1187 1188 1189 1190
        cflags           => combine(picker(default => "-DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-pthread")),
1191 1192
        sys_id           => "AIX",
        bn_ops           => "BN_LLONG RC4_CHAR",
1193
        thread_scheme    => "pthreads",
1194 1195 1196
        perlasm_scheme   => "aix32",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
1197
        shared_ldflag    => "-shared -static-libgcc -Wl,-G",
1198 1199 1200 1201
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X32",
    },
    "aix64-gcc" => {
1202
        inherit_from     => [ "BASE_unix", asm("ppc64_asm") ],
1203
        cc               => "gcc",
1204 1205 1206 1207
        cflags           => combine(picker(default => "-maix64 -DB_ENDIAN",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-pthread")),
1208 1209
        sys_id           => "AIX",
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1210
        thread_scheme    => "pthreads",
1211 1212 1213
        perlasm_scheme   => "aix64",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
1214
        shared_ldflag    => "-maix64 -shared -static-libgcc -Wl,-G",
1215 1216 1217 1218
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X64",
    },
    "aix-cc" => {
1219
        inherit_from     => [ "BASE_unix", asm("ppc32_asm") ],
1220
        cc               => "cc",
1221 1222 1223 1224
        cflags           => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-qthreaded -D_THREAD_SAFE")),
1225 1226
        sys_id           => "AIX",
        bn_ops           => "BN_LLONG RC4_CHAR",
1227
        thread_scheme    => "pthreads",
1228
        ex_libs          => threads("-lpthreads"),
1229 1230 1231 1232 1233 1234 1235 1236
        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" => {
1237
        inherit_from     => [ "BASE_unix", asm("ppc64_asm") ],
1238
        cc               => "cc",
1239 1240 1241 1242
        cflags           => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
                                           debug   => "-O0 -g",
                                           release => "-O"),
                                    threads("-qthreaded -D_THREAD_SAFE")),
1243 1244
        sys_id           => "AIX",
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1245
        thread_scheme    => "pthreads",
1246
        ex_libs          => threads("-lpthreads"),
1247 1248 1249 1250 1251 1252 1253
        perlasm_scheme   => "aix64",
        dso_scheme       => "dlfcn",
        shared_target    => "aix-shared",
        shared_ldflag    => "-q64 -G",
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
        arflags          => "-X 64",
    },
1254 1255

# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1256
    "BS2000-OSD" => {
1257
        inherit_from     => [ "BASE_unix" ],
1258 1259
        cc               => "c89",
        cflags           => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
1260
        ex_libs          => add("-lsocket -lnsl"),
1261
        bn_ops           => "THIRTY_TWO_BIT RC4_CHAR",
1262
        thread_scheme    => "(unknown)",
1263
    },
1264 1265 1266 1267 1268

# 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.
#
1269
    "OS390-Unix" => {
1270
        inherit_from     => [ "BASE_unix" ],
1271 1272
        cc               => "c89.sh",
        cflags           => "-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H  -D_ALL_SOURCE",
1273
        bn_ops           => "THIRTY_TWO_BIT RC4_CHAR",
1274
        thread_scheme    => "(unknown)",
1275
    },
1276

1277
#### Visual C targets
1278 1279 1280 1281 1282 1283 1284
#
# 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.
1285 1286 1287
#
# Also note that we force threads no matter what.  Configuring "no-threads"
# is ignored.
1288
    "VC-common" => {
1289
        inherit_from     => [ "BASE_Windows" ],
1290
        template         => 1,
1291
        cc               => "cl",
1292
        cflags           => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
1293 1294
        defines          => add(sub { my @defs = ();
                                      unless ($disabled{"zlib-dynamic"}) {
1295 1296
                                          my $zlib =
                                              $withargs{zlib_lib} // "ZLIB1";
1297 1298
                                          push @defs,
                                              quotify("perl",
1299
                                                      'LIBZ="' . $zlib . '"');
1300 1301 1302
                                      }
                                      return [ @defs ];
                                    }),
1303
        coutflag         => "/Fo",
1304 1305
        lib_cflags       => add("/Zi /Fdossl_static"),
        dso_cflags       => "/Zi /Fddso",
1306 1307 1308
        bin_cflags       => "/Zi /Fdapp",
        lflags           => add("/debug"),
        shared_ldflag    => "/dll",
1309
        shared_target    => "win-shared", # meaningless except it gives Configure a hint
1310
        thread_scheme    => "winthreads",
1311
        dso_scheme       => "win32",
1312
        apps_aux_src     => add("win32_init.c"),
1313
    },
1314
    "VC-noCE-common" => {
1315
        inherit_from     => [ "VC-common" ],
R
Richard Levitte 已提交
1316
        template         => 1,
1317 1318 1319
        cflags           => add(picker(default => "-DUNICODE -D_UNICODE",
                                       debug   =>
                                       sub {
1320 1321
                                           ($disabled{shared} ? "" : "/MDd")
                                               ." /Od -DDEBUG -D_DEBUG";
1322 1323 1324
                                       },
                                       release =>
                                       sub {
1325
                                           ($disabled{shared} ? "" : "/MD")
R
Richard Levitte 已提交
1326
                                               ." /O2";
1327
                                       })),
1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342
        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" : () },
                                      )),
1343
        bin_lflags       => add("/subsystem:console /opt:ref"),
1344
        ex_libs          => add(sub {
1345 1346 1347 1348
            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);
1349
        }),
1350 1351 1352
    },
    "VC-WIN64-common" => {
        inherit_from     => [ "VC-noCE-common" ],
R
Richard Levitte 已提交
1353
        template         => 1,
1354
        ex_libs          => add(sub {
1355 1356 1357
            my @ex_libs = ();
            push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
            return join(" ", @_, @ex_libs);
1358
        }),
1359 1360 1361
        bn_ops           => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
        build_scheme     => add("VC-W64", { separator => undef }),
    },
1362
    "VC-WIN64I" => {
1363 1364
        inherit_from     => [ "VC-WIN64-common", asm("ia64_asm"),
                              sub { $disabled{shared} ? () : "ia64_uplink" } ],
1365 1366 1367
        as               => "ias",
        asflags          => "-d debug",
        asoutflag        => "-o",
1368
        sys_id           => "WIN64I",
A
Andy Polyakov 已提交
1369 1370
        bn_asm_src       => sub { return undef unless @_;
                                  my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
1371
        perlasm_scheme   => "ias",
A
Andy Polyakov 已提交
1372
        multilib         => "-ia64",
1373 1374
    },
    "VC-WIN64A" => {
1375 1376
        inherit_from     => [ "VC-WIN64-common", asm("x86_64_asm"),
                              sub { $disabled{shared} ? () : "x86_64_uplink" } ],
1377 1378 1379
        as               => sub { vc_win64a_info()->{as} },
        asflags          => sub { vc_win64a_info()->{asflags} },
        asoutflag        => sub { vc_win64a_info()->{asoutflag} },
1380
        sys_id           => "WIN64A",
1381 1382
        bn_asm_src       => sub { return undef unless @_;
                                  my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
1383
        perlasm_scheme   => "auto",
A
Andy Polyakov 已提交
1384
        multilib         => "-x64",
1385 1386
    },
    "VC-WIN32" => {
1387 1388
        # x86 Win32 target defaults to ANSI API, if you want UNICODE,
        # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
1389
        inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
1390
                              sub { $disabled{shared} ? () : "uplink_common" } ],
1391 1392 1393
        as               => sub { vc_win32_info()->{as} },
        asflags          => sub { vc_win32_info()->{asflags} },
        asoutflag        => sub { vc_win32_info()->{asoutflag} },
1394
        ex_libs          => add(sub {
1395 1396 1397 1398 1399 1400
            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, @_);
1401
        }),
1402
        sys_id           => "WIN32",
R
Rich Salz 已提交
1403
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1404
        perlasm_scheme   => sub { vc_win32_info()->{perlasm_scheme} },
1405
        build_scheme     => add("VC-W32", { separator => undef }),
1406 1407
    },
    "VC-CE" => {
1408 1409 1410 1411
        inherit_from     => [ "VC-common" ],
        as               => "ml",
        asflags          => "/nologo /Cp /coff /c /Cx /Zi",
        asoutflag        => "/Fo",
1412
        cc               => "cl",
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
        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" : (); }),
1430
        sys_id           => "WINCE",
R
Rich Salz 已提交
1431
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1432
        ex_libs          => add(sub {
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449
            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;
1450
        }),
1451
        build_scheme     => add("VC-WCE", { separator => undef }),
1452
    },
1453

1454
#### MinGW
1455
    "mingw" => {
1456
        inherit_from     => [ "BASE_unix", asm("x86_asm"),
1457
                              sub { $disabled{shared} ? () : "x86_uplink" } ],
1458
        cc               => "gcc",
1459 1460 1461 1462
        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")),
1463
        sys_id           => "MINGW32",
1464
        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
R
Rich Salz 已提交
1465
        bn_ops           => "BN_LLONG EXPORT_VAR_AS_FN",
1466
        thread_scheme    => "winthreads",
1467 1468
        perlasm_scheme   => "coff",
        dso_scheme       => "win32",
1469
        shared_target    => "mingw-shared",
1470
        shared_cflag     => add("-D_WINDLL"),
1471
        shared_ldflag    => "-static-libgcc",
1472
        shared_rcflag    => "--target=pe-i386",
1473
        shared_extension => ".dll",
1474
        multilib         => "",
1475
        apps_aux_src     => add("win32_init.c"),
1476 1477
    },
    "mingw64" => {
1478 1479 1480 1481 1482 1483 1484 1485
        # 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.
1486
        inherit_from     => [ "BASE_unix", asm("x86_64_asm") ],
1487
        cc               => "gcc",
1488 1489 1490 1491
        cflags           => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
                                           debug   => "-g -O0",
                                           release => "-O3"),
                                    threads("-D_MT")),
1492
        sys_id           => "MINGW64",
1493
        ex_libs          => add("-lws2_32 -lgdi32 -lcrypt32"),
1494
        bn_ops           => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
1495
        thread_scheme    => "winthreads",
1496 1497
        perlasm_scheme   => "mingw64",
        dso_scheme       => "win32",
1498
        shared_target    => "mingw-shared",
1499
        shared_cflag     => add("-D_WINDLL"),
1500
        shared_ldflag    => "-static-libgcc",
1501
        shared_rcflag    => "--target=pe-x86-64",
1502
        shared_extension => ".dll",
1503
        multilib         => "64",
1504
        apps_aux_src     => add("win32_init.c"),
1505
    },
1506

D
David Woodhouse 已提交
1507 1508
#### UEFI
    "UEFI" => {
1509
        inherit_from     => [ "BASE_unix" ],
D
David Woodhouse 已提交
1510 1511 1512 1513 1514
        cc               => "cc",
        cflags           => "-DL_ENDIAN -O",
        sys_id           => "UEFI",
    },

1515
#### UWIN
1516
    "UWIN" => {
1517
        inherit_from     => [ "BASE_unix" ],
1518 1519 1520
        cc               => "cc",
        cflags           => "-DTERMIOS -DL_ENDIAN -O -Wall",
        sys_id           => "UWIN",
R
Rich Salz 已提交
1521
        bn_ops           => "BN_LLONG",
1522 1523
        dso_scheme       => "win32",
    },
1524

1525
#### Cygwin
1526
    "Cygwin-x86" => {
1527
        inherit_from     => [ "BASE_unix", asm("x86_asm") ],
1528
        cc               => "gcc",
1529 1530 1531
        cflags           => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
                                   debug   => "-g -O0",
                                   release => "-O3 -fomit-frame-pointer"),
1532
        sys_id           => "CYGWIN",
R
Rich Salz 已提交
1533
        bn_ops           => "BN_LLONG",
1534
        thread_scheme    => "pthread",
1535 1536 1537 1538 1539
        perlasm_scheme   => "coff",
        dso_scheme       => "dlfcn",
        shared_target    => "cygwin-shared",
        shared_cflag     => "-D_WINDLL",
        shared_ldflag    => "-shared",
1540
        shared_extension => ".dll",
1541 1542
    },
    "Cygwin-x86_64" => {
1543
        inherit_from     => [ "BASE_unix", asm("x86_64_asm") ],
1544
        cc               => "gcc",
1545 1546 1547
        cflags           => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
                                   debug   => "-g -O0",
                                   release => "-O3"),
1548
        sys_id           => "CYGWIN",
1549
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1550
        thread_scheme    => "pthread",
1551 1552 1553 1554 1555
        perlasm_scheme   => "mingw64",
        dso_scheme       => "dlfcn",
        shared_target    => "cygwin-shared",
        shared_cflag     => "-D_WINDLL",
        shared_ldflag    => "-shared",
1556
        shared_extension => ".dll",
1557
    },
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574
    # 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" ]
    },
1575 1576

##### MacOS X (a.k.a. Darwin) setup
1577
    "darwin-common" => {
1578
        inherit_from     => [ "BASE_unix" ],
1579
        template         => 1,
1580
        cc               => "cc",
1581 1582 1583 1584
        cflags           => combine(picker(default => "",
                                           debug   => "-g -O0",
                                           release => "-O3"),
                                   threads("-D_REENTRANT")),
1585
        sys_id           => "MACOSX",
1586
        plib_lflags      => "-Wl,-search_paths_first",
1587
        bn_ops           => "BN_LLONG RC4_CHAR",
1588
        thread_scheme    => "pthreads",
1589 1590
        perlasm_scheme   => "osx32",
        dso_scheme       => "dlfcn",
R
Richard Levitte 已提交
1591
        ranlib           => "ranlib -c",
1592
        shared_target    => "darwin-shared",
R
Richard Levitte 已提交
1593
        shared_cflag     => "-fPIC",
1594
        shared_ldflag    => "-dynamiclib",
1595 1596
        shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
    },
1597 1598 1599
    # 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.
1600 1601
    "darwin-ppc-cc" => {
        inherit_from     => [ "darwin-common", asm("ppc32_asm") ],
1602
        cflags           => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
1603 1604 1605
        perlasm_scheme   => "osx32",
        shared_ldflag    => "-arch ppc -dynamiclib",
    },
1606
    "darwin64-ppc-cc" => {
1607
        inherit_from     => [ "darwin-common", asm("ppc64_asm") ],
1608
        cflags           => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
1609
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1610 1611 1612 1613
        perlasm_scheme   => "osx64",
        shared_ldflag    => "-arch ppc64 -dynamiclib",
    },
    "darwin-i386-cc" => {
1614
        inherit_from     => [ "darwin-common", asm("x86_asm") ],
1615 1616
        cflags           => add(picker(default => "-arch i386 -DL_ENDIAN",
                                       release => "-fomit-frame-pointer")),
1617
        bn_ops           => "BN_LLONG RC4_INT",
1618 1619 1620 1621
        perlasm_scheme   => "macosx",
        shared_ldflag    => "-arch i386 -dynamiclib",
    },
    "darwin64-x86_64-cc" => {
1622
        inherit_from     => [ "darwin-common", asm("x86_64_asm") ],
1623
        cflags           => add("-arch x86_64 -DL_ENDIAN -Wall"),
1624
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1625 1626 1627
        perlasm_scheme   => "macosx",
        shared_ldflag    => "-arch x86_64 -dynamiclib",
    },
1628 1629

#### iPhoneOS/iOS
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641
#
# 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
1642
# CROSS_SDK=iPhoneOS.sdk
1643
#
1644
    "iphoneos-cross" => {
1645
        inherit_from     => [ "darwin-common" ],
1646
        cflags           => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1647 1648
        sys_id           => "iOS",
    },
1649 1650 1651 1652
    "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
1653
        # at this point.
1654
        cflags           => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1655 1656 1657
        sys_id           => "iOS",
        perlasm_scheme   => "ios32",
    },
1658
    "ios64-cross" => {
1659
        inherit_from     => [ "darwin-common", asm("aarch64_asm") ],
1660
        cflags           => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
1661
        sys_id           => "iOS",
1662
        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1663 1664
        perlasm_scheme   => "ios64",
    },
1665 1666

##### GNU Hurd
1667
    "hurd-x86" => {
1668
        inherit_from     => [ "BASE_unix" ],
1669
        inherit_from     => [ asm("x86_elf_asm") ],
1670
        cc               => "gcc",
1671 1672
        cflags           => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
                                    threads("-pthread")),
1673
        ex_libs          => add("-ldl"),
R
Rich Salz 已提交
1674
        bn_ops           => "BN_LLONG",
1675
        thread_scheme    => "pthreads",
1676 1677 1678
        dso_scheme       => "dlfcn",
        shared_target    => "linux-shared",
        shared_cflag     => "-fPIC",
K
Kurt Roeckx 已提交
1679
        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
1680
    },
1681 1682

##### VxWorks for various targets
1683
    "vxworks-ppc60x" => {
1684
        inherit_from     => [ "BASE_unix" ],
1685 1686 1687
        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",
1688
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1689 1690
    },
    "vxworks-ppcgen" => {
1691
        inherit_from     => [ "BASE_unix" ],
1692 1693 1694
        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",
1695
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1696 1697
    },
    "vxworks-ppc405" => {
1698
        inherit_from     => [ "BASE_unix" ],
1699 1700 1701 1702 1703 1704
        cc               => "ccppc",
        cflags           => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-ppc750" => {
1705
        inherit_from     => [ "BASE_unix" ],
1706 1707 1708 1709 1710 1711
        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" => {
1712
        inherit_from     => [ "BASE_unix" ],
1713
        cc               => "ccppc",
A
Andy Polyakov 已提交
1714
        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",
1715 1716 1717 1718
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-ppc860" => {
1719
        inherit_from     => [ "BASE_unix" ],
1720 1721 1722 1723 1724 1725
        cc               => "ccppc",
        cflags           => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
        sys_id           => "VXWORKS",
        lflags           => "-r",
    },
    "vxworks-simlinux" => {
1726
        inherit_from     => [ "BASE_unix" ],
1727 1728 1729 1730 1731 1732 1733
        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" => {
1734
        inherit_from     => [ "BASE_unix", asm("mips32_asm") ],
1735
        cc               => "ccmips",
1736 1737
        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")),
1738
        sys_id           => "VXWORKS",
1739
        ex_libs          => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1740
        thread_scheme    => "pthreads",
1741 1742 1743
        perlasm_scheme   => "o32",
        ranlib           => "ranlibmips",
    },
1744

1745
#### uClinux
1746
    "uClinux-dist" => {
1747
        inherit_from     => [ "BASE_unix" ],
1748
        cc               => "$ENV{'CC'}",
1749 1750
        cflags           => combine("\$(CFLAGS)",
                                    threads("-D_REENTRANT")),
1751
        plib_lflags      => "\$(LDFLAGS)",
1752
        ex_libs          => add("\$(LDLIBS)"),
1753
        bn_ops           => "BN_LLONG",
1754
        thread_scheme    => "pthreads",
1755 1756 1757 1758 1759 1760 1761 1762
        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" => {
1763
        inherit_from     => [ "BASE_unix" ],
1764
        cc               => "$ENV{'CC'}",
1765 1766
        cflags           => combine("\$(CFLAGS)",
                                    threads("-D_REENTRANT")),
1767
        plib_lflags      => "\$(LDFLAGS)",
1768
        ex_libs          => add("\$(LDLIBS)"),
1769
        bn_ops           => "SIXTY_FOUR_BIT_LONG",
1770
        thread_scheme    => "pthreads",
1771 1772 1773 1774 1775 1776 1777
        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'}",
    },
1778

1779 1780
    ##### VMS
    "vms-generic" => {
1781
        inherit_from     => [ "BASE_VMS" ],
1782 1783
        template         => 1,
        cc               => "CC/DECC",
1784
        cflags           => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1785 1786
                                   debug   => "/NOOPTIMIZE/DEBUG",
                                   release => "/OPTIMIZE/NODEBUG"),
R
Richard Levitte 已提交
1787
        defines          => add("OPENSSL_USE_NODELETE"),
1788
        lflags           => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
1789
                                   debug   => "/DEBUG/TRACEBACK",
1790
                                   release => "/NODEBUG/NOTRACEBACK"),
1791
        lib_cflags       => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
1792 1793 1794
        # 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)",
1795
        shared_target    => "vms-shared",
R
Richard Levitte 已提交
1796
        dso_scheme       => "vms",
1797
        thread_scheme    => "pthreads",
1798

1799
        apps_aux_src     => "vms_decc_init.c vms_term_sock.c",
1800 1801 1802 1803
    },

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

1907
);