0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

BSD/OS support

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2090 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-10-05 00:39:54 +00:00
parent f351f3b2eb
commit 2164dcdbe8
6 changed files with 28 additions and 14 deletions

View File

@ -9,7 +9,7 @@
#include <glob.h>
#include <unistd.h>
#ifdef __SVR4
#if defined(__SVR4) || defined(__bsdi__)
#define get_current_dir_name() getcwd(NULL, PATH_MAX)
#endif

View File

@ -39,6 +39,10 @@
#define mplIncAudioBufferDelay 28
#define mplDecAudioBufferDelay 29
#ifdef __bsdi__
#define _NSIG NSIG
#endif
#ifdef __SVR4
#define SIGTYPE SIGUSR2
#warning should we use SIGUSR1 or SIGUSR2 on linux, bsd, ... too?

View File

@ -113,15 +113,19 @@ $(PRG_CFG): version.h codec-cfg.c codec-cfg.h
$(CC) $(CFLAGS) -g codec-cfg.c -o $(PRG_CFG) -DCODECS2HTML
install: $(PRG) $(PRG_FIBMAP)
install -d $(BINDIR)
if [ ! -e $(BINDIR) ]; then \
mkdir -p $(BINDIR); \
fi
install -m 755 -s $(PRG) $(BINDIR)/$(PRG)
install -d $(prefix)/man/man1
install -m 644 DOCS/mplayer.1 $(prefix)/man/man1/mplayer.1
if [ ! -e $(prefix)/man/man1 ]; then \
mkdir -p $(prefix)/man/man1; \
fi
install -c -m 644 DOCS/mplayer.1 $(prefix)/man/man1/mplayer.1
@echo "Following task requires root privs. If it fails don't panic"
@echo "however it means you can't use fibmap_mplayer."
@echo "Without this (or without running mplayer as root) you won't be"
@echo "able to play encrypted DVDs."
install -o 0 -g 0 -m 4755 -s $(PRG_FIBMAP) $(BINDIR)/$(PRG_FIBMAP)
-install -o 0 -g 0 -m 4755 -s $(PRG_FIBMAP) $(BINDIR)/$(PRG_FIBMAP)
clean:
rm -f *.o *~ $(OBJS)

10
configure vendored
View File

@ -298,7 +298,7 @@ echo "Detected host architecture: $host_arch"
# Determine OS dependent libs
_confcygwin="TARGET_CYGWIN=no"
_confwin32=
if [ "$system_name" = "FreeBSD" -o "$system_name" = "OpenBSD" ]; then
if [ "$system_name" = "FreeBSD" -o "$system_name" = "OpenBSD" -o "$system_name" = "BSD/OS" ]; then
_archlibs="-rdynamic -pthread"
elif [ `echo $system_name | sed 's/[cC][yY][gG][wW][iI][nN].*/CYGWIN/'` = "CYGWIN" ]; then
_confcygwin="TARGET_CYGWIN=yes"
@ -308,6 +308,10 @@ else
_archlibs="-ldl -lpthread"
fi
if [ "$system_name" = "BSD/OS" ]; then
_archlibs="$_archlibs -ldvd"
fi
# LGB: temporary files
TMPC="mplayer-conf-${RANDOM}-$$-${RANDOM}.c"
@ -765,7 +769,7 @@ echo Using ... "$_mp_help" file
$_cc $_extraincdir $_extralibdir $TMPC -o $TMPO -lvgagl -lvga > /dev/null 2>&1 && _svga=yes
if [ "$system_name" = "FreeBSD" -o "$system_name" = "OpenBSD" ]; then
if [ "$system_name" = "FreeBSD" -o "$system_name" = "OpenBSD" -o "$system_name" = "BSD/OS" ]; then
$_cc $TMPC -o $TMPO -pthread > /dev/null 2>&1 || \
{ echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; }
else
@ -855,7 +859,7 @@ fi
if [ $_x11 = yes ]; then
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms $_socklib > /dev/null 2>&1 && _xdpms_3=yes
nm `echo $_x11libdir|cut -b 3-`/libXext.a | grep DPMSQueryExtension > /dev/null 2>&1 && _xdpms_4=yes
nm `echo $_x11libdir|cut -c 3-`/libXext.a | grep DPMSQueryExtension > /dev/null 2>&1 && _xdpms_4=yes
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib > /dev/null 2>&1 && _xv=yes
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib > /dev/null 2>&1 && _vm=yes

View File

@ -205,7 +205,7 @@ void getch2_enable(){
struct termios tio_new;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcgetattr(0,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
ioctl(0,TIOCGETA,&tio_orig);
#else
ioctl(0,TCGETS,&tio_orig);
@ -216,7 +216,7 @@ struct termios tio_new;
tio_new.c_cc[VTIME] = 0;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcsetattr(0,TCSANOW,&tio_new);
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
ioctl(0,TIOCSETA,&tio_new);
#else
ioctl(0,TCSETS,&tio_new);
@ -228,7 +228,7 @@ void getch2_disable(){
if(!getch2_status) return; // already disabled / never enabled
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcsetattr(0,TCSANOW,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
ioctl(0,TIOCSETA,&tio_orig);
#else
ioctl(0,TCSETS,&tio_orig);

View File

@ -1,11 +1,13 @@
//=================== VideoCD ==========================
#if defined(linux) || defined(sun)
#if defined(linux) || defined(sun) || defined(__bsdi__)
#if defined(linux)
#include <linux/cdrom.h>
#elif defined(sun)
#include <sys/cdio.h>
static int sun_vcd_read(int, int*);
#elif defined(__bsdi__)
#include <dvd.h>
#endif
@ -79,7 +81,7 @@ void vcd_read_toc(int fd){
static char vcd_buf[VCD_SECTOR_SIZE];
static int vcd_read(int fd,char *mem){
#if defined(linux)
#if defined(linux) || defined(__bsdi__)
memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
@ -236,7 +238,7 @@ int vcd_cache_read(int fd,char* mem){
++vcd_cache_index;if(vcd_cache_index>=vcd_cache_size)vcd_cache_index=0;
// read data!
vcd_set_msf(vcd_cache_current);
#if defined(linux)
#if defined(linux) || defined(__bsdi__)
memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);