diff --git a/configure b/configure index 674f45e907..11bf4c3e56 100755 --- a/configure +++ b/configure @@ -105,7 +105,7 @@ hpux() { issystem "HP-UX" ; return "$?" ; } 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 @@ if test -z "$_target" ; then IRIX*) system_name=IRIX ;; + GNU/kFreeBSD) + system_name=FreeBSD + ;; HP-UX*) system_name=HP-UX ;; @@ -618,6 +621,7 @@ else # if test -z "$_target" 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 @@ $_def_vcd #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 diff --git a/cpudetect.c b/cpudetect.c index 5592a1de28..4ceb2b5564 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -20,7 +20,7 @@ CpuCaps gCpuCaps; #include #endif -#if defined(__FreeBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #include #include #endif @@ -182,7 +182,7 @@ void GetCpuCaps( CpuCaps *caps) #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 @@ LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep) * 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 @@ static void check_os_katmai_support( void ) #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); diff --git a/libdha/pci.c b/libdha/pci.c index 474625a68a..72f8a62505 100644 --- a/libdha/pci.c +++ b/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" diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index c5e3d26859..28b2687020 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -41,7 +41,7 @@ #if defined(__linux__) #include -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #include #elif defined(WIN32) #include @@ -110,7 +110,7 @@ read_toc(const char *dev) { 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); diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c index 528a8d43d2..9af85ce2e8 100644 --- a/stream/stream_vcd.c +++ b/stream/stream_vcd.c @@ -13,7 +13,7 @@ #include #include -#if defined(__FreeBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #include #include "vcd_read_fbsd.h" #elif defined(__NetBSD__) || defined (__OpenBSD__) @@ -71,7 +71,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { 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 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { } 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"); } diff --git a/stream/tvi_bsdbt848.c b/stream/tvi_bsdbt848.c index a3b528fd6d..a3aa489db0 100644 --- a/stream/tvi_bsdbt848.c +++ b/stream/tvi_bsdbt848.c @@ -44,7 +44,7 @@ #elif defined(__DragonFly__) #include #include -#elif __FreeBSD_version >= 502100 +#elif (__FreeBSD_version >= 502100) || defined(__FreeBSD_kernel__) #include #include #else