Package: dx
Severity: important
Tags: patch

Hi,

currently your package FTBFS on GNU/kFreeBSD with the following error:
> sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. 
> -I../../../include -I../../../include  -Dunknown  -I/usr/include  
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -g -O2 -Wall -pthread -Wall -g 
> -fsigned-char -O2  -D_GNU_SOURCE -c -o memory.lo memory.c
>  gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -I../../../include -Dunknown 
> -I/usr/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -Wall 
> -pthread -Wall -g -fsigned-char -O2 -D_GNU_SOURCE -c memory.c  -fPIC -DPIC -o 
> .libs/memory.o
> memory.c:1764: error: conflicting types for 'malloc'
> make[5]: *** [memory.lo] Error 1
> make[5]: Leaving directory `/build/buildd/dx-4.4.0/src/exec/libdx'
> make[4]: *** [all] Error 2
> make[4]: Leaving directory `/build/buildd/dx-4.4.0/src/exec/libdx'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory `/build/buildd/dx-4.4.0/src/exec'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/build/buildd/dx-4.4.0/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/build/buildd/dx-4.4.0'
> make: *** [build-stamp] Error 2

Full build logs are available at
<http://experimental.ftbfs.de/build.php?arch=kfreebsd-i386&pkg=dx>.

Please find attached a patch which makes GNU/kFreeBSD detected where
needed. Please also note that the handling of *_unknown is certainly
suboptimal, since kfreebsd isn't recognized properly in the configure
(I guess), but digging in it would take my more time than I have right
now, that's why I'm proposing this patch (ugly WRT to debian/rules). You
might need to separate *_linux from *_kfreebsd in the future, so this
patch might help anyway. Feel free not to apply it and wait for
a(nother) GNU/kFreeBSD porter to propose a cleaner patch.

Cheers,

-- 
Cyril Brulebois
--- dx-4.4.0/src/exec/libdx/memory.c	2007-03-08 02:51:05.039996000 +0100
+++ dx-4.4.0/src/exec/libdx/memory.c	2007-03-08 02:55:25.000000000 +0100
@@ -70,7 +70,7 @@
 #include <sys/sysinfo.h>
 #endif
 
-#if freebsd
+#if freebsd || defined(__FreeBSD_kernel__)
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -1062,7 +1062,7 @@
 #define LARGE(x) ((ulong)x>=(ulong)large)
 #endif
 
-#ifdef	linux
+#if defined(linux) || defined(__FreeBSD_kernel__)
 #define initvalues
 #define SMALL_BASE    0               /* use data segment */
 #define SMALL_GET     _dxfgetmem      /* expand by using DosSetMem */
--- dx-4.4.0/src/uipp/startup/StartupWindow.C	2007-03-08 14:09:58.077513000 +0100
+++ dx-4.4.0/src/uipp/startup/StartupWindow.C	2007-03-08 14:11:05.000000000 +0100
@@ -65,7 +65,7 @@
 // On these platforms, the pipe doesn't work that way so we'll make a
 // polling loop that runs once every few seconds and checks the child pid.
 //
-#if defined(ibm6000) || defined(hp700) || defined(alphax) || defined(sun4) || defined(linux) || defined(cygwin) || defined(freebsd) || defined(macos)
+#if defined(ibm6000) || defined(hp700) || defined(alphax) || defined(sun4) || defined(linux) || defined(cygwin) || defined(freebsd) || defined(macos) || defined(__FreeBSD_kernel__)
 #define USE_WAIT3 1
 #endif
 
--- dx-4.4.0/debian/rules	2007-03-08 15:34:47.025214000 +0100
+++ dx-4.4.0/debian/rules	2007-03-08 15:59:28.000000000 +0100
@@ -115,6 +115,11 @@
 	cp debian/dxicon.xpm debian/tmp/usr/lib/dx/
 	# ... setup any symlinks we might need...
 	dh_link -A
+ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
+	# ... change *_unknown to *_linux for GNU/kFreeBSD
+	mv debian/tmp/usr/lib/dx/bin_unknown debian/tmp/usr/lib/dx/bin_linux
+	mv debian/tmp/usr/lib/dx/lib_unknown debian/tmp/usr/lib/dx/lib_linux
+endif
 	# ... then move around to per-package dirs...
 	dh_install --sourcedir=debian/tmp
 	# ... and setup further symlinks we create by globbing.
@@ -128,9 +133,17 @@
 	done
 
 	# Need to reflect relocation of libs in the libtool helper file.
+ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
+	# ... there are OS detection troubles with GNU/kFreeBSD
+	for i in `pwd`/debian/libdx4-dev/usr/lib/*.la; do \
+		printf '/^libdir=/s,/dx/lib_unknown,,g\nw\nq\n' | ed "$$i"; \
+	done
+else
+	# ... we assume that by default, we're on Linux
 	for i in `pwd`/debian/libdx4-dev/usr/lib/*.la; do \
 		printf '/^libdir=/s,/dx/lib_linux,,g\nw\nq\n' | ed "$$i"; \
 	done
+endif
 
 	# No clue where this symlink is coming from.
 	rm -f `pwd`/debian/libdx4-dev/usr/include/include

Reply via email to