Package: afbackup
Severity: important
Tags: patch

Hi,

afbackup fails to build on GNU/kFreeBSD because of missing #if #endif to
handle this system. Please find attached a patch to fix that. It would
be nice if you could apply it in the next upload.

Thanks in advance,
Aurelien

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.4-1-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Status: in BTS
Author: aurel32

--- afbackup-3.3.8.1final.orig/budefs.h.in
+++ afbackup-3.3.8.1final/budefs.h.in
@@ -225,7 +225,7 @@
 		/* this might be irritating ^^ it's just to remind me, */
 		/* that there is an open issue that should be clarified */
 #endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define DEFAULT_TAPE_DEVICE	"/dev/nsa0"
 #define END_OF_TAPE(e)		(e == ENOSPC)
 #endif
@@ -237,7 +237,7 @@
 #define	DEFAULT_TAPE_DEVICE	"/dev/rmt/ctape"
 #define	END_OF_TAPE(e)		(e == ENOSPC)
 #endif
-#if ! defined(sun) && ! defined(_AIX) && ! defined(sgi) && ! defined(linux) && ! defined(__osf__) && ! defined(__hpux) && !defined(hpux) && ! defined(__FreeBSD__) && ! defined(__OpenBSD__) && ! defined(__NetBSD__) && ! defined(UnixWare_5)
+#if ! defined(sun) && ! defined(_AIX) && ! defined(sgi) && ! defined(linux) && ! defined(__osf__) && ! defined(__hpux) && !defined(hpux) && ! defined(__FreeBSD__) && ! defined (__FreeBSD_kernel__) && ! defined(__OpenBSD__) && ! defined(__NetBSD__) && ! defined(UnixWare_5)
 # error		unknown architecture
 #endif
 
--- afbackup-3.3.8.1final.orig/server.c
+++ afbackup-3.3.8.1final/server.c
@@ -2362,6 +2362,11 @@
 #define	FREE_BSD_470000_OR_HIGHER	1
 #endif
 #endif
+#ifdef	__FreeBSD_kernel_version
+#if	__FreeBSD_kernel_version >= 470000
+#define	FREE_BSD_470000_OR_HIGHER	1
+#endif
+#endif
 #ifdef	FREE_BSD_470000_OR_HIGHER
 	/* hooray, the FreeBSD 'SA' driver behaviour has changed with */
 	/* FreeBSD 4.7 towards one closer to System-V style. Sigh. */
--- afbackup-3.3.8.1final.orig/sysutils.c
+++ afbackup-3.3.8.1final/sysutils.c
@@ -1586,7 +1586,7 @@
 #ifdef	HAVE_STATVFS		/* sees to be well-defined */
 	  if(statvfs(path, &statfsb) == -1)
 #else
-#if defined(_AIX) || defined(linux) || defined(__hpux) || defined(hpux) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#if defined(_AIX) || defined(linux) || defined(__hpux) || defined(hpux) || defined(__FreeBSD__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__NetBSD__)
 	  if(statfs(path, &statfsb) == -1)
 #else
 #if defined(sun)
@@ -1786,7 +1786,7 @@
 UChar *
 mount_tab_file()
 {
-#if	defined(linux) || defined(sgi) || ( defined(sun) && ! defined(HAVE_GETMNTENT_TWO_ARGS) )
+#if	defined(linux) || defined(sgi) || defined(__GLIBC__) || ( defined(sun) && ! defined(HAVE_GETMNTENT_TWO_ARGS) )
 #define	MTABFILE	"/etc/mtab"
 #else
 #if	defined(sun) || defined(__hpux) || defined(hpux) || defined(UnixWare_5)

Reply via email to