Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1749063638, "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":"3de2ad2e69d2e7acf3e505f0046d52f1", "oid":{ "oid": "50eaac9f3337667259de725451f201e784599687", "alias": [ "refs/heads/master"]},"blobname": "Configure", "blob": "#! /usr/bin/env perl\n# -*- mode: perl; -*-\n# Copyright 2016-2019 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 $orig_death_handler \u003d $SIG{__DIE__};\n$SIG{__DIE__} \u003d \u005c\u0026death_handler;\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 -Wstrict-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\n# -Wunused-function -- no, it forces header use of safestack et al\n# DEFINE macros\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 . \u0022 -Wno-unused-function\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 ();\nour $now_printing; # set to current entry's name in print_table_entry\n # (todo: right thing would be to encapsulate name\n # into %target [class] and make print_table_entry\n # a method)\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 die \u0022reconfiguring with other arguments present isn't supported\u0022\n if scalar @argvcopy \u003e 1;\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$config{perlenv} \u003d $configdata::config{perlenv} // {};\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# Save away perl command information\n$config{perl_cmd} \u003d $^X;\n$config{perl_version} \u003d $Config{version};\n$config{perl_archname} \u003d $Config{archname};\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;\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, \u0022sm3\u0022,\n \u0022des\u0022, \u0022aes\u0022, \u0022rc2\u0022, \u0022rc4\u0022, \u0022rc5\u0022, \u0022idea\u0022, \u0022aria\u0022, \u0022bf\u0022, \u0022cast\u0022, \u0022camellia\u0022, \u0022seed\u0022, \u0022sm4\u0022, \u0022chacha\u0022, \u0022modes\u0022,\n \u0022bn\u0022, \u0022ec\u0022, \u0022rsa\u0022, \u0022dsa\u0022, \u0022dh\u0022, \u0022sm2\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 \u0022autoload-config\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 \u0022pinshared\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 \u0022sm2\u0022,\n \u0022sm3\u0022,\n \u0022sm4\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 \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 are disabled by default:\n\nour %disabled \u003d ( # \u0022what\u0022 \u003d\u003e \u0022comment\u0022\n\t\t \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\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 \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 \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, \u0022sm2\u0022 ],\n \u0022sm3\u0022 \u003d\u003e [ \u0022sm2\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\n\u0026usage if ($#ARGV \u003c 0);\n\n# For the \u0022make variables\u0022 CINCLUDES and CDEFINES, we support lists with\n# platform specific list separators. Users from those platforms should\n# recognise those separators from how you set up the PATH to find executables.\n# The default is the Unix like separator, :, but as an exception, we also\n# support the space as separator.\nmy $list_separator_re \u003d\n { VMS \u003d\u003e qr/(?\u003c!\u005c^),/,\n MSWin32 \u003d\u003e qr/(?\u003c!\u005c\u005c);/ } -\u003e {$^O} // qr/(?\u003c!\u005c\u005c)[:\u005cs]/;\n# All the \u0022make variables\u0022 we support\n# Some get pre-populated for the sake of backward compatibility\n# (we supported those before the change to \u0022make variable\u0022 support.\nmy %user \u003d (\n AR \u003d\u003e env('AR'),\n ARFLAGS \u003d\u003e [],\n AS \u003d\u003e undef,\n ASFLAGS \u003d\u003e [],\n CC \u003d\u003e env('CC'),\n CFLAGS \u003d\u003e [],\n CXX \u003d\u003e env('CXX'),\n CXXFLAGS \u003d\u003e [],\n CPP \u003d\u003e undef,\n CPPFLAGS \u003d\u003e [], # -D, -I, -Wp,\n CPPDEFINES \u003d\u003e [], # Alternative for -D\n CPPINCLUDES \u003d\u003e [], # Alternative for -I\n CROSS_COMPILE \u003d\u003e env('CROSS_COMPILE'),\n HASHBANGPERL\u003d\u003e env('HASHBANGPERL') || env('PERL'),\n LD \u003d\u003e undef,\n LDFLAGS \u003d\u003e [], # -L, -Wl,\n LDLIBS \u003d\u003e [], # -l\n MT \u003d\u003e undef,\n MTFLAGS \u003d\u003e [],\n PERL \u003d\u003e env('PERL') || ($^O ne \u0022VMS\u0022 ? $^X : \u0022perl\u0022),\n RANLIB \u003d\u003e env('RANLIB'),\n RC \u003d\u003e env('RC') || env('WINDRES'),\n RCFLAGS \u003d\u003e [],\n RM \u003d\u003e undef,\n );\n# Info about what \u0022make variables\u0022 may be prefixed with the cross compiler\n# prefix. This should NEVER mention any such variable with a list for value.\nmy @user_crossable \u003d qw ( AR AS CC CXX CPP LD MT RANLIB RC );\n# The same but for flags given as Configure options. These are *additional*\n# input, as opposed to the VAR\u003dstring option that override the corresponding\n# config target attributes\nmy %useradd \u003d (\n CPPDEFINES \u003d\u003e [],\n CPPINCLUDES \u003d\u003e [],\n CPPFLAGS \u003d\u003e [],\n CFLAGS \u003d\u003e [],\n CXXFLAGS \u003d\u003e [],\n LDFLAGS \u003d\u003e [],\n LDLIBS \u003d\u003e [],\n );\n\nmy %user_synonyms \u003d (\n HASHBANGPERL\u003d\u003e 'PERL',\n RC \u003d\u003e 'WINDRES',\n );\n\n# Some target attributes have been renamed, this is the translation table\nmy %target_attr_translate \u003d(\n ar \u003d\u003e 'AR',\n as \u003d\u003e 'AS',\n cc \u003d\u003e 'CC',\n cxx \u003d\u003e 'CXX',\n cpp \u003d\u003e 'CPP',\n hashbangperl \u003d\u003e 'HASHBANGPERL',\n ld \u003d\u003e 'LD',\n mt \u003d\u003e 'MT',\n ranlib \u003d\u003e 'RANLIB',\n rc \u003d\u003e 'RC',\n rm \u003d\u003e 'RM',\n );\n\n# Initialisers coming from 'config' scripts\n$config{defines} \u003d [ split(/$list_separator_re/, env('__CNF_CPPDEFINES')) ];\n$config{includes} \u003d [ split(/$list_separator_re/, env('__CNF_CPPINCLUDES')) ];\n$config{cppflags} \u003d [ env('__CNF_CPPFLAGS') || () ];\n$config{cflags} \u003d [ env('__CNF_CFLAGS') || () ];\n$config{cxxflags} \u003d [ env('__CNF_CXXFLAGS') || () ];\n$config{lflags} \u003d [ env('__CNF_LDFLAGS') || () ];\n$config{ex_libs} \u003d [ env('__CNF_LDLIBS') || () ];\n\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[];\n$config{options}\u003d\u0022\u0022;\n$config{build_type} \u003d \u0022release\u0022;\nmy $target\u003d\u0022\u0022;\n\nmy %cmdvars \u003d (); # Stores FOO\u003d'blah' type arguments\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\n\t# Support env variable assignments among the options\n\tif (m|^(\u005cw+)\u003d(.+)?$|)\n\t\t{\n\t\t$cmdvars{$1} \u003d $2;\n\t\t# Every time a variable is given as a configuration argument,\n\t\t# it acts as a reset if the variable.\n\t\tif (exists $user{$1})\n\t\t\t{\n\t\t\t$user{$1} \u003d ref $user{$1} eq \u0022ARRAY\u0022 ? [] : undef;\n\t\t\t}\n\t\t#if (exists $useradd{$1})\n\t\t#\t{\n\t\t#\t$useradd{$1} \u003d [];\n\t\t#\t}\n\t\tnext;\n\t\t}\n\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\n\t# some people just can't read the instructions, clang people have to...\n\ts/^-no-(?!integrated-as)/no-/;\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$user{CROSS_COMPILE}\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 (/^-l(.*)$/)\n\t\t\t{\n\t\t\tpush @{$useradd{LDLIBS}}, $_;\n\t\t\t}\n\t\telsif (/^-framework$/)\n\t\t\t{\n\t\t\tpush @{$useradd{LDLIBS}}, $_, shift(@argvcopy);\n\t\t\t}\n\t\telsif (/^-L(.*)$/ or /^-Wl,/)\n\t\t\t{\n\t\t\tpush @{$useradd{LDFLAGS}}, $_;\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\tpush @{$useradd{LDFLAGS}}, $_, $rpath;\n\t\t\t}\n\t\telsif (/^-static$/)\n\t\t\t{\n\t\t\tpush @{$useradd{LDFLAGS}}, $_;\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 @{$useradd{CPPDEFINES}}, $1;\n\t\t\t}\n\t\telsif (/^-I(.*)$/)\n\t\t\t{\n\t\t\tpush @{$useradd{CPPINCLUDES}}, $1;\n\t\t\t}\n\t\telsif (/^-Wp,$/)\n\t\t\t{\n\t\t\tpush @{$useradd{CPPFLAGS}}, $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\tpush @{$useradd{CFLAGS}}, $_;\n\t\t\tpush @{$useradd{CXXFLAGS}}, $_;\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 deactivations\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\t}\n\nif (defined($config{api}) \u0026\u0026 !exists $apitable-\u003e{$config{api}}) {\n\tdie \u0022***** Unsupported api compatibility level: $config{api}\u005cn\u0022,\n}\n\nif (keys %deprecated_options)\n\t{\n\twarn \u0022***** Deprecated options: \u0022,\n\t\tjoin(\u0022, \u0022, keys %deprecated_options), \u0022\u005cn\u0022;\n\t}\nif (keys %unsupported_options)\n\t{\n\tdie \u0022***** Unsupported options: \u0022,\n\t\tjoin(\u0022, \u0022, keys %unsupported_options), \u0022\u005cn\u0022;\n\t}\n\n# If any %useradd entry has been set, we must check that the \u0022make\n# variables\u0022 haven't been set. We start by checking of any %useradd entry\n# is set.\nif (grep { scalar @$_ \u003e 0 } values %useradd) {\n # Hash of env / make variables names. The possible values are:\n # 1 - \u0022make vars\u0022\n # 2 - %useradd entry set\n # 3 - both set\n my %detected_vars \u003d\n map { my $v \u003d 0;\n $v +\u003d 1 if $cmdvars{$_};\n $v +\u003d 2 if @{$useradd{$_}};\n $_ \u003d\u003e $v }\n keys %useradd;\n\n # If any of the corresponding \u0022make variables\u0022 is set, we error\n if (grep { $_ \u0026 1 } values %detected_vars) {\n my $names \u003d join(', ', grep { $detected_vars{$_} \u003e 0 }\n sort keys %detected_vars);\n die \u003c\u003c\u0022_____\u0022;\n***** Mixing make variables and additional compiler/linker flags as\n***** configure command line option is not permitted.\n***** Affected make variables: $names\n_____\n }\n}\n\n# Check through all supported command line variables to see if any of them\n# were set, and canonicalise the values we got. If no compiler or linker\n# flag or anything else that affects %useradd was set, we also check the\n# environment for values.\nmy $anyuseradd \u003d\n grep { defined $_ \u0026\u0026 (ref $_ ne 'ARRAY' || @$_) } values %useradd;\nforeach (keys %user) {\n my $value \u003d $cmdvars{$_};\n $value //\u003d env($_) unless $anyuseradd;\n $value //\u003d\n defined $user_synonyms{$_} ? $cmdvars{$user_synonyms{$_}} : undef;\n $value //\u003d defined $user_synonyms{$_} ? env($user_synonyms{$_}) : undef\n unless $anyuseradd;\n\n if (defined $value) {\n if (ref $user{$_} eq 'ARRAY') {\n $user{$_} \u003d [ split /$list_separator_re/, $value ];\n } elsif (!defined $user{$_}) {\n $user{$_} \u003d $value;\n }\n }\n}\n\nif (grep { /-rpath\u005cb/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ())\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\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}) \u0022;\nprint \u0022for $target\u005cn\u0022;\n\nif (scalar(@seed_sources) \u003d\u003d 0) {\n print \u0022Using os-specific seed configuration\u005cn\u0022;\n push @seed_sources, 'os';\n}\nif (scalar(grep { $_ eq 'none' } @seed_sources) \u003e 0) {\n die \u0022Cannot seed with none and anything else\u0022 if scalar(@seed_sources) \u003e 1;\n warn \u003c\u003c_____ if scalar(@seed_sources) \u003d\u003d 1;\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d WARNING \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nYou have selected the --with-rand-seed\u003dnone option, which effectively\ndisables automatic reseeding of the OpenSSL random generator.\nAll operations depending on the random generator such as creating keys\nwill not work unless the random generator is seeded manually by the\napplication.\n\nPlease read the 'Note on random number generation' section in the\nINSTALL instructions and the RAND_DRBG(7) manual page for more details.\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d WARNING \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\n_____\n}\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\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\n\u0026usage if !$table{$target} || $table{$target}-\u003e{template};\n\n$config{target} \u003d $target;\nmy %target \u003d resolve_config($target);\n\nforeach (keys %target_attr_translate) {\n $target{$target_attr_translate{$_}} \u003d $target{$_}\n if $target{$_};\n delete $target{$_};\n}\n\n%target \u003d ( %{$table{DEFAULTS}}, %target );\n\n# Make the flags to build DSOs the same as for shared libraries unless they\n# are already defined\n$target{module_cflags} \u003d $target{shared_cflag} unless defined $target{module_cflags};\n$target{module_cxxflags} \u003d $target{shared_cxxflag} unless defined $target{module_cxxflags};\n$target{module_ldflags} \u003d $target{shared_ldflag} unless defined $target{module_ldflags};\n{\n my $shared_info_pl \u003d\n catfile(dirname($0), \u0022Configurations\u0022, \u0022shared-info.pl\u0022);\n my %shared_info \u003d read_eval_file($shared_info_pl);\n push @{$target{_conf_fname_int}}, $shared_info_pl;\n my $si \u003d $target{shared_target};\n while (ref $si ne \u0022HASH\u0022) {\n last if ! defined $si;\n if (ref $si eq \u0022CODE\u0022) {\n $si \u003d $si-\u003e();\n } else {\n $si \u003d $shared_info{$si};\n }\n }\n\n # Some of the 'shared_target' values don't have any entried in\n # %shared_info. That's perfectly fine, AS LONG AS the build file\n # template knows how to handle this. That is currently the case for\n # Windows and VMS.\n if (defined $si) {\n # Just as above, copy certain shared_* attributes to the corresponding\n # module_ attribute unless the latter is already defined\n $si-\u003e{module_cflags} \u003d $si-\u003e{shared_cflag} unless defined $si-\u003e{module_cflags};\n $si-\u003e{module_cxxflags} \u003d $si-\u003e{shared_cxxflag} unless defined $si-\u003e{module_cxxflags};\n $si-\u003e{module_ldflags} \u003d $si-\u003e{shared_ldflag} unless defined $si-\u003e{module_ldflags};\n foreach (sort keys %$si) {\n $target{$_} \u003d defined $target{$_}\n ? add($si-\u003e{$_})-\u003e($target{$_})\n : $si-\u003e{$_};\n }\n }\n}\n\nmy %conf_files \u003d map { $_ \u003d\u003e 1 } (@{$target{_conf_fname_int}});\n$config{conf_files} \u003d [ sort keys %conf_files ];\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{$feature} // \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{$feature};\n }\n}\n\n$target{CXXFLAGS}//\u003d$target{CFLAGS} if $target{CXX};\n$target{cxxflags}//\u003d$target{cflags} if $target{CXX};\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 unless defined($target{shared_extension_simple});\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# Fill %config with values from %user, and in case those are undefined or\n# empty, use values from %target (acting as a default).\nforeach (keys %user) {\n my $ref_type \u003d ref $user{$_};\n\n # Temporary function. Takes an intended ref type (empty string or \u0022ARRAY\u0022)\n # and a value that's to be coerced into that type.\n my $mkvalue \u003d sub {\n my $type \u003d shift;\n my $value \u003d shift;\n my $undef_p \u003d shift;\n\n die \u0022Too many arguments for \u005c$mkvalue\u0022 if @_;\n\n while (ref $value eq 'CODE') {\n $value \u003d $value-\u003e();\n }\n\n if ($type eq 'ARRAY') {\n return undef unless defined $value;\n return undef if ref $value ne 'ARRAY' \u0026\u0026 !$value;\n return undef if ref $value eq 'ARRAY' \u0026\u0026 !@$value;\n return [ $value ] unless ref $value eq 'ARRAY';\n }\n return undef unless $value;\n return $value;\n };\n\n $config{$_} \u003d\n $mkvalue-\u003e($ref_type, $user{$_})\n || $mkvalue-\u003e($ref_type, $target{$_});\n delete $config{$_} unless defined $config{$_};\n}\n\n# Allow overriding the build file name\n$config{build_file} \u003d env('BUILDFILE') || $target{build_file} || \u0022Makefile\u0022;\n\nmy %disabled_info \u003d (); # For configdata.pm\nforeach my $what (sort keys %disabled) {\n $config{options} .\u003d \u0022 no-$what\u0022;\n\n if (!grep { $what eq $_ } ( 'dso', 'threads', 'shared', 'pic',\n 'dynamic-engine', 'makedepend',\n 'zlib-dynamic', 'zlib', 'sse2' )) {\n (my $WHAT \u003d uc $what) \u003d~ s|-|_|g;\n\n # Fix up C macro end names\n $WHAT \u003d \u0022RMD160\u0022 if $what eq \u0022ripemd\u0022;\n\n # fix-up crypto/directory name(s)\n $what \u003d \u0022ripemd\u0022 if $what eq \u0022rmd160\u0022;\n $what \u003d \u0022whrlpool\u0022 if $what eq \u0022whirlpool\u0022;\n\n my $macro \u003d $disabled_info{$what}-\u003e{macro} \u003d \u0022OPENSSL_NO_$WHAT\u0022;\n\n if ((grep { $what eq $_ } @{$config{sdirs}})\n \u0026\u0026 $what ne 'async' \u0026\u0026 $what ne 'err') {\n @{$config{sdirs}} \u003d grep { $what ne $_} @{$config{sdirs}};\n $disabled_info{$what}-\u003e{skipped} \u003d [ catdir('crypto', $what) ];\n\n if ($what ne 'engine') {\n push @{$config{openssl_algorithm_defines}}, $macro;\n } else {\n @{$config{dirs}} \u003d grep !/^engines$/, @{$config{dirs}};\n push @{$disabled_info{engine}-\u003e{skipped}}, catdir('engines');\n push @{$config{openssl_other_defines}}, $macro;\n }\n } else {\n push @{$config{openssl_other_defines}}, $macro;\n }\n\n }\n}\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 `$config{CC} --target-help 2\u003e\u00261` \u003d~ m/-mno-cygwin/m)\n\t{\n\tpush @{$config{cflags}}, \u0022-mno-cygwin\u0022;\n\tpush @{$config{cxxflags}}, \u0022-mno-cygwin\u0022 if $config{CXX};\n\tpush @{$config{shared_ldflag}}, \u0022-mno-cygwin\u0022;\n\t}\n\nif ($target \u003d~ /linux.*-mips/ \u0026\u0026 !$disabled{asm}\n \u0026\u0026 !grep { $_ !~ /-m(ips|arch\u003d)/ } (@{$user{CFLAGS}},\n @{$useradd{CFLAGS}})) {\n\t# minimally required architecture flags for assembly modules\n\tmy $value;\n\t$value \u003d '-mips2' if ($target \u003d~ /mips32/);\n\t$value \u003d '-mips3' if ($target \u003d~ /mips64/);\n\tunshift @{$config{cflags}}, $value;\n\tunshift @{$config{cxxflags}}, $value if $config{CXX};\n}\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 (!@{$user{CFLAGS}} \u0026\u0026 !@{$useradd{CFLAGS}}\n \u0026\u0026 !@{$user{CPPDEFINES}} \u0026\u0026 !@{$useradd{CPPDEFINES}}) {\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 push @{$config{openssl_thread_defines}}, \u0022OPENSSL_THREADS\u0022;\n}\n\n# With \u0022deprecated\u0022 disable all deprecated features.\nif (defined($disabled{\u0022deprecated\u0022})) {\n $config{api} \u003d $maxapi;\n}\n\nmy $no_shared_warn\u003d0;\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{openssl_other_defines}}, \u0022OPENSSL_NO_DYNAMIC_ENGINE\u0022;\n $config{dynamic_engines} \u003d 0;\n} else {\n push @{$config{openssl_other_defines}}, \u0022OPENSSL_NO_STATIC_ENGINE\u0022;\n $config{dynamic_engines} \u003d 1;\n}\n\nunless ($disabled{asan}) {\n push @{$config{cflags}}, \u0022-fsanitize\u003daddress\u0022;\n push @{$config{cxxflags}}, \u0022-fsanitize\u003daddress\u0022 if $config{CXX};\n}\n\nunless ($disabled{ubsan}) {\n # -DPEDANTIC or -fnosanitize\u003dalignment may also be required on some\n # platforms.\n push @{$config{cflags}}, \u0022-fsanitize\u003dundefined\u0022, \u0022-fno-sanitize-recover\u003dall\u0022;\n push @{$config{cxxflags}}, \u0022-fsanitize\u003dundefined\u0022, \u0022-fno-sanitize-recover\u003dall\u0022\n if $config{CXX};\n}\n\nunless ($disabled{msan}) {\n push @{$config{cflags}}, \u0022-fsanitize\u003dmemory\u0022;\n push @{$config{cxxflags}}, \u0022-fsanitize\u003dmemory\u0022 if $config{CXX};\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 push @{$config{cflags}}, \u0022-fno-omit-frame-pointer\u0022, \u0022-g\u0022;\n push @{$config{cxxflags}}, \u0022-fno-omit-frame-pointer\u0022, \u0022-g\u0022 if $config{CXX};\n}\n#\n# Platform fix-ups\n#\n\n# This saves the build files from having to check\nif ($disabled{pic})\n\t{\n\tforeach (qw(shared_cflag shared_cxxflag shared_cppflag\n\t\t shared_defines shared_includes shared_ldflag\n\t\t module_cflags module_cxxflags module_cppflags\n\t\t module_defines module_includes module_lflags))\n\t\t{\n\t\tdelete $config{$_};\n\t\t$target{$_} \u003d \u0022\u0022;\n\t\t}\n\t}\nelse\n\t{\n\tpush @{$config{lib_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 push @{$config{lib_defines}}, \u0022OPENSSL_CPUID_OBJ\u0022 if ($target{cpuid_asm_src} ne \u0022mem_clr.c\u0022);\n\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{lib_defines}}, \u0022OPENSSL_BN_ASM_PART_WORDS\u0022 if ($target{bn_asm_src} \u003d~ /bn-586/);\n push @{$config{lib_defines}}, \u0022OPENSSL_IA32_SSE2\u0022 if (!$disabled{sse2} \u0026\u0026 $target{bn_asm_src} \u003d~ /86/);\n\n push @{$config{lib_defines}}, \u0022OPENSSL_BN_ASM_MONT\u0022 if ($target{bn_asm_src} \u003d~ /-mont/);\n push @{$config{lib_defines}}, \u0022OPENSSL_BN_ASM_MONT5\u0022 if ($target{bn_asm_src} \u003d~ /-mont5/);\n push @{$config{lib_defines}}, \u0022OPENSSL_BN_ASM_GF2m\u0022 if ($target{bn_asm_src} \u003d~ /-gf2m/);\n push @{$config{lib_defines}}, \u0022BN_DIV3W\u0022 if ($target{bn_asm_src} \u003d~ /-div3w/);\n\n if ($target{sha1_asm_src}) {\n\tpush @{$config{lib_defines}}, \u0022SHA1_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sx86/ || $target{sha1_asm_src} \u003d~ /sha1/);\n\tpush @{$config{lib_defines}}, \u0022SHA256_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sha256/);\n\tpush @{$config{lib_defines}}, \u0022SHA512_ASM\u0022 if ($target{sha1_asm_src} \u003d~ /sha512/);\n }\n if ($target{keccak1600_asm_src} ne $table{DEFAULTS}-\u003e{keccak1600_asm_src}) {\n\tpush @{$config{lib_defines}}, \u0022KECCAK1600_ASM\u0022;\n }\n if ($target{rc4_asm_src} ne $table{DEFAULTS}-\u003e{rc4_asm_src}) {\n\tpush @{$config{lib_defines}}, \u0022RC4_ASM\u0022;\n }\n if ($target{md5_asm_src}) {\n\tpush @{$config{lib_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{lib_defines}}, \u0022RMD160_ASM\u0022;\n }\n if ($target{aes_asm_src}) {\n\tpush @{$config{lib_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{lib_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{lib_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 ($disabled{sse2});\n\tpush @{$config{lib_defines}}, \u0022VPAES_ASM\u0022 if ($target{aes_asm_src} \u003d~ m/vpaes/);\n\tpush @{$config{lib_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{lib_defines}}, \u0022WHIRLPOOL_ASM\u0022;\n\t}\n }\n if ($target{modes_asm_src} \u003d~ /ghash-/) {\n\tpush @{$config{lib_defines}}, \u0022GHASH_ASM\u0022;\n }\n if ($target{ec_asm_src} \u003d~ /ecp_nistz256/) {\n\tpush @{$config{lib_defines}}, \u0022ECP_NISTZ256_ASM\u0022;\n }\n if ($target{ec_asm_src} \u003d~ /x25519/) {\n\tpush @{$config{lib_defines}}, \u0022X25519_ASM\u0022;\n }\n if ($target{padlock_asm_src} ne $table{DEFAULTS}-\u003e{padlock_asm_src}) {\n\tpush @{$config{lib_defines}}, \u0022PADLOCK_ASM\u0022;\n }\n if ($target{poly1305_asm_src} ne \u0022\u0022) {\n\tpush @{$config{lib_defines}}, \u0022POLY1305_ASM\u0022;\n }\n}\n\nmy %predefined \u003d compiler_predefined($config{CROSS_COMPILE}.$config{CC});\n\n# Check for makedepend capabilities.\nif (!$disabled{makedepend}) {\n if ($config{target} \u003d~ /^(VC|vms)-/) {\n # For VC- and vms- targets, there's nothing more to do here. The\n # functionality is hard coded in the corresponding build files for\n # cl (Windows) and CC/DECC (VMS).\n } elsif (($predefined{__GNUC__} // -1) \u003e\u003d 3\n\t \u0026\u0026 !($predefined{__APPLE_CC__} \u0026\u0026 !$predefined{__clang__})) {\n # We know that GNU C version 3 and up as well as all clang\n # versions support dependency generation, but Xcode did not\n # handle $cc -M before clang support (but claims __GNUC__ \u003d 3)\n $config{makedepprog} \u003d \u0022\u005c$(CROSS_COMPILE)$config{CC}\u0022;\n } else {\n # In all other cases, we look for 'makedepend', and disable the\n # capability if not found.\n $config{makedepprog} \u003d which('makedepend');\n $disabled{makedepend} \u003d \u0022unavailable\u0022 unless $config{makedepprog};\n }\n}\n\nif (!$disabled{asm} \u0026\u0026 !$predefined{__MACH__} \u0026\u0026 $^O ne 'VMS') {\n # probe for -Wa,--noexecstack option...\n if ($predefined{__clang__}) {\n # clang has builtin assembler, which doesn't recognize --help,\n # but it apparently recognizes the option in question on all\n # supported platforms even when it's meaningless. In other words\n # probe would fail, but probed option always accepted...\n push @{$config{cflags}}, \u0022-Wa,--noexecstack\u0022, \u0022-Qunused-arguments\u0022;\n } else {\n my $cc \u003d $config{CROSS_COMPILE}.$config{CC};\n open(PIPE, \u0022$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2\u003e\u00261 |\u0022);\n while(\u003cPIPE\u003e) {\n if (m/--noexecstack/) {\n push @{$config{cflags}}, \u0022-Wa,--noexecstack\u0022;\n last;\n }\n }\n close(PIPE);\n unlink(\u0022null.$$.o\u0022);\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 and C++ flags string. This permits it to be made part of\n# a string and works as well on command lines.\n$config{cflags} \u003d [ map { (my $x \u003d $_) \u003d~ s/([\u005c\u005c\u005c\u0022])/\u005c\u005c$1/g; $x }\n @{$config{cflags}} ];\n$config{cxxflags} \u003d [ map { (my $x \u003d $_) \u003d~ s/([\u005c\u005c\u005c\u0022])/\u005c\u005c$1/g; $x }\n @{$config{cxxflags}} ] if $config{CXX};\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 ($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\tforeach $wopt (split /\u005cs+/, $gcc_devteam_warn)\n\t\t{\n\t\tpush @{$config{cflags}}, $wopt\n\t\t\tunless grep { $_ eq $wopt } @{$config{cflags}};\n\t\tpush @{$config{cxxflags}}, $wopt\n\t\t\tif ($config{CXX}\n\t\t\t \u0026\u0026 !grep { $_ eq $wopt } @{$config{cxxflags}});\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\tpush @{$config{cflags}}, $wopt\n\t\t\t\tunless grep { $_ eq $wopt } @{$config{cflags}};\n\t\t\tpush @{$config{cxxflags}}, $wopt\n\t\t\t\tif ($config{CXX}\n\t\t\t\t \u0026\u0026 !grep { $_ eq $wopt } @{$config{cxxflags}});\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\tpush @{$config{cflags}}, $wopt\n\t\t\tunless grep { $_ eq $wopt } @{$config{cflags}};\n\t\tpush @{$config{cxxflags}}, $wopt\n\t\t\tif ($config{CXX}\n\t\t\t \u0026\u0026 !grep { $_ eq $wopt } @{$config{cxxflags}});\n\t\t}\n\tif ($target \u003d~ /^BSD-/)\n\t\t{\n\t\tpush @{$config{ex_libs}}, \u0022-lexecinfo\u0022;\n\t\t}\n\t}\n\nunless ($disabled{afalgeng}) {\n $config{afalgeng}\u003d\u0022\u0022;\n if (grep { $_ eq 'afalgeng' } @{$target{enable}}) {\n my $minver \u003d 4*10000 + 1*100 + 0;\n if ($config{CROSS_COMPILE} 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# Finish up %config by appending things the user gave us on the command line\n# apart from \u0022make variables\u0022\nforeach (keys %useradd) {\n # The must all be lists, so we assert that here\n die \u0022internal error: \u005c$useradd{$_} isn't an ARRAY\u005cn\u0022\n unless ref $useradd{$_} eq 'ARRAY';\n\n if (defined $config{$_}) {\n push @{$config{$_}}, @{$useradd{$_}};\n } else {\n $config{$_} \u003d [ @{$useradd{$_}} ];\n }\n}\n\n# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON\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 [ cleanfile($srcdir, catfile(\u0022Configurations\u0022, \u0022common0.tmpl\u0022),\n $blddir),\n $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 my %ordinals \u003d ();\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 %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 # We want to detect configdata.pm in the source tree, so we\n # don't use it if the build tree is different.\n my $src_configdata \u003d cleanfile($srcdir, \u0022configdata.pm\u0022, $blddir);\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 # explicitly 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 # explicitly 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 explicitly static and shared:\u005cn \u0022,\n join(\u0022 \u0022, @doubles), \u0022\u005cn\u0022\n if @doubles;\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 ($s eq $src_configdata || ! -f $s || $generate{$_}) {\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 } elsif ($s \u003d~ /\u005c.rc$/) {\n # We also recognise resource files\n my $o \u003d $_;\n $o \u003d~ s/\u005c.rc$/.res/; # Resource configuration\n my $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 ($s eq $src_configdata || ! -f $s || $generate{$_}) {\n $s \u003d cleanfile($buildd, $_, $blddir);\n }\n\n if ($s \u003d~ /\u005c.(cc|cpp|c|s|S)$/) {\n # We recognise C++, C and asm files\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 } elsif ($s \u003d~ /\u005c.rc$/) {\n # We also recognise resource files\n my $o \u003d $_;\n $o \u003d~ s/\u005c.rc$/.res/; # Resource configuration\n my $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 } elsif ($s \u003d~ /\u005c.(def|map|opt)$/) {\n # We also recognise .def / .map / .opt files\n # We know they are generated files\n my $def \u003d cleanfile($buildd, $s, $blddir);\n $unified_info{shared_sources}-\u003e{$ddest}-\u003e{$def} \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 ($ddest eq $src_configdata || ! -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 ($d eq $src_configdata\n || ! -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 }\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 ($ddest eq $src_configdata || ! -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 my $ordinals_text \u003d join(', ', sort keys %ordinals);\n warn \u003c\u003c\u0022EOF\u0022 if $ordinals_text;\n\nWARNING: ORDINALS were specified for $ordinals_text\nThey are ignored and should be replaced with a combination of GENERATE,\nDEPEND and SHARED_SOURCE.\nEOF\n\n # Massage the result\n\n # If the user configured no-shared, we allow no shared sources\n if ($disabled{shared}) {\n foreach (keys %{$unified_info{shared_sources}}) {\n foreach (keys %{$unified_info{shared_sources}-\u003e{$_}}) {\n delete $unified_info{sources}-\u003e{$_};\n }\n }\n $unified_info{shared_sources} \u003d {};\n }\n\n # If we depend on a header file or a perl module, add an inclusion of\n # its directory to allow smoothe inclusion\n foreach my $dest (keys %{$unified_info{depends}}) {\n next if $dest eq \u0022\u0022;\n foreach my $d (keys %{$unified_info{depends}-\u003e{$dest}}) {\n next unless $d \u003d~ /\u005c.(h|pm)$/;\n my $i \u003d dirname($d);\n my $spot \u003d\n $d eq \u0022configdata.pm\u0022 || defined($unified_info{generate}-\u003e{$d})\n ? 'build' : 'source';\n push @{$unified_info{includes}-\u003e{$dest}-\u003e{$spot}}, $i\n unless grep { $_ eq $i } @{$unified_info{includes}-\u003e{$dest}-\u003e{$spot}};\n }\n }\n\n # Trickle down includes placed on libraries, engines and programs to\n # their sources (i.e. object files)\n foreach my $dest (keys %{$unified_info{engines}},\n keys %{$unified_info{libraries}},\n keys %{$unified_info{programs}}) {\n foreach my $k ((\u0022source\u0022, \u0022build\u0022)) {\n next unless defined($unified_info{includes}-\u003e{$dest}-\u003e{$k});\n my @incs \u003d reverse @{$unified_info{includes}-\u003e{$dest}-\u003e{$k}};\n foreach my $obj (grep /\u005c.o$/,\n (keys %{$unified_info{sources}-\u003e{$dest} // {}},\n keys %{$unified_info{shared_sources}-\u003e{$dest} // {}})) {\n foreach my $inc (@incs) {\n unshift @{$unified_info{includes}-\u003e{$obj}-\u003e{$k}}, $inc\n unless grep { $_ eq $inc } @{$unified_info{includes}-\u003e{$obj}-\u003e{$k}};\n }\n }\n }\n delete $unified_info{includes}-\u003e{$dest};\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 @source_includes \u003d ( @{$unified_info{includes}-\u003e{$dest}-\u003e{source}} )\n if defined($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 # For convenience collect information regarding directories where\n # files are generated, those generated files and the end product\n # they end up in where applicable. Then, add build rules for those\n # directories\n my %loopinfo \u003d ( \u0022lib\u0022 \u003d\u003e [ @{$unified_info{libraries}} ],\n \u0022dso\u0022 \u003d\u003e [ @{$unified_info{engines}} ],\n \u0022bin\u0022 \u003d\u003e [ @{$unified_info{programs}} ],\n \u0022script\u0022 \u003d\u003e [ @{$unified_info{scripts}} ] );\n foreach my $type (keys %loopinfo) {\n foreach my $product (@{$loopinfo{$type}}) {\n my %dirs \u003d ();\n my $pd \u003d dirname($product);\n\n foreach (@{$unified_info{sources}-\u003e{$product} // []},\n @{$unified_info{shared_sources}-\u003e{$product} // []}) {\n my $d \u003d dirname($_);\n\n # We don't want to create targets for source directories\n # when building out of source\n next if ($config{sourcedir} ne $config{builddir}\n \u0026\u0026 $d \u003d~ m|^\u005cQ$config{sourcedir}\u005cE|);\n # We already have a \u0022test\u0022 target, and the current directory\n # is just silly to make a target for\n next if $d eq \u0022test\u0022 || $d eq \u0022.\u0022;\n\n $dirs{$d} \u003d 1;\n push @{$unified_info{dirinfo}-\u003e{$d}-\u003e{deps}}, $_\n if $d ne $pd;\n }\n foreach (keys %dirs) {\n push @{$unified_info{dirinfo}-\u003e{$_}-\u003e{products}-\u003e{$type}},\n $product;\n }\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\nprint \u0022Creating configdata.pm\u005cn\u0022;\nopen(OUT,\u0022\u003econfigdata.pm\u0022) || die \u0022unable to create configdata.pm: $!\u005cn\u0022;\nprint OUT \u003c\u003c\u0022EOF\u0022;\n#! $config{HASHBANGPERL}\n\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 } elsif (ref($config{$_}) eq \u0022HASH\u0022) {\n\tprint OUT \u0022 \u0022, $_, \u0022 \u003d\u003e {\u0022;\n if (scalar keys %{$config{$_}} \u003e 0) {\n print OUT \u0022\u005cn\u0022;\n foreach my $key (sort keys %{$config{$_}}) {\n print OUT \u0022 \u0022,\n join(\u0022 \u003d\u003e \u0022,\n quotify(\u0022perl\u0022, $key),\n defined $config{$_}-\u003e{$key}\n ? quotify(\u0022perl\u0022, $config{$_}-\u003e{$key})\n : \u0022undef\u0022);\n print OUT \u0022,\u005cn\u0022;\n }\n print OUT \u0022 \u0022;\n }\n print OUT \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\n \u0022# The following data is only used when this files is use as a script\u005cn\u0022;\nprint OUT \u0022my \u005c@makevars \u003d (\u005cn\u0022;\nforeach (sort keys %user) {\n print OUT \u0022 '\u0022,$_,\u0022',\u005cn\u0022;\n}\nprint OUT \u0022);\u005cn\u0022;\nprint OUT \u0022my \u005c%disabled_info \u003d (\u005cn\u0022;\nforeach my $what (sort keys %disabled_info) {\n print OUT \u0022 '$what' \u003d\u003e {\u005cn\u0022;\n foreach my $info (sort keys %{$disabled_info{$what}}) {\n if (ref $disabled_info{$what}-\u003e{$info} eq 'ARRAY') {\n print OUT \u0022 $info \u003d\u003e [ \u0022,\n join(', ', map { \u0022'$_'\u0022 } @{$disabled_info{$what}-\u003e{$info}}),\n \u0022 ],\u005cn\u0022;\n } else {\n print OUT \u0022 $info \u003d\u003e '\u0022, $disabled_info{$what}-\u003e{$info},\n \u0022',\u005cn\u0022;\n }\n }\n print OUT \u0022 },\u005cn\u0022;\n}\nprint OUT \u0022);\u005cn\u0022;\nprint OUT 'my @user_crossable \u003d qw( ', join (' ', @user_crossable), \u0022 );\u005cn\u0022;\nprint OUT \u003c\u003c 'EOF';\n# If run directly, we can give some answers, and even reconfigure\nunless (caller) {\n use Getopt::Long;\n use File::Spec::Functions;\n use File::Basename;\n use Pod::Usage;\n\n my $here \u003d dirname($0);\n\n my $dump \u003d undef;\n my $cmdline \u003d undef;\n my $options \u003d undef;\n my $target \u003d undef;\n my $envvars \u003d undef;\n my $makevars \u003d undef;\n my $buildparams \u003d undef;\n my $reconf \u003d undef;\n my $verbose \u003d undef;\n my $help \u003d undef;\n my $man \u003d undef;\n GetOptions('dump|d' \u003d\u003e \u005c$dump,\n 'command-line|c' \u003d\u003e \u005c$cmdline,\n 'options|o' \u003d\u003e \u005c$options,\n 'target|t' \u003d\u003e \u005c$target,\n 'environment|e' \u003d\u003e \u005c$envvars,\n 'make-variables|m' \u003d\u003e \u005c$makevars,\n 'build-parameters|b' \u003d\u003e \u005c$buildparams,\n 'reconfigure|reconf|r' \u003d\u003e \u005c$reconf,\n 'verbose|v' \u003d\u003e \u005c$verbose,\n 'help' \u003d\u003e \u005c$help,\n 'man' \u003d\u003e \u005c$man)\n or die \u0022Errors in command line arguments\u005cn\u0022;\n\n unless ($dump || $cmdline || $options || $target || $envvars || $makevars\n || $buildparams || $reconf || $verbose || $help || $man) {\n print STDERR \u003c\u003c\u0022_____\u0022;\nYou must give at least one option.\nFor more information, do '$0 --help'\n_____\n exit(2);\n }\n\n if ($help) {\n pod2usage(-exitval \u003d\u003e 0,\n -verbose \u003d\u003e 1);\n }\n if ($man) {\n pod2usage(-exitval \u003d\u003e 0,\n -verbose \u003d\u003e 2);\n }\n if ($dump || $cmdline) {\n print \u0022\u005cnCommand line (with current working directory \u003d $here):\u005cn\u005cn\u0022;\n print ' ',join(' ',\n $config{PERL},\n catfile($config{sourcedir}, 'Configure'),\n @{$config{perlargv}}), \u0022\u005cn\u0022;\n print \u0022\u005cnPerl information:\u005cn\u005cn\u0022;\n print ' ',$config{perl_cmd},\u0022\u005cn\u0022;\n print ' ',$config{perl_version},' for ',$config{perl_archname},\u0022\u005cn\u0022;\n }\n if ($dump || $options) {\n my $longest \u003d 0;\n my $longest2 \u003d 0;\n foreach my $what (@disablables) {\n $longest \u003d length($what) if $longest \u003c length($what);\n $longest2 \u003d length($disabled{$what})\n if $disabled{$what} \u0026\u0026 $longest2 \u003c length($disabled{$what});\n }\n print \u0022\u005cnEnabled features:\u005cn\u005cn\u0022;\n foreach my $what (@disablables) {\n print \u0022 $what\u005cn\u0022 unless $disabled{$what};\n }\n print \u0022\u005cnDisabled features:\u005cn\u005cn\u0022;\n foreach my $what (@disablables) {\n if ($disabled{$what}) {\n print \u0022 $what\u0022, ' ' x ($longest - length($what) + 1),\n \u0022[$disabled{$what}]\u0022, ' ' x ($longest2 - length($disabled{$what}) + 1);\n print $disabled_info{$what}-\u003e{macro}\n if $disabled_info{$what}-\u003e{macro};\n print ' (skip ',\n join(', ', @{$disabled_info{$what}-\u003e{skipped}}),\n ')'\n if $disabled_info{$what}-\u003e{skipped};\n print \u0022\u005cn\u0022;\n }\n }\n }\n if ($dump || $target) {\n print \u0022\u005cnConfig target attributes:\u005cn\u005cn\u0022;\n foreach (sort keys %target) {\n next if $_ \u003d~ m|^_| || $_ eq 'template';\n my $quotify \u003d sub {\n map { (my $x \u003d $_) \u003d~ s|([\u005c\u005c\u005c$\u005c@\u0022])|\u005c\u005c$1|g; \u0022\u005c\u0022$x\u005c\u0022\u0022} @_;\n };\n print ' ', $_, ' \u003d\u003e ';\n if (ref($target{$_}) eq \u0022ARRAY\u0022) {\n print '[ ', join(', ', $quotify-\u003e(@{$target{$_}})), \u0022 ],\u005cn\u0022;\n } else {\n print $quotify-\u003e($target{$_}), \u0022,\u005cn\u0022\n }\n }\n }\n if ($dump || $envvars) {\n print \u0022\u005cnRecorded environment:\u005cn\u005cn\u0022;\n foreach (sort keys %{$config{perlenv}}) {\n print ' ',$_,' \u003d ',($config{perlenv}-\u003e{$_} || ''),\u0022\u005cn\u0022;\n }\n }\n if ($dump || $makevars) {\n print \u0022\u005cnMakevars:\u005cn\u005cn\u0022;\n foreach my $var (@makevars) {\n my $prefix \u003d '';\n $prefix \u003d $config{CROSS_COMPILE}\n if grep { $var eq $_ } @user_crossable;\n $prefix //\u003d '';\n print ' ',$var,' ' x (16 - length $var),'\u003d ',\n (ref $config{$var} eq 'ARRAY'\n ? join(' ', @{$config{$var}})\n : $prefix.$config{$var}),\n \u0022\u005cn\u0022\n if defined $config{$var};\n }\n\n my @buildfile \u003d ($config{builddir}, $config{build_file});\n unshift @buildfile, $here\n unless file_name_is_absolute($config{builddir});\n my $buildfile \u003d canonpath(catdir(@buildfile));\n print \u003c\u003c\u0022_____\u0022;\n\nNOTE: These variables only represent the configuration view. The build file\ntemplate may have processed these variables further, please have a look at the\nbuild file for more exact data:\n $buildfile\n_____\n }\n if ($dump || $buildparams) {\n my @buildfile \u003d ($config{builddir}, $config{build_file});\n unshift @buildfile, $here\n unless file_name_is_absolute($config{builddir});\n print \u0022\u005cnbuild file:\u005cn\u005cn\u0022;\n print \u0022 \u0022, canonpath(catfile(@buildfile)),\u0022\u005cn\u0022;\n\n print \u0022\u005cnbuild file templates:\u005cn\u005cn\u0022;\n foreach (@{$config{build_file_templates}}) {\n my @tmpl \u003d ($_);\n unshift @tmpl, $here\n unless file_name_is_absolute($config{sourcedir});\n print ' ',canonpath(catfile(@tmpl)),\u0022\u005cn\u0022;\n }\n }\n if ($reconf) {\n if ($verbose) {\n print 'Reconfiguring with: ', join(' ',@{$config{perlargv}}), \u0022\u005cn\u0022;\n\t foreach (sort keys %{$config{perlenv}}) {\n\t print ' ',$_,' \u003d ',($config{perlenv}-\u003e{$_} || \u0022\u0022),\u0022\u005cn\u0022;\n\t }\n }\n\n chdir $here;\n exec $^X,catfile($config{sourcedir}, 'Configure'),'reconf';\n }\n}\n\n1;\n\n__END__\n\n\u003dhead1 NAME\n\nconfigdata.pm - configuration data for OpenSSL builds\n\n\u003dhead1 SYNOPSIS\n\nInteractive:\n\n perl configdata.pm [options]\n\nAs data bank module:\n\n use configdata;\n\n\u003dhead1 DESCRIPTION\n\nThis module can be used in two modes, interactively and as a module containing\nall the data recorded by OpenSSL's Configure script.\n\nWhen used interactively, simply run it as any perl script, with at least one\noption, and you will get the information you ask for. See L\u003c/OPTIONS\u003e below.\n\nWhen loaded as a module, you get a few databanks with useful information to\nperform build related tasks. The databanks are:\n\n %config Configured things.\n %target The OpenSSL config target with all inheritances\n resolved.\n %disabled The features that are disabled.\n @disablables The list of features that can be disabled.\n %withargs All data given through --with-THING options.\n %unified_info All information that was computed from the build.info\n files.\n\n\u003dhead1 OPTIONS\n\n\u003dover 4\n\n\u003ditem B\u003c--help\u003e\n\nPrint a brief help message and exit.\n\n\u003ditem B\u003c--man\u003e\n\nPrint the manual page and exit.\n\n\u003ditem B\u003c--dump\u003e | B\u003c-d\u003e\n\nPrint all relevant configuration data. This is equivalent to B\u003c--command-line\u003e\nB\u003c--options\u003e B\u003c--target\u003e B\u003c--environment\u003e B\u003c--make-variables\u003e\nB\u003c--build-parameters\u003e.\n\n\u003ditem B\u003c--command-line\u003e | B\u003c-c\u003e\n\nPrint the current configuration command line.\n\n\u003ditem B\u003c--options\u003e | B\u003c-o\u003e\n\nPrint the features, both enabled and disabled, and display defined macro and\nskipped directories where applicable.\n\n\u003ditem B\u003c--target\u003e | B\u003c-t\u003e\n\nPrint the config attributes for this config target.\n\n\u003ditem B\u003c--environment\u003e | B\u003c-e\u003e\n\nPrint the environment variables and their values at the time of configuration.\n\n\u003ditem B\u003c--make-variables\u003e | B\u003c-m\u003e\n\nPrint the main make variables generated in the current configuration\n\n\u003ditem B\u003c--build-parameters\u003e | B\u003c-b\u003e\n\nPrint the build parameters, i.e. build file and build file templates.\n\n\u003ditem B\u003c--reconfigure\u003e | B\u003c--reconf\u003e | B\u003c-r\u003e\n\nRedo the configuration.\n\n\u003ditem B\u003c--verbose\u003e | B\u003c-v\u003e\n\nVerbose output.\n\n\u003dback\n\n\u003dcut\n\nEOF\nclose(OUT);\nif ($builder_platform eq 'unix') {\n my $mode \u003d (0755 \u0026 ~umask);\n chmod $mode, 'configdata.pm'\n or warn sprintf(\u0022WARNING: Couldn't change mode for 'configdata.pm' to 0%03o: %s\u005cn\u0022,$mode,$!);\n}\n\nmy %builders \u003d (\n unified \u003d\u003e sub {\n print 'Creating ',$target{build_file},\u0022\u005cn\u0022;\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\n$SIG{__DIE__} \u003d $orig_death_handler;\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;\n\n**********************************************************************\n*** ***\n*** OpenSSL has been successfully configured ***\n*** ***\n*** If you encounter a problem while building, please open an ***\n*** issue on GitHub \u003chttps://github.com/openssl/openssl/issues\u003e ***\n*** and include the output from the following command: ***\n*** ***\n*** perl configdata.pm --dump ***\n*** ***\n*** (If you are new to OpenSSL, you might want to consult the ***\n*** 'Troubleshooting' section in the INSTALL file first) ***\n*** ***\n**********************************************************************\nEOF\n\nexit(0);\n\n######################################################################\n#\n# Helpers and utility functions\n#\n\n# Death handler, to print a helpful message in case of failure #######\n#\nsub death_handler {\n die @_ if $^S; # To prevent the added message in eval blocks\n my $build_file \u003d $target{build_file} // \u0022build file\u0022;\n my @message \u003d ( \u003c\u003c\u0022_____\u0022, @_ );\n\nFailure! $build_file wasn't produced.\nPlease read INSTALL and associated NOTES files. You may also have to look over\nyour available compiler tool chain or change your configuration.\n\n_____\n\n # Dying is terminal, so it's ok to reset the signal handler here.\n $SIG{__DIE__} \u003d $orig_death_handler;\n die @message;\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\nsub shared {\n my @flags \u003d @_;\n return sub { add($disabled{shared} ? () : @flags)-\u003e(); }\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\nsub read_eval_file {\n my $fname \u003d shift;\n my $content;\n my @result;\n\n open F, \u0022\u003c $fname\u0022 or die \u0022Can't open '$fname': $!\u005cn\u0022;\n {\n undef local $/;\n $content \u003d \u003cF\u003e;\n }\n close F;\n {\n local $@;\n\n @result \u003d ( eval $content );\n warn $@ if $@;\n }\n return wantarray ? @result : $result[0];\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 my %targets;\n\n {\n\t# Protect certain tables from tampering\n\tlocal %table \u003d ();\n\n\t%targets \u003d read_eval_file($fname);\n }\n my %preexisting \u003d ();\n foreach (sort keys %targets) {\n $preexisting{$_} \u003d 1 if $table{$_};\n }\n die \u003c\u003c\u0022EOF\u0022,\nThe following config targets from $fname\nshadow pre-existing config targets with the same name:\nEOF\n map { \u0022 $_\u005cn\u0022 } sort keys %preexisting\n if %preexisting;\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 compiler_predefined {\n state %predefined;\n my $cc \u003d shift;\n\n return () if $^O eq 'VMS';\n\n die 'compiler_predefined called without a compiler command'\n unless $cc;\n\n if (! $predefined{$cc}) {\n\n $predefined{$cc} \u003d {};\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 (my $l \u003d \u003cPIPE\u003e) {\n $l \u003d~ m/^#define\u005cs+(\u005cw+(?:\u005c(\u005cw+\u005c))?)(?:\u005cs+(.+))?/ or last;\n $predefined{$cc}-\u003e{$1} \u003d $2 // '';\n }\n close(PIPE);\n }\n\n return %{$predefined{$cc}};\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\nsub env\n{\n my $name \u003d shift;\n my %opts \u003d @_;\n\n unless ($opts{cacheonly}) {\n # Note that if $ENV{$name} doesn't exist or is undefined,\n # $config{perlenv}-\u003e{$name} will be created with the value\n # undef. This is intentional.\n\n $config{perlenv}-\u003e{$name} \u003d $ENV{$name}\n if ! exists $config{perlenv}-\u003e{$name};\n }\n return $config{perlenv}-\u003e{$name};\n}\n\n# Configuration printer ##############################################\n\nsub print_table_entry\n{\n local $now_printing \u003d shift;\n my %target \u003d resolve_config($now_printing);\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\u0022cpp\u0022,\n\t\u0022cppflags\u0022,\n\t\u0022defines\u0022,\n\t\u0022includes\u0022,\n\t\u0022cc\u0022,\n\t\u0022cflags\u0022,\n\t\u0022unistd\u0022,\n\t\u0022ld\u0022,\n\t\u0022lflags\u0022,\n\t\u0022loutflag\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*** $now_printing\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 '$now_printing' \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":1749063638,"u": 3953}} ],"g": 115829,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}