Lines Matching +full:inline +full:- +full:crypto +full:- +full:engine
2 # -*- mode: perl; -*-
3 # Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
10 ## Configure -- OpenSSL source tree configuration script
30 …-<feature> ...] [enable-<feature> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] […
42 *** perl configdata.pm --dump ***
52 # --config add the given configuration file, which will be read after
55 # --prefix prefix for the OpenSSL installation, which includes the
59 # --openssldir OpenSSL data area, such as openssl.cnf, certificates and keys.
61 # given with --prefix.
64 # --banner=".." Output specified text instead of default completion banner
66 # -w Don't wait after showing a Configure warning
68 # --cross-compile-prefix Add specified prefix to binutils components.
70 # --api One of 0.9.8, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, or 3.0
72 # including patch releases. If 'no-deprecated' is also
76 # no-hw-xxx do not compile support for specific crypto hardware.
77 # Generic OpenSSL-style methods relating to this support
81 # enable-demos Enable the building of the example code in the demos directory
82 # enable-h3demo Enable the http3 demo, which currently only links to the
85 # enable-hqinterop
86 # Enable the building of the hq-interop code for construction
89 # no-hw do not compile support for any crypto hardware.
90 # [no-]threads [don't] try to create a library that is suitable for
93 # [no-]thread-pool
95 # [no-]default-thread-pool
97 # [no-]shared [don't] try to create shared libraries when supported.
98 # [no-]pic [don't] try to build position independent code when supported.
99 # If disabled, it also disables shared and dynamic-engine.
100 # no-asm do not use assembler
101 # no-egd do not compile support for the entropy-gathering daemon APIs
102 # [no-]zlib [don't] compile support for zlib compression.
103 # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
104 # library and will be loaded at run-time by the OpenSSL library.
106 # no-quic disable QUIC support
107 # no-uplink Don't build support for UPLINK interface.
108 # enable-weak-ssl-ciphers
111 # no-sse2 disables IA-32 SSE2 code in assembly modules, the above
113 # no-<cipher> build without specified algorithm (dsa, idea, rc5, ...)
114 # -<xxx> +<xxx> All options which are unknown to the 'Configure' script are
115 # /<xxx> passed through to the compiler. Unix-style options beginning
116 # with a '-' or '+' are recognized, as well as Windows-style
118 # separated by spaces, then the URL-style notation %20 can be
120 # the option. For example, -opt%20arg gets expanded to -opt arg.
123 # -static while -static is also a pass-through compiler option (and
126 # namely no-pic, no-shared and no-threads. It is
129 # -static flag, and not just executables linked with static
130 # libcrypto.a) is to eliminate dependency on specific run-time,
140 # BN_LLONG use the type 'long long' in crypto/bn/bn.h
141 # RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h
155 # -DPEDANTIC complements -pedantic and is meant to mask code that
156 # is not strictly standard-compliant and/or implementation-specific,
157 # e.g. inline assembly, disregards to alignment requirements, such
158 # that -pedantic would complain about. Incidentally -DPEDANTIC has
160 # supposed to and does take notice of non-standard behaviour. Then
161 # -pedantic with pre-C9x compiler would also complain about 'long
162 # long' not being supported. As 64-bit algorithms are common now,
168 -DPEDANTIC -pedantic -Wno-long-long -DUNUSEDRESULT_DEBUG
169 -Wall
170 -Wmissing-declarations
171 -Wextra
172 -Wno-unused-parameter
173 -Wno-missing-field-initializers
174 -Wno-unterminated-string-initialization
175 -Wswitch
176 -Wsign-compare
177 -Wshadow
178 -Wformat
179 -Wno-type-limits
180 -Wundef
181 -Werror
182 -Wmissing-prototypes
183 -Wstrict-prototypes
187 # TODO(openssl-team): fix problems and investigate if (at least) the
189 # -Wcast-align
190 # -Wunreachable-code -- no, too ugly/compiler-specific
191 # -Wlanguage-extension-token -- no, we use asm()
192 # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc
193 # -Wextended-offsetof -- no, needed in CMS ASN1 code
195 -Wno-unknown-warning-option
196 -Wno-parentheses-equality
197 -Wno-language-extension-token
198 -Wno-extended-offsetof
199 -Wno-missing-braces
200 -Wno-tautological-constant-out-of-range-compare
201 -Wconditional-uninitialized
202 -Wincompatible-pointer-types-discards-qualifiers
203 -Wmissing-variable-declarations
213 # which would cover all BSD flavors. -pthread applies to them all,
214 # but is treated differently. OpenBSD expands is as -D_POSIX_THREAD
215 # -lc_r, which is sufficient. FreeBSD 4.x expands it as -lc_r,
216 # which has to be accompanied by explicit -D_THREAD_SAFE and
217 # sometimes -D_REENTRANT. FreeBSD 5.x expands it as -lc_r, which
219 our $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
281 # We must check @File::Spec::ISA rather than using File::Spec->isa() to
293 # echo -n 'holy hand grenade of antioch' | openssl sha256
303 if (-f "./configdata.pm") {
323 # Historical: if known directories in crypto/ have been removed, it means
324 # that those sub-systems are disabled.
326 # crypto/build.info)
333 unshift @argvcopy, "no-$_" if ! -d catdir($srcdir, 'crypto', $_);
360 defined $version{PRE_RELEASE_TAG} ? "-$version{PRE_RELEASE_TAG}" : '';
420 # be regexps, and will be used like this: /^no-${option}$/
424 "acvp-tests",
435 "autoload-config",
439 "brotli-dynamic",
440 "buildtest-c++",
442 "cached-fetch",
452 "crypto-mdebug",
454 "default-thread-pool",
467 "dynamic-engine",
475 "engine",
477 "external-tests",
480 "fips-securitychecks",
481 "fips-post",
482 "fips-jitter",
483 "fuzz-afl",
484 "fuzz-libfuzzer",
488 "integrity-only-ciphers",
497 "ml-dsa",
498 "ml-kem",
510 "posix-io",
513 "unstable-qlog",
522 "secure-memory",
527 "slh-dsa",
529 "sm2-precomp",
537 "ssl-trace",
538 "static-engine",
543 "thread-pool",
546 "tls-deprecated-ec",
550 "ui-console",
551 "unit-test",
553 "weak-ssl-ciphers",
556 "zlib-dynamic",
558 "zstd-dynamic",
563 push(@disablables, "$proto-method") unless $proto eq "tls1_3";
576 "buf-freelists" => undef,
577 "crypto-mdebug-backtrace" => undef,
579 "hw-padlock" => "padlockeng",
581 "ui" => "ui-console",
589 "fips-jitter" => "default",
592 "brotli-dynamic" => "default",
593 "buildtest-c++" => "default",
594 "crypto-mdebug" => "default",
595 "crypto-mdebug-backtrace" => "default",
602 "external-tests" => "default",
603 "fuzz-afl" => "default",
604 "fuzz-libfuzzer" => "default",
613 "ssl3-method" => "default",
618 "unit-test" => "default",
619 "weak-ssl-ciphers" => "default",
621 "zlib-dynamic" => "default",
623 "zstd-dynamic" => "default",
630 "aria", "async", "atexit", "autoload-config",
634 "ec", "engine",
637 "md4", "ml-dsa", "ml-kem", "multiblock",
642 "srtp", "ssl3-method", "ssl-trace",
644 "ts", "ui-console", "whirlpool",
645 "fips-securitychecks" ],
649 "ssl3-method" => [ "ssl3" ],
650 "zlib" => [ "zlib-dynamic" ],
651 "brotli" => [ "brotli-dynamic" ],
652 "zstd" => [ "zstd-dynamic" ],
654 "deprecated" => [ "tls-deprecated-ec" ],
655 "ec" => [ qw(ec2m ecdsa ecdh sm2 gost ecx tls-deprecated-ec) ],
666 "quic" => [ "unstable-qlog" ],
668 "crypto-mdebug" => [ "crypto-mdebug-backtrace" ],
670 "module" => [ "dynamic-engine", "fips" ],
674 # using the ENGINE functionality, and since that relies on global tables,
679 "shared" => [ "dynamic-engine", "uplink" ],
680 "dso" => [ "dynamic-engine", "module" ],
688 "engine" => [ "dynamic-engine", grep(/eng$/, @disablables) ],
689 "dynamic-engine" => [ "loadereng" ],
692 # no-autoalginit is only useful when building non-shared
697 "tests" => [ "external-tests" ],
700 sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
709 "fips" => [ "fips-securitychecks", "fips-post", "acvp-tests",
710 "fips-jitter" ],
712 "threads" => [ "thread-pool" ],
713 "thread-pool" => [ "default-thread-pool" ],
717 "deprecated-3.0" => [ "engine", "srp" ],
740 # Explicit "no-..." options will be collected in %disabled along with the defaults.
741 # To remove something from %disabled, use "enable-foo".
742 # For symmetry, "disable-foo" is a synonym for "no-foo".
751 MSWin32 => qr/(?<!\\);/ } -> {$^O} // qr/(?<!\\)[:\s]/;
753 # Some get pre-populated for the sake of backward compatibility
765 CPPFLAGS => [ env('CPPFLAGS') || () ], # -D, -I, -Wp,
766 CPPDEFINES => [], # Alternative for -D
767 CPPINCLUDES => [], # Alternative for -I
771 LDFLAGS => [ env('LDFLAGS') || () ], # -L, -Wl,
772 LDLIBS => [ env('LDLIBS') || () ], # -l
872 s/^-no-(?!integrated-as)/no-/;
874 # rewrite some options in "enable-..." form
875 s /^-?-?shared$/enable-shared/;
876 s /^sctp$/enable-sctp/;
877 s /^threads$/enable-threads/;
878 s /^zlib$/enable-zlib/;
879 s /^zlib-dynamic$/enable-zlib-dynamic/;
880 s /^fips$/enable-fips/;
882 if (/^(no|disable|enable)-(.+)$/)
885 if ($word !~ m|hw(?:-.+)| # special treatment for hw regexp opt
893 if (/^no-(.+)$/ || /^disable-(.+)$/)
897 if ($1 eq "$proto-method")
899 $disabled{"$proto"} = "option($proto-method)";
925 elsif ($1 eq "static-engine")
927 delete $disabled{"dynamic-engine"};
929 elsif ($1 eq "dynamic-engine")
931 $disabled{"dynamic-engine"} = "option";
941 elsif ($1 =~ m|hw(?:-.+)|) # deprecate hw options in regexp form
952 elsif (/^enable-(.+)$/)
954 if ($1 eq "static-engine")
956 $disabled{"dynamic-engine"} = "option";
958 elsif ($1 eq "dynamic-engine")
960 delete $disabled{"dynamic-engine"};
962 elsif ($1 eq "zlib-dynamic")
966 elsif ($1 eq "brotli-dynamic")
974 elsif ($1 eq "zstd-dynamic")
978 elsif ($1 eq "fips-jitter")
989 elsif (/^-d$/) # From older 'config'
993 elsif (/^-v$/) # From older 'config'
997 elsif (/^-w$/)
1001 elsif (/^-t$/) # From older 'config'
1005 elsif (/^--strict-warnings$/)
1009 push @{$useradd{CFLAGS}}, '--ossl-strict-warnings';
1012 elsif (/^--debug$/)
1016 elsif (/^--release$/)
1028 elsif (m|^[-+/]|)
1030 if (/^--prefix=(.*)$/)
1034 elsif (/^--api=(.*)$/)
1038 unless defined $apitable->{$api};
1039 $config{api}=$apitable->{$api};
1041 elsif (/^--libdir=(.*)$/)
1045 elsif (/^--openssldir=(.*)$/)
1049 elsif (/^--with-jitter-include=(.*)$/)
1053 elsif (/^--with-jitter-lib=(.*)$/)
1057 elsif (/^--with-zlib-lib=(.*)$/)
1061 elsif (/^--with-zlib-include=(.*)$/)
1065 elsif (/^--with-brotli-lib=(.*)$/)
1069 elsif (/^--with-brotli-include=(.*)$/)
1073 elsif (/^--with-zstd-lib=(.*)$/)
1077 elsif (/^--with-zstd-include=(.*)$/)
1081 elsif (/^--with-fuzzer-lib=(.*)$/)
1085 elsif (/^--with-fuzzer-include=(.*)$/)
1089 elsif (/^--with-rand-seed=(.*)$/)
1093 die "Unknown --with-rand-seed choice $x\n"
1098 elsif (/^--fips-key=(.*)$/)
1101 die "Non-hex character in FIPS key\n"
1102 if $user{FIPSKEY} =~ /[^a-f0-9]/;
1108 elsif (/^--banner=(.*)$/)
1112 elsif (/^--cross-compile-prefix=(.*)$/)
1116 elsif (/^--config=(.*)$/)
1120 elsif (/^-l(.*)$/)
1124 elsif (/^-framework$/)
1128 elsif (/^-L(.*)$/ or /^-Wl,/)
1132 elsif (/^-rpath$/ or /^-R$/)
1133 # -rpath is the OSF1 rpath flag
1134 # -R is the old Solaris rpath flag
1140 elsif (/^-static$/)
1144 elsif (m|^[-/]D(.*)$|)
1148 elsif (m|^[-/]I(.*)$|)
1152 elsif (/^-Wp,$/)
1156 else # common if (/^[-+]/), just pass down...
1160 # by spaces without quoting (e.g. -opt%20arg translates to -opt arg).
1161 $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
1171 $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
1177 die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
1180 unless ($_ eq $target || /^no-/ || /^disable-/)
1182 # "no-..." follows later after implied deactivations
1210 # 1 - "make vars"
1211 # 2 - %useradd entry set
1212 # 3 - both set
1259 if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ())
1262 die "***** Cannot simultaneously use -rpath, shared libraries, and\n",
1297 if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) {
1319 print $_,"\n" unless $table{$_}->{template};
1337 print "Using os-specific seed configuration\n";
1348 You have selected the --with-rand-seed=none option, which effectively
1349 disables automatic reseeding of the OpenSSL SEED-SRC random generator.
1356 -DOPENSSL_DEFAULT_SEED_SRC.
1366 map { (my $x = $_) =~ tr|[\-a-z]|[_A-Z]|; "OPENSSL_RAND_SEED_$x" }
1369 my $provider_string = $disabled{"fips-post"} ? "non-compliant FIPS Provider" : "FIPS Provider";
1375 if ($target =~ m/^CygWin32(-.*)$/) {
1379 # Support for legacy targets having a name starting with 'debug-'
1380 my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
1384 # If we do not find debug-foo in the table, the target is set to foo.
1395 foreach ( ( "$target-$user{CC}", "$target", undef ) ) {
1396 $found=$_ if $table{$_} && !$table{$_}->{template};
1404 $target = $cc if $table{$cc} && !$table{$cc}->{template};
1473 $value = $value->();
1487 $mkvalue->($ref_type, $user{$_})
1488 || $mkvalue->($ref_type, $target{$_});
1509 die "Directory given with --prefix MUST be absolute\n"
1513 if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
1527 foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm",
1528 $builder_platform."-checker.pm")) {
1530 if (-f $checker_path) {
1535 $fn->($@);
1537 $fn->($!);
1539 $fn->("The detected tools didn't match the platform\n");
1548 if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m)
1550 push @{$config{cflags}}, "-mno-cygwin";
1551 push @{$config{cxxflags}}, "-mno-cygwin" if $config{CXX};
1552 push @{$config{shared_ldflag}}, "-mno-cygwin";
1555 if ($target =~ /linux.*-mips/ && !$disabled{asm}
1556 && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
1559 $value = '-mips2' if ($target =~ /mips32/);
1560 $value = '-mips3' if ($target =~ /mips64/);
1578 # system-dependent compiler options that are necessary. We
1582 die "You asked for multi-threading support, but didn't\n"
1583 ,"provide any system-specific compiler options\n";
1589 # Find out if clang's sanitizers have been enabled with -fsanitize
1593 foreach (grep /^-fsanitize=/, @{$config{CFLAGS} || []}) {
1594 (my $checks = $_) =~ s/^-fsanitize=//;
1598 memory => 'msan' } -> {$_};
1616 if ($disabled{"unstable-qlog"}) {
1624 if (!$disabled{shared} || !$disabled{"dynamic-engine"});
1625 disable('no-shared-target', 'pic');
1628 if ($disabled{"dynamic-engine"}) {
1635 push @{$config{cflags}}, "-fsanitize=address";
1639 push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all", "-DPEDANTIC";
1643 push @{$config{cflags}}, "-fsanitize=memory";
1646 unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}
1648 push @{$config{cflags}}, "-fno-omit-frame-pointer", "-g";
1649 push @{$config{cxxflags}}, "-fno-omit-frame-pointer", "-g" if $config{CXX};
1652 # Platform fix-ups
1684 if ($target eq "linux-ppc64" || $target eq "BSD-ppc64") {
1702 } elsif (($predefined_C{__GNUC__} // -1) >= 3
1706 # handle $cc -M before clang support (but claims __GNUC__ = 3)
1720 # probe for -Wa,--noexecstack option...
1722 # clang has builtin assembler, which doesn't recognize --help,
1726 push @{$config{cflags}}, "-Wa,--noexecstack", "-Qunused-arguments";
1729 open(PIPE, "$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2>&1 |");
1731 if (m/--noexecstack/) {
1732 push @{$config{cflags}}, "-Wa,--noexecstack";
1766 $disabled{"deprecated-$_"} = "deprecation"
1767 if $disabled{deprecated} && $config{api} >= $apitable->{$_};
1789 my $gccver = $predefined_C{__GNUC__} // -1;
1797 elsif ($config{target} =~ /^VC-/)
1803 warn "WARNING --strict-warnings requires gcc[>=4] or gcc-alike, or MSVC"
1807 $config{CFLAGS} = [ map { $_ eq '--ossl-strict-warnings'
1817 disable('not-linux', 'afalgeng');
1824 my $sysstr = `uname -s`;
1825 my $verstr = `uname -r`;
1831 disable('too-new-kernel', 'devcryptoeng');
1840 … system("printf '#include <sys/types.h>\n#include <linux/tls.h>' | $cc -E - >/dev/null 2>&1");
1842 disable('too-old-kernel', 'ktls');
1845 system("printf '#include <sys/types.h>\n#include <sys/ktls.h>' | $cc -E - >/dev/null 2>&1");
1847 disable('too-old-freebsd', 'ktls');
1850 disable('not-linux-or-freebsd', 'ktls');
1855 unless ($target =~ /^(?:Cygwin|mingw|VC-|BC-)/) {
1856 disable('not-windows', 'winstore');
1872 catfile(dirname($0), "Configurations", "shared-info.pl");
1879 $si = $si->();
1892 $si->{module_cflags} = $si->{shared_cflag} unless defined $si->{module_cflags};
1893 $si->{module_cxxflags} = $si->{shared_cxxflag} unless defined $si->{module_cxxflags};
1894 $si->{module_ldflags} = $si->{shared_ldflag} unless defined $si->{module_ldflags};
1897 ? add($si->{$_})->($target{$_})
1898 : $si->{$_};
1923 # The generated $disabled{"deprecated-x.y"} entries are special
1925 next if $what =~ m|^deprecated-|;
1927 $config{options} .= " no-$what";
1929 if (!grep { $what eq $_ } ( 'buildtest-c++', 'fips', 'threads', 'shared',
1930 'module', 'pic', 'dynamic-engine', 'makedepend',
1932 (my $WHAT = uc $what) =~ s|-|_|g;
1935 # fix-up crypto/directory name(s)
1939 my $macro = $disabled_info{$what}->{macro} = "OPENSSL_NO_$WHAT";
1942 $skipdir{engines} = $what if $what eq 'engine';
1943 $skipdir{"crypto/$skipdir"} = $what
1948 if ($disabled{"dynamic-engine"}) {
1999 ( $builder_platform."-".$config{build_file}.".tmpl",
2025 last if -f $build_file_template;
2061 push @{$disabled_info{$what}->{skipped}}, catdir(@curd);
2164 $$ref->{$g}->{$ak} = $av;
2166 delete $$ref->{$g}->{$ak};
2187 push @{$valueref->{$_}}, @values;
2189 $handle_attributes->($attr_str, \$$attrref->{$_},
2195 $handle_attributes->($attr_str, $attrref, @values)
2205 Text::Template->new(TYPE => 'FILE',
2211 $template->fill_in(HASH => { config => \%config,
2219 DELIMITERS => [ "{-", "-}" ]);
2222 # -2 positive already run and we found ELSE (following ELSIF should fail)
2223 # -1 positive already run (skip until ENDIF)
2242 push @skip, !! $expand_variables->($+{COND});
2244 push @skip, -1;
2250 $skip[$#skip] = -1 if $skip[$#skip] != 0;
2251 $skip[$#skip] = !! $expand_variables->($+{COND})
2255 $skip[$#skip] = -2 if $skip[$#skip] != 0;
2263 $variables{$+{VARIABLE}} = $expand_variables->($+{VALUE});
2269 foreach (tokenize($expand_variables->($+{VALUE}))) {
2275 => sub { $push_to->(\@programs, undef,
2277 tokenize($expand_variables->($+{VALUE})))
2280 => sub { $push_to->(\@libraries, undef,
2282 tokenize($expand_variables->($+{VALUE})))
2285 => sub { $push_to->(\@modules, undef,
2287 tokenize($expand_variables->($+{VALUE})))
2290 => sub { $push_to->(\@scripts, undef,
2292 tokenize($expand_variables->($+{VALUE})))
2295 => sub { $push_to->(\%imagedocs, $expand_variables->($+{INDEX}),
2297 tokenize($expand_variables->($+{VALUE})))
2300 => sub { $push_to->(\%htmldocs, $expand_variables->($+{INDEX}),
2302 tokenize($expand_variables->($+{VALUE})))
2305 => sub { $push_to->(\%mandocs, $expand_variables->($+{INDEX}),
2307 tokenize($expand_variables->($+{VALUE})))
2310 => sub { $push_to->(\%sources, $expand_variables->($+{INDEX}),
2312 tokenize($expand_variables->($+{VALUE})))
2315 => sub { $push_to->(\%shared_sources, $expand_variables->($+{INDEX}),
2317 tokenize($expand_variables->($+{VALUE})))
2320 => sub { $push_to->(\%includes, $expand_variables->($+{INDEX}),
2322 tokenize($expand_variables->($+{VALUE})))
2325 => sub { $push_to->(\%defines, $expand_variables->($+{INDEX}),
2327 tokenize($expand_variables->($+{VALUE})))
2330 => sub { $push_to->(\%depends, $expand_variables->($+{INDEX}),
2332 tokenize($expand_variables->($+{VALUE})))
2335 => sub { $push_to->(\%generate, $expand_variables->($+{INDEX}),
2337 $expand_variables->($+{VALUE}))
2355 if (grep { defined $attributes{modules}->{$_}->{engine} } keys %attributes
2358 ENGINES can only be used if configured with 'dynamic-engine'.
2371 $unified_info{$k}->{$item} = 1;
2374 $unified_info{attributes}->{$k}->{$item} =
2375 $attributes{$k}->{$_}
2376 if defined $attributes{$k}->{$_};
2386 push @doubles, $l if defined $unified_info{libraries}->{$l};
2400 if ($s eq $src_configdata || $generate{$_} || ! -f $s) {
2410 $unified_info{sources}->{$ddest}->{$o} = -1;
2411 $unified_info{sources}->{$o}->{$s} = -1;
2417 $unified_info{sources}->{$ddest}->{$o} = -1;
2418 $unified_info{sources}->{$o}->{$s} = -1;
2421 $unified_info{sources}->{$ddest}->{$s} = 1;
2425 $unified_info{attributes}->{sources}->{$ddest}->{$o} =
2426 $unified_info{attributes}->{sources}->{$o}->{$s} =
2427 $attributes{sources}->{$dest}->{$_}
2428 if defined $attributes{sources}->{$dest}->{$_};
2430 $unified_info{attributes}->{sources}->{$ddest}->{$s} =
2431 $attributes{sources}->{$dest}->{$_}
2432 if defined $attributes{sources}->{$dest}->{$_};
2445 if ($s eq $src_configdata || $generate{$_} || ! -f $s) {
2456 $unified_info{shared_sources}->{$ddest}->{$o} = -1;
2457 $unified_info{sources}->{$o}->{$s} = -1;
2463 $unified_info{shared_sources}->{$ddest}->{$o} = -1;
2464 $unified_info{sources}->{$o}->{$s} = -1;
2470 $unified_info{shared_sources}->{$ddest}->{$o} = 1;
2476 $unified_info{attributes}->{shared_sources}->{$ddest}->{$o} =
2477 $unified_info{attributes}->{sources}->{$o}->{$s} =
2478 $attributes{sources}->{$dest}->{$_}
2479 if defined $attributes{sources}->{$dest}->{$_};
2481 $unified_info{attributes}->{shared_sources}->{$ddest}->{$o} =
2482 $attributes{sources}->{$dest}->{$_}
2483 if defined $attributes{sources}->{$dest}->{$_};
2494 my @generator = split /\s+/, $generate{$dest}->[0];
2499 if ($generate{$gen} || ! -f $generator[0]) {
2502 $check_generate{$ddest}->{$generator[0]}++;
2504 $unified_info{generate}->{$ddest} = [ @generator ];
2506 $unified_info{attributes}->{generate}->{$ddest} =
2507 $attributes{generate}->{$dest}->{$gen}
2508 if defined $attributes{generate}->{$dest}->{$gen};
2517 $unified_info{targets}->{$1} = 1;
2526 if ($ddest eq $src_configdata || ! -f $ddest) {
2543 if ($unified_info{generate}->{$ddest}
2563 || ! -f $d) {
2573 $unified_info{depends}->{$ddest}->{$d} = 1;
2576 $unified_info{attributes}->{depends}->{$ddest}->{$d} =
2577 $attributes{depends}->{$dest}->{$f}
2578 if defined $attributes{depends}->{$dest}->{$f};
2588 if ($ddest eq $src_configdata || ! -f $ddest) {
2594 push @{$unified_info{includes}->{$ddest}->{source}}, $is
2595 unless grep { $_ eq $is } @{$unified_info{includes}->{$ddest}->{source}};
2596 push @{$unified_info{includes}->{$ddest}->{build}}, $ib
2597 unless grep { $_ eq $ib } @{$unified_info{includes}->{$ddest}->{build}};
2609 if (! -f $ddest) {
2618 if defined $unified_info{defines}->{$ddest}->{$1};
2619 $unified_info{defines}->{$ddest}->{$1} = $2;
2631 $unified_info{imagedocs}->{$section}->{$imagedocs} = 1;
2638 $unified_info{htmldocs}->{$section}->{$htmldocs} = 1;
2645 $unified_info{mandocs}->{$section}->{$mandocs} = 1;
2667 if ($check_generate{$_}->{$generators[0]} > 1) {
2698 if (! -f $gen) {
2720 map { keys %{$unified_info{sources}->{$_}} }
2721 keys %{$unified_info{sources}->{$prod}};
2746 foreach my $d (keys %{$unified_info{depends}->{$dest}}) {
2752 $d eq "configdata.pm" || defined($unified_info{generate}->{$d})
2754 push @{$unified_info{includes}->{$dest}->{$spot}}, $i
2755 unless grep { $_ eq $i } @{$unified_info{includes}->{$dest}->{$spot}};
2763 # {productname}-{midfix}-{origobjname}.[o|res]
2784 # - give a prefix for the new object files names
2785 # - in the case of libraries, rearrange the object files so static
2802 } -> {$prodtype};
2804 next if ($intent->{$kind}->{dst} eq 'shared_sources'
2807 my @src = @{$intent->{$kind}->{src}};
2808 my $dst = $intent->{$kind}->{dst};
2809 my $prodselect = $intent->{$kind}->{prodselect} // sub { @_ };
2810 foreach my $prod ($prodselect->(keys %{$unified_info{$prodtype}})) {
2814 map { $_ => [ keys %{$unified_copy{sources}->{$_}} ] }
2815 map { keys %{$unified_copy{$_}->{$prod}} }
2820 # (+1 instead of -1)
2826 . '-' . $kind
2827 . '-' . basename($_));
2828 $unified_info{$dst}->{$prod}->{$newobj} = 1;
2830 $unified_info{sources}->{$newobj}->{$src} = 1;
2832 my $attrs = $unified_info{attributes}->{sources};
2833 if (defined $attrs->{$prod}
2834 && defined $attrs->{$prod}->{$_}) {
2835 $attrs->{$prod}->{$newobj} =
2836 $attrs->{$prod}->{$_};
2837 delete $attrs->{$prod}->{$_};
2839 foreach my $objsrc (keys %{$attrs->{$_} // {}}) {
2840 $attrs->{$newobj}->{$objsrc} =
2841 $attrs->{$_}->{$objsrc};
2842 delete $attrs->{$_}->{$objsrc};
2846 foreach my $deps (keys %{$unified_info{depends}->{$_}}) {
2847 $unified_info{depends}->{$_}->{$deps} = -1;
2848 $unified_info{depends}->{$newobj}->{$deps} = 1;
2853 defined($unified_info{includes}->{$_}->{$k});
2854 my @incs = @{$unified_info{includes}->{$_}->{$k}};
2855 $unified_info{includes}->{$newobj}->{$k} = [ @incs ];
2858 $unified_info{$dst}->{$prod}->{$_} = 1;
2866 # At this point, we have a number of sources with the value -1. They
2882 grep { $unified_info{$l1}->{$l2}->{$_} > 0 }
2883 keys %{$unified_info{$l1}->{$l2}};
2885 $unified_info{$l1}->{$l2} = [ @items ];
2887 delete $unified_info{$l1}->{$l2};
2893 $unified_info{defines}->{$dest}
2894 = [ map { $_.$unified_info{defines}->{$dest}->{$_} }
2895 sort keys %{$unified_info{defines}->{$dest}} ];
2899 if (defined($unified_info{includes}->{$dest}->{build})) {
2901 @source_includes = ( @{$unified_info{includes}->{$dest}->{source}} )
2902 if defined($unified_info{includes}->{$dest}->{source});
2903 $unified_info{includes}->{$dest} =
2904 [ @{$unified_info{includes}->{$dest}->{build}} ];
2906 push @{$unified_info{includes}->{$dest}}, $inc
2907 unless grep { $_ eq $inc } @{$unified_info{includes}->{$dest}};
2909 } elsif (defined($unified_info{includes}->{$dest}->{source})) {
2910 $unified_info{includes}->{$dest} =
2911 [ @{$unified_info{includes}->{$dest}->{source}} ];
2913 delete $unified_info{includes}->{$dest};
2925 "docs" => [ (map { @{$unified_info{imagedocs}->{$_} // []} }
2927 (map { @{$unified_info{htmldocs}->{$_} // []} }
2929 (map { @{$unified_info{mandocs}->{$_} // []} }
2936 foreach (@{$unified_info{sources}->{$product} // []},
2937 @{$unified_info{shared_sources}->{$product} // []}) {
2949 push @{$unified_info{dirinfo}->{$d}->{deps}}, $_
2953 push @{$unified_info{dirinfo}->{$_}->{products}->{$type}},
2991 OpenSSL::Template->new(TYPE => 'FILE', SOURCE => $configdata_tmplname);
2992 $configdata_tmpl->fill_in(
3022 The library could not be configured for supporting multi-threaded
3024 See file INSTALL.md for details if you need multi-threading.
3029 The options 'shared', 'pic' and 'dynamic-engine' aren't supported on this
3030 platform, so we will pretend you gave the option 'no-pic', which also disables
3031 'shared' and 'dynamic-engine'. If you know how to implement shared libraries
3053 Please read INSTALL.md and associated NOTES-* files. You may also have to
3078 # When configuring with --debug, the resulting string will be
3084 # cflags => picker(default => "-Wall",
3085 # debug => "-g -O0",
3086 # release => "-O3")
3091 $opts{$config{build_type}} || ())->(); }
3098 # cflags => combine("-Wall", sub { $disabled{zlib} ? () : "-DZLIB" })
3102 return sub { add(@stuff)->(); }
3108 # cflags => combine("-Wall", threads("-pthread"))
3112 return sub { add($disabled{threads} ? () : @flags)->(); }
3117 return sub { add($disabled{shared} ? () : @flags)->(); }
3135 $res = $res->();
3161 $separator = $opts->{separator};
3170 $separator = $opts->{separator};
3215 shadow pre-existing config targets with the same name:
3231 $targets{$_}->{_conf_fname_int} = add([ $fname ]);
3264 if ($table{$target}->{inherit_from}) {
3266 map { ref($_) eq "CODE" ? $_->() : $_ } @{$table{$target}->{inherit_from}};
3285 delete $table{$target}->{inherit_from};
3290 # - If a value is a coderef, it will be executed with the list of
3292 # - If the corresponding key doesn't have a value at all or is the
3296 # - Otherwise, this target's value is assumed to be a string that
3313 $object = $object->(@$inherited);
3326 ," found in target ",$target," -> ",$entry,"\n";
3336 if (!exists $table{$target}->{$key}) {
3337 $table{$target}->{$key} = $default_combiner;
3340 $table{$target}->{$key} = process_values($table{$target}->{$key},
3343 unless(defined($table{$target}->{$key})) {
3344 delete $table{$target}->{$key};
3347 # $previous && !($add_called || $previous ~~ $table{$target}->{$key})) {
3365 next if $table{$i}->{template};
3377 next if $table{$i}->{template};
3403 # collect compiler pre-defines from gcc or gcc-alike...
3404 open(PIPE, "$cc -dM -E -x c /dev/null 2>&1 |");
3407 $predefined{$cc}->{$1} = $2 // '';
3420 IPC::Cmd->import();
3425 return $name if (File::Spec->splitpath($name))[1];
3427 foreach (File::Spec->path()) {
3429 if (-f $fullpath and -x $fullpath) {
3443 # $config{perlenv}->{$name} will be created with the value
3446 $config{perlenv}->{$name} = $ENV{$name}
3447 if ! exists $config{perlenv}->{$name};
3449 return $config{perlenv}->{$name};
3511 printf "\$%-12s = %s\n", $_, join(" ", @{$target{$_}});
3513 printf "\$%-12s = %s\n", $_, $target{$_};
3518 length((sort { length($a) <=> length($b) } @sequence)[-1]);
3523 …print " '",$_,"'"," " x ($largest - length($_))," => [ ",join(", ", map { "'$_'" } @{$target{…
3525 print " '",$_,"'"," " x ($largest - length($_))," => '",$target{$_},"',\n";
3541 # On non-platforms, we just use file_name_is_absolute().
3621 return map { $processor->($_); } @_;
3640 $_ = $line_concat->($saved_line, $_);
3671 $_ = $line_concat->($saved_line, $_);
3693 while(defined($_ = $lineiterator->())) {
3697 $collectors{"BEFORE"}->($_);
3701 $collectors{$re}->($lineiterator);
3706 $collectors{"OTHERWISE"}->($lineiterator, $_)
3710 $collectors{"AFTER"}->($_);