[MPlayer-dev-eng] FreeBSD patches (was Re: [mplayer-users] Bug in compilation)

Rémi Guyomarch rguyom at pobox.com
Thu Apr 25 01:05:17 CEST 2002


On Thu, Apr 25, 2002 at 12:39:23AM +0200, Arpi wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi,
> 
> > Install the following ports :
> > - graphics/mplayer-fonts
> > - graphics/win32-codecs
> > - graphics/libdvdread
> > - graphics/libdvdcss
> > 
> > Apply (by hand) the port's patches :
> > /usr/ports/graphics/mplayer/files/patch-*
> 
> what are these patches?

Attached. Those are for 0.60.1. I'm also attaching the port's
Makefile.

> why aren't they sent to -dev-eng to be incldued?

I don't know.

-- 
Rémi
-------------- next part --------------
--- configure.old	Fri Jan  4 23:48:35 2002
+++ configure	Sat Jan  5 00:26:19 2002
@@ -415,19 +415,10 @@
 
 # Try to find the available options for the current CPU
 if x86 ; then
-  if test -r /proc/cpuinfo ; then
-    # linux with /proc mounted, extract cpu information from it
-    _cpuinfo="cat /proc/cpuinfo"
-  elif test -r /compat/linux/proc/cpuinfo ; then
-    # FreeBSD with linux emulation /proc mounted,
-    # extract cpu information from it
-    _cpuinfo="cat /compat/linux/proc/cpuinfo"
-  else
     # all other OS try to extract cpu information from a small helper
     # program TOOLS/cpuinfo instead
     $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
     _cpuinfo="TOOLS/cpuinfo"
-  fi
 
   pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
   pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2 | head -1`
@@ -1135,14 +1126,7 @@
 int main(void) { (void) malloc(0); return 0; }
 EOF
 _malloc=no
-cc_check && _malloc=yes
-if test "$_malloc" = yes ; then
-  _def_malloc='#define HAVE_MALLOC_H 1'
-else
-  _def_malloc='#undef HAVE_MALLOC_H'
-fi
-# malloc.h emits a warning in FreeBSD
-freebsd && _def_malloc='#undef HAVE_MALLOC_H'
+_def_malloc='#undef HAVE_MALLOC_H'
 echores "$_malloc"
 
 
@@ -1153,12 +1137,7 @@
 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
 EOF
 _memalign=no
-cc_check && _memalign=yes
-if test "$_memalign" = yes ; then
- _def_memalign='#define HAVE_MEMALIGN 1'
-else
- _def_memalign='#undef HAVE_MEMALIGN'
-fi
+_def_memalign='#undef HAVE_MEMALIGN'
 echores "$_memalign"
 
 
@@ -1235,15 +1214,7 @@
 void* func(void *arg) { return arg; }
 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
 EOF
-if ( cc_check && $TMPO ) ; then              # QNX
-  _ld_pthread=''
-elif ( cc_check -lpthread && $TMPO ) ; then
-  _ld_pthread='-lpthread'
-elif ( cc_check -pthread && $TMPO ) ; then
-  _ld_pthread='-pthread'
-else
-  die "Lib pthread not found. (needed by windows and networking stuff)"
-fi
+_ld_pthread="${PTHREAD_LIBS}"
 echores "yes (using $_ld_pthread)"
 
 
@@ -2692,7 +2663,7 @@
   CFLAGS="$CFLAGS -D_REENTRANT"
 elif bsd ; then
   # FIXME bsd needs this so maybe other OS'es
-  CFLAGS="$CFLAGS -D_THREAD_SAFE"
+  CFLAGS="$CFLAGS ${PTHREAD_CFLAGS}"
 fi
 
 # 64 bit file offsets?
-------------- next part --------------
--- Makefile.old	Wed Jan  2 20:05:02 2002
+++ Makefile	Sat Jan  5 01:38:46 2002
@@ -15,12 +15,12 @@
 PRG_MENCODER = mencoder
 
 #prefix = /usr/local
-BINDIR = ${prefix}/bin
+BINDIR = $(PREFIX)/bin
 # BINDIR = /usr/local/bin
-MANDIR = ${prefix}/man
+MANDIR = $(PREFIX)/man
 
 # a BSD compatible 'install' program
-INSTALL = install
+INSTALL = @${BSD_INSTALL_PROGRAM}
 
 SRCS_COMMON = adpcm.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c cinepak.c fli.c qtrle.c codec-cfg.c cfgparser.c my_profile.c RTjpegN.c minilzo.c nuppelvideo.c
 SRCS_MENCODER = mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/img_format.c
@@ -186,38 +186,12 @@
 
 install: $(ALL_PRG)
 	if test ! -d $(BINDIR) ; then mkdir -p $(BINDIR) ; fi
-	$(INSTALL) -m 755 -s $(PRG) $(BINDIR)/$(PRG)
-ifeq ($(GUI),yes)
-	-ln -sf $(BINDIR)/$(PRG) $(BINDIR)/gmplayer
-endif
+	$(INSTALL) $(PRG) $(BINDIR)/$(PRG)
 	if test ! -d $(MANDIR)/man1 ; then mkdir -p $(MANDIR)/man1; fi
-	$(INSTALL) -c -m 644 DOCS/mplayer.1 $(MANDIR)/man1/mplayer.1
+	@${BSD_INSTALL_MAN}  DOCS/mplayer.1 $(MANDIR)/man1/mplayer.1
 ifeq ($(MENCODER),yes)
 	$(INSTALL) -m 755 -s $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
-	$(INSTALL) -c -m 644 DOCS/mencoder.1 $(MANDIR)/man1/mencoder.1
-endif
-	@if test ! -d $(DATADIR) ; then mkdir -p $(DATADIR) ; fi
-	@if test ! -d $(DATADIR)/font ; then mkdir -p $(DATADIR)/font ; fi
-	@if test ! -f $(DATADIR)/font/font.desc ; then \
-	echo "*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
-	echo "*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
-	fi
-ifeq ($(GUI),yes)
-	@if test ! -d $(DATADIR)/Skin ; then mkdir -p $(DATADIR)/Skin ; fi
-	@echo "*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
-	@echo "*** for GUI, and extract to $(DATADIR)/Skin/"
-endif
-	@if test ! -d $(CONFDIR) ; then mkdir -p $(CONFDIR) ; fi
-	@if test -f $(CONFDIR)/codecs.conf.old ; then mv -f $(CONFDIR)/codecs.conf.old $(CONFDIR)/codecs.conf.older ; fi
-	@if test -f $(CONFDIR)/codecs.conf ; then mv -f $(CONFDIR)/codecs.conf $(CONFDIR)/codecs.conf.old ; fi
-	$(INSTALL) -c -m 644 etc/codecs.conf $(CONFDIR)/codecs.conf
-
-ifeq ($(CSS_USE),yes)
-	@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)
+	@${BSD_INSTALL_MAN} DOCS/mencoder.1 $(MANDIR)/man1/mencoder.1
 endif
 
 uninstall:
-------------- next part --------------
# New ports collection makefile for:	mplayer
# Date created:		10 August 2001
# Whom:			Thomas E. Zander
#			with lots of help from Vladimir Kushnir
# $FreeBSD: ports/graphics/mplayer/Makefile,v 1.20 2002/04/19 21:28:59 lioux Exp $
#

PORTNAME=	mplayer
PORTVERSION=	0.60.1
PORTREVISION=	2
CATEGORIES=	graphics
MASTER_SITES=	http://ftp.mplayerhq.hu/MPlayer/releases/ \
		http://www.mplayerhq.hu/MPlayer/releases/ \
		http://www2.mplayerhq.hu/MPlayer/releases/ \
		ftp://ftp.mplayerhq.hu/MPlayer/releases/ \
		ftp://ftp2.mplayerhq.hu/MPlayer/releases/ \
		http://www.stud.uni-karlsruhe.de/~uedc/mplayer/ \
		http://www.rrr.de/~riggs/mplayer/
DISTNAME=	MPlayer-0.60

MAINTAINER=	riggs at rrr.de

LIB_DEPENDS=	png.5:${PORTSDIR}/graphics/png \
		iconv.3:${PORTSDIR}/converters/libiconv \
		SDL-1.1.4:${PORTSDIR}/devel/sdl12
RUN_DEPENDS=	${LOCALBASE}/share/mplayer/fonts:${PORTSDIR}/graphics/mplayer-fonts

NO_PACKAGE=	yes
USE_BZIP2=	yes
USE_GMAKE=	yes
USE_XLIB=	yes
GNU_CONFIGURE=	yes
CONFIGURE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
		PTHREAD_LIBS=${PTHREAD_LIBS}
CONFIGURE_ARGS= --disable-mencoder \
		--with-extralibdir=${LOCALBASE}/lib \
		--with-extraincdir=${LOCALBASE}/include

MAN1=		mplayer.1
MANCOMPRESSED=	no

CONFFILES=	codecs.conf example.conf
DOCFILES=       DVB bugreports.html cd-dvd.html codecs-in.html \
		codecs.html documentation.html faq.html skin-en.html \
		DXR3 formats.html skin-en.html sound.html tech/tech-eng.txt \
		video.html

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/lib/libdvdread.so.2)
WITH_DVD=	yes
.endif

.if exists(${LOCALBASE}/lib/libvga.so.1)
WITH_SVGALIB=	yes
.endif

.if exists(${X11BASE}/bin/xanim)
WITH_XANIM=	yes
.endif

.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+=       -O3 -ffast-math -fomit-frame-pointer
.endif

.if defined(WITH_GUI)
USE_GTK=	yes

RUN_DEPENDS+=	${SKIN_DETECTION_FILE}:${SKIN_PORT}

CONFIGURE_ARGS+=	--enable-gui

SKIN_PORT=     ${PORTSDIR}/graphics/mplayer-skins
#SKIN_PORT=     ${.CURDIR}/../mplayer-skins
SKIN_DETECTION_FILE!=  ${MAKE} -f ${SKIN_PORT}/Makefile -V SKIN_DETECTION_FILE
.endif

.if defined(WITH_DVD)
LIB_DEPENDS+=	dvdread.2:${PORTSDIR}/graphics/libdvdread
.endif

.if defined(WITH_SVGALIB)
LIB_DEPENDS+=	vga.1:${PORTSDIR}/graphics/svgalib
.endif

.if defined(WITH_VORBIS)
LIB_DEPENDS+=	vorbis.1:${PORTSDIR}/audio/libvorbis
.endif

.if defined(WITH_XANIM) 
BUILD_DEPENDS+=	xanim:${PORTSDIR}/graphics/xanim

CONFIGURE_ARGS+=--enable-xanim --with-xanimlibdir=${X11BASE}/lib/X11/xanim
.else
CONFIGURE_ARGS+=--disable-xanim
.endif

# "enable" build for other archs
.if ${ARCH} == "i386"
.if defined(WITHOUT_MMX)
CONFIGURE_ARGS+=--disable-mmx
.endif
.if defined(WITHOUT_3DNOW) || ${OSVERSION} < 400021
CONFIGURE_ARGS+=--disable-3dnow
.endif
.if defined(WITHOUT_DSP) || defined(WITHOUT_3DNOW) || ${OSVERSION} < 400021
CONFIGURE_ARGS+=--disable-3dnowex
.endif
.if defined(WITHOUT_SSE)
CONFIGURE_ARGS+=--disable-mmx2 --disable-sse
.endif
.if !defined(WITH_SVGALIB)
CONFIGURE_ARGS+=--disable-svga
.endif
.if !defined(WITH_VORBIS)
CONFIGURE_ARGS+=--disable-vorbis
.endif
.if !defined(WITHOUT_WIN32_CODECS)
RUN_DEPENDS+=	${CODEC_DETECTION_FILE}:${CODEC_PORT}

CONFIGURE_ARGS+=	--with-win32libdir=${LOCALBASE}/lib/win32

CODEC_PORT=	${PORTSDIR}/graphics/win32-codecs
#CODEC_PORT=	${.CURDIR}/../win32-codecs
CODEC_DETECTION_FILE!=	${MAKE} -f ${CODEC_PORT}/Makefile -V CODEC_DETECTION_FILE
.endif
.endif # ARCH == i386

pre-everything::
.if !defined(WITH_OPTIMIZED_CFLAGS)
	@${ECHO_MSG} "You can enable additional compilation optimizations"
	@${ECHO_MSG} "by defining WITH_OPTIMIZED_CFLAGS"
.endif
.if !defined(WITH_GUI)
	@${ECHO_MSG} "You can enable GTK GUI by defining WITH_GUI."
.endif
.if !defined(WITH_DVD)
	@${ECHO_MSG} "You can enable DVD support by defining WITH_DVD."
.endif
.if !defined(WITH_SVGALIB)
	@${ECHO_MSG} "You can enable SVGALIB support by defining WITH_SVGALIB."
.endif
.if !defined(WITH_VORBIS)
	@${ECHO_MSG} "You can enable VORBIS sound support by defining WITH_VORBIS."
.endif
.if !defined(WITH_XANIM)
	@${ECHO_MSG} "You can enable XAnim DLL support by defining WITH_XANIM."
.endif
.if ${ARCH} == "i386"
.if !defined(WITHOUT_WIN32_CODECS)
	@${ECHO_MSG} "You can disable support (this turns this into a X86 only port)"
	@${ECHO_MSG} "for Win32 codecs"
.endif
.if !defined(WITHOUT_SSE)
	@${ECHO_MSG} "You have to enable \"options CPU_ENABLE_SSE\" in your kernel"
	@${ECHO_MSG} "config in order to enable kernel support for SSE/MMX2."
.endif
.if !defined(WITHOUT_MMX)
	@${ECHO_MSG} "You can disable use of MMX routines by defining WITHOUT_MMX."
.endif
.if !defined(WITHOUT_3DNOW) && ${OSVERSION} >= 400021
	@${ECHO_MSG} "You can disable use of 3DNow! optimized routines by defining WITHOUT_3DNOW."
.endif
.if !defined(WITHOUT_3DNOW) && !defined(WITHOUT_DSP) && ${OSVERSION} >= 400021
	@${ECHO_MSG} "You can disable support for Athlon DSP extensions by defining WITHOUT_DSP."
.endif
	@${ECHO_MSG} "Note: The cpu features are autodetected, so there is probably no need"
	@${ECHO_MSG} "to manually disable them."
.endif # ARCH == i386

post-install:
	@${MKDIR} ${DATADIR}
	@${CHMOD} 755 ${DATADIR}
.for conf in ${CONFFILES}
	${INSTALL_DATA} ${WRKSRC}/etc/${conf} ${DATADIR}
.endfor
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@${CHMOD} 755 ${DOCSDIR}
.for doc in ${DOCFILES}
	@${INSTALL_DATA} ${WRKSRC}/DOCS/${doc} ${DOCSDIR}
.endfor
.endif
	@${CAT} pkg-message

install-user:
	@${PERL} ${FILESDIR}/install-user

.include <bsd.port.post.mk>


More information about the MPlayer-dev-eng mailing list