fix build on secondary arches

This commit is contained in:
Dan Horák 2011-12-20 18:29:33 +01:00
parent e98bd0885c
commit 654ad6066b
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,46 @@
diff -up libtpms-0.5.1/src/tpm_crypto_freebl.c.secondary libtpms-0.5.1/src/tpm_crypto_freebl.c
--- libtpms-0.5.1/src/tpm_crypto_freebl.c.secondary 2011-12-20 17:28:41.000000000 +0100
+++ libtpms-0.5.1/src/tpm_crypto_freebl.c 2011-12-20 17:43:53.000000000 +0100
@@ -1841,12 +1841,17 @@ void TPM_SHA1Delete(void **context)
#if defined (__x86_64__) || \
defined(__amd64__) || \
defined(__ia64__) || \
- defined(__powerpc64__)
+ defined(__powerpc64__) || \
+ defined(__s390x__) || \
+ defined(__sparc__) && defined(__arch64__)
#define IS_64
typedef PRUint64 SHA_HW_t;
#elif defined (__i386__) || \
- defined (__powerpc__)
+ defined (__powerpc__) || \
+ defined (__s390__) || \
+ defined (__sparc__) || \
+ defined (__arm__)
typedef PRUint32 SHA_HW_t;
#undef IS_64
diff -up libtpms-0.5.1/tests/freebl_sha1flattensize.c.secondary libtpms-0.5.1/tests/freebl_sha1flattensize.c
--- libtpms-0.5.1/tests/freebl_sha1flattensize.c.secondary 2011-12-20 18:17:02.000000000 +0100
+++ libtpms-0.5.1/tests/freebl_sha1flattensize.c 2011-12-20 18:17:32.000000000 +0100
@@ -8,12 +8,17 @@
#if defined (__x86_64__) || \
defined (__amd64__) || \
defined (__ia64__) || \
- defined (__powerpc64__)
+ defined (__powerpc64__) || \
+ defined(__s390x__) || \
+ defined(__sparc__) && defined(__arch64__)
#define EXPECTED_LIB_FLATTENSIZE 248
#elif defined (__i386__) || \
- defined (__powerpc__)
+ defined (__powerpc__) || \
+ defined (__s390__) || \
+ defined (__sparc__) || \
+ defined (__arm__)
#define EXPECTED_LIB_FLATTENSIZE 160

View File

@ -2,7 +2,7 @@
%define name libtpms
%define version 0.5.1
%define release 11
%define release 12
# Valid crypto subsystems are 'freebl' and 'openssl'
%define crypto_subsystem freebl
@ -18,6 +18,7 @@ License: BSD
Group: Development/Libraries
Url: http://sourceforge.net/projects/ibmswtpm
Source: http://bergerstefan.users.sourceforge.net/libtpms/%{name}-%{version}.tar.gz
Patch0: %{name}-0.5.1-secondary.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if %{crypto_subsystem} == openssl
BuildRequires: openssl-devel
@ -60,6 +61,7 @@ Libtpms header files and documentation.
%prep
%setup -q
%patch0 -p1
%build
@ -93,6 +95,9 @@ make %{?_smp_mflags} install DESTDIR=${RPM_BUILD_ROOT}
%postun -p /sbin/ldconfig
%changelog
* Tue Dec 20 2011 Dan Horák <dan[at]danny.cz> - 0.5.1-12
- fix build on secondary arches
* Wed Nov 2 2011 Stefan Berger - 0.5.1-11
- added (lib)gmp as runtime dependency