diff options
-rwxr-xr-x | configure.pl | 10 | ||||
-rw-r--r-- | misc/config/arch/amd64 | 2 | ||||
-rw-r--r-- | misc/config/arch/ia32 | 2 |
3 files changed, 14 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'}})); diff --git a/misc/config/arch/amd64 b/misc/config/arch/amd64 index 8a321ce11..cafe1bb32 100644 --- a/misc/config/arch/amd64 +++ b/misc/config/arch/amd64 @@ -2,6 +2,8 @@ realname "AMD64" default_submodel amd64 +endian little + <aliases> x86-64 x86_64 # for RPM diff --git a/misc/config/arch/ia32 b/misc/config/arch/ia32 index 9747070a8..1eec8cdbe 100644 --- a/misc/config/arch/ia32 +++ b/misc/config/arch/ia32 @@ -2,6 +2,8 @@ realname "IA-32" default_submodel i586 +endian little + <aliases> x86 ix86 |