[Mplayer-users] mplayer-0.50pre1 for BSD/OS
Steven M. Schultz
sms at TO.GD-ES.COM
Mon Oct 1 03:41:52 CEST 2001
Greetings!
Thank you very much for making MPlayer so portable! It was not
hard to port MPlayer-0.50pre1 to BSD/OS this afternoon.
Almost all of the changes are small/simple: adding 'defined(__bsdi__)'
to existing ifdef lines.
I did have to make two system specific changes though. One change
is in the ./configure script. BSD/OS does not have a native poll()
system call. It is necessary to link with the "libpoll" library
via "-lpoll". One other library is necessary to read DVD and VCD
discs so I also added "-ldvd" to the list of architecture specific
libraries (libdvd emulates the Linux VCD/DVD ioctls).
The other system related change is in the Makefile. BSD systems
have a different 'install' program than Linux. In order to not
use the '-d' option I modified the Makefile to use a 'if ... mkdir; fi'
sequence - this had the added benefit of being very portable. Oh,
it is a good idea to use '-c' when running install to avoid mv'ing
rather than cp'ing the manpages. "install -c mplayer.1 ..." does not
remove the original manpage but "install mplayer.1 ..." will remove
the original file.
Below is the "diff -u" output for your consideration.
Thanks again for a very good player (a command line player is great -
that way I can watch the movie instead of the GUI ;)).
Steven Schultz
sms at to.gd-es.com
p.s. Almost forgot the information you requested in the bugreport form :)
Operating system: BSD/OS 4.3 (4.3beta3 to be exact)
Gcc: 2.95.3
Binutiles ('as', 'ld'): 2.10.1
Libc: BSD/OS libc
Hardware and drivers:
BSDI BSD/OS 4.3 Kernel #1: Sun Sep 2 19:02:00 PDT 2001
sms at sitka.2bsd.com:/usr/src/sys/compile/SITKA
Cpu-0 = Pentium III (801.82 MHz) GenuineIntel mdl 8 step 6 type 0, feat 383fbff
Open Sound System loaded (c) 2000 4Front Technologies
IPsec: Initialized Security Association Processing.
Cpu-1 = Pentium III (801.82 MHz) GenuineIntel mdl 8 step 6 type 0, feat 383fbff
XFree86-4.0.3 with the Matrox MGA drivers
Matrox G450 video card
SoundBlaster PCI512 sound card
------------------------cut here-----------------
--- ./linux/getch2.c.dist Wed Aug 22 12:43:23 2001
+++ ./linux/getch2.c Sun Sep 30 12:05:43 2001
@@ -205,7 +205,7 @@
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 @@
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 @@
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);
--- ./configure.dist Thu Sep 27 10:40:42 2001
+++ ./configure Sun Sep 30 17:22:12 2001
@@ -298,7 +298,7 @@
# 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 @@
_archlibs="-ldl -lpthread"
fi
+if [ "$system_name" = "BSD/OS" ]; then
+ _archlibs="$_archlibs -lpoll -ldvd"
+fi
+
# LGB: temporary files
TMPC="mplayer-conf-${RANDOM}-$$-${RANDOM}.c"
@@ -765,7 +769,7 @@
$_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 @@
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
--- ./vcd_read.c.dist Wed Sep 26 14:35:14 2001
+++ ./vcd_read.c Sun Sep 30 16:02:58 2001
@@ -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 @@
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 @@
++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);
--- ./Makefile.dist Thu Sep 27 10:40:42 2001
+++ ./Makefile Sun Sep 30 17:28:15 2001
@@ -113,15 +113,19 @@
$(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 root -g root -m 4755 -s $(PRG_FIBMAP) $(BINDIR)/$(PRG_FIBMAP)
+ -install -o root -g root -m 4755 -s $(PRG_FIBMAP) $(BINDIR)/$(PRG_FIBMAP)
clean:
rm -f *.o *~ $(OBJS)
_______________________________________________
Mplayer-users mailing list
Mplayer-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mplayer-users
More information about the MPlayer-users
mailing list