Add a patch to fix alignment tests when cross compiling

This commit is contained in:
Kalev Lember 2012-03-28 13:21:49 +03:00
parent d18b5ea8d0
commit 2bc7b7c718
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 8f8fc836709cff58bd666b87937542088cfc19db Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Wed, 28 Mar 2012 12:42:49 +0300
Subject: [PATCH] configure: Fix alignment tests when cross compiling
When inserting custom code to AC_CHECK_ALIGNOF, make sure to not replace
the default includes, but instead append to them.
This fixes ALIGNOF_GUINT32 and ALIGNOF_GUINT64 that were both 0 when cross
compiling. The third 'unsigned long' test wasn't affected because the
AC_CHECK_ALIGNOF call didn't specify the optional 2nd parameter.
---
configure.ac | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0d30b3e..82d74c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3405,8 +3405,10 @@ $ac_cv_sizeof___int64)
;;
esac
-AC_CHECK_ALIGNOF([guint32], [typedef unsigned $gint32 guint32;])
-AC_CHECK_ALIGNOF([guint64], typedef unsigned $gint64 guint64;)
+AC_CHECK_ALIGNOF([guint32], [AC_INCLUDES_DEFAULT
+typedef unsigned $gint32 guint32;])
+AC_CHECK_ALIGNOF([guint64], [AC_INCLUDES_DEFAULT
+typedef unsigned $gint64 guint64;])
AC_CHECK_ALIGNOF([unsigned long])
# Check for libdbus1 - Optional - is only used in the GDBus test cases
--
1.7.9.3

View File

@ -2,7 +2,7 @@
Name: mingw-glib2
Version: 2.32.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: MinGW Windows GLib2 library
License: LGPLv2+
@ -11,6 +11,8 @@ URL: http://www.gtk.org
# first two digits of version
%define release_version %(echo %{version} | awk -F. '{print $1"."$2}')
Source0: http://download.gnome.org/sources/glib/%{release_version}/glib-%{version}.tar.xz
# Already upstreamed
Patch0: 0001-configure-Fix-alignment-tests-when-cross-compiling.patch
BuildArch: noarch
@ -35,6 +37,9 @@ BuildRequires: gettext
# Native version required for glib-genmarshal
BuildRequires: glib2-devel >= 2.31.20
# Needed for the patch
BuildRequires: autoconf automake libtool
%description
MinGW Windows Glib2 library.
@ -74,6 +79,8 @@ Static version of the MinGW Windows GLib2 library.
%prep
%setup -q -n glib-%{version}
%patch0 -p1 -b .alignof
autoreconf -i --force
%build
@ -252,6 +259,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%changelog
* Wed Mar 28 2012 Kalev Lember <kalevlember@gmail.com> - 2.32.0-2
- Add a patch to fix alignment tests when cross compiling
* Mon Mar 26 2012 Kalev Lember <kalevlember@gmail.com> - 2.32.0-1
- Update to 2.32.0
- Dropped upstreamed patch