diff options
author | lloyd <[email protected]> | 2007-10-19 15:37:56 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-10-19 15:37:56 +0000 |
commit | 26877ca7184302e5204325c1a13ddce00b94e07b (patch) | |
tree | 4fdb9a29806a4f265b59b4d625d4ca4d9f820211 /configure.pl | |
parent | 1bd6dba28be1db70227ddb5bac4284ac18f6a46b (diff) |
Add a new build-time macro BOTAN_TARGET_UNALIGNED_LOADSTOR_OK which is
0 or 1 depending on if the target CPU can handle an unaligned read or
write. This will be true on x86 and x86-64 (are there others?)
Diffstat (limited to 'configure.pl')
-rwxr-xr-x | configure.pl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/configure.pl b/configure.pl index 498922519..c52ec02eb 100755 --- a/configure.pl +++ b/configure.pl @@ -838,10 +838,21 @@ sub load_modules { $defines .= "#define BOTAN_TARGET_CPU_IS_$submodel\n"; } + my $unaligned_ok = 0; + if(defined($endian)) { $endian = uc $endian; $defines .= "#define BOTAN_TARGET_CPU_IS_${endian}_ENDIAN\n"; + + if(defined($cpu_info{'unaligned'}) + and $cpu_info{'unaligned'} eq 'ok') + { + $unaligned_ok = 1; + } } + + $defines .= + "#define BOTAN_TARGET_UNALIGNED_LOADSTOR_OK $unaligned_ok\n"; } my @defarray; @@ -1186,8 +1197,8 @@ sub get_arch_info { while($_ = &$reader()) { match_any_of($_, \%info, 'quoted', 'realname'); - match_any_of($_, \%info, 'unquoted', 'default_submodel'); - match_any_of($_, \%info, 'unquoted', 'endian'); + match_any_of($_, \%info, 'unquoted', + 'default_submodel:endian:unaligned'); read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}})); read_list($_, $reader, 'submodels', list_push(\@{$info{'submodels'}})); |