Source: libunistring
Severity: normal
Tags: patch
User: [email protected]
Usertags: ppc64el

Dear Maintainer,

The package libunistring fails to build from source on ppc64el.
Using dh-autoreconf fixes that situation and the package builds successfully.

There are 2 patches attached. The dh-autoreconf one just includes dh-autoreconf
to the build.

The other one, which fixes detection of floating point endianness has been 
gathered
from Ubuntu, created by Colin Watson.

Thanks
Fernando


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: ppc64el (ppc64le)

Kernel: Linux 3.13-1-powerpc64le (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -purN a/debian/control b/debian/control
--- a/debian/control	2014-02-28 12:31:25.000000000 +0000
+++ b/debian/control	2014-02-28 12:31:37.000000000 +0000
@@ -1,7 +1,7 @@
 Source: libunistring
 Priority: optional
 Maintainer: Andreas Rottmann <[email protected]>
-Build-Depends: cdbs (>= 0.4.93~), debhelper (>= 8.1.3~), autotools-dev
+Build-Depends: cdbs (>= 0.4.93~), debhelper (>= 8.1.3~), autotools-dev, dh-autoreconf
 Standards-Version: 3.9.2
 Section: libs
 Homepage: http://www.gnu.org/software/libunistring/
diff -purN a/debian/rules b/debian/rules
--- a/debian/rules	2014-02-28 12:30:11.000000000 +0000
+++ b/debian/rules	2014-02-28 12:30:20.000000000 +0000
@@ -5,6 +5,7 @@
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/autotools.mk
 include /usr/share/cdbs/1/rules/buildvars.mk
+include /usr/share/cdbs/1/rules/autoreconf.mk
 
 ifneq ($(findstring $(DEB_BUILD_ARCH), mips mipsel),)
 	CFLAGS += -mplt
Description: Fix detection of floating point endianness
 See https://lists.gnu.org/archive/html/bug-gnulib/2013-12/msg00104.html
Author: Alan Modra <[email protected]>
Author: Colin Watson <[email protected]>
Forwarded: no
Last-Update: 2013-12-18

Index: b/tests/test-isnanl.h
===================================================================
--- a/tests/test-isnanl.h
+++ b/tests/test-isnanl.h
@@ -38,6 +38,12 @@
 long double minus_zero = -0.0L;
 #endif
 
+#ifdef __FLOAT_WORD_ORDER__
+# define FLOAT_BIG_ENDIAN (__FLOAT_WORD_ORDER__ != __ORDER_LITTLE_ENDIAN__)
+#else
+# define FLOAT_BIG_ENDIAN (LDBL_EXPBIT0_WORD < NWORDS / 2)
+#endif
+
 int
 main ()
 {
@@ -70,10 +76,10 @@
 # if LDBL_EXPBIT0_BIT > 0
     m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1);
 # else
-    m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+    m.word[LDBL_EXPBIT0_WORD + (FLOAT_BIG_ENDIAN ? 1 : - 1)]
       ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
 # endif
-    m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+    m.word[LDBL_EXPBIT0_WORD + (FLOAT_BIG_ENDIAN ? 1 : - 1)]
       |= (unsigned int) 1 << LDBL_EXPBIT0_BIT;
     ASSERT (isnanl (m.value));
   }
Index: b/tests/test-signbit.c
===================================================================
--- a/tests/test-signbit.c
+++ b/tests/test-signbit.c
@@ -56,6 +56,12 @@
 long double minus_zerol = -0.0L;
 #endif
 
+#ifdef __FLOAT_WORD_ORDER__
+# define FLOAT_BIG_ENDIAN (__FLOAT_WORD_ORDER__ != __ORDER_LITTLE_ENDIAN__)
+#else
+# define FLOAT_BIG_ENDIAN (LDBL_EXPBIT0_WORD < NWORDS / 2)
+#endif
+
 static void
 test_signbitf ()
 {
@@ -176,10 +182,10 @@
 # if LDBL_EXPBIT0_BIT > 0
     m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1);
 # else
-    m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+    m.word[LDBL_EXPBIT0_WORD + (FLOAT_BIG_ENDIAN ? 1 : - 1)]
       ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
 # endif
-    m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+    m.word[LDBL_EXPBIT0_WORD + (FLOAT_BIG_ENDIAN ? 1 : - 1)]
       |= (unsigned int) 1 << LDBL_EXPBIT0_BIT;
     (void) signbit (m.value);
     #undef NWORDS

Reply via email to