Add support for ARM using definitions from WINE

This commit is contained in:
Peter Robinson 2012-05-01 10:47:47 +01:00
parent cc212e40ff
commit 0e9bc0a922
2 changed files with 101 additions and 17 deletions

83
libEMF-arm.patch Normal file
View File

@ -0,0 +1,83 @@
--- libEMF-1.0.4/include/libEMF/wine/winnt.h.orig 2012-05-01 09:36:45.607228307 +0100
+++ libEMF-1.0.4/include/libEMF/wine/winnt.h 2012-05-01 10:27:53.636581246 +0100
@@ -37,6 +37,10 @@
# undef WORDS_BIGENDIAN
# undef BITFIELDS_BIGENDIAN
# undef ALLOW_UNALIGNED_ACCESS
+#elif defined(__arm__)
+# undef WORDS_BIGENDIAN
+# undef BITFIELDS_BIGENDIAN
+# undef ALLOW_UNALIGNED_ACCESS
#elif defined(__sparc__)
# define WORDS_BIGENDIAN
# define BITFIELDS_BIGENDIAN
@@ -1128,6 +1132,69 @@
#endif /* __s390__ */
+#ifdef __arm__
+
+/* These definitions are taken directly from wine
+ * http://source.winehq.org/git/wine.git/blob_plain/HEAD:/include/winnt.h */
+
+/* The following flags control the contents of the CONTEXT structure. */
+
+#define CONTEXT_ARM 0x0200000
+#define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001)
+#define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002)
+#define CONTEXT_FLOATING_POINT (CONTEXT_ARM | 0x00000004)
+#define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM | 0x00000008)
+
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
+
+#define EXCEPTION_READ_FAULT 0
+#define EXCEPTION_WRITE_FAULT 1
+#define EXCEPTION_EXECUTE_FAULT 8
+
+typedef struct _CONTEXT {
+/* The flags values within this flag control the contents of
+ * a CONTEXT record.
+ *
+ * If the context record is used as an input parameter, then
+ * for each portion of the context record controlled by a flag
+ * whose value is set, it is assumed that that portion of the
+ * context record contains valid context. If the context record
+ * is being used to modify a thread's context, then only that
+ * portion of the threads context will be modified.
+ *
+ * If the context record is used as an IN OUT parameter to capture
+ * the context of a thread, then only those portions of the thread's
+ * context corresponding to set flags will be returned.
+ *
+ * The context record is never used as an OUT only parameter. */
+
+ULONG ContextFlags;
+
+/* This section is specified/returned if the ContextFlags word contains
+ * the flag CONTEXT_INTEGER. */
+ULONG R0;
+ULONG R1;
+ULONG R2;
+ULONG R3;
+ULONG R4;
+ULONG R5;
+ULONG R6;
+ULONG R7;
+ULONG R8;
+ULONG R9;
+ULONG R10;
+ULONG Fp;
+ULONG Ip;
+
+/* These are selected by CONTEXT_CONTROL */
+ULONG Sp;
+ULONG Lr;
+ULONG Pc;
+ULONG Cpsr;
+} CONTEXT;
+
+#endif /* __arm__ */
+
#if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
#error You need to define a CONTEXT for your CPU
#endif

View File

@ -2,18 +2,19 @@ Summary: A library for generating Enhanced Metafiles
Summary(pl): Biblioteka do generowania plików w formacie Enhanced Metafile
Name: libEMF
Version: 1.0.4
Release: 3%{?dist}
Release: 4%{?dist}
License: LGPLv2+ and GPLv2+
Group: System Environment/Libraries
URL: http://libemf.sourceforge.net/
Source0: http://downloads.sourceforge.net/pstoedit/%{name}-%{version}.tar.gz
# Source0-md5: a4e91fd8077ce5f540f569e20e8ef7ff
Patch0: %{name}-amd64.patch
Patch1: %{name}-axp.patch
Patch3: %{name}-s390.patch
URL: http://libemf.sourceforge.net/
Patch2: %{name}-s390.patch
Patch3: %{name}-arm.patch
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
%description
libEMF is a library for generating Enhanced Metafiles on systems which
@ -46,35 +47,32 @@ Pliki nagłówkowe libEMF.
%setup -q
%patch0 -p1 -b .amd64
%patch1 -p1 -b .axp
%patch3 -p1 -b .s390
%patch2 -p1 -b .s390
%patch3 -p1 -b .arm
chmod 0644 libemf/libemf.h
%build
# supplied libtool is broken (no C++ libraries support)
%{__libtoolize} --force
%{__aclocal}
%{__autoconf}
%{__automake}
libtoolize --force
aclocal
autoconf
automake
%configure \
--disable-static \
--enable-editing
%{__make} %{?_smp_mflags}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
export CPPROG="cp -p"
%{__make} install \
make install \
DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/libEMF.la
%check
%{__make} check
%clean
rm -rf $RPM_BUILD_ROOT
make check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -92,6 +90,9 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/libEMF
%changelog
* Tue May 1 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 1.0.4-4
- Add support for ARM using definitions from WINE
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild