"async",
"autoalginit",
"autoerrinit",
+ "autoload-config",
"bf",
"blake2",
"camellia",
# All of the following are disabled by default:
our %disabled = ( # "what" => "comment"
- "asan" => "default",
+ "asan" => "default",
"crypto-mdebug" => "default",
"crypto-mdebug-backtrace" => "default",
"devcryptoeng" => "default",
push @{$config{lib_defines}}, "SHA256_ASM" if ($target{sha1_asm_src} =~ /sha256/);
push @{$config{lib_defines}}, "SHA512_ASM" if ($target{sha1_asm_src} =~ /sha512/);
}
+ if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) {
+ push @{$config{lib_defines}}, "KECCAK1600_ASM";
+ }
if ($target{rc4_asm_src} ne $table{DEFAULTS}->{rc4_asm_src}) {
push @{$config{lib_defines}}, "RC4_ASM";
}
}
}
-my %predefined = compiler_predefined($config{CC});
+my %predefined = compiler_predefined($config{CROSS_COMPILE}.$config{CC});
# Check for makedepend capabilities.
if (!$disabled{makedepend}) {
# For VC- and vms- targets, there's nothing more to do here. The
# functionality is hard coded in the corresponding build files for
# cl (Windows) and CC/DECC (VMS).
- } elsif ($predefined{__GNUC__} >= 3) {
+ } elsif (($predefined{__GNUC__} // -1) >= 3
+ && !($predefined{__APPLE_CC__} && !$predefined{__clang__})) {
# We know that GNU C version 3 and up as well as all clang
- # versions support dependency generation
+ # versions support dependency generation, but Xcode did not
+ # handle $cc -M before clang support (but claims __GNUC__ = 3)
$config{makedepprog} = "\$(CROSS_COMPILE)$config{CC}";
} else {
# In all other cases, we look for 'makedepend', and disable the
}
}
+if (!$disabled{asm}) {
+ # probe for -Wa,--noexecstack option...
+ if ($predefined{__clang__}) {
+ # clang has builtin assembler, which doesn't recognize --help,
+ # but it apparently recognizes the option in question on all
+ # supported platforms even when it's meaningless. In other words
+ # probe would fail, but probed option always accepted...
+ push @{$config{cflags}}, "-Wa,--noexecstack", "-Qunused-arguments";
+ } elsif ($^O ne 'VMS') {
+ my $cc = $config{CROSS_COMPILE}.$config{CC};
+ open(PIPE, "$cc -Wa,--help -c -o null.$$.o -x assembler /dev/null 2>&1 |");
+ while(<PIPE>) {
+ if (m/--noexecstack/) {
+ push @{$config{cflags}}, "-Wa,--noexecstack";
+ last;
+ }
+ }
+ close(PIPE);
+ unlink("null.$$.o");
+ }
+}
# Deal with bn_ops ###################################################
push @{$config{defines}}, $apiflag;
}
-if (defined($predefined{__clang__}) && !$disabled{asm}) {
- push @{$config{cflags}}, "-Qunused-arguments";
- push @{$config{cxxflags}}, "-Qunused-arguments" if $config{CXX};
-}
-
if ($strict_warnings)
{
my $wopt;
die "*** Couldn't find any of:\n", join("\n", @build_file_templates), "\n";
}
$config{build_file_templates}
- = [ $build_file_template,
+ = [ cleanfile($srcdir, catfile("Configurations", "common0.tmpl"),
+ $blddir),
+ $build_file_template,
cleanfile($srcdir, catfile("Configurations", "common.tmpl"),
$blddir) ];
sub compiler_predefined {
state %predefined;
- my $default_compiler = shift;
+ my $cc = shift;
return () if $^O eq 'VMS';
- die 'compiler_predefined called without a default compiler'
- unless $default_compiler;
+ die 'compiler_predefined called without a compiler command'
+ unless $cc;
- if (! $predefined{$default_compiler}) {
- my $cc = "$config{CROSS_COMPILE}$default_compiler";
+ if (! $predefined{$cc}) {
- $predefined{$default_compiler} = {};
+ $predefined{$cc} = {};
# collect compiler pre-defines from gcc or gcc-alike...
open(PIPE, "$cc -dM -E -x c /dev/null 2>&1 |");
while (my $l = <PIPE>) {
$l =~ m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
- $predefined{$default_compiler}->{$1} = $2 // '';
+ $predefined{$cc}->{$1} = $2 // '';
}
close(PIPE);
}
- return %{$predefined{$default_compiler}};
+ return %{$predefined{$cc}};
}
sub which