Subject: Build fixes for Debian GNU/kFreeBSD
From: Axel Beckert <abe@debian.org>
Bug-Debian: #565539
Last-updated: 2010-04-04
Index: git/Makefile
===================================================================
--- git.orig/Makefile
+++ git/Makefile
@@ -19,6 +19,7 @@
 #
 
 HAVE_GZIP		= 1
+ifeq (Linux,$(shell uname -s))
 HAVE_LINUX_ATTR		= 1
 HAVE_LINUX_CHROOT	= 1
 HAVE_LINUX_LOSETUP	= 1
@@ -26,6 +27,16 @@ HAVE_LINUX_PIVOT	= 1
 HAVE_LINUX_MOUNT	= 1
 HAVE_BSD_MOUNT		= 0
 MOUNT_TYPE		= '"ext3"'
+endif
+ifeq (GNU/kFreeBSD,$(shell uname -s))
+HAVE_LINUX_ATTR	= 0
+HAVE_LINUX_CHROOT	= 0
+HAVE_LINUX_LOSETUP	= 0
+HAVE_LINUX_PIVOT	= 0
+HAVE_LINUX_MOUNT	= 0
+HAVE_BSD_MOUNT		= 1
+MOUNT_TYPE		= '"ufs"'
+endif
 
 OPT = -O3
 
Index: git/cmds.c
===================================================================
--- git.orig/cmds.c
+++ git/cmds.c
@@ -19,6 +19,10 @@
 
 #if	HAVE_LINUX_MOUNT
 #include <linux/fs.h>
+#elif	HAVE_BSD_MOUNT
+#include <ufs/ufs/ufsmount.h>
+#include <fs/cd9660/cd9660_mount.h>
+#include <fs/msdosfs/msdosfsmount.h>
 #endif
 
 /* Need to tell loop.h what the actual dev_t type is. */
Index: git/sash.c
===================================================================
--- git.orig/sash.c
+++ git/sash.c
@@ -107,7 +107,7 @@ static const CommandEntry	commandEntryTa
 		"srcName ... destName"
 	},
 
-#ifdef	HAVE_LINUX_CHROOT
+#if	HAVE_LINUX_CHROOT
 	{
 		"-chroot",	do_chroot,	2,	2,
 		"change root file system",
@@ -189,7 +189,7 @@ static const CommandEntry	commandEntryTa
 		"[-sig] pid ..."
 	},
 
-#ifdef	HAVE_LINUX_LOSETUP
+#if	HAVE_LINUX_LOSETUP
 	{
 		"-losetup",	do_losetup,	3,	3,
 		"Associate a loopback device with a file",
@@ -253,7 +253,7 @@ static const CommandEntry	commandEntryTa
 		"srcName ... destName"
 	},
 
-#ifdef	HAVE_LINUX_PIVOT
+#if	HAVE_LINUX_PIVOT
 	{
 		"-pivot_root",	do_pivot_root,	3,	3,
 		"pivot the root file system",
