diff options
author | lloyd <[email protected]> | 2007-05-17 00:37:21 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-05-17 00:37:21 +0000 |
commit | e0bea59d5e321c335f1a66aa430aca80be8a69bd (patch) | |
tree | c129d38b89cb2b79bd45e5350e6aae0014f46076 /configure.pl | |
parent | 925a58bba71b94782fa08025ac1eac8af0e95bb5 (diff) |
Add a new preprocessor macro defining the endian-ness of the target CPU.
Currently it is only set for x86 and x86-64 as they are two of the few
architectures which are not bi-endian, and we're not doing any detection
(nor is there any way for a user to override the selection yet).
Diffstat (limited to 'configure.pl')
-rwxr-xr-x | configure.pl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.pl b/configure.pl index 7f741fe21..201bcb0ce 100755 --- a/configure.pl +++ b/configure.pl @@ -823,7 +823,11 @@ sub load_modules { my $defines = ''; my $arch = $$config{'arch'}; + if($arch ne 'generic') { + my %cpu_info = %{$CPU{$arch}}; + my $endian = $cpu_info{'endian'}; + $arch = uc $arch; $defines .= "#define BOTAN_TARGET_ARCH_IS_$arch\n"; @@ -833,6 +837,11 @@ sub load_modules { $submodel =~ s/-/_/g; $defines .= "#define BOTAN_TARGET_CPU_IS_$submodel\n"; } + + if(defined($endian)) { + $endian = uc $endian; + $defines .= "#define BOTAN_TARGET_CPU_IS_${endian}_ENDIAN\n"; + } } my @defarray; @@ -1178,6 +1187,7 @@ 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'); read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}})); read_list($_, $reader, 'submodels', list_push(\@{$info{'submodels'}})); |