[MPlayer-dev-eng] patch for GNU/kFreeBSD

A Mennucc debdev at tonelli.sns.it
Tue Feb 6 09:21:25 CET 2007


hi,

some time ago  Petr Salinger  sent me a patch that fixes
compilation on GNU/kFreeBSD systems.

I have been using it in the version of MPlayer in Debian, and it has
worked ever since.  (This patch is for MPlayer 1.0rc1 .... I am sorry,
I know that you prefer patches for SVN; but I simply do not find the
time to adapt it :-> )

(There was a part of the patch for debian/* stuff ; that
I omitted, since it is for my own version of debian/* stuff).

diff -u mplayer-1.0~rc1/configure mplayer-1.0~rc1/configure
--- mplayer-1.0~rc1/configure
+++ mplayer-1.0~rc1/configure
@@ -102,7 +102,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 "$?" ; }
@@ -567,6 +567,9 @@
   IRIX*)
     system_name=IRIX
     ;;
+  GNU/kFreeBSD)
+    system_name=FreeBSD
+    ;;  
   HP-UX*)
     system_name=HP-UX
     ;;
@@ -627,6 +630,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 ;;
@@ -8177,7 +8181,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
only in patch2:
unchanged:
--- mplayer-1.0~rc1.orig/libdha/pci.c
+++ mplayer-1.0~rc1/libdha/pci.c
@@ -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"
only in patch2:
unchanged:
--- mplayer-1.0~rc1.orig/cpudetect.c
+++ mplayer-1.0~rc1/cpudetect.c
@@ -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);
 
only in patch2:
unchanged:
--- mplayer-1.0~rc1.orig/stream/stream_vcd.c
+++ mplayer-1.0~rc1/stream/stream_vcd.c
@@ -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");
   }
only in patch2:
unchanged:
--- mplayer-1.0~rc1.orig/stream/stream_cddb.c
+++ mplayer-1.0~rc1/stream/stream_cddb.c
@@ -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>
@@ -133,7 +133,7 @@
         return toc.LastTrack;
 }
 
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 int 
 read_toc(const char *dev) {
 	int drive;
only in patch2:
unchanged:
--- mplayer-1.0~rc1.orig/stream/tvi_bsdbt848.c
+++ mplayer-1.0~rc1/stream/tvi_bsdbt848.c
@@ -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




-- 
Andrea Mennucc

"The EULA sounds like it was written by a team of lawyers who want to tell 
me what I can't do, and the GPL sounds like it was written by a human 
being who wants me to know what I can do."
Anonymous,    http://www.securityfocus.com/columnists/420



More information about the MPlayer-dev-eng mailing list