Lines Matching +full:pm +full:- +full:api
2 # -*- mode: perl; -*-
3 # Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
10 ## Configure -- OpenSSL source tree configuration script
30 …-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[n…
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
80 # no-hw do not compile support for any crypto hardware.
81 # [no-]threads [don't] try to create a library that is suitable for
84 # [no-]shared [don't] try to create shared libraries when supported.
85 # [no-]pic [don't] try to build position independent code when supported.
86 # If disabled, it also disables shared and dynamic-engine.
87 # no-asm do not use assembler
88 # no-egd do not compile support for the entropy-gathering daemon APIs
89 # [no-]zlib [don't] compile support for zlib compression.
90 # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
91 # library and will be loaded in run-time by the OpenSSL library.
93 # no-uplink Don't build support for UPLINK interface.
94 # enable-weak-ssl-ciphers
97 # no-sse2 disables IA-32 SSE2 code in assembly modules, the above
99 # no-<cipher> build without specified algorithm (dsa, idea, rc5, ...)
100 # -<xxx> +<xxx> All options which are unknown to the 'Configure' script are
101 # /<xxx> passed through to the compiler. Unix-style options beginning
102 # with a '-' or '+' are recognized, as well as Windows-style
104 # separated by spaces, then the URL-style notation %20 can be
106 # the option. For example, -opt%20arg gets expanded to -opt arg.
109 # -static while -static is also a pass-through compiler option (and
112 # namely no-pic, no-shared and no-threads. It is
115 # -static flag, and not just executables linked with static
116 # libcrypto.a) is to eliminate dependency on specific run-time,
141 # -DPEDANTIC complements -pedantic and is meant to mask code that
142 # is not strictly standard-compliant and/or implementation-specific,
144 # that -pedantic would complain about. Incidentally -DPEDANTIC has
146 # supposed to and does take notice of non-standard behaviour. Then
147 # -pedantic with pre-C9x compiler would also complain about 'long
148 # long' not being supported. As 64-bit algorithms are common now,
154 -DPEDANTIC -pedantic -Wno-long-long -DUNUSEDRESULT_DEBUG
155 -Wall
156 -Wmissing-declarations
157 -Wextra
158 -Wno-unused-parameter
159 -Wno-missing-field-initializers
160 -Wswitch
161 -Wsign-compare
162 -Wshadow
163 -Wformat
164 -Wtype-limits
165 -Wundef
166 -Werror
167 -Wmissing-prototypes
168 -Wstrict-prototypes
172 # TODO(openssl-team): fix problems and investigate if (at least) the
174 # -Wcast-align
175 # -Wunreachable-code -- no, too ugly/compiler-specific
176 # -Wlanguage-extension-token -- no, we use asm()
177 # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc
178 # -Wextended-offsetof -- no, needed in CMS ASN1 code
180 -Wno-unknown-warning-option
181 -Wno-parentheses-equality
182 -Wno-language-extension-token
183 -Wno-extended-offsetof
184 -Wconditional-uninitialized
185 -Wincompatible-pointer-types-discards-qualifiers
186 -Wmissing-variable-declarations
196 # which would cover all BSD flavors. -pthread applies to them all,
197 # but is treated differently. OpenBSD expands is as -D_POSIX_THREAD
198 # -lc_r, which is sufficient. FreeBSD 4.x expands it as -lc_r,
199 # which has to be accompanied by explicit -D_THREAD_SAFE and
200 # sometimes -D_REENTRANT. FreeBSD 5.x expands it as -lc_r, which
202 our $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
205 # API compatibility name to version number mapping.
208 # This table expresses when API additions or changes can occur.
264 # We must check @File::Spec::ISA rather than using File::Spec->isa() to
276 # echo -n 'holy hand grenade of antioch' | openssl sha256
286 if (-f "./configdata.pm") {
287 my $file = "./configdata.pm";
307 # that those sub-systems are disabled.
316 unshift @argvcopy, "no-$_" if ! -d catdir($srcdir, 'crypto', $_);
343 defined $version{PRE_RELEASE_TAG} ? "-$version{PRE_RELEASE_TAG}" : '';
397 # be regexps, and will be used like this: /^no-${option}$/
401 "acvp-tests",
410 "autoload-config",
413 "buildtest-c++",
415 "cached-fetch",
424 "crypto-mdebug",
434 "dynamic-engine",
443 "external-tests",
446 "fips-securitychecks",
447 "fuzz-afl",
448 "fuzz-libfuzzer",
468 "posix-io",
478 "secure-memory",
491 "ssl-trace",
492 "static-engine",
500 "ui-console",
501 "unit-test",
503 "weak-ssl-ciphers",
506 "zlib-dynamic",
511 push(@disablables, "$proto-method") unless $proto eq "tls1_3";
515 # purpose here, but allow scripts to get to know them through configdata.pm,
524 "buf-freelists" => undef,
525 "crypto-mdebug-backtrace" => undef,
527 "hw-padlock" => "padlockeng",
529 "ui" => "ui-console",
538 "buildtest-c++" => "default",
539 "crypto-mdebug" => "default",
540 "crypto-mdebug-backtrace" => "default",
544 "external-tests" => "default",
545 "fuzz-afl" => "default",
546 "fuzz-libfuzzer" => "default",
553 "ssl3-method" => "default",
556 "unit-test" => "default",
557 "weak-ssl-ciphers" => "default",
559 "zlib-dynamic" => "default",
566 "aria", "async", "autoload-config",
578 "srtp", "ssl3-method", "ssl-trace",
579 "ts", "ui-console", "whirlpool",
580 "fips-securitychecks" ],
584 "ssl3-method" => [ "ssl3" ],
585 "zlib" => [ "zlib-dynamic" ],
598 "crypto-mdebug" => [ "crypto-mdebug-backtrace" ],
600 "module" => [ "dynamic-engine", "fips" ],
609 "shared" => [ "dynamic-engine", "uplink" ],
610 "dso" => [ "dynamic-engine", "module" ],
618 "engine" => [ "dynamic-engine", grep(/eng$/, @disablables) ],
619 "dynamic-engine" => [ "loadereng" ],
622 # no-autoalginit is only useful when building non-shared
627 "tests" => [ "external-tests" ],
630 sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
639 "fips" => [ "fips-securitychecks", "acvp-tests" ],
641 "deprecated-3.0" => [ "engine", "srp" ]
662 # Explicit "no-..." options will be collected in %disabled along with the defaults.
663 # To remove something from %disabled, use "enable-foo".
664 # For symmetry, "disable-foo" is a synonym for "no-foo".
673 MSWin32 => qr/(?<!\\);/ } -> {$^O} // qr/(?<!\\)[:\s]/;
675 # Some get pre-populated for the sake of backward compatibility
687 CPPFLAGS => [ env('CPPFLAGS') || () ], # -D, -I, -Wp,
688 CPPDEFINES => [], # Alternative for -D
689 CPPINCLUDES => [], # Alternative for -I
693 LDFLAGS => [ env('LDFLAGS') || () ], # -L, -Wl,
694 LDLIBS => [ env('LDLIBS') || () ], # -l
792 s/^-no-(?!integrated-as)/no-/;
794 # rewrite some options in "enable-..." form
795 s /^-?-?shared$/enable-shared/;
796 s /^sctp$/enable-sctp/;
797 s /^threads$/enable-threads/;
798 s /^zlib$/enable-zlib/;
799 s /^zlib-dynamic$/enable-zlib-dynamic/;
800 s /^fips$/enable-fips/;
802 if (/^(no|disable|enable)-(.+)$/)
805 if ($word !~ m|hw(?:-.+)| # special treatment for hw regexp opt
813 if (/^no-(.+)$/ || /^disable-(.+)$/)
817 if ($1 eq "$proto-method")
819 $disabled{"$proto"} = "option($proto-method)";
845 elsif ($1 eq "static-engine")
847 delete $disabled{"dynamic-engine"};
849 elsif ($1 eq "dynamic-engine")
851 $disabled{"dynamic-engine"} = "option";
861 elsif ($1 =~ m|hw(?:-.+)|) # deprecate hw options in regexp form
872 elsif (/^enable-(.+)$/)
874 if ($1 eq "static-engine")
876 $disabled{"dynamic-engine"} = "option";
878 elsif ($1 eq "dynamic-engine")
880 delete $disabled{"dynamic-engine"};
882 elsif ($1 eq "zlib-dynamic")
892 elsif (/^-d$/) # From older 'config'
896 elsif (/^-v$/) # From older 'config'
900 elsif (/^-w$/)
904 elsif (/^-t$/) # From older 'config'
908 elsif (/^--strict-warnings$/)
912 push @{$useradd{CFLAGS}}, '--ossl-strict-warnings';
915 elsif (/^--debug$/)
919 elsif (/^--release$/)
931 elsif (m|^[-+/]|)
933 if (/^--prefix=(.*)$/)
937 elsif (/^--api=(.*)$/)
939 my $api = $1;
940 die "Unknown API compatibility level $api"
941 unless defined $apitable->{$api};
942 $config{api}=$apitable->{$api};
944 elsif (/^--libdir=(.*)$/)
948 elsif (/^--openssldir=(.*)$/)
952 elsif (/^--with-zlib-lib=(.*)$/)
956 elsif (/^--with-zlib-include=(.*)$/)
960 elsif (/^--with-fuzzer-lib=(.*)$/)
964 elsif (/^--with-fuzzer-include=(.*)$/)
968 elsif (/^--with-rand-seed=(.*)$/)
972 die "Unknown --with-rand-seed choice $x\n"
977 elsif (/^--fips-key=(.*)$/)
980 die "Non-hex character in FIPS key\n"
981 if $user{FIPSKEY} =~ /[^a-f0-9]/;
987 elsif (/^--banner=(.*)$/)
991 elsif (/^--cross-compile-prefix=(.*)$/)
995 elsif (/^--config=(.*)$/)
999 elsif (/^-l(.*)$/)
1003 elsif (/^-framework$/)
1007 elsif (/^-L(.*)$/ or /^-Wl,/)
1011 elsif (/^-rpath$/ or /^-R$/)
1012 # -rpath is the OSF1 rpath flag
1013 # -R is the old Solaris rpath flag
1019 elsif (/^-static$/)
1023 elsif (m|^[-/]D(.*)$|)
1027 elsif (m|^[-/]I(.*)$|)
1031 elsif (/^-Wp,$/)
1035 else # common if (/^[-+]/), just pass down...
1039 # by spaces without quoting (e.g. -opt%20arg translates to -opt arg).
1040 $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
1050 $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
1056 die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
1059 unless ($_ eq $target || /^no-/ || /^disable-/)
1061 # "no-..." follows later after implied deactivations
1089 # 1 - "make vars"
1090 # 2 - %useradd entry set
1091 # 3 - both set
1138 if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ())
1141 die "***** Cannot simultaneously use -rpath, shared libraries, and\n",
1176 if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) {
1198 print $_,"\n" unless $table{$_}->{template};
1216 print "Using os-specific seed configuration\n";
1227 You have selected the --with-rand-seed=none option, which effectively
1241 map { (my $x = $_) =~ tr|[\-a-z]|[_A-Z]|; "OPENSSL_RAND_SEED_$x" }
1245 if ($target =~ m/^CygWin32(-.*)$/) {
1249 # Support for legacy targets having a name starting with 'debug-'
1250 my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
1254 # If we do not find debug-foo in the table, the target is set to foo.
1265 foreach ( ( "$target-$user{CC}", "$target", undef ) ) {
1266 $found=$_ if $table{$_} && !$table{$_}->{template};
1274 $target = $cc if $table{$cc} && !$table{$cc}->{template};
1326 $target{exe_extension}=".pm" if ($config{target} =~ /vos/);
1343 $value = $value->();
1357 $mkvalue->($ref_type, $user{$_})
1358 || $mkvalue->($ref_type, $target{$_});
1379 die "Directory given with --prefix MUST be absolute\n"
1383 if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
1397 foreach my $checker (($builder_platform."-".$config{build_file}."-checker.pm",
1398 $builder_platform."-checker.pm")) {
1400 if (-f $checker_path) {
1405 $fn->($@);
1407 $fn->($!);
1409 $fn->("The detected tools didn't match the platform\n");
1418 if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m)
1420 push @{$config{cflags}}, "-mno-cygwin";
1421 push @{$config{cxxflags}}, "-mno-cygwin" if $config{CXX};
1422 push @{$config{shared_ldflag}}, "-mno-cygwin";
1425 if ($target =~ /linux.*-mips/ && !$disabled{asm}
1426 && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
1429 $value = '-mips2' if ($target =~ /mips32/);
1430 $value = '-mips3' if ($target =~ /mips64/);
1448 # system-dependent compiler options that are necessary. We
1452 die "You asked for multi-threading support, but didn't\n"
1453 ,"provide any system-specific compiler options\n";
1459 # Find out if clang's sanitizers have been enabled with -fsanitize
1463 foreach (grep /^-fsanitize=/, @{$config{CFLAGS} || []}) {
1464 (my $checks = $_) =~ s/^-fsanitize=//;
1468 memory => 'msan' } -> {$_};
1490 if (!$disabled{shared} || !$disabled{"dynamic-engine"});
1491 disable('no-shared-target', 'pic');
1494 if ($disabled{"dynamic-engine"}) {
1501 push @{$config{cflags}}, "-fsanitize=address";
1505 push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all", "-DPEDANTIC";
1509 push @{$config{cflags}}, "-fsanitize=memory";
1512 unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}
1514 push @{$config{cflags}}, "-fno-omit-frame-pointer", "-g";
1515 push @{$config{cxxflags}}, "-fno-omit-frame-pointer", "-g" if $config{CXX};
1518 # Platform fix-ups
1550 if ($target eq "linux-ppc64") {
1568 } elsif (($predefined_C{__GNUC__} // -1) >= 3
1572 # handle $cc -M before clang support (but claims __GNUC__ = 3)
1586 # probe for -Wa,--noexecstack option...
1588 # clang has builtin assembler, which doesn't recognize --help,
1592 push @{$config{cflags}}, "-Wa,--noexecstack", "-Qunused-arguments";
1595 open(PIPE, "$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2>&1 |");
1597 if (m/--noexecstack/) {
1598 push @{$config{cflags}}, "-Wa,--noexecstack";
1629 $config{api} = $config{major} * 10000 + $config{minor} * 100
1630 unless $config{api};
1632 $disabled{"deprecated-$_"} = "deprecation"
1633 if $disabled{deprecated} && $config{api} >= $apitable->{$_};
1648 "OPENSSL_CONFIGURED_API=".$config{api},
1655 my $gccver = $predefined_C{__GNUC__} // -1;
1663 elsif ($config{target} =~ /^VC-/)
1669 warn "WARNING --strict-warnings requires gcc[>=4] or gcc-alike, or MSVC"
1673 $config{CFLAGS} = [ map { $_ eq '--ossl-strict-warnings'
1683 my $verstr = `uname -r`;
1688 disable('too-old-kernel', 'afalgeng');
1693 disable('cross-compiling', 'afalgeng');
1696 disable('not-linux', 'afalgeng');
1703 my $sysstr = `uname -s`;
1704 my $verstr = `uname -r`;
1710 disable('too-new-kernel', 'devcryptoeng');
1719 … system("printf '#include <sys/types.h>\n#include <linux/tls.h>' | $cc -E - >/dev/null 2>&1");
1721 disable('too-old-kernel', 'ktls');
1724 system("printf '#include <sys/types.h>\n#include <sys/ktls.h>' | $cc -E - >/dev/null 2>&1");
1726 disable('too-old-freebsd', 'ktls');
1729 disable('not-linux-or-freebsd', 'ktls');
1745 catfile(dirname($0), "Configurations", "shared-info.pl");
1752 $si = $si->();
1765 $si->{module_cflags} = $si->{shared_cflag} unless defined $si->{module_cflags};
1766 $si->{module_cxxflags} = $si->{shared_cxxflag} unless defined $si->{module_cxxflags};
1767 $si->{module_ldflags} = $si->{shared_ldflag} unless defined $si->{module_ldflags};
1770 ? add($si->{$_})->($target{$_})
1771 : $si->{$_};
1791 my %disabled_info = (); # For configdata.pm
1796 # The generated $disabled{"deprecated-x.y"} entries are special
1798 next if $what =~ m|^deprecated-|;
1800 $config{options} .= " no-$what";
1802 if (!grep { $what eq $_ } ( 'buildtest-c++', 'fips', 'threads', 'shared',
1803 'module', 'pic', 'dynamic-engine', 'makedepend',
1804 'zlib-dynamic', 'zlib', 'sse2', 'legacy' )) {
1805 (my $WHAT = uc $what) =~ s|-|_|g;
1808 # fix-up crypto/directory name(s)
1812 my $macro = $disabled_info{$what}->{macro} = "OPENSSL_NO_$WHAT";
1821 if ($disabled{"dynamic-engine"}) {
1872 ( $builder_platform."-".$config{build_file}.".tmpl",
1898 last if -f $build_file_template;
1914 # We want to detect configdata.pm in the source tree, so we
1916 my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir, 1);
1934 push @{$disabled_info{$what}->{skipped}}, catdir(@curd);
2037 $$ref->{$g}->{$ak} = $av;
2039 delete $$ref->{$g}->{$ak};
2060 push @{$valueref->{$_}}, @values;
2062 $handle_attributes->($attr_str, \$$attrref->{$_},
2068 $handle_attributes->($attr_str, $attrref, @values)
2078 Text::Template->new(TYPE => 'FILE',
2084 $template->fill_in(HASH => { config => \%config,
2092 DELIMITERS => [ "{-", "-}" ]);
2095 # -2 positive already run and we found ELSE (following ELSIF should fail)
2096 # -1 positive already run (skip until ENDIF)
2115 push @skip, !! $expand_variables->($+{COND});
2117 push @skip, -1;
2123 $skip[$#skip] = -1 if $skip[$#skip] != 0;
2124 $skip[$#skip] = !! $expand_variables->($+{COND})
2128 $skip[$#skip] = -2 if $skip[$#skip] != 0;
2136 $variables{$+{VARIABLE}} = $expand_variables->($+{VALUE});
2142 foreach (tokenize($expand_variables->($+{VALUE}))) {
2148 => sub { $push_to->(\@programs, undef,
2150 tokenize($expand_variables->($+{VALUE})))
2153 => sub { $push_to->(\@libraries, undef,
2155 tokenize($expand_variables->($+{VALUE})))
2158 => sub { $push_to->(\@modules, undef,
2160 tokenize($expand_variables->($+{VALUE})))
2163 => sub { $push_to->(\@scripts, undef,
2165 tokenize($expand_variables->($+{VALUE})))
2168 => sub { $push_to->(\%imagedocs, $expand_variables->($+{INDEX}),
2170 tokenize($expand_variables->($+{VALUE})))
2173 => sub { $push_to->(\%htmldocs, $expand_variables->($+{INDEX}),
2175 tokenize($expand_variables->($+{VALUE})))
2178 => sub { $push_to->(\%mandocs, $expand_variables->($+{INDEX}),
2180 tokenize($expand_variables->($+{VALUE})))
2183 => sub { $push_to->(\%sources, $expand_variables->($+{INDEX}),
2185 tokenize($expand_variables->($+{VALUE})))
2188 => sub { $push_to->(\%shared_sources, $expand_variables->($+{INDEX}),
2190 tokenize($expand_variables->($+{VALUE})))
2193 => sub { $push_to->(\%includes, $expand_variables->($+{INDEX}),
2195 tokenize($expand_variables->($+{VALUE})))
2198 => sub { $push_to->(\%defines, $expand_variables->($+{INDEX}),
2200 tokenize($expand_variables->($+{VALUE})))
2203 => sub { $push_to->(\%depends, $expand_variables->($+{INDEX}),
2205 tokenize($expand_variables->($+{VALUE})))
2208 => sub { $push_to->(\%generate, $expand_variables->($+{INDEX}),
2210 $expand_variables->($+{VALUE}))
2228 if (grep { defined $attributes{modules}->{$_}->{engine} } keys %attributes
2231 ENGINES can only be used if configured with 'dynamic-engine'.
2244 $unified_info{$k}->{$item} = 1;
2247 $unified_info{attributes}->{$k}->{$item} =
2248 $attributes{$k}->{$_}
2249 if defined $attributes{$k}->{$_};
2259 push @doubles, $l if defined $unified_info{libraries}->{$l};
2273 if ($s eq $src_configdata || $generate{$_} || ! -f $s) {
2283 $unified_info{sources}->{$ddest}->{$o} = -1;
2284 $unified_info{sources}->{$o}->{$s} = -1;
2290 $unified_info{sources}->{$ddest}->{$o} = -1;
2291 $unified_info{sources}->{$o}->{$s} = -1;
2294 $unified_info{sources}->{$ddest}->{$s} = 1;
2298 $unified_info{attributes}->{sources}->{$ddest}->{$o} =
2299 $unified_info{attributes}->{sources}->{$o}->{$s} =
2300 $attributes{sources}->{$dest}->{$_}
2301 if defined $attributes{sources}->{$dest}->{$_};
2303 $unified_info{attributes}->{sources}->{$ddest}->{$s} =
2304 $attributes{sources}->{$dest}->{$_}
2305 if defined $attributes{sources}->{$dest}->{$_};
2318 if ($s eq $src_configdata || $generate{$_} || ! -f $s) {
2329 $unified_info{shared_sources}->{$ddest}->{$o} = -1;
2330 $unified_info{sources}->{$o}->{$s} = -1;
2336 $unified_info{shared_sources}->{$ddest}->{$o} = -1;
2337 $unified_info{sources}->{$o}->{$s} = -1;
2343 $unified_info{shared_sources}->{$ddest}->{$o} = 1;
2349 $unified_info{attributes}->{shared_sources}->{$ddest}->{$o} =
2350 $unified_info{attributes}->{sources}->{$o}->{$s} =
2351 $attributes{sources}->{$dest}->{$_}
2352 if defined $attributes{sources}->{$dest}->{$_};
2354 $unified_info{attributes}->{shared_sources}->{$ddest}->{$o} =
2355 $attributes{sources}->{$dest}->{$_}
2356 if defined $attributes{sources}->{$dest}->{$_};
2367 my @generator = split /\s+/, $generate{$dest}->[0];
2372 if ($generate{$gen} || ! -f $generator[0]) {
2375 $check_generate{$ddest}->{$generator[0]}++;
2377 $unified_info{generate}->{$ddest} = [ @generator ];
2379 $unified_info{attributes}->{generate}->{$ddest} =
2380 $attributes{generate}->{$dest}->{$gen}
2381 if defined $attributes{generate}->{$dest}->{$gen};
2390 $unified_info{targets}->{$1} = 1;
2399 if ($ddest eq $src_configdata || ! -f $ddest) {
2413 || ! -f $d) {
2416 $unified_info{depends}->{$ddest}->{$d} = 1;
2419 $unified_info{attributes}->{depends}->{$ddest}->{$d} =
2420 $attributes{depends}->{$dest}->{$_}
2421 if defined $attributes{depends}->{$dest}->{$_};
2431 if ($ddest eq $src_configdata || ! -f $ddest) {
2437 push @{$unified_info{includes}->{$ddest}->{source}}, $is
2438 unless grep { $_ eq $is } @{$unified_info{includes}->{$ddest}->{source}};
2439 push @{$unified_info{includes}->{$ddest}->{build}}, $ib
2440 unless grep { $_ eq $ib } @{$unified_info{includes}->{$ddest}->{build}};
2452 if (! -f $ddest) {
2461 if defined $unified_info{defines}->{$ddest}->{$1};
2462 $unified_info{defines}->{$ddest}->{$1} = $2;
2474 $unified_info{imagedocs}->{$section}->{$imagedocs} = 1;
2481 $unified_info{htmldocs}->{$section}->{$htmldocs} = 1;
2488 $unified_info{mandocs}->{$section}->{$mandocs} = 1;
2510 if ($check_generate{$_}->{$generators[0]} > 1) {
2541 if (! -f $gen) {
2563 map { keys %{$unified_info{sources}->{$_}} }
2564 keys %{$unified_info{sources}->{$prod}};
2589 foreach my $d (keys %{$unified_info{depends}->{$dest}}) {
2590 next unless $d =~ /\.(h|pm)$/;
2593 $d eq "configdata.pm" || defined($unified_info{generate}->{$d})
2595 push @{$unified_info{includes}->{$dest}->{$spot}}, $i
2596 unless grep { $_ eq $i } @{$unified_info{includes}->{$dest}->{$spot}};
2604 # {productname}-{midfix}-{origobjname}.[o|res]
2625 # - give a prefix for the new object files names
2626 # - in the case of libraries, rearrange the object files so static
2643 } -> {$prodtype};
2645 next if ($intent->{$kind}->{dst} eq 'shared_sources'
2648 my @src = @{$intent->{$kind}->{src}};
2649 my $dst = $intent->{$kind}->{dst};
2650 my $prodselect = $intent->{$kind}->{prodselect} // sub { @_ };
2651 foreach my $prod ($prodselect->(keys %{$unified_info{$prodtype}})) {
2655 map { $_ => [ keys %{$unified_copy{sources}->{$_}} ] }
2656 map { keys %{$unified_copy{$_}->{$prod}} }
2661 # (+1 instead of -1)
2667 . '-' . $kind
2668 . '-' . basename($_));
2669 $unified_info{$dst}->{$prod}->{$newobj} = 1;
2671 $unified_info{sources}->{$newobj}->{$src} = 1;
2673 my $attrs = $unified_info{attributes}->{sources};
2674 if (defined $attrs->{$prod}
2675 && defined $attrs->{$prod}->{$_}) {
2676 $attrs->{$prod}->{$newobj} =
2677 $attrs->{$prod}->{$_};
2678 delete $attrs->{$prod}->{$_};
2680 foreach my $objsrc (keys %{$attrs->{$_} // {}}) {
2681 $attrs->{$newobj}->{$objsrc} =
2682 $attrs->{$_}->{$objsrc};
2683 delete $attrs->{$_}->{$objsrc};
2687 foreach my $deps (keys %{$unified_info{depends}->{$_}}) {
2688 $unified_info{depends}->{$_}->{$deps} = -1;
2689 $unified_info{depends}->{$newobj}->{$deps} = 1;
2694 defined($unified_info{includes}->{$_}->{$k});
2695 my @incs = @{$unified_info{includes}->{$_}->{$k}};
2696 $unified_info{includes}->{$newobj}->{$k} = [ @incs ];
2699 $unified_info{$dst}->{$prod}->{$_} = 1;
2707 # At this point, we have a number of sources with the value -1. They
2723 grep { $unified_info{$l1}->{$l2}->{$_} > 0 }
2724 keys %{$unified_info{$l1}->{$l2}};
2726 $unified_info{$l1}->{$l2} = [ @items ];
2728 delete $unified_info{$l1}->{$l2};
2734 $unified_info{defines}->{$dest}
2735 = [ map { $_.$unified_info{defines}->{$dest}->{$_} }
2736 sort keys %{$unified_info{defines}->{$dest}} ];
2740 if (defined($unified_info{includes}->{$dest}->{build})) {
2742 @source_includes = ( @{$unified_info{includes}->{$dest}->{source}} )
2743 if defined($unified_info{includes}->{$dest}->{source});
2744 $unified_info{includes}->{$dest} =
2745 [ @{$unified_info{includes}->{$dest}->{build}} ];
2747 push @{$unified_info{includes}->{$dest}}, $inc
2748 unless grep { $_ eq $inc } @{$unified_info{includes}->{$dest}};
2750 } elsif (defined($unified_info{includes}->{$dest}->{source})) {
2751 $unified_info{includes}->{$dest} =
2752 [ @{$unified_info{includes}->{$dest}->{source}} ];
2754 delete $unified_info{includes}->{$dest};
2766 "docs" => [ (map { @{$unified_info{imagedocs}->{$_} // []} }
2768 (map { @{$unified_info{htmldocs}->{$_} // []} }
2770 (map { @{$unified_info{mandocs}->{$_} // []} }
2777 foreach (@{$unified_info{sources}->{$product} // []},
2778 @{$unified_info{shared_sources}->{$product} // []}) {
2790 push @{$unified_info{dirinfo}->{$d}->{deps}}, $_
2794 push @{$unified_info{dirinfo}->{$_}->{products}->{$type}},
2827 my $configdata_outname = 'configdata.pm';
2830 my $configdata_tmplname = cleanfile($srcdir, "configdata.pm.in", $blddir, 1);
2832 OpenSSL::Template->new(TYPE => 'FILE', SOURCE => $configdata_tmplname);
2833 $configdata_tmpl->fill_in(
2847 chmod $mode, 'configdata.pm'
2848 … or warn sprintf("WARNING: Couldn't change mode for 'configdata.pm' to 0%03o: %s\n",$mode,$!);
2863 The library could not be configured for supporting multi-threaded
2865 See file INSTALL.md for details if you need multi-threading.
2870 The options 'shared', 'pic' and 'dynamic-engine' aren't supported on this
2871 platform, so we will pretend you gave the option 'no-pic', which also disables
2872 'shared' and 'dynamic-engine'. If you know how to implement shared libraries
2894 Please read INSTALL.md and associated NOTES-* files. You may also have to
2919 # When configuring with --debug, the resulting string will be
2925 # cflags => picker(default => "-Wall",
2926 # debug => "-g -O0",
2927 # release => "-O3")
2932 $opts{$config{build_type}} || ())->(); }
2939 # cflags => combine("-Wall", sub { $disabled{zlib} ? () : "-DZLIB" })
2943 return sub { add(@stuff)->(); }
2949 # cflags => combine("-Wall", threads("-pthread"))
2953 return sub { add($disabled{threads} ? () : @flags)->(); }
2958 return sub { add($disabled{shared} ? () : @flags)->(); }
2976 $res = $res->();
3002 $separator = $opts->{separator};
3011 $separator = $opts->{separator};
3056 shadow pre-existing config targets with the same name:
3072 $targets{$_}->{_conf_fname_int} = add([ $fname ]);
3105 if ($table{$target}->{inherit_from}) {
3107 map { ref($_) eq "CODE" ? $_->() : $_ } @{$table{$target}->{inherit_from}};
3126 delete $table{$target}->{inherit_from};
3131 # - If a value is a coderef, it will be executed with the list of
3133 # - If the corresponding key doesn't have a value at all or is the
3137 # - Otherwise, this target's value is assumed to be a string that
3154 $object = $object->(@$inherited);
3167 ," found in target ",$target," -> ",$entry,"\n";
3177 if (!exists $table{$target}->{$key}) {
3178 $table{$target}->{$key} = $default_combiner;
3181 $table{$target}->{$key} = process_values($table{$target}->{$key},
3184 unless(defined($table{$target}->{$key})) {
3185 delete $table{$target}->{$key};
3188 # $previous && !($add_called || $previous ~~ $table{$target}->{$key})) {
3206 next if $table{$i}->{template};
3218 next if $table{$i}->{template};
3244 # collect compiler pre-defines from gcc or gcc-alike...
3245 open(PIPE, "$cc -dM -E -x c /dev/null 2>&1 |");
3248 $predefined{$cc}->{$1} = $2 // '';
3261 IPC::Cmd->import();
3266 return $name if (File::Spec->splitpath($name))[1];
3268 foreach (File::Spec->path()) {
3270 if (-f $fullpath and -x $fullpath) {
3284 # $config{perlenv}->{$name} will be created with the value
3287 $config{perlenv}->{$name} = $ENV{$name}
3288 if ! exists $config{perlenv}->{$name};
3290 return $config{perlenv}->{$name};
3352 printf "\$%-12s = %s\n", $_, join(" ", @{$target{$_}});
3354 printf "\$%-12s = %s\n", $_, $target{$_};
3359 length((sort { length($a) <=> length($b) } @sequence)[-1]);
3364 …print " '",$_,"'"," " x ($largest - length($_))," => [ ",join(", ", map { "'$_'" } @{$target{…
3366 print " '",$_,"'"," " x ($largest - length($_))," => '",$target{$_},"',\n";
3382 # On non-platforms, we just use file_name_is_absolute().
3462 return map { $processor->($_); } @_;
3481 $_ = $line_concat->($saved_line, $_);
3512 $_ = $line_concat->($saved_line, $_);
3534 while(defined($_ = $lineiterator->())) {
3538 $collectors{"BEFORE"}->($_);
3542 $collectors{$re}->($lineiterator);
3547 $collectors{"OTHERWISE"}->($lineiterator, $_)
3551 $collectors{"AFTER"}->($_);