changeset 21848:3ff1eade91f9

GNU/kFreeBSD support, closes Bugzilla #704. patch by Petr Salinger, Petr.Salinger seznam cz
author diego
date Wed, 10 Jan 2007 14:56:23 +0000
parents b14f79bc96b9
children 28eb65b3a241
files configure cpudetect.c libdha/pci.c stream/stream_cddb.c stream/stream_vcd.c stream/tvi_bsdbt848.c
diffstat 6 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed Jan 10 14:32:35 2007 +0000
+++ b/configure	Wed Jan 10 14:56:23 2007 +0000
@@ -105,7 +105,7 @@
 irix()    { issystem "IRIX"    ; return "$?" ; }
 aix()     { issystem "AIX"     ; return "$?" ; }
 cygwin()  { issystem "CYGWIN"  ; return "$?" ; }
-freebsd() { issystem "FreeBSD" ; return "$?" ; }
+freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
 netbsd()  { issystem "NetBSD"  ; return "$?" ; }
 bsdos()   { issystem "BSD/OS"  ; return "$?" ; }
 openbsd() { issystem "OpenBSD" ; return "$?" ; }
@@ -558,6 +558,9 @@
   IRIX*)
     system_name=IRIX
     ;;
+  GNU/kFreeBSD)
+    system_name=FreeBSD
+    ;;
   HP-UX*)
     system_name=HP-UX
     ;;
@@ -618,6 +621,7 @@
   case "`echo $system_name | tr A-Z a-z`" in
     linux) system_name=Linux ;;
     freebsd) system_name=FreeBSD ;;
+    gnu/kfreebsd) system_name=FreeBSD ;;
     netbsd) system_name=NetBSD ;;
     bsd/os) system_name=BSD/OS ;;
     openbsd) system_name=OpenBSD ;;
@@ -8070,7 +8074,7 @@
 #elif defined(__OpenBSD__)
 #define DEFAULT_CDROM_DEVICE	"/dev/rcd0a"
 #define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define DEFAULT_CDROM_DEVICE	"/dev/acd0"
 #define DEFAULT_DVD_DEVICE	DEFAULT_CDROM_DEVICE
 #else
--- a/cpudetect.c	Wed Jan 10 14:32:35 2007 +0000
+++ b/cpudetect.c	Wed Jan 10 14:56:23 2007 +0000
@@ -20,7 +20,7 @@
 #include <machine/cpu.h>
 #endif
 
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #endif
@@ -182,7 +182,7 @@
 #endif
 
 		/* FIXME: Does SSE2 need more OS support, too? */
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
 		if (caps->hasSSE)
 			check_os_katmai_support();
 		if (!caps->hasSSE)
@@ -346,7 +346,7 @@
  * support for user space apps that do SSE.
  */
  
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #define SSE_SYSCTL_NAME "hw.instruction_sse"
 #elif defined(__APPLE__)
 #define SSE_SYSCTL_NAME "hw.optional.sse"
@@ -357,7 +357,7 @@
 #ifdef ARCH_X86_64
    gCpuCaps.hasSSE=1;
    gCpuCaps.hasSSE2=1;
-#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
    int has_sse=0, ret;
    size_t len=sizeof(has_sse);
 
--- a/libdha/pci.c	Wed Jan 10 14:32:35 2007 +0000
+++ b/libdha/pci.c	Wed Jan 10 14:56:23 2007 +0000
@@ -62,7 +62,7 @@
 /* OS depended stuff */
 #if defined (linux)
 #include "sysdep/pci_linux.c"
-#elif defined (__FreeBSD__) || defined(__DragonFly__)
+#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__DragonFly__)
 #include "sysdep/pci_freebsd.c"
 #elif defined (__386BSD__)
 #include "sysdep/pci_386bsd.c"
--- a/stream/stream_cddb.c	Wed Jan 10 14:32:35 2007 +0000
+++ b/stream/stream_cddb.c	Wed Jan 10 14:56:23 2007 +0000
@@ -41,7 +41,7 @@
 
 #if defined(__linux__)
 	#include <linux/cdrom.h>
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 	#include <sys/cdio.h>
 #elif defined(WIN32)
         #include <ddk/ntddcdrm.h>
@@ -110,7 +110,7 @@
 		cdtoc[i].sec = tocentry.cdte_addr.msf.second;
 		cdtoc[i].frame = tocentry.cdte_addr.msf.frame;
 	}
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 	{
 	struct ioc_toc_header tochdr;
 	ioctl(drive, CDIOREADTOCHEADER, &tochdr);
--- a/stream/stream_vcd.c	Wed Jan 10 14:32:35 2007 +0000
+++ b/stream/stream_vcd.c	Wed Jan 10 14:56:23 2007 +0000
@@ -13,7 +13,7 @@
 #include <sys/ioctl.h>
 #include <errno.h>
 
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #include <sys/cdrio.h>
 #include "vcd_read_fbsd.h" 
 #elif defined(__NetBSD__) || defined (__OpenBSD__)
@@ -71,7 +71,7 @@
   struct stream_priv_s* p = (struct stream_priv_s*)opts;
   int ret,ret2,f;
   mp_vcd_priv_t* vcd;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   int bsize = VCD_SECTOR_SIZE;
 #endif
 
@@ -119,7 +119,7 @@
   }
   mp_msg(MSGT_OPEN,MSGL_V,"VCD start byte position: 0x%X  end: 0x%X\n",ret,ret2);
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
   if (ioctl (f, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
     mp_msg(MSGT_OPEN,MSGL_WARN,"Error in CDRIOCSETBLOCKSIZE");
   }
--- a/stream/tvi_bsdbt848.c	Wed Jan 10 14:32:35 2007 +0000
+++ b/stream/tvi_bsdbt848.c	Wed Jan 10 14:56:23 2007 +0000
@@ -44,7 +44,7 @@
 #elif defined(__DragonFly__)
 #include <dev/video/meteor/ioctl_meteor.h>
 #include <dev/video/bktr/ioctl_bt848.h>
-#elif __FreeBSD_version >= 502100
+#elif (__FreeBSD_version >= 502100) || defined(__FreeBSD_kernel__)
 #include <dev/bktr/ioctl_meteor.h>
 #include <dev/bktr/ioctl_bt848.h>
 #else