[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#530286: apr: FTBFS on hurd-i386



Package: apr
Version: 1.3.3-4
Severity: important
Tags: patch


Coin,

Please consider applying this patch to enable Hurd support :
- define _GNU_SOURCE because without it a few GNU things are not defined (it doesn't FTBFS on Linux probably because something else enforce it) - don't use --enable-nonportable-atomics on GNU (maybe this should be enforced on kfreebsd too)
  - deactivate IP multicast support which is not supported yet
- deactivate tests on Hurd as most succeed and apr is pretty usuable (apr-utils builds, apache2 too, and the later is working like a charm), so before investigation is over there is no reason to block so many packages

Regards.

--
Marc Dequènes (Duck)
diff -Nur orig/apr-1.3.3/debian/changelog new/apr-1.3.3/debian/changelog
--- orig/apr-1.3.3/debian/changelog	2009-05-23 20:17:46.000000000 +0200
+++ new/apr-1.3.3/debian/changelog	2009-05-23 20:22:22.000000000 +0200
@@ -1,3 +1,15 @@
+apr (1.3.3-4+hurdfr1) unreleased; urgency=low
+
+  * NMU by HurdFr.
+  * Built using '-D_GNU_SOURCE' or PTHREAD_MUTEX_RECURSIVE is not
+    exported (and maybe others).
+  * Don't compile with --enable-nonportable-atomics on GNU.
+  * Deactivate missing multicast support on Hurd (by removing
+    HAVE_STRUCT_IPMREQ manually).
+  * Ignore failed tests on Hurd at the moment (tests deactivated).
+
+ -- Marc Dequènes (Duck) <duck@hurdfr.org>  Sat, 16 May 2009 12:51:31 +0200
+
 apr (1.3.3-4) unstable; urgency=low
 
   [ Ryan Niebur ]
diff -Nur orig/apr-1.3.3/debian/rules new/apr-1.3.3/debian/rules
--- orig/apr-1.3.3/debian/rules	2009-05-23 20:17:46.000000000 +0200
+++ new/apr-1.3.3/debian/rules	2009-05-23 20:22:22.000000000 +0200
@@ -8,12 +8,13 @@
 
 # These are used for cross-compiling and for saving the configure script
 # # from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
 
 BUILDDIR := build-$(DEB_HOST_GNU_TYPE)
 
-CFLAGS := $(CFLAGS) -pipe -Wall -g
+CFLAGS := $(CFLAGS) -pipe -Wall -g -D_GNU_SOURCE
 
 # hardening options
 H_CFLAGS := -Wformat -Wformat-security -D_FORTIFY_SOURCE=2
@@ -23,6 +24,9 @@
 	H_CFLAGS += -fstack-protector
 endif
 
+# export needed GNU extensions
+H_CFLAGS += -D_GNU_SOURCE
+
 CONFFLAGS += ac_cv_prog_AWK=mawk apr_cv_sctp=no
 
 # Enable debug builds
@@ -46,9 +50,18 @@
 else
 	TEST_TARGET =
 endif
+ifeq (gnu, $(DEB_BUILD_GNU_SYSTEM))
+	TEST_TARGET =
+endif
 
 SHELL=/bin/bash
 
+CONFOPTS =	--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
+		--enable-layout=Debian --includedir=\$${prefix}/usr/include/apr-1.0 --with-installbuilddir=\$${prefix}/usr/share/apr-1.0/build
+ifneq (gnu, $(DEB_BUILD_GNU_SYSTEM))
+	CONFOPTS += --enable-nonportable-atomics
+endif
+
 $(BUILDDIR)/config.status: patch-stamp
 	dh_testdir
 	mkdir -p $(BUILDDIR)/docs
@@ -56,12 +69,16 @@
 	# we need to force the use of bash here. Otherwise, if apr is built with
 	# /bin/sh -> /bin/bash, the resulting libtool will not work on systems
 	# where /bin/sh -> /bin/dash
-	cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CONFFLAGS) CONFIG_SHELL=/bin/bash /bin/bash ../configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --enable-layout=Debian --includedir=\$${prefix}/usr/include/apr-1.0 --with-installbuilddir=\$${prefix}/usr/share/apr-1.0/build  --enable-nonportable-atomics
+	cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(CONFFLAGS) CONFIG_SHELL=/bin/bash /bin/bash ../configure $(CONFOPTS)
 	# Determine whether upstream's configure gives the same definition of apr_ino_t as we had until 1.2.11-1
 	rm -f debian/ino_t_test
 	gcc -I$(CURDIR)/include -I$(BUILDDIR)/include `$(BUILDDIR)/apr-1-config --cppflags` -o debian/ino_t_test debian/ino_t_test.c
 	debian/ino_t_test
 	rm -f debian/ino_t_test
+ifeq (gnu, $(DEB_BUILD_GNU_SYSTEM))
+	# multicast not supported on Hurd
+	sed -i '/HAVE_STRUCT_IPMREQ/ d' $(BUILDDIR)/include/arch/unix/apr_private.h
+endif
 
 build: patch-stamp build-stamp
 

Attachment: pgpMMfNZHIL4n.pgp
Description: PGP Digital Signature


Reply to: