Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1753257102, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"041bf5484fec8e8305427854d05f8413", "oid":{ "oid": "fe6fcd31546db1ab019e55edd15c953c5b358559", "alias": []},"blobname": "Configure", "blob": "#! /usr/bin/env perl\n# -*- mode: perl; -*-\n# Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.\n#\n# Licensed under the OpenSSL license (the \u0022License\u0022). You may not use\n# this file except in compliance with the License. You can obtain a copy\n# in the file LICENSE in the source distribution or at\n# https://www.openssl.org/source/license.html\n\n## Configure -- OpenSSL source tree configuration script\n\nuse 5.10.0;\nuse strict;\nuse Config;\nuse FindBin;\nuse lib \u0022$FindBin::Bin/util/perl\u0022;\nuse File::Basename;\nuse File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;\nuse File::Path qw/mkpath/;\nuse OpenSSL::Glob;\n\n# see INSTALL for instructions.\n\nmy $usage\u003d\u0022Usage: Configure [no-\u003ccipher\u003e ...] [enable-\u003ccipher\u003e ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix\u003dDIR] [--openssldir\u003dOPENSSLDIR] [--with-xxx[\u003dvvv]] [--config\u003dFILE] os/compiler[:flags]\u005cn\u0022;\n\n# Options:\n#\n# --config add the given configuration file, which will be read after\n# any \u0022Configurations*\u0022 files that are found in the same\n# directory as this script.\n# --prefix prefix for the OpenSSL installation, which includes the\n# directories bin, lib, include, share/man, share/doc/openssl\n# This becomes the value of INSTALLTOP in Makefile\n# (Default: /usr/local)\n# --openssldir OpenSSL data area, such as openssl.cnf, certificates and keys.\n# If it's a relative directory, it will be added on the directory\n# given with --prefix.\n# This becomes the value of OPENSSLDIR in Makefile and in C.\n# (Default: PREFIX/ssl)\n#\n# --cross-compile-prefix Add specified prefix to binutils components.\n#\n# --api One of 0.9.8, 1.0.0 or 1.1.0. Do not compile support for\n# interfaces deprecated as of the specified OpenSSL version.\n#\n# no-hw-xxx do not compile support for specific crypto hardware.\n# Generic OpenSSL-style methods relating to this support\n# are always compiled but return NULL if the hardware\n# support isn't compiled.\n# no-hw do not compile support for any crypto hardware.\n# [no-]threads [don't] try to create a library that is suitable for\n# multithreaded applications (default is \u0022threads\u0022 if we\n# know how to do it)\n# [no-]shared\t[don't] try to create shared libraries when supported.\n# [no-]pic [don't] try to build position independent code when supported.\n# If disabled, it also disables shared and dynamic-engine.\n# no-asm do not use assembler\n# no-dso do not compile in any native shared-library methods. This\n# will ensure that all methods just return NULL.\n# no-egd do not compile support for the entropy-gathering daemon APIs\n# [no-]zlib [don't] compile support for zlib compression.\n# zlib-dynamic\tLike \u0022zlib\u0022, but the zlib library is expected to be a shared\n#\t\tlibrary and will be loaded in run-time by the OpenSSL library.\n# sctp include SCTP support\n# enable-weak-ssl-ciphers\n# Enable weak ciphers that are disabled by default.\n# 386 generate 80386 code in assembly modules\n# no-sse2 disables IA-32 SSE2 code in assembly modules, the above\n# mentioned '386' option implies this one\n# no-\u003ccipher\u003e build without specified algorithm (rsa, idea, rc5, ...)\n# -\u003cxxx\u003e +\u003cxxx\u003e compiler options are passed through\n# -static while -static is also a pass-through compiler option (and\n# as such is limited to environments where it's actually\n# meaningful), it triggers a number configuration options,\n# namely no-dso, no-pic, no-shared and no-threads. It is\n# argued that the only reason to produce statically linked\n# binaries (and in context it means executables linked with\n# -static flag, and not just executables linked with static\n# libcrypto.a) is to eliminate dependency on specific run-time,\n# a.k.a. libc version. The mentioned config options are meant\n# to achieve just that. Unfortunately on Linux it's impossible\n# to eliminate the dependency completely for openssl executable\n# because of getaddrinfo and gethostbyname calls, which can\n# invoke dynamically loadable library facility anyway to meet\n# the lookup requests. For this reason on Linux statically\n# linked openssl executable has rather debugging value than\n# production quality.\n#\n# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items\n#\t\tprovided to stack calls. Generates unique stack functions for\n#\t\teach possible stack type.\n# BN_LLONG\tuse the type 'long long' in crypto/bn/bn.h\n# RC4_CHAR\tuse 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h\n# Following are set automatically by this script\n#\n# MD5_ASM\tuse some extra md5 assembler,\n# SHA1_ASM\tuse some extra sha1 assembler, must define L_ENDIAN for x86\n# RMD160_ASM\tuse some extra ripemd160 assembler,\n# SHA256_ASM\tsha256_block is implemented in assembler\n# SHA512_ASM\tsha512_block is implemented in assembler\n# AES_ASM\tAES_[en|de]crypt is implemented in assembler\n\n# Minimum warning options... any contributions to OpenSSL should at least get\n# past these.\n\n# DEBUG_UNUSED enables __owur (warn unused result) checks.\n# -DPEDANTIC complements -pedantic and is meant to mask code that\n# is not strictly standard-compliant and/or implementation-specific,\n# e.g. inline assembly, disregards to alignment requirements, such\n# that -pedantic would complain about. Incidentally -DPEDANTIC has\n# to be used even in sanitized builds, because sanitizer too is\n# supposed to and does take notice of non-standard behaviour. Then\n# -pedantic with pre-C9x compiler would also complain about 'long\n# long' not being supported. As 64-bit algorithms are common now,\n# it grew impossible to resolve this without sizeable additional\n# code, so we just tell compiler to be pedantic about everything\n# but 'long long' type.\n\nmy $gcc_devteam_warn \u003d \u0022-DDEBUG_UNUSED\u0022\n . \u0022 -DPEDANTIC -pedantic -Wno-long-long\u0022\n . \u0022 -Wall\u0022\n . \u0022 -Wextra\u0022\n . \u0022 -Wno-unused-parameter\u0022\n . \u0022 -Wno-missing-field-initializers\u0022\n . \u0022 -Wswitch\u0022\n . \u0022 -Wsign-compare\u0022\n . \u0022 -Wmissing-prototypes\u0022\n . \u0022 -Wshadow\u0022\n . \u0022 -Wformat\u0022\n . \u0022 -Wtype-limits\u0022\n . \u0022 -Wundef\u0022\n . \u0022 -Werror\u0022\n ;\n\n# These are used in addition to $gcc_devteam_warn when the compiler is clang.\n# TODO(openssl-team): fix problems and investigate if (at least) the\n# following warnings can also be enabled:\n# -Wcast-align\n# -Wunreachable-code -- no, too ugly/compiler-specific\n# -Wlanguage-extension-token -- no, we use asm()\n# -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc\n# -Wextended-offsetof -- no, needed in CMS ASN1 code\nmy $clang_devteam_warn \u003d \u0022\u0022\n . \u0022 -Wswitch-default\u0022\n . \u0022 -Wno-parentheses-equality\u0022\n . \u0022 -Wno-language-extension-token\u0022\n . \u0022 -Wno-extended-offsetof\u0022\n . \u0022 -Wconditional-uninitialized\u0022\n . \u0022 -Wincompatible-pointer-types-discards-qualifiers\u0022\n . \u0022 -Wmissing-variable-declarations\u0022\n . \u0022 -Wno-unknown-warning-option\u0022\n ;\n\n# This adds backtrace information to the memory leak info. Is only used\n# when crypto-mdebug-backtrace is enabled.\nmy $memleak_devteam_backtrace \u003d \u0022-rdynamic\u0022;\n\nmy $strict_warnings \u003d 0;\n\n# As for $BSDthreads. Idea is to maintain \u0022collective\u0022 set of flags,\n# which would cover all BSD flavors. -pthread applies to them all,\n# but is treated differently. OpenBSD expands is as -D_POSIX_THREAD\n# -lc_r, which is sufficient. FreeBSD 4.x expands it as -lc_r,\n# which has to be accompanied by explicit -D_THREAD_SAFE and\n# sometimes -D_REENTRANT. FreeBSD 5.x expands it as -lc_r, which\n# seems to be sufficient?\nour $BSDthreads\u003d\u0022-pthread -D_THREAD_SAFE -D_REENTRANT\u0022;\n\n#\n# API compatibility name to version number mapping.\n#\nmy $maxapi \u003d \u00221.1.0\u0022; # API for \u0022no-deprecated\u0022 builds\nmy $apitable \u003d {\n \u00221.1.0\u0022 \u003d\u003e \u00220x10100000L\u0022,\n \u00221.0.0\u0022 \u003d\u003e \u00220x10000000L\u0022,\n \u00220.9.8\u0022 \u003d\u003e \u00220x00908000L\u0022,\n};\n\nour %table \u003d ();\nour %config \u003d ();\nour %withargs \u003d ();\n\n# Forward declarations ###############################################\n\n# read_config(filename)\n#\n# Reads a configuration file and populates %table with the contents\n# (which the configuration file places in %targets).\nsub read_config;\n\n# resolve_config(target)\n#\n# Resolves all the late evaluations, inheritances and so on for the\n# chosen target and any target it inherits from.\nsub resolve_config;\n\n\n# Information collection #############################################\n\n# Unified build supports separate build dir\nmy $srcdir \u003d catdir(absolutedir(dirname($0))); # catdir ensures local syntax\nmy $blddir \u003d catdir(absolutedir(\u0022.\u0022)); # catdir ensures local syntax\nmy $dofile \u003d abs2rel(catfile($srcdir, \u0022util/dofile.pl\u0022));\n\nmy $local_config_envname \u003d 'OPENSSL_LOCAL_CONFIG_DIR';\n\n$config{sourcedir} \u003d abs2rel($srcdir);\n$config{builddir} \u003d abs2rel($blddir);\n\n# Collect reconfiguration information if needed\nmy @argvcopy\u003d@ARGV;\n\nif (grep /^reconf(igure)?$/, @argvcopy) {\n if (-f \u0022./configdata.pm\u0022) {\n\tmy $file \u003d \u0022./configdata.pm\u0022;\n\tunless (my $return \u003d do $file) {\n\t die \u0022couldn't parse $file: $@\u0022 if $@;\n die \u0022couldn't do $file: $!\u0022 unless defined $return;\n die \u0022couldn't run $file\u0022 unless $return;\n\t}\n\n\t@argvcopy \u003d defined($configdata::config{perlargv}) ?\n\t @{$configdata::config{perlargv}} : ();\n\tdie \u0022Incorrect data to reconfigure, please do a normal configuration\u005cn\u0022\n\t if (grep(/^reconf/,@argvcopy));\n\t$ENV{CROSS_COMPILE} \u003d $configdata::config{cross_compile_prefix}\n\t if defined($configdata::config{cross_compile_prefix});\n\t$ENV{CC} \u003d $configdata::config{cc}\n\t if defined($configdata::config{cc});\n\t$ENV{CXX} \u003d $configdata::config{cxx}\n\t if defined($configdata::config{cxx});\n\t$ENV{BUILDFILE} \u003d $configdata::config{build_file}\n\t if defined($configdata::config{build_file});\n\t$ENV{$local_config_envname} \u003d $configdata::config{local_config_dir}\n\t if defined($configdata::config{local_config_dir});\n\n\tprint \u0022Reconfiguring with: \u0022, join(\u0022 \u0022,@argvcopy), \u0022\u005cn\u0022;\n\tprint \u0022 CROSS_COMPILE \u003d \u0022,$ENV{CROSS_COMPILE},\u0022\u005cn\u0022\n\t if $ENV{CROSS_COMPILE};\n\tprint \u0022 CC \u003d \u0022,$ENV{CC},\u0022\u005cn\u0022 if $ENV{CC};\n\tprint \u0022 CXX \u003d \u0022,$ENV{CXX},\u0022\u005cn\u0022 if $ENV{CXX};\n\tprint \u0022 BUILDFILE \u003d \u0022,$ENV{BUILDFILE},\u0022\u005cn\u0022 if $ENV{BUILDFILE};\n\tprint \u0022 $local_config_envname \u003d \u0022,$ENV{$local_config_envname},\u0022\u005cn\u0022\n\t if $ENV{$local_config_envname};\n } else {\n\tdie \u0022Insufficient data to reconfigure, please do a normal configuration\u005cn\u0022;\n }\n}\n\n$config{perlargv} \u003d [ @argvcopy ];\n\n# Collect version numbers\n$config{version} \u003d \u0022unknown\u0022;\n$config{version_num} \u003d \u0022unknown\u0022;\n$config{shlib_version_number} \u003d \u0022unknown\u0022;\n$config{shlib_version_history} \u003d \u0022unknown\u0022;\n\ncollect_information(\n collect_from_file(catfile($srcdir,'include/openssl/opensslv.h')),\n qr/OPENSSL.VERSION.TEXT.*OpenSSL (\u005cS+) / \u003d\u003e sub { $config{version} \u003d $1; },\n qr/OPENSSL.VERSION.NUMBER.*(0x\u005cS+)/\t \u003d\u003e sub { $config{version_num}\u003d$1 },\n qr/SHLIB_VERSION_NUMBER *\u0022([^\u0022]+)\u0022/\t \u003d\u003e sub { $config{shlib_version_number}\u003d$1 },\n qr/SHLIB_VERSION_HISTORY *\u0022([^\u0022]*)\u0022/ \u003d\u003e sub { $config{shlib_version_history}\u003d$1 }\n );\nif ($config{shlib_version_history} ne \u0022\u0022) { $config{shlib_version_history} .\u003d \u0022:\u0022; }\n\n($config{major}, $config{minor})\n \u003d ($config{version} \u003d~ /^([0-9]+)\u005c.([0-9\u005c.]+)/);\n($config{shlib_major}, $config{shlib_minor})\n \u003d ($config{shlib_version_number} \u003d~ /^([0-9]+)\u005c.([0-9\u005c.]+)/);\ndie \u0022erroneous version information in opensslv.h: \u0022,\n \u0022$config{major}, $config{minor}, $config{shlib_major}, $config{shlib_minor}\u005cn\u0022\n if ($config{major} eq \u0022\u0022 || $config{minor} eq \u0022\u0022\n\t|| $config{shlib_major} eq \u0022\u0022 || $config{shlib_minor} eq \u0022\u0022);\n\n# Collect target configurations\n\nmy $pattern \u003d catfile(dirname($0), \u0022Configurations\u0022, \u0022*.conf\u0022);\nforeach (sort glob($pattern)) {\n \u0026read_config($_);\n}\n\nif (defined $ENV{$local_config_envname}) {\n if ($^O eq 'VMS') {\n # VMS environment variables are logical names,\n # which can be used as is\n $pattern \u003d $local_config_envname . ':' . '*.conf';\n } else {\n $pattern \u003d catfile($ENV{$local_config_envname}, '*.conf');\n }\n\n foreach (sort glob($pattern)) {\n \u0026read_config($_);\n }\n}\n\n$config{prefix}\u003d\u0022\u0022;\n$config{openssldir}\u003d\u0022\u0022;\n$config{processor}\u003d\u0022\u0022;\n$config{libdir}\u003d\u0022\u0022;\n$config{cross_compile_prefix}\u003d\u0022\u0022;\nmy $auto_threads\u003d1; # enable threads automatically? true by default\nmy $default_ranlib;\n\n# Top level directories to build\n$config{dirs} \u003d [ \u0022crypto\u0022, \u0022ssl\u0022, \u0022engines\u0022, \u0022apps\u0022, \u0022test\u0022, \u0022util\u0022, \u0022tools\u0022, \u0022fuzz\u0022 ];\n# crypto/ subdirectories to build\n$config{sdirs} \u003d [\n \u0022objects\u0022,\n \u0022md2\u0022, \u0022md4\u0022, \u0022md5\u0022, \u0022sha\u0022, \u0022mdc2\u0022, \u0022hmac\u0022, \u0022ripemd\u0022, \u0022whrlpool\u0022, \u0022poly1305\u0022, \u0022blake2\u0022, \u0022siphash\u0022,\n \u0022des\u0022, \u0022aes\u0022, \u0022rc2\u0022, \u0022rc4\u0022, \u0022rc5\u0022, \u0022idea\u0022, \u0022aria\u0022, \u0022bf\u0022, \u0022cast\u0022, \u0022camellia\u0022, \u0022seed\u0022, \u0022chacha\u0022, \u0022modes\u0022,\n \u0022bn\u0022, \u0022ec\u0022, \u0022rsa\u0022, \u0022dsa\u0022, \u0022dh\u0022, \u0022dso\u0022, \u0022engine\u0022,\n \u0022buffer\u0022, \u0022bio\u0022, \u0022stack\u0022, \u0022lhash\u0022, \u0022rand\u0022, \u0022err\u0022,\n \u0022evp\u0022, \u0022asn1\u0022, \u0022pem\u0022, \u0022x509\u0022, \u0022x509v3\u0022, \u0022conf\u0022, \u0022txt_db\u0022, \u0022pkcs7\u0022, \u0022pkcs12\u0022, \u0022comp\u0022, \u0022ocsp\u0022, \u0022ui\u0022,\n \u0022cms\u0022, \u0022ts\u0022, \u0022srp\u0022, \u0022cmac\u0022, \u0022ct\u0022, \u0022async\u0022, \u0022kdf\u0022, \u0022store\u0022\n ];\n# test/ subdirectories to build\n$config{tdirs} \u003d [ \u0022ossl_shim\u0022 ];\n\n# Known TLS and DTLS protocols\nmy @tls \u003d qw(ssl3 tls1 tls1_1 tls1_2 tls1_3);\nmy @dtls \u003d qw(dtls1 dtls1_2);\n\n# Explicitly known options that are possible to disable. They can\n# be regexps, and will be used like this: /^no-${option}$/\n# For developers: keep it sorted alphabetically\n\nmy @disablables \u003d (\n \u0022afalgeng\u0022,\n \u0022aria\u0022,\n \u0022asan\u0022,\n \u0022asm\u0022,\n \u0022async\u0022,\n \u0022autoalginit\u0022,\n \u0022autoerrinit\u0022,\n \u0022bf\u0022,\n \u0022blake2\u0022,\n \u0022camellia\u0022,\n \u0022capieng\u0022,\n \u0022cast\u0022,\n \u0022chacha\u0022,\n \u0022cmac\u0022,\n \u0022cms\u0022,\n \u0022comp\u0022,\n \u0022crypto-mdebug\u0022,\n \u0022crypto-mdebug-backtrace\u0022,\n \u0022ct\u0022,\n \u0022deprecated\u0022,\n \u0022des\u0022,\n \u0022devcryptoeng\u0022,\n \u0022dgram\u0022,\n \u0022dh\u0022,\n \u0022dsa\u0022,\n \u0022dso\u0022,\n \u0022dtls\u0022,\n \u0022dynamic-engine\u0022,\n \u0022ec\u0022,\n \u0022ec2m\u0022,\n \u0022ecdh\u0022,\n \u0022ecdsa\u0022,\n \u0022ec_nistp_64_gcc_128\u0022,\n \u0022egd\u0022,\n \u0022engine\u0022,\n \u0022err\u0022,\n \u0022external-tests\u0022,\n \u0022filenames\u0022,\n \u0022fuzz-libfuzzer\u0022,\n \u0022fuzz-afl\u0022,\n \u0022gost\u0022,\n \u0022heartbeats\u0022,\n \u0022hw(-.+)?\u0022,\n \u0022idea\u0022,\n \u0022makedepend\u0022,\n \u0022md2\u0022,\n \u0022md4\u0022,\n \u0022mdc2\u0022,\n \u0022msan\u0022,\n \u0022multiblock\u0022,\n \u0022nextprotoneg\u0022,\n \u0022ocb\u0022,\n \u0022ocsp\u0022,\n \u0022pic\u0022,\n \u0022poly1305\u0022,\n \u0022posix-io\u0022,\n \u0022psk\u0022,\n \u0022rc2\u0022,\n \u0022rc4\u0022,\n \u0022rc5\u0022,\n \u0022rdrand\u0022,\n \u0022rfc3779\u0022,\n \u0022rmd160\u0022,\n \u0022scrypt\u0022,\n \u0022sctp\u0022,\n \u0022seed\u0022,\n \u0022shared\u0022,\n \u0022siphash\u0022,\n \u0022sock\u0022,\n \u0022srp\u0022,\n \u0022srtp\u0022,\n \u0022sse2\u0022,\n \u0022ssl\u0022,\n \u0022ssl-trace\u0022,\n \u0022static-engine\u0022,\n \u0022stdio\u0022,\n \u0022tests\u0022,\n \u0022threads\u0022,\n \u0022tls\u0022,\n \u0022tls13downgrade\u0022,\n \u0022ts\u0022,\n \u0022ubsan\u0022,\n \u0022ui-console\u0022,\n \u0022unit-test\u0022,\n \u0022whirlpool\u0022,\n \u0022weak-ssl-ciphers\u0022,\n \u0022zlib\u0022,\n \u0022zlib-dynamic\u0022,\n );\nforeach my $proto ((@tls, @dtls))\n\t{\n\tpush(@disablables, $proto);\n\tpush(@disablables, \u0022$proto-method\u0022) unless $proto eq \u0022tls1_3\u0022;\n\t}\n\nmy %deprecated_disablables \u003d (\n \u0022ssl2\u0022 \u003d\u003e undef,\n \u0022buf-freelists\u0022 \u003d\u003e undef,\n \u0022ripemd\u0022 \u003d\u003e \u0022rmd160\u0022,\n \u0022ui\u0022 \u003d\u003e \u0022ui-console\u0022,\n );\n\n# All of the following is disabled by default (RC5 was enabled before 0.9.8):\n\nour %disabled \u003d ( # \u0022what\u0022 \u003d\u003e \u0022comment\u0022\n \u0022aria\u0022 \u003d\u003e \u0022default\u0022,\n \u0022asan\u0022\t\t\u003d\u003e \u0022default\u0022,\n\t\t \u0022crypto-mdebug\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022crypto-mdebug-backtrace\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022devcryptoeng\u0022\t\u003d\u003e \u0022default\u0022,\n\t\t \u0022ec_nistp_64_gcc_128\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022egd\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022external-tests\u0022\t\u003d\u003e \u0022default\u0022,\n\t\t \u0022fuzz-libfuzzer\u0022\t\u003d\u003e \u0022default\u0022,\n\t\t \u0022fuzz-afl\u0022\t\t\u003d\u003e \u0022default\u0022,\n\t\t \u0022heartbeats\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022md2\u0022 \u003d\u003e \u0022default\u0022,\n \u0022msan\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022rc5\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022sctp\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022ssl-trace\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022ssl3\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022ssl3-method\u0022 \u003d\u003e \u0022default\u0022,\n \u0022ubsan\u0022\t\t\u003d\u003e \u0022default\u0022,\n #TODO(TLS1.3): Temporarily disabled while this is a WIP\n\t\t \u0022tls1_3\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022tls13downgrade\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022unit-test\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022weak-ssl-ciphers\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022zlib\u0022 \u003d\u003e \u0022default\u0022,\n\t\t \u0022zlib-dynamic\u0022 \u003d\u003e \u0022default\u0022,\n\t\t);\n\n# Note: \u003d\u003e pair form used for aesthetics, not to truly make a hash table\nmy @disable_cascades \u003d (\n # \u0022what\u0022\t\t\u003d\u003e [ \u0022cascade\u0022, ... ]\n sub { $config{processor} eq \u0022386\u0022 }\n\t\t\t\u003d\u003e [ \u0022sse2\u0022 ],\n \u0022ssl\u0022\t\t\u003d\u003e [ \u0022ssl3\u0022 ],\n \u0022ssl3-method\u0022\t\u003d\u003e [ \u0022ssl3\u0022 ],\n \u0022zlib\u0022\t\t\u003d\u003e [ \u0022zlib-dynamic\u0022 ],\n \u0022des\u0022\t\t\u003d\u003e [ \u0022mdc2\u0022 ],\n \u0022ec\u0022\t\t\u003d\u003e [ \u0022ecdsa\u0022, \u0022ecdh\u0022 ],\n\n \u0022dgram\u0022\t\t\u003d\u003e [ \u0022dtls\u0022, \u0022sctp\u0022 ],\n \u0022sock\u0022\t\t\u003d\u003e [ \u0022dgram\u0022 ],\n \u0022dtls\u0022\t\t\u003d\u003e [ @dtls ],\n sub { 0 \u003d\u003d scalar grep { !$disabled{$_} } @dtls }\n\t\t\t\u003d\u003e [ \u0022dtls\u0022 ],\n\n # SSL 3.0, (D)TLS 1.0 and TLS 1.1 require MD5 and SHA\n \u0022md5\u0022\t\t\u003d\u003e [ \u0022ssl\u0022, \u0022tls1\u0022, \u0022tls1_1\u0022, \u0022dtls1\u0022 ],\n \u0022sha\u0022\t\t\u003d\u003e [ \u0022ssl\u0022, \u0022tls1\u0022, \u0022tls1_1\u0022, \u0022dtls1\u0022 ],\n\n # Additionally, SSL 3.0 requires either RSA or DSA+DH\n sub { $disabled{rsa}\n\t \u0026\u0026 ($disabled{dsa} || $disabled{dh}); }\n\t\t\t\u003d\u003e [ \u0022ssl\u0022 ],\n\n # (D)TLS 1.0 and TLS 1.1 also require either RSA or DSA+DH\n # or ECDSA + ECDH. (D)TLS 1.2 has this requirement as well.\n # (XXX: We don't support PSK-only builds).\n sub { $disabled{rsa}\n\t \u0026\u0026 ($disabled{dsa} || $disabled{dh})\n\t \u0026\u0026 ($disabled{ecdsa} || $disabled{ecdh}); }\n\t\t\t\u003d\u003e [ \u0022tls1\u0022, \u0022tls1_1\u0022, \u0022tls1_2\u0022, \u0022tls1_3\u0022,\n\t\t\t \u0022dtls1\u0022, \u0022dtls1_2\u0022 ],\n\n \u0022tls\u0022\t\t\u003d\u003e [ @tls ],\n sub { 0 \u003d\u003d scalar grep { !$disabled{$_} } @tls }\n\t\t\t\u003d\u003e [ \u0022tls\u0022 ],\n\n # SRP and HEARTBEATS require TLSEXT\n \u0022tlsext\u0022\t\t\u003d\u003e [ \u0022srp\u0022, \u0022heartbeats\u0022 ],\n\n \u0022crypto-mdebug\u0022 \u003d\u003e [ \u0022crypto-mdebug-backtrace\u0022 ],\n\n # Without DSO, we can't load dynamic engines, so don't build them dynamic\n \u0022dso\u0022 \u003d\u003e [ \u0022dynamic-engine\u0022 ],\n\n # Without position independent code, there can be no shared libraries or DSOs\n \u0022pic\u0022 \u003d\u003e [ \u0022shared\u0022 ],\n \u0022shared\u0022 \u003d\u003e [ \u0022dynamic-engine\u0022 ],\n \u0022engine\u0022 \u003d\u003e [ \u0022afalgeng\u0022, \u0022devcryptoeng\u0022 ],\n\n # no-autoalginit is only useful when building non-shared\n \u0022autoalginit\u0022 \u003d\u003e [ \u0022shared\u0022, \u0022apps\u0022 ],\n\n \u0022stdio\u0022 \u003d\u003e [ \u0022apps\u0022, \u0022capieng\u0022, \u0022egd\u0022 ],\n \u0022apps\u0022 \u003d\u003e [ \u0022tests\u0022 ],\n \u0022tests\u0022 \u003d\u003e [ \u0022external-tests\u0022 ],\n \u0022comp\u0022 \u003d\u003e [ \u0022zlib\u0022 ],\n \u0022ec\u0022 \u003d\u003e [ \u0022tls1_3\u0022 ],\n sub { !$disabled{\u0022unit-test\u0022} } \u003d\u003e [ \u0022heartbeats\u0022 ],\n\n sub { !$disabled{\u0022msan\u0022} } \u003d\u003e [ \u0022asm\u0022 ],\n );\n\n# Avoid protocol support holes. Also disable all versions below N, if version\n# N is disabled while N+1 is enabled.\n#\nmy @list \u003d (reverse @tls);\nwhile ((my $first, my $second) \u003d (shift @list, shift @list)) {\n last unless @list;\n push @disable_cascades, ( sub { !$disabled{$first} \u0026\u0026 $disabled{$second} }\n\t\t\t \u003d\u003e [ @list ] );\n unshift @list, $second;\n}\nmy @list \u003d (reverse @dtls);\nwhile ((my $first, my $second) \u003d (shift @list, shift @list)) {\n last unless @list;\n push @disable_cascades, ( sub { !$disabled{$first} \u0026\u0026 $disabled{$second} }\n\t\t\t \u003d\u003e [ @list ] );\n unshift @list, $second;\n}\n\n# Explicit \u0022no-...\u0022 options will be collected in %disabled along with the defaults.\n# To remove something from %disabled, use \u0022enable-foo\u0022.\n# For symmetry, \u0022disable-foo\u0022 is a synonym for \u0022no-foo\u0022.\n\nmy $no_sse2\u003d0;\n\n\u0026usage if ($#ARGV \u003c 0);\n\nmy $user_cflags\u003d\u0022\u0022;\nmy @user_defines\u003d();\n$config{openssl_api_defines}\u003d[];\n$config{openssl_algorithm_defines}\u003d[];\n$config{openssl_thread_defines}\u003d[];\n$config{openssl_sys_defines}\u003d[];\n$config{openssl_other_defines}\u003d[];\nmy $libs\u003d\u0022\u0022;\nmy $target\u003d\u0022\u0022;\n$config{options}\u003d\u0022\u0022;\n$config{build_type} \u003d \u0022release\u0022;\n\nmy %unsupported_options \u003d ();\nmy %deprecated_options \u003d ();\n# If you change this, update apps/version.c\nmy @known_seed_sources \u003d qw(getrandom devrandom os egd none rdcpu librandom);\nmy @seed_sources \u003d ();\nwhile (@argvcopy)\n\t{\n\t$_ \u003d shift @argvcopy;\n\t# VMS is a case insensitive environment, and depending on settings\n\t# out of our control, we may receive options uppercased. Let's\n\t# downcase at least the part before any equal sign.\n\tif ($^O eq \u0022VMS\u0022)\n\t\t{\n\t\ts/^([^\u003d]*)/lc($1)/e;\n\t\t}\n\ts /^-no-/no-/; # some people just can't read the instructions\n\n\t# rewrite some options in \u0022enable-...\u0022 form\n\ts /^-?-?shared$/enable-shared/;\n\ts /^sctp$/enable-sctp/;\n\ts /^threads$/enable-threads/;\n\ts /^zlib$/enable-zlib/;\n\ts /^zlib-dynamic$/enable-zlib-dynamic/;\n\n if (/^(no|disable|enable)-(.+)$/)\n {\n my $word \u003d $2;\n if (!exists $deprecated_disablables{$word}\n \u0026\u0026 !grep { $word \u003d~ /^${_}$/ } @disablables)\n {\n $unsupported_options{$_} \u003d 1;\n next;\n }\n }\n if (/^no-(.+)$/ || /^disable-(.+)$/)\n {\n foreach my $proto ((@tls, @dtls))\n {\n if ($1 eq \u0022$proto-method\u0022)\n {\n $disabled{\u0022$proto\u0022} \u003d \u0022option($proto-method)\u0022;\n last;\n }\n }\n if ($1 eq \u0022dtls\u0022)\n {\n foreach my $proto (@dtls)\n {\n $disabled{$proto} \u003d \u0022option(dtls)\u0022;\n }\n $disabled{\u0022dtls\u0022} \u003d \u0022option(dtls)\u0022;\n }\n elsif ($1 eq \u0022ssl\u0022)\n {\n # Last one of its kind\n $disabled{\u0022ssl3\u0022} \u003d \u0022option(ssl)\u0022;\n }\n elsif ($1 eq \u0022tls\u0022)\n {\n # XXX: Tests will fail if all SSL/TLS\n # protocols are disabled.\n foreach my $proto (@tls)\n {\n $disabled{$proto} \u003d \u0022option(tls)\u0022;\n }\n }\n elsif ($1 eq \u0022static-engine\u0022)\n {\n delete $disabled{\u0022dynamic-engine\u0022};\n }\n elsif ($1 eq \u0022dynamic-engine\u0022)\n {\n $disabled{\u0022dynamic-engine\u0022} \u003d \u0022option\u0022;\n }\n elsif (exists $deprecated_disablables{$1})\n {\n $deprecated_options{$_} \u003d 1;\n if (defined $deprecated_disablables{$1})\n {\n $disabled{$deprecated_disablables{$1}} \u003d \u0022option\u0022;\n }\n }\n else\n {\n $disabled{$1} \u003d \u0022option\u0022;\n }\n\t\t# No longer an automatic choice\n\t\t$auto_threads \u003d 0 if ($1 eq \u0022threads\u0022);\n\t\t}\n\telsif (/^enable-(.+)$/)\n\t\t{\n if ($1 eq \u0022static-engine\u0022)\n {\n $disabled{\u0022dynamic-engine\u0022} \u003d \u0022option\u0022;\n }\n elsif ($1 eq \u0022dynamic-engine\u0022)\n {\n delete $disabled{\u0022dynamic-engine\u0022};\n }\n elsif ($1 eq \u0022zlib-dynamic\u0022)\n {\n delete $disabled{\u0022zlib\u0022};\n }\n\t\tmy $algo \u003d $1;\n\t\tdelete $disabled{$algo};\n\n\t\t# No longer an automatic choice\n\t\t$auto_threads \u003d 0 if ($1 eq \u0022threads\u0022);\n\t\t}\n\telsif (/^--strict-warnings$/)\n\t\t{\n\t\t$strict_warnings \u003d 1;\n\t\t}\n\telsif (/^--debug$/)\n\t\t{\n\t\t$config{build_type} \u003d \u0022debug\u0022;\n\t\t}\n\telsif (/^--release$/)\n\t\t{\n\t\t$config{build_type} \u003d \u0022release\u0022;\n\t\t}\n\telsif (/^386$/)\n\t\t{ $config{processor}\u003d386; }\n\telsif (/^fips$/)\n\t\t{\n\t\tdie \u0022FIPS mode not supported\u005cn\u0022;\n\t\t}\n\telsif (/^rsaref$/)\n\t\t{\n\t\t# No RSAref support any more since it's not needed.\n\t\t# The check for the option is there so scripts aren't\n\t\t# broken\n\t\t}\n\telsif (/^nofipscanistercheck$/)\n\t\t{\n\t\tdie \u0022FIPS mode not supported\u005cn\u0022;\n\t\t}\n\telsif (/^[-+]/)\n\t\t{\n\t\tif (/^--prefix\u003d(.*)$/)\n\t\t\t{\n\t\t\t$config{prefix}\u003d$1;\n\t\t\tdie \u0022Directory given with --prefix MUST be absolute\u005cn\u0022\n\t\t\t\tunless file_name_is_absolute($config{prefix});\n\t\t\t}\n\t\telsif (/^--api\u003d(.*)$/)\n\t\t\t{\n\t\t\t$config{api}\u003d$1;\n\t\t\t}\n\t\telsif (/^--libdir\u003d(.*)$/)\n\t\t\t{\n\t\t\t$config{libdir}\u003d$1;\n\t\t\t}\n\t\telsif (/^--openssldir\u003d(.*)$/)\n\t\t\t{\n\t\t\t$config{openssldir}\u003d$1;\n\t\t\t}\n\t\telsif (/^--with-zlib-lib\u003d(.*)$/)\n\t\t\t{\n\t\t\t$withargs{zlib_lib}\u003d$1;\n\t\t\t}\n\t\telsif (/^--with-zlib-include\u003d(.*)$/)\n\t\t\t{\n\t\t\t$withargs{zlib_include}\u003d$1;\n\t\t\t}\n\t\telsif (/^--with-fuzzer-lib\u003d(.*)$/)\n\t\t\t{\n\t\t\t$withargs{fuzzer_lib}\u003d$1;\n\t\t\t}\n\t\telsif (/^--with-fuzzer-include\u003d(.*)$/)\n\t\t\t{\n\t\t\t$withargs{fuzzer_include}\u003d$1;\n\t\t\t}\n\t\telsif (/^--with-rand-seed\u003d(.*)$/)\n\t\t\t{\n\t\t\tforeach my $x (split(m|,|, $1))\n\t\t\t {\n\t\t\t die \u0022Unknown --with-rand-seed choice $x\u005cn\u0022\n\t\t\t\tif ! grep { $x eq $_ } @known_seed_sources;\n\t\t\t push @seed_sources, $x;\n\t\t\t }\n }\n\t\telsif (/^--cross-compile-prefix\u003d(.*)$/)\n\t\t\t{\n\t\t\t$config{cross_compile_prefix}\u003d$1;\n\t\t\t}\n\t\telsif (/^--config\u003d(.*)$/)\n\t\t\t{\n\t\t\tread_config $1;\n\t\t\t}\n\t\telsif (/^-[lL](.*)$/ or /^-Wl,/)\n\t\t\t{\n\t\t\t$libs.\u003d$_.\u0022 \u0022;\n\t\t\t}\n\t\telsif (/^-framework$/)\n\t\t\t{\n\t\t\t$libs.\u003d$_.\u0022 \u0022.shift(@argvcopy).\u0022 \u0022;\n\t\t\t}\n\t\telsif (/^-rpath$/ or /^-R$/)\n\t\t\t# -rpath is the OSF1 rpath flag\n\t\t\t# -R is the old Solaris rpath flag\n\t\t\t{\n\t\t\tmy $rpath \u003d shift(@argvcopy) || \u0022\u0022;\n\t\t\t$rpath .\u003d \u0022 \u0022 if $rpath ne \u0022\u0022;\n\t\t\t$libs.\u003d$_.\u0022 \u0022.$rpath;\n\t\t\t}\n\t\telsif (/^-static$/)\n\t\t\t{\n\t\t\t$libs.\u003d$_.\u0022 \u0022;\n\t\t\t$disabled{\u0022dso\u0022} \u003d \u0022forced\u0022;\n\t\t\t$disabled{\u0022pic\u0022} \u003d \u0022forced\u0022;\n\t\t\t$disabled{\u0022shared\u0022} \u003d \u0022forced\u0022;\n\t\t\t$disabled{\u0022threads\u0022} \u003d \u0022forced\u0022;\n\t\t\t}\n\t\telsif (/^-D(.*)$/)\n\t\t\t{\n\t\t\tpush @user_defines, $1;\n\t\t\t}\n\t\telse\t# common if (/^[-+]/), just pass down...\n\t\t\t{\n\t\t\t$_ \u003d~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;\n\t\t\t$user_cflags.\u003d\u0022 \u0022.$_;\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\tdie \u0022target already defined - $target (offending arg: $_)\u005cn\u0022 if ($target ne \u0022\u0022);\n\t\t$target\u003d$_;\n\t\t}\n\tunless ($_ eq $target || /^no-/ || /^disable-/)\n\t\t{\n\t\t# \u0022no-...\u0022 follows later after implied disactivations\n\t\t# have been derived. (Don't take this too seriously,\n\t\t# we really only write OPTIONS to the Makefile out of\n\t\t# nostalgia.)\n\n\t\tif ($config{options} eq \u0022\u0022)\n\t\t\t{ $config{options} \u003d $_; }\n\t\telse\n\t\t\t{ $config{options} .\u003d \u0022 \u0022.$_; }\n\t\t}\n\n if (defined($config{api}) \u0026\u0026 !exists $apitable-\u003e{$config{api}}) {\n\t\tdie \u0022***** Unsupported api compatibility level: $config{api}\u005cn\u0022,\n }\n\n\tif (keys %deprecated_options)\n\t\t{\n\t\twarn \u0022***** Deprecated options: \u0022,\n\t\t\tjoin(\u0022, \u0022, keys %deprecated_options), \u0022\u005cn\u0022;\n\t\t}\n\tif (keys %unsupported_options)\n\t\t{\n\t\tdie \u0022***** Unsupported options: \u0022,\n\t\t\tjoin(\u0022, \u0022, keys %unsupported_options), \u0022\u005cn\u0022;\n\t\t}\n\t}\n\nif ($libs \u003d~ /(^|\u005cs)-Wl,-rpath,/\n \u0026\u0026 !$disabled{shared}\n \u0026\u0026 !($disabled{asan} \u0026\u0026 $disabled{msan} \u0026\u0026 $disabled{ubsan})) {\n die \u0022***** Cannot simultaneously use -rpath, shared libraries, and\u005cn\u0022,\n\t\u0022***** any of asan, msan or ubsan\u005cn\u0022;\n}\n\nif (scalar(@seed_sources) \u003d\u003d 0) {\n print \u0022Using implicit seed configuration\u005cn\u0022;\n push @seed_sources, 'os';\n}\ndie \u0022Cannot seed with none and anything else\u0022\n if scalar(grep { $_ eq 'none' } @seed_sources) \u003e 0\n \u0026\u0026 scalar(@seed_sources) \u003e 1;\npush @{$config{openssl_other_defines}},\n map { (my $x \u003d $_) \u003d~ tr|[\u005c-a-z]|[_A-Z]|; \u0022OPENSSL_RAND_SEED_$x\u0022 }\n\t@seed_sources;\n\nmy @tocheckfor \u003d (keys %disabled);\nwhile (@tocheckfor) {\n my %new_tocheckfor \u003d ();\n my @cascade_copy \u003d (@disable_cascades);\n while (@cascade_copy) {\n\tmy ($test, $descendents) \u003d (shift @cascade_copy, shift @cascade_copy);\n\tif (ref($test) eq \u0022CODE\u0022 ? $test-\u003e() : defined($disabled{$test})) {\n\t foreach(grep { !defined($disabled{$_}) } @$descendents) {\n\t\t$new_tocheckfor{$_} \u003d 1; $disabled{$_} \u003d \u0022forced\u0022;\n\t }\n\t}\n }\n @tocheckfor \u003d (keys %new_tocheckfor);\n}\n\nour $die \u003d sub { die @_; };\nif ($target eq \u0022TABLE\u0022) {\n local $die \u003d sub { warn @_; };\n foreach (sort keys %table) {\n\tprint_table_entry($_, \u0022TABLE\u0022);\n }\n exit 0;\n}\n\nif ($target eq \u0022LIST\u0022) {\n foreach (sort keys %table) {\n\tprint $_,\u0022\u005cn\u0022 unless $table{$_}-\u003e{template};\n }\n exit 0;\n}\n\nif ($target eq \u0022HASH\u0022) {\n local $die \u003d sub { warn @_; };\n print \u0022%table \u003d (\u005cn\u0022;\n foreach (sort keys %table) {\n\tprint_table_entry($_, \u0022HASH\u0022);\n }\n exit 0;\n}\n\nprint \u0022Configuring OpenSSL version $config{version} ($config{version_num})\u005cn\u0022;\nprint \u0022for $target\u005cn\u0022;\n\n# Backward compatibility?\nif ($target \u003d~ m/^CygWin32(-.*)$/) {\n $target \u003d \u0022Cygwin\u0022.$1;\n}\n\n# Support for legacy targets having a name starting with 'debug-'\nmy ($d, $t) \u003d $target \u003d~ m/^(debug-)?(.*)$/;\nif ($d) {\n $config{build_type} \u003d \u0022debug\u0022;\n\n # If we do not find debug-foo in the table, the target is set to foo.\n if (!$table{$target}) {\n\t$target \u003d $t;\n }\n}\n$config{target} \u003d $target;\nmy %target \u003d resolve_config($target);\n\n\u0026usage if (!%target || $target{template});\n\nmy %conf_files \u003d map { $_ \u003d\u003e 1 } (@{$target{_conf_fname_int}});\n$config{conf_files} \u003d [ sort keys %conf_files ];\n%target \u003d ( %{$table{DEFAULTS}}, %target );\n\nforeach my $feature (@{$target{disable}}) {\n if (exists $deprecated_disablables{$feature}) {\n warn \u0022***** config $target disables deprecated feature $feature\u005cn\u0022;\n } elsif (!grep { $feature eq $_ } @disablables) {\n die \u0022***** config $target disables unknown feature $feature\u005cn\u0022;\n }\n $disabled{$feature} \u003d 'config';\n}\nforeach my $feature (@{$target{enable}}) {\n if (\u0022default\u0022 eq ($disabled{$_} // \u0022\u0022)) {\n if (exists $deprecated_disablables{$feature}) {\n warn \u0022***** config $target enables deprecated feature $feature\u005cn\u0022;\n } elsif (!grep { $feature eq $_ } @disablables) {\n die \u0022***** config $target enables unknown feature $feature\u005cn\u0022;\n }\n delete $disabled{$_};\n }\n}\n\nforeach (sort (keys %disabled))\n\t{\n\t$config{options} .\u003d \u0022 no-$_\u0022;\n\n\tprintf \u0022 no-%-12s %-10s\u0022, $_, \u0022[$disabled{$_}]\u0022;\n\n\tif (/^dso$/)\n\t\t{ }\n\telsif (/^threads$/)\n\t\t{ }\n\telsif (/^shared$/)\n\t\t{ }\n\telsif (/^pic$/)\n\t\t{ }\n\telsif (/^zlib$/)\n\t\t{ }\n\telsif (/^dynamic-engine$/)\n\t\t{ }\n\telsif (/^makedepend$/)\n\t\t{ }\n\telsif (/^zlib-dynamic$/)\n\t\t{ }\n\telsif (/^sse2$/)\n\t\t{ $no_sse2 \u003d 1; }\n\telsif (/^engine$/)\n\t\t{\n\t\t@{$config{dirs}} \u003d grep !/^engines$/, @{$config{dirs}};\n\t\t@{$config{sdirs}} \u003d grep !/^engine$/, @{$config{sdirs}};\n\t\tpush @{$config{openssl_other_defines}}, \u0022OPENSSL_NO_ENGINE\u0022;\n\t\tprint \u0022 OPENSSL_NO_ENGINE (skip engines)\u0022;\n\t\t}\n\telse\n\t\t{\n\t\tmy ($WHAT, $what);\n\n\t\t($WHAT \u003d $what \u003d $_) \u003d~ tr/[\u005c-a-z]/[_A-Z]/;\n\n\t\t# Fix up C macro end names\n\t\t$WHAT \u003d \u0022RMD160\u0022 if $what eq \u0022ripemd\u0022;\n\n\t\t# fix-up crypto/directory name(s)\n\t\t$what \u003d \u0022ripemd\u0022 if $what eq \u0022rmd160\u0022;\n\t\t$what \u003d \u0022whrlpool\u0022 if $what eq \u0022whirlpool\u0022;\n\n\t\tif ($what ne \u0022async\u0022 \u0026\u0026 $what ne \u0022err\u0022\n\t\t \u0026\u0026 grep { $_ eq $what } @{$config{sdirs}})\n\t\t\t{\n\t\t\tpush @{$config{openssl_algorithm_defines}}, \u0022OPENSSL_NO_$WHAT\u0022;\n\t\t\t@{$config{sdirs}} \u003d grep { $_ ne $what} @{$config{sdirs}};\n\n\t\t\tprint \u0022 OPENSSL_NO_$WHAT (skip dir)\u0022;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tpush @{$config{openssl_other_defines}}, \u0022OPENSSL_NO_$WHAT\u0022;\n\t\t\tprint \u0022 OPENSSL_NO_$WHAT\u0022;\n\n\t\t\tif (/^err$/)\t{ push @user_defines, \u0022OPENSSL_NO_ERR\u0022; }\n\t\t\t}\n\t\t}\n\n\tprint \u0022\u005cn\u0022;\n\t}\n\n$target{cxxflags}\u003d$target{cflags} unless defined $target{cxxflags};\n$target{exe_extension}\u003d\u0022\u0022;\n$target{exe_extension}\u003d\u0022.exe\u0022 if ($config{target} eq \u0022DJGPP\u0022\n || $config{target} \u003d~ /^(?:Cygwin|mingw)/);\n$target{exe_extension}\u003d\u0022.pm\u0022 if ($config{target} \u003d~ /vos/);\n\n($target{shared_extension_simple}\u003d$target{shared_extension})\n \u003d~ s|\u005c.\u005c$\u005c(SHLIB_VERSION_NUMBER\u005c)||;\n$target{dso_extension}\u003d$target{shared_extension_simple};\n($target{shared_import_extension}\u003d$target{shared_extension_simple}.\u0022.a\u0022)\n if ($config{target} \u003d~ /^(?:Cygwin|mingw)/);\n\n\n$config{cross_compile_prefix} \u003d $ENV{'CROSS_COMPILE'}\n if $config{cross_compile_prefix} eq \u0022\u0022;\n\n# Allow overriding the names of some tools. USE WITH CARE\n# Note: only Unix cares about HASHBANGPERL... that explains\n# the default string.\n$config{perl} \u003d ($^O ne \u0022VMS\u0022 ? $^X : \u0022perl\u0022);\n$config{hashbangperl} \u003d\n $ENV{'HASHBANGPERL'} || $ENV{'PERL'} || \u0022/usr/bin/env perl\u0022;\n$target{cc} \u003d $ENV{'CC'} || $target{cc} || \u0022cc\u0022;\n$target{cxx} \u003d $ENV{'CXX'} || $target{cxx} || \u0022c++\u0022;\n$target{ranlib} \u003d $ENV{'RANLIB'} || $target{ranlib} ||\n (which(\u0022$config{cross_compile_prefix}ranlib\u0022) ?\n \u0022\u005c$(CROSS_COMPILE)ranlib\u0022 : \u0022true\u0022);\n$target{ar} \u003d $ENV{'AR'} || $target{ar} || \u0022ar\u0022;\n$target{nm} \u003d $ENV{'NM'} || $target{nm} || \u0022nm\u0022;\n$target{rc} \u003d\n $ENV{'RC'} || $ENV{'WINDRES'} || $target{rc} || \u0022windres\u0022;\n\n# Allow overriding the build file name\n$target{build_file} \u003d $ENV{BUILDFILE} || $target{build_file} || \u0022Makefile\u0022;\n\n# Cache information necessary for reconfiguration\n$config{cc} \u003d $target{cc};\n$config{cxx} \u003d $target{cxx};\n$config{build_file} \u003d $target{build_file};\n\n# For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_\n# or release_ attributes.\n# Do it in such a way that no spurious space is appended (hence the grep).\n$config{defines} \u003d [];\n$config{cflags} \u003d \u0022\u0022;\n$config{cxxflags} \u003d \u0022\u0022;\n$config{ex_libs} \u003d \u0022\u0022;\n$config{shared_ldflag} \u003d \u0022\u0022;\n\n# Make sure build_scheme is consistent.\n$target{build_scheme} \u003d [ $target{build_scheme} ]\n if ref($target{build_scheme}) ne \u0022ARRAY\u0022;\n\nmy ($builder, $builder_platform, @builder_opts) \u003d\n @{$target{build_scheme}};\n\nforeach my $checker (($builder_platform.\u0022-\u0022.$target{build_file}.\u0022-checker.pm\u0022,\n $builder_platform.\u0022-checker.pm\u0022)) {\n my $checker_path \u003d catfile($srcdir, \u0022Configurations\u0022, $checker);\n if (-f $checker_path) {\n my $fn \u003d $ENV{CONFIGURE_CHECKER_WARN}\n ? sub { warn $@; } : sub { die $@; };\n if (! do $checker_path) {\n if ($@) {\n $fn-\u003e($@);\n } elsif ($!) {\n $fn-\u003e($!);\n } else {\n $fn-\u003e(\u0022The detected tools didn't match the platform\u005cn\u0022);\n }\n }\n last;\n }\n}\n\npush @{$config{defines}}, \u0022NDEBUG\u0022 if $config{build_type} eq \u0022release\u0022;\n\nif ($target \u003d~ /^mingw/ \u0026\u0026 `$target{cc} --target-help 2\u003e\u00261` \u003d~ m/-mno-cygwin/m)\n\t{\n\t$config{cflags} .\u003d \u0022 -mno-cygwin\u0022;\n\t$config{shared_ldflag} .\u003d \u0022 -mno-cygwin\u0022;\n\t}\n\nif ($target \u003d~ /linux.*-mips/ \u0026\u0026 !$disabled{asm} \u0026\u0026 $user_cflags !~ /-m(ips|arch\u003d)/) {\n\t# minimally required architecture flags for assembly modules\n\t$config{cflags}\u003d\u0022-mips2 $config{cflags}\u0022 if ($target \u003d~ /mips32/);\n\t$config{cflags}\u003d\u0022-mips3 $config{cflags}\u0022 if ($target \u003d~ /mips64/);\n}\n\nmy $no_shared_warn\u003d0;\nmy $no_user_cflags\u003d0;\nmy $no_user_defines\u003d0;\n\n# The DSO code currently always implements all functions so that no\n# applications will have to worry about that from a compilation point\n# of view. However, the \u0022method\u0022s may return zero unless that platform\n# has support compiled in for them. Currently each method is enabled\n# by a define \u0022DSO_\u003cname\u003e\u0022 ... we translate the \u0022dso_scheme\u0022 config\n# string entry into using the following logic;\nif (!$disabled{dso} \u0026\u0026 $target{dso_scheme} ne \u0022\u0022)\n\t{\n\t$target{dso_scheme} \u003d~ tr/[a-z]/[A-Z]/;\n\tif ($target{dso_scheme} eq \u0022DLFCN\u0022)\n\t\t{\n\t\tunshift @{$config{defines}}, \u0022DSO_DLFCN\u0022, \u0022HAVE_DLFCN_H\u0022;\n\t\t}\n\telsif ($target{dso_scheme} eq \u0022DLFCN_NO_H\u0022)\n\t\t{\n\t\tunshift @{$config{defines}}, \u0022DSO_DLFCN\u0022;\n\t\t}\n\telse\n\t\t{\n\t\tunshift @{$config{defines}}, \u0022DSO_$target{dso_scheme}\u0022;\n\t\t}\n\t}\n\n$config{ex_libs}\u003d\u0022$libs$config{ex_libs}\u0022 if ($libs ne \u0022\u0022);\n\n# If threads aren't disabled, check how possible they are\nunless ($disabled{threads}) {\n if ($auto_threads) {\n # Enabled by default, disable it forcibly if unavailable\n if ($target{thread_scheme} eq \u0022(unknown)\u0022) {\n $disabled{threads} \u003d \u0022unavailable\u0022;\n }\n } else {\n # The user chose to enable threads explicitly, let's see\n # if there's a chance that's possible\n if ($target{thread_scheme} eq \u0022(unknown)\u0022) {\n # If the user asked for \u0022threads\u0022 and we don't have internal\n # knowledge how to do it, [s]he is expected to provide any\n # system-dependent compiler options that are necessary. We\n # can't truly check that the given options are correct, but\n # we expect the user to know what [s]He is doing.\n if ($no_user_cflags \u0026\u0026 $no_user_defines) {\n die \u0022You asked for multi-threading support, but didn't\u005cn\u0022\n ,\u0022provide any system-specific compiler options\u005cn\u0022;\n }\n }\n }\n}\n\n# If threads still aren't disabled, add a C macro to ensure the source\n# code knows about it. Any other flag is taken care of by the configs.\nunless($disabled{threads}) {\n foreach ((\u0022defines\u0022, \u0022openssl_thread_defines\u0022)) {\n push @{$config{$_}}, \u0022OPENSSL_THREADS\u0022;\n }\n}\n\n# With \u0022deprecated\u0022 disable all deprecated features.\nif (defined($disabled{\u0022deprecated\u0022})) {\n $config{api} \u003d $maxapi;\n}\n\nif ($target{shared_target} eq \u0022\u0022)\n\t{\n\t$no_shared_warn \u003d 1\n\t if (!$disabled{shared} || !$disabled{\u0022dynamic-engine\u0022});\n\t$disabled{shared} \u003d \u0022no-shared-target\u0022;\n\t$disabled{pic} \u003d $disabled{shared} \u003d $disabled{\u0022dynamic-engine\u0022} \u003d\n\t \u0022no-shared-target\u0022;\n\t}\n\nif ($disabled{\u0022dynamic-engine\u0022}) {\n push @{$config{defines}}, \u0022OPENSSL_NO_DYNAMIC_ENGINE\u0022;\n $config{dynamic_engines} \u003d 0;\n} else {\n push @{$config{defines}}, \u0022OPENSSL_NO_STATIC_ENGINE\u0022;\n $config{dynamic_engines} \u003d 1;\n}\n\nunless ($disabled{asan}) {\n $config{cflags} .\u003d \u0022-fsanitize\u003daddress \u0022;\n}\n\nunless ($disabled{ubsan}) {\n # -DPEDANTIC or -fnosanitize\u003dalignment may also be required on some\n # platforms.\n $config{cflags} .\u003d \u0022-fsanitize\u003dundefined -fno-sanitize-recover\u003dall \u0022;\n}\n\nunless ($disabled{msan}) {\n $config{cflags} .\u003d \u0022-fsanitize\u003dmemory \u0022;\n}\n\nunless ($disabled{\u0022fuzz-libfuzzer\u0022} \u0026\u0026 $disabled{\u0022fuzz-afl\u0022}\n \u0026\u0026 $disabled{asan} \u0026\u0026 $disabled{ubsan} \u0026\u0026 $disabled{msan}) {\n $config{cflags} .\u003d \u0022-fno-omit-frame-pointer -g \u0022;\n}\n#\n# Platform fix-ups\n#\n\n# This saves the build files from having to check\nif ($disabled{pic})\n\t{\n\t$target{shared_cflag} \u003d $target{shared_ldflag} \u003d\n\t\t$target{shared_rcflag} \u003d \u0022\u0022;\n\t}\nelse\n\t{\n\tpush @{$config{defines}}, \u0022OPENSSL_PIC\u0022;\n\t}\n\nif ($target{sys_id} ne \u0022\u0022)\n\t{\n\tpush @{$config{openssl_sys_defines}}, \u0022OPENSSL_SYS_$target{sys_id}\u0022;\n\t}\n\nunless ($disabled{asm}) {\n $target{cpuid_asm_src}\u003d$table{DEFAULTS}-\u003e{cpuid_asm_src} if ($config{processor} eq \u0022386\u0022);\n $target{bn_asm_src} \u003d~ s/\u005cw+-gf2m.c// if (defined($disabled{ec2m}));\n\n # bn-586 is the only one implementing bn_*_part_words\n push @{$config{defines}}, \u0022OPENSSL_BN_ASM_PART_WORDS\u0022 if ($target{bn_asm_src} \u003d~ /bn-586/);\n push @{$config{defines}}, \u0022OPENSSL_IA32_SSE2\u0022 if (!$no_sse2 \u0026\u0026 $target{bn_asm_src} \u003d~ /86/);\n\n push @{$config{defines}}, \u0022OPENSSL_BN_ASM_MONT\u0022 if ($target{bn_asm_src} \u003d~ /-mont/);\n push @{$config{defines}}, \u0022OPENSSL_BN_ASM_MONT5\u0022 if ($target{bn_asm_src} \u003d~ /-mont5/);\n push @{$config{defines}}, \u0022OPENSSL_BN_ASM_GF2m\u0022 if ($target{bn_asm_src} \u003d~ /-gf2m/);\n\n if ($target{sha1_asm_src}) {\n\tpush @{$config{defines}}, \u0022SHA1_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sx86/ || $target{sha1_asm_src} \u003d~ /sha1/);\n\tpush @{$config{defines}}, \u0022SHA256_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sha256/);\n\tpush @{$config{defines}}, \u0022SHA512_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sha512/);\n }\n if ($target{rc4_asm_src} ne $table{DEFAULTS}-\u003e{rc4_asm_src}) {\n\tpush @{$config{defines}}, \u0022RC4_ASM\u0022;\n }\n if ($target{md5_asm_src}) {\n\tpush @{$config{defines}}, \u0022MD5_ASM\u0022;\n }\n $target{cast_asm_src}\u003d$table{DEFAULTS}-\u003e{cast_asm_src} unless $disabled{pic}; # CAST assembler is not PIC\n if ($target{rmd160_asm_src}) {\n\tpush @{$config{defines}}, \u0022RMD160_ASM\u0022;\n }\n if ($target{aes_asm_src}) {\n\tpush @{$config{defines}}, \u0022AES_ASM\u0022 if ($target{aes_asm_src} \u003d~ m/\u005cbaes-/);;\n\t# aes-ctr.fake is not a real file, only indication that assembler\n\t# module implements AES_ctr32_encrypt...\n\tpush @{$config{defines}}, \u0022AES_CTR_ASM\u0022 if ($target{aes_asm_src} \u003d~ s/\u005cs*aes-ctr\u005c.fake//);\n\t# aes-xts.fake indicates presence of AES_xts_[en|de]crypt...\n\tpush @{$config{defines}}, \u0022AES_XTS_ASM\u0022 if ($target{aes_asm_src} \u003d~ s/\u005cs*aes-xts\u005c.fake//);\n\t$target{aes_asm_src} \u003d~ s/\u005cs*(vpaes|aesni)-x86\u005c.s//g if ($no_sse2);\n\tpush @{$config{defines}}, \u0022VPAES_ASM\u0022 if ($target{aes_asm_src} \u003d~ m/vpaes/);\n\tpush @{$config{defines}}, \u0022BSAES_ASM\u0022 if ($target{aes_asm_src} \u003d~ m/bsaes/);\n }\n if ($target{wp_asm_src} \u003d~ /mmx/) {\n if ($config{processor} eq \u0022386\u0022) {\n\t $target{wp_asm_src}\u003d$table{DEFAULTS}-\u003e{wp_asm_src};\n\t} elsif (!$disabled{\u0022whirlpool\u0022}) {\n\t push @{$config{defines}}, \u0022WHIRLPOOL_ASM\u0022;\n\t}\n }\n if ($target{modes_asm_src} \u003d~ /ghash-/) {\n\tpush @{$config{defines}}, \u0022GHASH_ASM\u0022;\n }\n if ($target{ec_asm_src} \u003d~ /ecp_nistz256/) {\n\tpush @{$config{defines}}, \u0022ECP_NISTZ256_ASM\u0022;\n }\n if ($target{padlock_asm_src} ne $table{DEFAULTS}-\u003e{padlock_asm_src}) {\n\tpush @{$config{defines}}, \u0022PADLOCK_ASM\u0022;\n }\n if ($target{poly1305_asm_src} ne \u0022\u0022) {\n\tpush @{$config{defines}}, \u0022POLY1305_ASM\u0022;\n }\n}\n\nmy %predefined;\n\nif ($^O ne \u0022VMS\u0022) {\n my $cc \u003d \u0022$config{cross_compile_prefix}$target{cc}\u0022;\n\n # collect compiler pre-defines from gcc or gcc-alike...\n open(PIPE, \u0022$cc -dM -E -x c /dev/null 2\u003e\u00261 |\u0022);\n while (\u003cPIPE\u003e) {\n\tm/^#define\u005cs+(\u005cw+(?:\u005c(\u005cw+\u005c))?)(?:\u005cs+(.+))?/ or last;\n\t$predefined{$1} \u003d $2 // \u0022\u0022;\n }\n close(PIPE);\n\n if (!$disabled{makedepend}) {\n\t# We know that GNU C version 3 and up as well as all clang\n\t# versions support dependency generation\n\tif ($predefined{__GNUC__} \u003e\u003d 3) {\n\t $config{makedepprog} \u003d $cc;\n\t} else {\n\t $config{makedepprog} \u003d which('makedepend');\n\t $disabled{makedepend} \u003d \u0022unavailable\u0022 unless $config{makedepprog};\n\t}\n }\n}\n\n\n\n# Deal with bn_ops ###################################################\n\n$config{bn_ll}\t\t\t\u003d0;\n$config{export_var_as_fn}\t\u003d0;\nmy $def_int\u003d\u0022unsigned int\u0022;\n$config{rc4_int}\t\t\u003d$def_int;\n($config{b64l},$config{b64},$config{b32})\u003d(0,0,1);\n\nmy $count \u003d 0;\nforeach (sort split(/\u005cs+/,$target{bn_ops})) {\n $count++ if /SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT/;\n $config{export_var_as_fn}\u003d1 if $_ eq 'EXPORT_VAR_AS_FN';\n $config{bn_ll}\u003d1\t\t\t\tif $_ eq 'BN_LLONG';\n $config{rc4_int}\u003d\u0022unsigned char\u0022\t\tif $_ eq 'RC4_CHAR';\n ($config{b64l},$config{b64},$config{b32})\n\t\u003d(0,1,0)\t\t\t\tif $_ eq 'SIXTY_FOUR_BIT';\n ($config{b64l},$config{b64},$config{b32})\n\t\u003d(1,0,0)\t\t\t\tif $_ eq 'SIXTY_FOUR_BIT_LONG';\n ($config{b64l},$config{b64},$config{b32})\n\t\u003d(0,0,1)\t\t\t\tif $_ eq 'THIRTY_TWO_BIT';\n}\ndie \u0022Exactly one of SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT can be set in bn_ops\u005cn\u0022\n if $count \u003e 1;\n\n\n# Hack cflags for better warnings (dev option) #######################\n\n# \u0022Stringify\u0022 the C flags string. This permits it to be made part of a string\n# and works as well on command lines.\n$config{cflags} \u003d~ s/([\u005c\u005c\u005c\u0022])/\u005c\u005c$1/g;\n\nif (defined($config{api})) {\n $config{openssl_api_defines} \u003d [ \u0022OPENSSL_MIN_API\u003d\u0022.$apitable-\u003e{$config{api}} ];\n my $apiflag \u003d sprintf(\u0022OPENSSL_API_COMPAT\u003d%s\u0022, $apitable-\u003e{$config{api}});\n push @{$config{defines}}, $apiflag;\n}\n\nif (defined($predefined{__clang__}) \u0026\u0026 !$disabled{asm}) {\n $config{cflags} .\u003d \u0022 -Qunused-arguments\u0022;\n}\n\nif ($strict_warnings)\n\t{\n\tmy $wopt;\n\tmy $gccver \u003d $predefined{__GNUC__} // -1;\n\n\tdie \u0022ERROR --strict-warnings requires gcc[\u003e\u003d4] or gcc-alike\u0022\n unless $gccver \u003e\u003d 4;\n\t$gcc_devteam_warn .\u003d \u0022 -Wmisleading-indentation\u0022 if $gccver \u003e\u003d 6;\n\tforeach $wopt (split /\u005cs+/, $gcc_devteam_warn)\n\t\t{\n\t\t$config{cflags} .\u003d \u0022 $wopt\u0022 unless ($config{cflags} \u003d~ /(?:^|\u005cs)$wopt(?:\u005cs|$)/)\n\t\t}\n\tif (defined($predefined{__clang__}))\n\t\t{\n\t\tforeach $wopt (split /\u005cs+/, $clang_devteam_warn)\n\t\t\t{\n\t\t\t$config{cflags} .\u003d \u0022 $wopt\u0022 unless ($config{cflags} \u003d~ /(?:^|\u005cs)$wopt(?:\u005cs|$)/)\n\t\t\t}\n\t\t}\n\t}\n\nunless ($disabled{\u0022crypto-mdebug-backtrace\u0022})\n\t{\n\tforeach my $wopt (split /\u005cs+/, $memleak_devteam_backtrace)\n\t\t{\n\t\t$config{cflags} .\u003d \u0022 $wopt\u0022 unless ($config{cflags} \u003d~ /(?:^|\u005cs)$wopt(?:\u005cs|$)/)\n\t\t}\n\tif ($target \u003d~ /^BSD-/)\n\t\t{\n\t\t$config{ex_libs} .\u003d \u0022 -lexecinfo\u0022;\n\t\t}\n\t}\n\nif ($user_cflags ne \u0022\u0022) { $config{cflags}\u003d\u0022$config{cflags}$user_cflags\u0022; $config{cxxflags}\u003d\u0022$config{cxxflags}$user_cflags\u0022;}\nelse { $no_user_cflags\u003d1; }\nif (@user_defines) { $config{defines}\u003d[ @{$config{defines}}, @user_defines ]; }\nelse { $no_user_defines\u003d1; }\n\n# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON\n\nunless ($disabled{afalgeng}) {\n $config{afalgeng}\u003d\u0022\u0022;\n if ($target \u003d~ m/^linux/) {\n my $minver \u003d 4*10000 + 1*100 + 0;\n if ($config{cross_compile_prefix} eq \u0022\u0022) {\n my $verstr \u003d `uname -r`;\n my ($ma, $mi1, $mi2) \u003d split(\u0022\u005c\u005c.\u0022, $verstr);\n ($mi2) \u003d $mi2 \u003d~ /(\u005cd+)/;\n my $ver \u003d $ma*10000 + $mi1*100 + $mi2;\n if ($ver \u003c $minver) {\n $disabled{afalgeng} \u003d \u0022too-old-kernel\u0022;\n } else {\n push @{$config{engdirs}}, \u0022afalg\u0022;\n }\n } else {\n $disabled{afalgeng} \u003d \u0022cross-compiling\u0022;\n }\n } else {\n $disabled{afalgeng} \u003d \u0022not-linux\u0022;\n }\n}\n\npush @{$config{openssl_other_defines}}, \u0022OPENSSL_NO_AFALGENG\u0022 if ($disabled{afalgeng});\n\n# If we use the unified build, collect information from build.info files\nmy %unified_info \u003d ();\n\nmy $buildinfo_debug \u003d defined($ENV{CONFIGURE_DEBUG_BUILDINFO});\nif ($builder eq \u0022unified\u0022) {\n use with_fallback qw(Text::Template);\n\n sub cleandir {\n my $base \u003d shift;\n my $dir \u003d shift;\n my $relativeto \u003d shift || \u0022.\u0022;\n\n $dir \u003d catdir($base,$dir) unless isabsolute($dir);\n\n # Make sure the directories we're building in exists\n mkpath($dir);\n\n my $res \u003d abs2rel(absolutedir($dir), rel2abs($relativeto));\n #print STDERR \u0022DEBUG[cleandir]: $dir , $base \u003d\u003e $res\u005cn\u0022;\n return $res;\n }\n\n sub cleanfile {\n my $base \u003d shift;\n my $file \u003d shift;\n my $relativeto \u003d shift || \u0022.\u0022;\n\n $file \u003d catfile($base,$file) unless isabsolute($file);\n\n my $d \u003d dirname($file);\n my $f \u003d basename($file);\n\n # Make sure the directories we're building in exists\n mkpath($d);\n\n my $res \u003d abs2rel(catfile(absolutedir($d), $f), rel2abs($relativeto));\n #print STDERR \u0022DEBUG[cleanfile]: $d , $f \u003d\u003e $res\u005cn\u0022;\n return $res;\n }\n\n # Store the name of the template file we will build the build file from\n # in %config. This may be useful for the build file itself.\n my @build_file_template_names \u003d\n\t( $builder_platform.\u0022-\u0022.$target{build_file}.\u0022.tmpl\u0022,\n\t $target{build_file}.\u0022.tmpl\u0022 );\n my @build_file_templates \u003d ();\n\n # First, look in the user provided directory, if given\n if (defined $ENV{$local_config_envname}) {\n\t@build_file_templates \u003d\n\t map {\n\t\tif ($^O eq 'VMS') {\n\t\t # VMS environment variables are logical names,\n\t\t # which can be used as is\n\t\t $local_config_envname . ':' . $_;\n\t\t} else {\n\t\t catfile($ENV{$local_config_envname}, $_);\n\t\t}\n\t }\n\t @build_file_template_names;\n }\n # Then, look in our standard directory\n push @build_file_templates,\n\t( map { cleanfile($srcdir, catfile(\u0022Configurations\u0022, $_), $blddir) }\n\t @build_file_template_names );\n\n my $build_file_template;\n for $_ (@build_file_templates) {\n\t$build_file_template \u003d $_;\n last if -f $build_file_template;\n\n $build_file_template \u003d undef;\n }\n if (!defined $build_file_template) {\n\tdie \u0022*** Couldn't find any of:\u005cn\u0022, join(\u0022\u005cn\u0022, @build_file_templates), \u0022\u005cn\u0022;\n }\n $config{build_file_templates}\n \u003d [ $build_file_template,\n cleanfile($srcdir, catfile(\u0022Configurations\u0022, \u0022common.tmpl\u0022),\n $blddir) ];\n\n my @build_infos \u003d ( [ \u0022.\u0022, \u0022build.info\u0022 ] );\n foreach (@{$config{dirs}}) {\n push @build_infos, [ $_, \u0022build.info\u0022 ]\n if (-f catfile($srcdir, $_, \u0022build.info\u0022));\n }\n foreach (@{$config{sdirs}}) {\n push @build_infos, [ catdir(\u0022crypto\u0022, $_), \u0022build.info\u0022 ]\n if (-f catfile($srcdir, \u0022crypto\u0022, $_, \u0022build.info\u0022));\n }\n foreach (@{$config{engdirs}}) {\n push @build_infos, [ catdir(\u0022engines\u0022, $_), \u0022build.info\u0022 ]\n if (-f catfile($srcdir, \u0022engines\u0022, $_, \u0022build.info\u0022));\n }\n foreach (@{$config{tdirs}}) {\n push @build_infos, [ catdir(\u0022test\u0022, $_), \u0022build.info\u0022 ]\n if (-f catfile($srcdir, \u0022test\u0022, $_, \u0022build.info\u0022));\n }\n\n $config{build_infos} \u003d [ ];\n\n foreach (@build_infos) {\n my $sourced \u003d catdir($srcdir, $_-\u003e[0]);\n my $buildd \u003d catdir($blddir, $_-\u003e[0]);\n\n mkpath($buildd);\n\n my $f \u003d $_-\u003e[1];\n # The basic things we're trying to build\n my @programs \u003d ();\n my @programs_install \u003d ();\n my @libraries \u003d ();\n my @libraries_install \u003d ();\n my @engines \u003d ();\n my @engines_install \u003d ();\n my @scripts \u003d ();\n my @scripts_install \u003d ();\n my @extra \u003d ();\n my @overrides \u003d ();\n my @intermediates \u003d ();\n my @rawlines \u003d ();\n\n my %ordinals \u003d ();\n my %sources \u003d ();\n my %shared_sources \u003d ();\n my %includes \u003d ();\n my %depends \u003d ();\n my %renames \u003d ();\n my %sharednames \u003d ();\n my %generate \u003d ();\n\n push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f);\n my $template \u003d\n Text::Template-\u003enew(TYPE \u003d\u003e 'FILE',\n SOURCE \u003d\u003e catfile($sourced, $f),\n PREPEND \u003d\u003e qq{use lib \u0022$FindBin::Bin/util/perl\u0022;});\n die \u0022Something went wrong with $sourced/$f: $!\u005cn\u0022 unless $template;\n my @text \u003d\n split /^/m,\n $template-\u003efill_in(HASH \u003d\u003e { config \u003d\u003e \u005c%config,\n target \u003d\u003e \u005c%target,\n disabled \u003d\u003e \u005c%disabled,\n withargs \u003d\u003e \u005c%withargs,\n builddir \u003d\u003e abs2rel($buildd, $blddir),\n sourcedir \u003d\u003e abs2rel($sourced, $blddir),\n buildtop \u003d\u003e abs2rel($blddir, $blddir),\n sourcetop \u003d\u003e abs2rel($srcdir, $blddir) },\n DELIMITERS \u003d\u003e [ \u0022{-\u0022, \u0022-}\u0022 ]);\n\n # The top item of this stack has the following values\n # -2 positive already run and we found ELSE (following ELSIF should fail)\n # -1 positive already run (skip until ENDIF)\n # 0 negatives so far (if we're at a condition, check it)\n # 1 last was positive (don't skip lines until next ELSE, ELSIF or ENDIF)\n # 2 positive ELSE (following ELSIF should fail)\n my @skip \u003d ();\n collect_information(\n collect_from_array([ @text ],\n qr/\u005c\u005c$/ \u003d\u003e sub { my $l1 \u003d shift; my $l2 \u003d shift;\n $l1 \u003d~ s/\u005c\u005c$//; $l1.$l2 }),\n # Info we're looking for\n qr/^\u005cs*IF\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])*)\u005c]\u005cs*$/\n \u003d\u003e sub {\n if (! @skip || $skip[$#skip] \u003e 0) {\n push @skip, !! $1;\n } else {\n push @skip, -1;\n }\n },\n qr/^\u005cs*ELSIF\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])*)\u005c]\u005cs*$/\n \u003d\u003e sub { die \u0022ELSIF out of scope\u0022 if ! @skip;\n die \u0022ELSIF following ELSE\u0022 if abs($skip[$#skip]) \u003d\u003d 2;\n $skip[$#skip] \u003d -1 if $skip[$#skip] !\u003d 0;\n $skip[$#skip] \u003d !! $1\n if $skip[$#skip] \u003d\u003d 0; },\n qr/^\u005cs*ELSE\u005cs*$/\n \u003d\u003e sub { die \u0022ELSE out of scope\u0022 if ! @skip;\n $skip[$#skip] \u003d -2 if $skip[$#skip] !\u003d 0;\n $skip[$#skip] \u003d 2 if $skip[$#skip] \u003d\u003d 0; },\n qr/^\u005cs*ENDIF\u005cs*$/\n \u003d\u003e sub { die \u0022ENDIF out of scope\u0022 if ! @skip;\n pop @skip; },\n qr/^\u005cs*PROGRAMS(_NO_INST)?\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub {\n if (!@skip || $skip[$#skip] \u003e 0) {\n my $install \u003d $1;\n my @x \u003d tokenize($2);\n push @programs, @x;\n push @programs_install, @x unless $install;\n }\n },\n qr/^\u005cs*LIBS(_NO_INST)?\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub {\n if (!@skip || $skip[$#skip] \u003e 0) {\n my $install \u003d $1;\n my @x \u003d tokenize($2);\n push @libraries, @x;\n push @libraries_install, @x unless $install;\n }\n },\n qr/^\u005cs*ENGINES(_NO_INST)?\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub {\n if (!@skip || $skip[$#skip] \u003e 0) {\n my $install \u003d $1;\n my @x \u003d tokenize($2);\n push @engines, @x;\n push @engines_install, @x unless $install;\n }\n },\n qr/^\u005cs*SCRIPTS(_NO_INST)?\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub {\n if (!@skip || $skip[$#skip] \u003e 0) {\n my $install \u003d $1;\n my @x \u003d tokenize($2);\n push @scripts, @x;\n push @scripts_install, @x unless $install;\n }\n },\n qr/^\u005cs*EXTRA\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @extra, tokenize($1)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*OVERRIDES\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @overrides, tokenize($1)\n if !@skip || $skip[$#skip] \u003e 0 },\n\n qr/^\u005cs*ORDINALS\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/,\n \u003d\u003e sub { push @{$ordinals{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*SOURCE\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$sources{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*SHARED_SOURCE\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$shared_sources{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*INCLUDE\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$includes{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*DEPEND\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])*)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$depends{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*GENERATE\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$generate{$1}}, $2\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*RENAME\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$renames{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*SHARED_NAME\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*\u003d\u005cs*(.*)\u005cs*$/\n \u003d\u003e sub { push @{$sharednames{$1}}, tokenize($2)\n if !@skip || $skip[$#skip] \u003e 0 },\n qr/^\u005cs*BEGINRAW\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*$/\n \u003d\u003e sub {\n my $lineiterator \u003d shift;\n my $target_kind \u003d $1;\n while (defined $lineiterator-\u003e()) {\n s|\u005cR$||;\n if (/^\u005cs*ENDRAW\u005c[((?:\u005c\u005c.|[^\u005c\u005c\u005c]])+)\u005c]\u005cs*$/) {\n die \u0022ENDRAW doesn't match BEGINRAW\u0022\n if $1 ne $target_kind;\n last;\n }\n next if @skip \u0026\u0026 $skip[$#skip] \u003c\u003d 0;\n push @rawlines, $_\n if ($target_kind eq $target{build_file}\n || $target_kind eq $target{build_file}.\u0022(\u0022.$builder_platform.\u0022)\u0022);\n }\n },\n qr/^\u005cs*(?:#.*)?$/ \u003d\u003e sub { },\n \u0022OTHERWISE\u0022 \u003d\u003e sub { die \u0022Something wrong with this line:\u005cn$_\u005cnat $sourced/$f\u0022 },\n \u0022BEFORE\u0022 \u003d\u003e sub {\n if ($buildinfo_debug) {\n print STDERR \u0022DEBUG: Parsing \u0022,join(\u0022 \u0022, @_),\u0022\u005cn\u0022;\n print STDERR \u0022DEBUG: ... before parsing, skip stack is \u0022,join(\u0022 \u0022, map { int($_) } @skip),\u0022\u005cn\u0022;\n }\n },\n \u0022AFTER\u0022 \u003d\u003e sub {\n if ($buildinfo_debug) {\n print STDERR \u0022DEBUG: .... after parsing, skip stack is \u0022,join(\u0022 \u0022, map { int($_) } @skip),\u0022\u005cn\u0022;\n }\n },\n );\n die \u0022runaway IF?\u0022 if (@skip);\n\n foreach (keys %renames) {\n die \u0022$_ renamed to more than one thing: \u0022\n ,join(\u0022 \u0022, @{$renames{$_}}),\u0022\u005cn\u0022\n if scalar @{$renames{$_}} \u003e 1;\n my $dest \u003d cleanfile($buildd, $_, $blddir);\n my $to \u003d cleanfile($buildd, $renames{$_}-\u003e[0], $blddir);\n die \u0022$dest renamed to more than one thing: \u0022\n ,$unified_info{rename}-\u003e{$dest}, $to\n unless !defined($unified_info{rename}-\u003e{$dest})\n or $unified_info{rename}-\u003e{$dest} eq $to;\n $unified_info{rename}-\u003e{$dest} \u003d $to;\n }\n\n foreach (@programs) {\n my $program \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$program}) {\n $program \u003d $unified_info{rename}-\u003e{$program};\n }\n $unified_info{programs}-\u003e{$program} \u003d 1;\n }\n\n foreach (@programs_install) {\n my $program \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$program}) {\n $program \u003d $unified_info{rename}-\u003e{$program};\n }\n $unified_info{install}-\u003e{programs}-\u003e{$program} \u003d 1;\n }\n\n foreach (@libraries) {\n my $library \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$library}) {\n $library \u003d $unified_info{rename}-\u003e{$library};\n }\n $unified_info{libraries}-\u003e{$library} \u003d 1;\n }\n\n foreach (@libraries_install) {\n my $library \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$library}) {\n $library \u003d $unified_info{rename}-\u003e{$library};\n }\n $unified_info{install}-\u003e{libraries}-\u003e{$library} \u003d 1;\n }\n\n die \u003c\u003c\u0022EOF\u0022 if scalar @engines and !$config{dynamic_engines};\nENGINES can only be used if configured with 'dynamic-engine'.\nThis is usually a fault in a build.info file.\nEOF\n foreach (@engines) {\n my $library \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$library}) {\n $library \u003d $unified_info{rename}-\u003e{$library};\n }\n $unified_info{engines}-\u003e{$library} \u003d 1;\n }\n\n foreach (@engines_install) {\n my $library \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$library}) {\n $library \u003d $unified_info{rename}-\u003e{$library};\n }\n $unified_info{install}-\u003e{engines}-\u003e{$library} \u003d 1;\n }\n\n foreach (@scripts) {\n my $script \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$script}) {\n $script \u003d $unified_info{rename}-\u003e{$script};\n }\n $unified_info{scripts}-\u003e{$script} \u003d 1;\n }\n\n foreach (@scripts_install) {\n my $script \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$script}) {\n $script \u003d $unified_info{rename}-\u003e{$script};\n }\n $unified_info{install}-\u003e{scripts}-\u003e{$script} \u003d 1;\n }\n\n foreach (@extra) {\n my $extra \u003d cleanfile($buildd, $_, $blddir);\n $unified_info{extra}-\u003e{$extra} \u003d 1;\n }\n\n foreach (@overrides) {\n my $override \u003d cleanfile($buildd, $_, $blddir);\n $unified_info{overrides}-\u003e{$override} \u003d 1;\n }\n\n push @{$unified_info{rawlines}}, @rawlines;\n\n unless ($disabled{shared}) {\n # Check sharednames.\n foreach (keys %sharednames) {\n my $dest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$dest}) {\n $dest \u003d $unified_info{rename}-\u003e{$dest};\n }\n die \u0022shared_name for $dest with multiple values: \u0022\n ,join(\u0022 \u0022, @{$sharednames{$_}}),\u0022\u005cn\u0022\n if scalar @{$sharednames{$_}} \u003e 1;\n my $to \u003d cleanfile($buildd, $sharednames{$_}-\u003e[0], $blddir);\n die \u0022shared_name found for a library $dest that isn't defined\u005cn\u0022\n unless $unified_info{libraries}-\u003e{$dest};\n die \u0022shared_name for $dest with multiple values: \u0022\n ,$unified_info{sharednames}-\u003e{$dest}, \u0022, \u0022, $to\n unless !defined($unified_info{sharednames}-\u003e{$dest})\n or $unified_info{sharednames}-\u003e{$dest} eq $to;\n $unified_info{sharednames}-\u003e{$dest} \u003d $to;\n }\n\n # Additionally, we set up sharednames for libraries that don't\n # have any, as themselves. Only for libraries that aren't\n # explicitely static.\n foreach (grep !/\u005c.a$/, keys %{$unified_info{libraries}}) {\n if (!defined $unified_info{sharednames}-\u003e{$_}) {\n $unified_info{sharednames}-\u003e{$_} \u003d $_\n }\n }\n\n # Check that we haven't defined any library as both shared and\n # explicitely static. That is forbidden.\n my @doubles \u003d ();\n foreach (grep /\u005c.a$/, keys %{$unified_info{libraries}}) {\n (my $l \u003d $_) \u003d~ s/\u005c.a$//;\n push @doubles, $l if defined $unified_info{sharednames}-\u003e{$l};\n }\n die \u0022these libraries are both explicitely static and shared:\u005cn \u0022,\n join(\u0022 \u0022, @doubles), \u0022\u005cn\u0022\n if @doubles;\n }\n\n foreach (keys %ordinals) {\n my $dest \u003d $_;\n my $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n foreach (@{$ordinals{$dest}}) {\n my %known_ordinals \u003d\n (\n crypto \u003d\u003e\n cleanfile($sourced, catfile(\u0022util\u0022, \u0022libcrypto.num\u0022), $blddir),\n ssl \u003d\u003e\n cleanfile($sourced, catfile(\u0022util\u0022, \u0022libssl.num\u0022), $blddir)\n );\n my $o \u003d $known_ordinals{$_};\n die \u0022Ordinals for $ddest defined more than once\u005cn\u0022\n if $unified_info{ordinals}-\u003e{$ddest};\n $unified_info{ordinals}-\u003e{$ddest} \u003d [ $_, $o ];\n }\n }\n\n foreach (keys %sources) {\n my $dest \u003d $_;\n my $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n foreach (@{$sources{$dest}}) {\n my $s \u003d cleanfile($sourced, $_, $blddir);\n\n # If it isn't in the source tree, we assume it's generated\n # in the build tree\n if (! -f $s) {\n $s \u003d cleanfile($buildd, $_, $blddir);\n }\n # We recognise C++, C and asm files\n if ($s \u003d~ /\u005c.(cc|cpp|c|s|S)$/) {\n my $o \u003d $_;\n $o \u003d~ s/\u005c.[csS]$/.o/; # C and assembler\n $o \u003d~ s/\u005c.(cc|cpp)$/_cc.o/; # C++\n $o \u003d cleanfile($buildd, $o, $blddir);\n $unified_info{sources}-\u003e{$ddest}-\u003e{$o} \u003d 1;\n $unified_info{sources}-\u003e{$o}-\u003e{$s} \u003d 1;\n } else {\n $unified_info{sources}-\u003e{$ddest}-\u003e{$s} \u003d 1;\n }\n }\n }\n\n foreach (keys %shared_sources) {\n my $dest \u003d $_;\n my $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n foreach (@{$shared_sources{$dest}}) {\n my $s \u003d cleanfile($sourced, $_, $blddir);\n\n # If it isn't in the source tree, we assume it's generated\n # in the build tree\n if (! -f $s) {\n $s \u003d cleanfile($buildd, $_, $blddir);\n }\n # We recognise C++, C and asm files\n if ($s \u003d~ /\u005c.(cc|cpp|c|s|S)$/) {\n my $o \u003d $_;\n $o \u003d~ s/\u005c.[csS]$/.o/; # C and assembler\n $o \u003d~ s/\u005c.(cc|cpp)$/_cc.o/; # C++\n $o \u003d cleanfile($buildd, $o, $blddir);\n $unified_info{shared_sources}-\u003e{$ddest}-\u003e{$o} \u003d 1;\n $unified_info{sources}-\u003e{$o}-\u003e{$s} \u003d 1;\n } else {\n die \u0022unrecognised source file type for shared library: $s\u005cn\u0022;\n }\n }\n }\n\n foreach (keys %generate) {\n my $dest \u003d $_;\n my $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n die \u0022more than one generator for $dest: \u0022\n ,join(\u0022 \u0022, @{$generate{$_}}),\u0022\u005cn\u0022\n if scalar @{$generate{$_}} \u003e 1;\n my @generator \u003d split /\u005cs+/, $generate{$dest}-\u003e[0];\n $generator[0] \u003d cleanfile($sourced, $generator[0], $blddir),\n $unified_info{generate}-\u003e{$ddest} \u003d [ @generator ];\n }\n\n foreach (keys %depends) {\n my $dest \u003d $_;\n my $ddest \u003d $dest eq \u0022\u0022 ? \u0022\u0022 : cleanfile($sourced, $_, $blddir);\n\n # If the destination doesn't exist in source, it can only be\n # a generated file in the build tree.\n if ($ddest ne \u0022\u0022 \u0026\u0026 ! -f $ddest) {\n $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n }\n foreach (@{$depends{$dest}}) {\n my $d \u003d cleanfile($sourced, $_, $blddir);\n\n # If we know it's generated, or assume it is because we can't\n # find it in the source tree, we set file we depend on to be\n # in the build tree rather than the source tree, and assume\n # and that there are lines to build it in a BEGINRAW..ENDRAW\n # section or in the Makefile template.\n if (! -f $d\n || (grep { $d eq $_ }\n map { cleanfile($srcdir, $_, $blddir) }\n grep { /\u005c.h$/ } keys %{$unified_info{generate}})) {\n $d \u003d cleanfile($buildd, $_, $blddir);\n }\n # Take note if the file to depend on is being renamed\n # Take extra care with files ending with .a, they should\n # be treated without that extension, and the extension\n # should be added back after treatment.\n $d \u003d~ /(\u005c.a)?$/;\n my $e \u003d $1 // \u0022\u0022;\n $d \u003d $`;\n if ($unified_info{rename}-\u003e{$d}) {\n $d \u003d $unified_info{rename}-\u003e{$d};\n }\n $d .\u003d $e;\n $unified_info{depends}-\u003e{$ddest}-\u003e{$d} \u003d 1;\n # If we depend on a header file or a perl module, let's make\n # sure it can get included\n if ($dest ne \u0022\u0022 \u0026\u0026 $d \u003d~ /\u005c.(h|pm)$/) {\n my $i \u003d dirname($d);\n push @{$unified_info{includes}-\u003e{$ddest}-\u003e{source}}, $i\n unless grep { $_ eq $i } @{$unified_info{includes}-\u003e{$ddest}-\u003e{source}};\n }\n }\n }\n\n foreach (keys %includes) {\n my $dest \u003d $_;\n my $ddest \u003d cleanfile($sourced, $_, $blddir);\n\n # If the destination doesn't exist in source, it can only be\n # a generated file in the build tree.\n if (! -f $ddest) {\n $ddest \u003d cleanfile($buildd, $_, $blddir);\n if ($unified_info{rename}-\u003e{$ddest}) {\n $ddest \u003d $unified_info{rename}-\u003e{$ddest};\n }\n }\n foreach (@{$includes{$dest}}) {\n my $is \u003d cleandir($sourced, $_, $blddir);\n my $ib \u003d cleandir($buildd, $_, $blddir);\n push @{$unified_info{includes}-\u003e{$ddest}-\u003e{source}}, $is\n unless grep { $_ eq $is } @{$unified_info{includes}-\u003e{$ddest}-\u003e{source}};\n push @{$unified_info{includes}-\u003e{$ddest}-\u003e{build}}, $ib\n unless grep { $_ eq $ib } @{$unified_info{includes}-\u003e{$ddest}-\u003e{build}};\n }\n }\n }\n\n ### Make unified_info a bit more efficient\n # One level structures\n foreach ((\u0022programs\u0022, \u0022libraries\u0022, \u0022engines\u0022, \u0022scripts\u0022, \u0022extra\u0022, \u0022overrides\u0022)) {\n $unified_info{$_} \u003d [ sort keys %{$unified_info{$_}} ];\n }\n # Two level structures\n foreach my $l1 ((\u0022install\u0022, \u0022sources\u0022, \u0022shared_sources\u0022, \u0022ldadd\u0022, \u0022depends\u0022)) {\n foreach my $l2 (sort keys %{$unified_info{$l1}}) {\n $unified_info{$l1}-\u003e{$l2} \u003d\n [ sort keys %{$unified_info{$l1}-\u003e{$l2}} ];\n }\n }\n # Includes\n foreach my $dest (sort keys %{$unified_info{includes}}) {\n if (defined($unified_info{includes}-\u003e{$dest}-\u003e{build})) {\n my @source_includes \u003d\n ( @{$unified_info{includes}-\u003e{$dest}-\u003e{source}} );\n $unified_info{includes}-\u003e{$dest} \u003d\n [ @{$unified_info{includes}-\u003e{$dest}-\u003e{build}} ];\n foreach my $inc (@source_includes) {\n push @{$unified_info{includes}-\u003e{$dest}}, $inc\n unless grep { $_ eq $inc } @{$unified_info{includes}-\u003e{$dest}};\n }\n } else {\n $unified_info{includes}-\u003e{$dest} \u003d\n [ @{$unified_info{includes}-\u003e{$dest}-\u003e{source}} ];\n }\n }\n}\n\n# For the schemes that need it, we provide the old *_obj configs\n# from the *_asm_obj ones\nforeach (grep /_(asm|aux)_src$/, keys %target) {\n my $src \u003d $_;\n (my $obj \u003d $_) \u003d~ s/_(asm|aux)_src$/_obj/;\n $target{$obj} \u003d $target{$src};\n $target{$obj} \u003d~ s/\u005c.[csS]\u005cb/.o/g; # C and assembler\n $target{$obj} \u003d~ s/\u005c.(cc|cpp)\u005cb/_cc.o/g; # C++\n}\n\n# Write down our configuration where it fits #########################\n\nopen(OUT,\u0022\u003econfigdata.pm\u0022) || die \u0022unable to create configdata.pm: $!\u005cn\u0022;\nprint OUT \u003c\u003c\u0022EOF\u0022;\npackage configdata;\n\nuse strict;\nuse warnings;\n\nuse Exporter;\n#use vars qw(\u005c@ISA \u005c@EXPORT);\nour \u005c@ISA \u003d qw(Exporter);\nour \u005c@EXPORT \u003d qw(\u005c%config \u005c%target \u005c%disabled \u005c%withargs \u005c%unified_info \u005c@disablables);\n\nEOF\nprint OUT \u0022our %config \u003d (\u005cn\u0022;\nforeach (sort keys %config) {\n if (ref($config{$_}) eq \u0022ARRAY\u0022) {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e [ \u0022, join(\u0022, \u0022,\n\t\t\t\t\t map { quotify(\u0022perl\u0022, $_) }\n\t\t\t\t\t @{$config{$_}}), \u0022 ],\u005cn\u0022;\n } else {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $config{$_}), \u0022,\u005cn\u0022\n }\n}\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nprint OUT \u0022our %target \u003d (\u005cn\u0022;\nforeach (sort keys %target) {\n if (ref($target{$_}) eq \u0022ARRAY\u0022) {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e [ \u0022, join(\u0022, \u0022,\n\t\t\t\t\t map { quotify(\u0022perl\u0022, $_) }\n\t\t\t\t\t @{$target{$_}}), \u0022 ],\u005cn\u0022;\n } else {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $target{$_}), \u0022,\u005cn\u0022\n }\n}\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nprint OUT \u0022our \u005c%available_protocols \u003d (\u005cn\u0022;\nprint OUT \u0022 tls \u003d\u003e [ \u0022, join(\u0022, \u0022, map { quotify(\u0022perl\u0022, $_) } @tls), \u0022 ],\u005cn\u0022;\nprint OUT \u0022 dtls \u003d\u003e [ \u0022, join(\u0022, \u0022, map { quotify(\u0022perl\u0022, $_) } @dtls), \u0022 ],\u005cn\u0022;\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nprint OUT \u0022our \u005c@disablables \u003d (\u005cn\u0022;\nforeach (@disablables) {\n print OUT \u0022 \u0022, quotify(\u0022perl\u0022, $_), \u0022,\u005cn\u0022;\n}\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nprint OUT \u0022our \u005c%disabled \u003d (\u005cn\u0022;\nforeach (sort keys %disabled) {\n print OUT \u0022 \u0022, quotify(\u0022perl\u0022, $_), \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $disabled{$_}), \u0022,\u005cn\u0022;\n}\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nprint OUT \u0022our %withargs \u003d (\u005cn\u0022;\nforeach (sort keys %withargs) {\n if (ref($withargs{$_}) eq \u0022ARRAY\u0022) {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e [ \u0022, join(\u0022, \u0022,\n\t\t\t\t\t map { quotify(\u0022perl\u0022, $_) }\n\t\t\t\t\t @{$withargs{$_}}), \u0022 ],\u005cn\u0022;\n } else {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $withargs{$_}), \u0022,\u005cn\u0022\n }\n}\nprint OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\nif ($builder eq \u0022unified\u0022) {\n my $recurse;\n $recurse \u003d sub {\n my $indent \u003d shift;\n foreach (@_) {\n if (ref $_ eq \u0022ARRAY\u0022) {\n print OUT \u0022 \u0022x$indent, \u0022[\u005cn\u0022;\n foreach (@$_) {\n $recurse-\u003e($indent + 4, $_);\n }\n print OUT \u0022 \u0022x$indent, \u0022],\u005cn\u0022;\n } elsif (ref $_ eq \u0022HASH\u0022) {\n my %h \u003d %$_;\n print OUT \u0022 \u0022x$indent, \u0022{\u005cn\u0022;\n foreach (sort keys %h) {\n if (ref $h{$_} eq \u0022\u0022) {\n print OUT \u0022 \u0022x($indent + 4), quotify(\u0022perl\u0022, $_), \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $h{$_}), \u0022,\u005cn\u0022;\n } else {\n print OUT \u0022 \u0022x($indent + 4), quotify(\u0022perl\u0022, $_), \u0022 \u003d\u003e\u005cn\u0022;\n $recurse-\u003e($indent + 8, $h{$_});\n }\n }\n print OUT \u0022 \u0022x$indent, \u0022},\u005cn\u0022;\n } else {\n print OUT \u0022 \u0022x$indent, quotify(\u0022perl\u0022, $_), \u0022,\u005cn\u0022;\n }\n }\n };\n print OUT \u0022our %unified_info \u003d (\u005cn\u0022;\n foreach (sort keys %unified_info) {\n if (ref $unified_info{$_} eq \u0022\u0022) {\n print OUT \u0022 \u0022x4, quotify(\u0022perl\u0022, $_), \u0022 \u003d\u003e \u0022, quotify(\u0022perl\u0022, $unified_info{$_}), \u0022,\u005cn\u0022;\n } else {\n print OUT \u0022 \u0022x4, quotify(\u0022perl\u0022, $_), \u0022 \u003d\u003e\u005cn\u0022;\n $recurse-\u003e(8, $unified_info{$_});\n }\n }\n print OUT \u003c\u003c\u0022EOF\u0022;\n);\n\nEOF\n}\nprint OUT \u00221;\u005cn\u0022;\nclose(OUT);\n\nprint \u0022\u005cn\u0022;\nprint \u0022PROCESSOR \u003d$config{processor}\u005cn\u0022 if $config{processor};\nprint \u0022PERL \u003d$config{perl}\u005cn\u0022;\nprint \u0022PERLVERSION \u003d$Config{version} for $Config{archname}\u005cn\u0022;\nprint \u0022HASHBANGPERL \u003d$config{hashbangperl}\u005cn\u0022;\nprint \u0022CC \u003d$config{cross_compile_prefix}$target{cc}\u005cn\u0022;\nprint \u0022CFLAG \u003d$target{cflags} $config{cflags}\u005cn\u0022;\nprint \u0022CXX \u003d$config{cross_compile_prefix}$target{cxx}\u005cn\u0022\n if defined $target{cxx};\nprint \u0022CXXFLAG \u003d$target{cxxflags} $config{cxxflags}\u005cn\u0022\n if defined $target{cxx};\nprint \u0022DEFINES \u003d\u0022,join(\u0022 \u0022, @{$target{defines}}, @{$config{defines}}),\u0022\u005cn\u0022;\n#print \u0022RANLIB \u003d\u0022, $target{ranlib} eq '$(CROSS_COMPILE)ranlib' ?\n# \u0022$config{cross_compile_prefix}ranlib\u0022 :\n# \u0022$target{ranlib}\u0022, \u0022\u005cn\u0022;\nprint \u0022EX_LIBS \u003d$target{ex_libs} $config{ex_libs}\u005cn\u0022;\n\nmy %builders \u003d (\n unified \u003d\u003e sub {\n run_dofile(catfile($blddir, $target{build_file}),\n @{$config{build_file_templates}});\n },\n );\n\n$builders{$builder}-\u003e($builder_platform, @builder_opts);\n\nprint \u003c\u003c\u0022EOF\u0022 if ($disabled{threads} eq \u0022unavailable\u0022);\n\nThe library could not be configured for supporting multi-threaded\napplications as the compiler options required on this system are not known.\nSee file INSTALL for details if you need multi-threading.\nEOF\n\nprint \u003c\u003c\u0022EOF\u0022 if ($no_shared_warn);\n\nThe options 'shared', 'pic' and 'dynamic-engine' aren't supported on this\nplatform, so we will pretend you gave the option 'no-pic', which also disables\n'shared' and 'dynamic-engine'. If you know how to implement shared libraries\nor position independent code, please let us know (but please first make sure\nyou have tried with a current version of OpenSSL).\nEOF\n\nprint \u003c\u003c\u0022EOF\u0022 if (-f catfile($srcdir, \u0022configdata.pm\u0022) \u0026\u0026 $srcdir ne $blddir);\n\nWARNING: there are indications that another build was made in the source\ndirectory. This build may have picked up artifacts from that build, the\nsafest course of action is to clean the source directory and redo this\nconfiguration.\nEOF\n\nexit(0);\n\n######################################################################\n#\n# Helpers and utility functions\n#\n\n# Configuration file reading #########################################\n\n# Note: All of the helper functions are for lazy evaluation. They all\n# return a CODE ref, which will return the intended value when evaluated.\n# Thus, whenever there's mention of a returned value, it's about that\n# intended value.\n\n# Helper function to implement conditional inheritance depending on the\n# value of $disabled{asm}. Used in inherit_from values as follows:\n#\n# inherit_from \u003d\u003e [ \u0022template\u0022, asm(\u0022asm_tmpl\u0022) ]\n#\nsub asm {\n my @x \u003d @_;\n sub {\n\t$disabled{asm} ? () : @x;\n }\n}\n\n# Helper function to implement conditional value variants, with a default\n# plus additional values based on the value of $config{build_type}.\n# Arguments are given in hash table form:\n#\n# picker(default \u003d\u003e \u0022Basic string: \u0022,\n# debug \u003d\u003e \u0022debug\u0022,\n# release \u003d\u003e \u0022release\u0022)\n#\n# When configuring with --debug, the resulting string will be\n# \u0022Basic string: debug\u0022, and when not, it will be \u0022Basic string: release\u0022\n#\n# This can be used to create variants of sets of flags according to the\n# build type:\n#\n# cflags \u003d\u003e picker(default \u003d\u003e \u0022-Wall\u0022,\n# debug \u003d\u003e \u0022-g -O0\u0022,\n# release \u003d\u003e \u0022-O3\u0022)\n#\nsub picker {\n my %opts \u003d @_;\n return sub { add($opts{default} || (),\n $opts{$config{build_type}} || ())-\u003e(); }\n}\n\n# Helper function to combine several values of different types into one.\n# This is useful if you want to combine a string with the result of a\n# lazy function, such as:\n#\n# cflags \u003d\u003e combine(\u0022-Wall\u0022, sub { $disabled{zlib} ? () : \u0022-DZLIB\u0022 })\n#\nsub combine {\n my @stuff \u003d @_;\n return sub { add(@stuff)-\u003e(); }\n}\n\n# Helper function to implement conditional values depending on the value\n# of $disabled{threads}. Can be used as follows:\n#\n# cflags \u003d\u003e combine(\u0022-Wall\u0022, threads(\u0022-pthread\u0022))\n#\nsub threads {\n my @flags \u003d @_;\n return sub { add($disabled{threads} ? () : @flags)-\u003e(); }\n}\n\n\n\nour $add_called \u003d 0;\n# Helper function to implement adding values to already existing configuration\n# values. It handles elements that are ARRAYs, CODEs and scalars\nsub _add {\n my $separator \u003d shift;\n\n # If there's any ARRAY in the collection of values OR the separator\n # is undef, we will return an ARRAY of combined values, otherwise a\n # string of joined values with $separator as the separator.\n my $found_array \u003d !defined($separator);\n\n my @values \u003d\n\tmap {\n\t my $res \u003d $_;\n\t while (ref($res) eq \u0022CODE\u0022) {\n\t\t$res \u003d $res-\u003e();\n\t }\n\t if (defined($res)) {\n\t\tif (ref($res) eq \u0022ARRAY\u0022) {\n\t\t $found_array \u003d 1;\n\t\t @$res;\n\t\t} else {\n\t\t $res;\n\t\t}\n\t } else {\n\t\t();\n\t }\n } (@_);\n\n $add_called \u003d 1;\n\n if ($found_array) {\n\t[ @values ];\n } else {\n\tjoin($separator, grep { defined($_) \u0026\u0026 $_ ne \u0022\u0022 } @values);\n }\n}\nsub add_before {\n my $separator \u003d \u0022 \u0022;\n if (ref($_[$#_]) eq \u0022HASH\u0022) {\n my $opts \u003d pop;\n $separator \u003d $opts-\u003e{separator};\n }\n my @x \u003d @_;\n sub { _add($separator, @x, @_) };\n}\nsub add {\n my $separator \u003d \u0022 \u0022;\n if (ref($_[$#_]) eq \u0022HASH\u0022) {\n my $opts \u003d pop;\n $separator \u003d $opts-\u003e{separator};\n }\n my @x \u003d @_;\n sub { _add($separator, @_, @x) };\n}\n\n# configuration reader, evaluates the input file as a perl script and expects\n# it to fill %targets with target configurations. Those are then added to\n# %table.\nsub read_config {\n my $fname \u003d shift;\n open(CONFFILE, \u0022\u003c $fname\u0022)\n\tor die \u0022Can't open configuration file '$fname'!\u005cn\u0022;\n my $x \u003d $/;\n undef $/;\n my $content \u003d \u003cCONFFILE\u003e;\n $/ \u003d $x;\n close(CONFFILE);\n my %targets \u003d ();\n {\n\t# Protect certain tables from tampering\n\tlocal %table \u003d %::table;\n\n\teval $content;\n\twarn $@ if $@;\n }\n\n # For each target, check that it's configured with a hash table.\n foreach (keys %targets) {\n\tif (ref($targets{$_}) ne \u0022HASH\u0022) {\n\t if (ref($targets{$_}) eq \u0022\u0022) {\n\t\twarn \u0022Deprecated target configuration for $_, ignoring...\u005cn\u0022;\n\t } else {\n\t\twarn \u0022Misconfigured target configuration for $_ (should be a hash table), ignoring...\u005cn\u0022;\n\t }\n\t delete $targets{$_};\n\t} else {\n $targets{$_}-\u003e{_conf_fname_int} \u003d add([ $fname ]);\n }\n }\n\n %table \u003d (%table, %targets);\n\n}\n\n# configuration resolver. Will only resolve all the lazy evaluation\n# codeblocks for the chosen target and all those it inherits from,\n# recursively\nsub resolve_config {\n my $target \u003d shift;\n my @breadcrumbs \u003d @_;\n\n# my $extra_checks \u003d defined($ENV{CONFIGURE_EXTRA_CHECKS});\n\n if (grep { $_ eq $target } @breadcrumbs) {\n\tdie \u0022inherit_from loop! target backtrace:\u005cn \u0022\n\t ,$target,\u0022\u005cn \u0022,join(\u0022\u005cn \u0022, @breadcrumbs),\u0022\u005cn\u0022;\n }\n\n if (!defined($table{$target})) {\n\twarn \u0022Warning! target $target doesn't exist!\u005cn\u0022;\n\treturn ();\n }\n # Recurse through all inheritances. They will be resolved on the\n # fly, so when this operation is done, they will all just be a\n # bunch of attributes with string values.\n # What we get here, though, are keys with references to lists of\n # the combined values of them all. We will deal with lists after\n # this stage is done.\n my %combined_inheritance \u003d ();\n if ($table{$target}-\u003e{inherit_from}) {\n\tmy @inherit_from \u003d\n\t map { ref($_) eq \u0022CODE\u0022 ? $_-\u003e() : $_ } @{$table{$target}-\u003e{inherit_from}};\n\tforeach (@inherit_from) {\n\t my %inherited_config \u003d resolve_config($_, $target, @breadcrumbs);\n\n\t # 'template' is a marker that's considered private to\n\t # the config that had it.\n\t delete $inherited_config{template};\n\n\t foreach (keys %inherited_config) {\n\t\tif (!$combined_inheritance{$_}) {\n\t\t $combined_inheritance{$_} \u003d [];\n\t\t}\n\t\tpush @{$combined_inheritance{$_}}, $inherited_config{$_};\n\t }\n\t}\n }\n\n # We won't need inherit_from in this target any more, since we've\n # resolved all the inheritances that lead to this\n delete $table{$target}-\u003e{inherit_from};\n\n # Now is the time to deal with those lists. Here's the place to\n # decide what shall be done with those lists, all based on the\n # values of the target we're currently dealing with.\n # - If a value is a coderef, it will be executed with the list of\n # inherited values as arguments.\n # - If the corresponding key doesn't have a value at all or is the\n # empty string, the inherited value list will be run through the\n # default combiner (below), and the result becomes this target's\n # value.\n # - Otherwise, this target's value is assumed to be a string that\n # will simply override the inherited list of values.\n my $default_combiner \u003d add();\n\n my %all_keys \u003d\n\tmap { $_ \u003d\u003e 1 } (keys %combined_inheritance,\n\t\t\t keys %{$table{$target}});\n\n sub process_values {\n\tmy $object \u003d shift;\n\tmy $inherited \u003d shift; # Always a [ list ]\n\tmy $target \u003d shift;\n\tmy $entry \u003d shift;\n\n $add_called \u003d 0;\n\n while(ref($object) eq \u0022CODE\u0022) {\n $object \u003d $object-\u003e(@$inherited);\n }\n if (!defined($object)) {\n return ();\n }\n elsif (ref($object) eq \u0022ARRAY\u0022) {\n local $add_called; # To make sure recursive calls don't affect it\n return [ map { process_values($_, $inherited, $target, $entry) }\n @$object ];\n } elsif (ref($object) eq \u0022\u0022) {\n return $object;\n } else {\n die \u0022cannot handle reference type \u0022,ref($object)\n ,\u0022 found in target \u0022,$target,\u0022 -\u003e \u0022,$entry,\u0022\u005cn\u0022;\n }\n }\n\n foreach (sort keys %all_keys) {\n my $previous \u003d $combined_inheritance{$_};\n\n\t# Current target doesn't have a value for the current key?\n\t# Assign it the default combiner, the rest of this loop body\n\t# will handle it just like any other coderef.\n\tif (!exists $table{$target}-\u003e{$_}) {\n\t $table{$target}-\u003e{$_} \u003d $default_combiner;\n\t}\n\n\t$table{$target}-\u003e{$_} \u003d process_values($table{$target}-\u003e{$_},\n\t\t\t\t\t $combined_inheritance{$_},\n\t\t\t\t\t $target, $_);\n unless(defined($table{$target}-\u003e{$_})) {\n delete $table{$target}-\u003e{$_};\n }\n# if ($extra_checks \u0026\u0026\n# $previous \u0026\u0026 !($add_called || $previous ~~ $table{$target}-\u003e{$_})) {\n# warn \u0022$_ got replaced in $target\u005cn\u0022;\n# }\n }\n\n # Finally done, return the result.\n return %{$table{$target}};\n}\n\nsub usage\n\t{\n\tprint STDERR $usage;\n\tprint STDERR \u0022\u005cnpick os/compiler from:\u005cn\u0022;\n\tmy $j\u003d0;\n\tmy $i;\n my $k\u003d0;\n\tforeach $i (sort keys %table)\n\t\t{\n\t\tnext if $table{$i}-\u003e{template};\n\t\tnext if $i \u003d~ /^debug/;\n\t\t$k +\u003d length($i) + 1;\n\t\tif ($k \u003e 78)\n\t\t\t{\n\t\t\tprint STDERR \u0022\u005cn\u0022;\n\t\t\t$k\u003dlength($i);\n\t\t\t}\n\t\tprint STDERR $i . \u0022 \u0022;\n\t\t}\n\tforeach $i (sort keys %table)\n\t\t{\n\t\tnext if $table{$i}-\u003e{template};\n\t\tnext if $i !~ /^debug/;\n\t\t$k +\u003d length($i) + 1;\n\t\tif ($k \u003e 78)\n\t\t\t{\n\t\t\tprint STDERR \u0022\u005cn\u0022;\n\t\t\t$k\u003dlength($i);\n\t\t\t}\n\t\tprint STDERR $i . \u0022 \u0022;\n\t\t}\n\tprint STDERR \u0022\u005cn\u005cnNOTE: If in doubt, on Unix-ish systems use './config'.\u005cn\u0022;\n\texit(1);\n\t}\n\nsub run_dofile\n{\n my $out \u003d shift;\n my @templates \u003d @_;\n\n unlink $out || warn \u0022Can't remove $out, $!\u0022\n if -f $out;\n foreach (@templates) {\n die \u0022Can't open $_, $!\u0022 unless -f $_;\n }\n my $perlcmd \u003d (quotify(\u0022maybeshell\u0022, $config{perl}))[0];\n my $cmd \u003d \u0022$perlcmd \u005c\u0022-I.\u005c\u0022 \u005c\u0022-Mconfigdata\u005c\u0022 \u005c\u0022$dofile\u005c\u0022 -o\u005c\u0022Configure\u005c\u0022 \u005c\u0022\u0022.join(\u0022\u005c\u0022 \u005c\u0022\u0022,@templates).\u0022\u005c\u0022 \u003e \u005c\u0022$out.new\u005c\u0022\u0022;\n #print STDERR \u0022DEBUG[run_dofile]: \u005c$cmd \u003d $cmd\u005cn\u0022;\n system($cmd);\n exit 1 if $? !\u003d 0;\n rename(\u0022$out.new\u0022, $out) || die \u0022Can't rename $out.new, $!\u0022;\n}\n\nsub which\n{\n my ($name)\u003d@_;\n\n if (eval { require IPC::Cmd; 1; }) {\n IPC::Cmd-\u003eimport();\n return scalar IPC::Cmd::can_run($name);\n } else {\n # if there is $directories component in splitpath,\n # then it's not something to test with $PATH...\n return $name if (File::Spec-\u003esplitpath($name))[1];\n\n foreach (File::Spec-\u003epath()) {\n my $fullpath \u003d catfile($_, \u0022$name$target{exe_extension}\u0022);\n if (-f $fullpath and -x $fullpath) {\n return $fullpath;\n }\n }\n }\n}\n\n# Configuration printer ##############################################\n\nsub print_table_entry\n{\n my $target \u003d shift;\n my %target \u003d resolve_config($target);\n my $type \u003d shift;\n\n # Don't print the templates\n return if $target{template};\n\n my @sequence \u003d (\n\t\u0022sys_id\u0022,\n\t\u0022cc\u0022,\n\t\u0022cflags\u0022,\n\t\u0022defines\u0022,\n\t\u0022unistd\u0022,\n\t\u0022ld\u0022,\n\t\u0022lflags\u0022,\n\t\u0022loutflag\u0022,\n\t\u0022plib_lflags\u0022,\n\t\u0022ex_libs\u0022,\n\t\u0022bn_ops\u0022,\n\t\u0022apps_aux_src\u0022,\n\t\u0022cpuid_asm_src\u0022,\n\t\u0022uplink_aux_src\u0022,\n\t\u0022bn_asm_src\u0022,\n\t\u0022ec_asm_src\u0022,\n\t\u0022des_asm_src\u0022,\n\t\u0022aes_asm_src\u0022,\n\t\u0022bf_asm_src\u0022,\n\t\u0022md5_asm_src\u0022,\n\t\u0022cast_asm_src\u0022,\n\t\u0022sha1_asm_src\u0022,\n\t\u0022rc4_asm_src\u0022,\n\t\u0022rmd160_asm_src\u0022,\n\t\u0022rc5_asm_src\u0022,\n\t\u0022wp_asm_src\u0022,\n\t\u0022cmll_asm_src\u0022,\n\t\u0022modes_asm_src\u0022,\n\t\u0022padlock_asm_src\u0022,\n\t\u0022chacha_asm_src\u0022,\n\t\u0022poly1035_asm_src\u0022,\n\t\u0022thread_scheme\u0022,\n\t\u0022perlasm_scheme\u0022,\n\t\u0022dso_scheme\u0022,\n\t\u0022shared_target\u0022,\n\t\u0022shared_cflag\u0022,\n\t\u0022shared_defines\u0022,\n\t\u0022shared_ldflag\u0022,\n\t\u0022shared_rcflag\u0022,\n\t\u0022shared_extension\u0022,\n\t\u0022dso_extension\u0022,\n\t\u0022obj_extension\u0022,\n\t\u0022exe_extension\u0022,\n\t\u0022ranlib\u0022,\n\t\u0022ar\u0022,\n\t\u0022arflags\u0022,\n\t\u0022aroutflag\u0022,\n\t\u0022rc\u0022,\n\t\u0022rcflags\u0022,\n\t\u0022rcoutflag\u0022,\n\t\u0022mt\u0022,\n\t\u0022mtflags\u0022,\n\t\u0022mtinflag\u0022,\n\t\u0022mtoutflag\u0022,\n\t\u0022multilib\u0022,\n\t\u0022build_scheme\u0022,\n\t);\n\n if ($type eq \u0022TABLE\u0022) {\n\tprint \u0022\u005cn\u0022;\n\tprint \u0022*** $target\u005cn\u0022;\n foreach (@sequence) {\n if (ref($target{$_}) eq \u0022ARRAY\u0022) {\n printf \u0022\u005c$%-12s \u003d %s\u005cn\u0022, $_, join(\u0022 \u0022, @{$target{$_}});\n } else {\n printf \u0022\u005c$%-12s \u003d %s\u005cn\u0022, $_, $target{$_};\n }\n }\n } elsif ($type eq \u0022HASH\u0022) {\n\tmy $largest \u003d\n\t length((sort { length($a) \u003c\u003d\u003e length($b) } @sequence)[-1]);\n\tprint \u0022 '$target' \u003d\u003e {\u005cn\u0022;\n\tforeach (@sequence) {\n\t if ($target{$_}) {\n if (ref($target{$_}) eq \u0022ARRAY\u0022) {\n print \u0022 '\u0022,$_,\u0022'\u0022,\u0022 \u0022 x ($largest - length($_)),\u0022 \u003d\u003e [ \u0022,join(\u0022, \u0022, map { \u0022'$_'\u0022 } @{$target{$_}}),\u0022 ],\u005cn\u0022;\n } else {\n print \u0022 '\u0022,$_,\u0022'\u0022,\u0022 \u0022 x ($largest - length($_)),\u0022 \u003d\u003e '\u0022,$target{$_},\u0022',\u005cn\u0022;\n }\n\t }\n\t}\n\tprint \u0022 },\u005cn\u0022;\n }\n}\n\n# Utility routines ###################################################\n\n# On VMS, if the given file is a logical name, File::Spec::Functions\n# will consider it an absolute path. There are cases when we want a\n# purely syntactic check without checking the environment.\nsub isabsolute {\n my $file \u003d shift;\n\n # On non-platforms, we just use file_name_is_absolute().\n return file_name_is_absolute($file) unless $^O eq \u0022VMS\u0022;\n\n # If the file spec includes a device or a directory spec,\n # file_name_is_absolute() is perfectly safe.\n return file_name_is_absolute($file) if $file \u003d~ m|[:\u005c[]|;\n\n # Here, we know the given file spec isn't absolute\n return 0;\n}\n\n# Makes a directory absolute and cleans out /../ in paths like foo/../bar\n# On some platforms, this uses rel2abs(), while on others, realpath() is used.\n# realpath() requires that at least all path components except the last is an\n# existing directory. On VMS, the last component of the directory spec must\n# exist.\nsub absolutedir {\n my $dir \u003d shift;\n\n # realpath() is quite buggy on VMS. It uses LIB$FID_TO_NAME, which\n # will return the volume name for the device, no matter what. Also,\n # it will return an incorrect directory spec if the argument is a\n # directory that doesn't exist.\n if ($^O eq \u0022VMS\u0022) {\n return rel2abs($dir);\n }\n\n # We use realpath() on Unix, since no other will properly clean out\n # a directory spec.\n use Cwd qw/realpath/;\n\n return realpath($dir);\n}\n\nsub quotify {\n my %processors \u003d (\n\tperl \u003d\u003e sub { my $x \u003d shift;\n\t\t\t $x \u003d~ s/([\u005c\u005c\u005c$\u005c@\u0022])/\u005c\u005c$1/g;\n\t\t\t return '\u0022'.$x.'\u0022'; },\n\tmaybeshell \u003d\u003e sub { my $x \u003d shift;\n\t\t\t (my $y \u003d $x) \u003d~ s/([\u005c\u005c\u005c\u0022])/\u005c\u005c$1/g;\n\t\t\t if ($x ne $y || $x \u003d~ m|\u005cs|) {\n\t\t\t\treturn '\u0022'.$y.'\u0022';\n\t\t\t } else {\n\t\t\t\treturn $x;\n\t\t\t }\n\t\t\t},\n\t);\n my $for \u003d shift;\n my $processor \u003d\n\tdefined($processors{$for}) ? $processors{$for} : sub { shift; };\n\n return map { $processor-\u003e($_); } @_;\n}\n\n# collect_from_file($filename, $line_concat_cond_re, $line_concat)\n# $filename is a file name to read from\n# $line_concat_cond_re is a regexp detecting a line continuation ending\n# $line_concat is a CODEref that takes care of concatenating two lines\nsub collect_from_file {\n my $filename \u003d shift;\n my $line_concat_cond_re \u003d shift;\n my $line_concat \u003d shift;\n\n open my $fh, $filename || die \u0022unable to read $filename: $!\u005cn\u0022;\n return sub {\n my $saved_line \u003d \u0022\u0022;\n $_ \u003d \u0022\u0022;\n while (\u003c$fh\u003e) {\n s|\u005cR$||;\n if (defined $line_concat) {\n $_ \u003d $line_concat-\u003e($saved_line, $_);\n $saved_line \u003d \u0022\u0022;\n }\n if (defined $line_concat_cond_re \u0026\u0026 /$line_concat_cond_re/) {\n $saved_line \u003d $_;\n next;\n }\n return $_;\n }\n die \u0022$filename ending with continuation line\u005cn\u0022 if $_;\n close $fh;\n return undef;\n }\n}\n\n# collect_from_array($array, $line_concat_cond_re, $line_concat)\n# $array is an ARRAYref of lines\n# $line_concat_cond_re is a regexp detecting a line continuation ending\n# $line_concat is a CODEref that takes care of concatenating two lines\nsub collect_from_array {\n my $array \u003d shift;\n my $line_concat_cond_re \u003d shift;\n my $line_concat \u003d shift;\n my @array \u003d (@$array);\n\n return sub {\n my $saved_line \u003d \u0022\u0022;\n $_ \u003d \u0022\u0022;\n while (defined($_ \u003d shift @array)) {\n s|\u005cR$||;\n if (defined $line_concat) {\n $_ \u003d $line_concat-\u003e($saved_line, $_);\n $saved_line \u003d \u0022\u0022;\n }\n if (defined $line_concat_cond_re \u0026\u0026 /$line_concat_cond_re/) {\n $saved_line \u003d $_;\n next;\n }\n return $_;\n }\n die \u0022input text ending with continuation line\u005cn\u0022 if $_;\n return undef;\n }\n}\n\n# collect_information($lineiterator, $line_continue, $regexp \u003d\u003e $CODEref, ...)\n# $lineiterator is a CODEref that delivers one line at a time.\n# All following arguments are regex/CODEref pairs, where the regexp detects a\n# line and the CODEref does something with the result of the regexp.\nsub collect_information {\n my $lineiterator \u003d shift;\n my %collectors \u003d @_;\n\n while(defined($_ \u003d $lineiterator-\u003e())) {\n s|\u005cR$||;\n my $found \u003d 0;\n if ($collectors{\u0022BEFORE\u0022}) {\n $collectors{\u0022BEFORE\u0022}-\u003e($_);\n }\n foreach my $re (keys %collectors) {\n if ($re !~ /^OTHERWISE|BEFORE|AFTER$/ \u0026\u0026 /$re/) {\n $collectors{$re}-\u003e($lineiterator);\n $found \u003d 1;\n };\n }\n if ($collectors{\u0022OTHERWISE\u0022}) {\n $collectors{\u0022OTHERWISE\u0022}-\u003e($lineiterator, $_)\n unless $found || !defined $collectors{\u0022OTHERWISE\u0022};\n }\n if ($collectors{\u0022AFTER\u0022}) {\n $collectors{\u0022AFTER\u0022}-\u003e($_);\n }\n }\n}\n\n# tokenize($line)\n# $line is a line of text to split up into tokens\n# returns a list of tokens\n#\n# Tokens are divided by spaces. If the tokens include spaces, they\n# have to be quoted with single or double quotes. Double quotes\n# inside a double quoted token must be escaped. Escaping is done\n# with backslash.\n# Basically, the same quoting rules apply for \u0022 and ' as in any\n# Unix shell.\nsub tokenize {\n my $line \u003d my $debug_line \u003d shift;\n my @result \u003d ();\n\n while ($line \u003d~ s|^\u005cs+||, $line ne \u0022\u0022) {\n my $token \u003d \u0022\u0022;\n while ($line ne \u0022\u0022 \u0026\u0026 $line !~ m|^\u005cs|) {\n if ($line \u003d~ m/^\u0022((?:[^\u0022\u005c\u005c]+|\u005c\u005c.)*)\u0022/) {\n $token .\u003d $1;\n $line \u003d $';\n } elsif ($line \u003d~ m/^'([^']*)'/) {\n $token .\u003d $1;\n $line \u003d $';\n } elsif ($line \u003d~ m/^(\u005cS+)/) {\n $token .\u003d $1;\n $line \u003d $';\n }\n }\n push @result, $token;\n }\n\n if ($ENV{CONFIGURE_DEBUG_TOKENIZE}) {\n\tprint STDERR \u0022DEBUG[tokenize]: Parsed '$debug_line' into:\u005cn\u0022;\n\tprint STDERR \u0022DEBUG[tokenize]: ('\u0022, join(\u0022', '\u0022, @result), \u0022')\u005cn\u0022;\n }\n return @result;\n}\n","s":{"c":1753257102,"u": 6757}} ],"g": 21964,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}