mplayer: convert to gentargets, bump to a recent SVN version

Based on the conversion to gentargets done by Martin Banky, several
issues were fixed, and the mplayer package was improved:

 * Updated to a recent SVN version

 * Removed mandatory dependency on libmad

 * The AVR32 specific patch has been removed. It was a pain to remain
   blocked at the old 1.0-rc2 just for this patch. All this
   optimization work should have been submitted upstream, Buildroot is
   not the place to carry such heavy modifications.

 * Options were added to select whether mplayer and/or mencoder should
   be built/installed.

 * Support for additional options if packages have been selected:
   tremor, libmad, libtheora, libpng, jpeg, xlib_libX11,
   xlib_libXv. More could be added in the future.

 * Support for ARM-related optimization options. Similar improvements
   could be done for x86 and PowerPC architectures.

[Peter: fix build with !IPV6]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Thomas Petazzoni 2010-12-12 22:54:03 +01:00 committed by Peter Korsgaard
parent 1e17f73d27
commit 6bcedeed37
8 changed files with 142 additions and 6377 deletions

View File

@ -6,9 +6,10 @@
Updated/fixed packages: alsa-utils, at, busybox, bzip2, dbus,
direcfb-examples, dmalloc, cloop, cups, ffmpeg, gdk-pixbuf,
hostapd, i2c-tools, input-tools, libaio, libconfig, lsof,
ltp-testsuite, lvm2, m4, memtester, mii-diag, mrouted,
netplug, openssh, openssl, openvpn, pango, qt, rsync, sdl_gfx,
sdl_sound, sysklogd, sysvinit, udev, usbutils, xz, zlib
ltp-testsuite, lvm2, m4, memtester, mii-diag, mplayer,
mrouted, netplug, openssh, openssl, openvpn, pango, qt, rsync,
sdl_gfx, sdl_sound, sysklogd, sysvinit, udev, usbutils, xz,
zlib
New packages: dhrystone, fbgrab, lsuio, rsh-redone, whetstone

View File

@ -1,8 +1,22 @@
config BR2_PACKAGE_MPLAYER
bool "mplayer"
select BR2_PACKAGE_LIBMAD
help
MPlayer is a movie player which runs on many systems and supports
many different file formats.
http://www.mplayerhq.hu/
if BR2_PACKAGE_MPLAYER
config BR2_PACKAGE_MPLAYER_MPLAYER
bool "Build and install mplayer"
default y
help
This will install the video player.
config BR2_PACKAGE_MPLAYER_MENCODER
bool "Build and install mencoder"
help
This will install the video encoder.
endif

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
mplayer: don't unconditionally force largefile support for libraries
---
common.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: MPlayer-1.0rc1/common.mak
===================================================================
--- MPlayer-1.0rc1.orig/common.mak
+++ MPlayer-1.0rc1/common.mak
@@ -5,7 +5,7 @@
SRC_DIR = $(SRC_PATH)/lib$(NAME)
VPATH = $(SRC_DIR)
-CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+CFLAGS += -DHAVE_AV_CONFIG_H \
-D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \
-I$(SRC_PATH)/libavutil $(OPTFLAGS)
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)

View File

@ -1,12 +0,0 @@
win32.c:67:23: error: sys/timeb.h: No such file or directory
--- a/loader/win32.c 2009-01-26 01:53:20.000000000 +0100
+++ b/loader/win32.c 2009-01-26 01:53:39.000000000 +0100
@@ -64,7 +64,6 @@
#include <sys/types.h>
#include <dirent.h>
#include <sys/time.h>
-#include <sys/timeb.h>
#ifdef HAVE_KSTAT
#include <kstat.h>
#endif

View File

@ -0,0 +1,24 @@
Disable stripping on installation
Using the -s option of install does not work, as it uses the host
strip instead of the cross strip. So, get rid of it, and let Buildroot
handle the stripping.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mplayer-32710/configure
===================================================================
--- mplayer-32710.orig/configure
+++ mplayer-32710/configure
@@ -2519,7 +2519,7 @@
# Checking for CFLAGS
-_install_strip="-s"
+_install_strip=
if test "$_profile" != "" || test "$_debug" != "" ; then
CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
WARNFLAGS="-W -Wall"

View File

@ -7,16 +7,16 @@ Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: MPlayer-1.0rc2/configure
Index: mplayer-32710/configure
===================================================================
--- MPlayer-1.0rc2.orig/configure
+++ MPlayer-1.0rc2/configure
@@ -761,7 +761,7 @@ for ac_option do
_target=`echo $ac_option | cut -d '=' -f 2`
--- mplayer-32710.orig/configure
+++ mplayer-32710/configure
@@ -870,7 +870,7 @@
_target=$(echo $ac_option | cut -d '=' -f 2)
;;
--cc=*)
- _cc=`echo $ac_option | cut -d '=' -f 2`
+ _cc=`echo $ac_option | cut -d '=' -f 2-`
- _cc=$(echo $ac_option | cut -d '=' -f 2)
+ _cc=$(echo $ac_option | cut -d '=' -f 2-)
;;
--host-cc=*)
_host_cc=`echo $ac_option | cut -d '=' -f 2`
_host_cc=$(echo $ac_option | cut -d '=' -f 2)

View File

@ -3,128 +3,146 @@
# mplayer
#
#############################################################
MPLAYER_VERSION:=1.0rc2
MPLAYER_SOURCE:=MPlayer-$(MPLAYER_VERSION).tar.bz2
MPLAYER_SITE:=http://www7.mplayerhq.hu/MPlayer/releases
MPLAYER_DIR:=$(BUILD_DIR)/MPlayer-$(MPLAYER_VERSION)
MPLAYER_CAT:=$(BZCAT)
MPLAYER_BINARY:=mplayer
MPLAYER_TARGET_BINARY:=usr/bin/$(MPLAYER_BINARY)
MPLAYER_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBMAD),libmad)
MPLAYER_VERSION = 32710
# MPLAYER_SOURCE = MPlayer-$(MPLAYER_VERSION).tar.bz2
# MPLAYER_SITE = http://www.mplayerhq.hu/MPlayer/releases
MPLAYER_SITE = svn://svn.mplayerhq.hu/mplayer/trunk
# mplayer needs pcm+mixer support, but configure fails to check for it
ifeq ($(BR2_PACKAGE_ALSA_LIB)$(BR2_PACKAGE_ALSA_LIB_MIXER)$(BR2_PACKAGE_ALSA_LIB_PCM),yyy)
MPLAYER_DEPENDENCIES += alsa-lib
MPLAYER_ALSA:=--enable-alsa
MPLAYER_CONF_OPTS += --enable-alsa
else
MPLAYER_ALSA:=--disable-alsa
MPLAYER_CONF_OPTS += --disable-alsa
endif
ifeq ($(BR2_ENDIAN),"BIG")
MPLAYER_ENDIAN:=--enable-big-endian
MPLAYER_CONF_OPTS += --enable-big-endian
else
MPLAYER_ENDIAN:=--disable-big-endian
MPLAYER_CONF_OPTS += --disable-big-endian
endif
# mplayer unfortunately uses --disable-largefileS, so we cannot use
# mplayer unfortunately uses --disable-largefiles, so we cannot use
# DISABLE_LARGEFILE
ifeq ($(BR2_LARGEFILE),y)
MPLAYER_LARGEFILE:=--enable-largefiles
MPLAYER_CONF_OPTS += --enable-largefiles
else
# dvdread/dvdcss requires largefile support
MPLAYER_LARGEFILE:=--disable-largefiles \
--disable-dvdread-internal \
--disable-libdvdcss-internal
MPLAYER_CONF_OPTS += \
--disable-largefiles \
--disable-dvdread-internal \
--disable-libdvdcss-internal
endif
ifeq ($(BR2_PACKAGE_SDL),y)
MPLAYER_SDL:=--enable-sdl --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config
MPLAYER_CONF_OPTS += \
--enable-sdl \
--with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config
MPLAYER_DEPENDENCIES += sdl
else
MPLAYER_SDL:=--disable-sdl
MPLAYER_CONF_OPTS += --disable-sdl
endif
ifeq ($(BR2_PACKAGE_FREETYPE),y)
MPLAYER_FREETYPE:= \
MPLAYER_CONF_OPTS += \
--enable-freetype \
--with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config
MPLAYER_DEPENDENCIES += freetype
else
MPLAYER_FREETYPE:=--disable-freetype
MPLAYER_CONF_OPTS += --disable-freetype
endif
ifeq ($(BR2_i386),y)
# This seems to be required to compile some of the inline asm
MPLAYER_CFLAGS:=-fomit-frame-pointer
ifeq ($(BR2_PACKAGE_MPLAYER_MPLAYER),y)
MPLAYER_CONF_OPTS += --enable-mplayer
else
MPLAYER_CONF_OPTS += --disable-mplayer
endif
$(DL_DIR)/$(MPLAYER_SOURCE):
$(call DOWNLOAD,$(MPLAYER_SITE),$(MPLAYER_SOURCE))
ifeq ($(BR2_PACKAGE_MPLAYER_MENCODER),y)
MPLAYER_CONF_OPTS += --enable-mencoder
else
MPLAYER_CONF_OPTS += --disable-mencoder
endif
$(MPLAYER_DIR)/.unpacked: $(DL_DIR)/$(MPLAYER_SOURCE)
$(MPLAYER_CAT) $(DL_DIR)/$(MPLAYER_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
toolchain/patch-kernel.sh $(MPLAYER_DIR) package/multimedia/mplayer/ mplayer-$(MPLAYER_VERSION)\*.patch\*
$(CONFIG_UPDATE) $(MPLAYER_DIR)
touch $@
ifeq ($(BR2_PACKAGE_TREMOR),y)
MPLAYER_DEPENDENCIES += tremor
MPLAYER_CONF_OPTS += --disable-tremor-internal --enable-tremor
endif
$(MPLAYER_DIR)/.configured: $(MPLAYER_DIR)/.unpacked
(cd $(MPLAYER_DIR); rm -rf config.cache; \
ifeq ($(BR2_PACKAGE_MAD),y)
MPLAYER_DEPENDENCIES += libmad
else
MPLAYER_CONF_OPTS += --disable-mad
endif
MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBTHEORA),libtheora)
MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBPNG),libpng)
MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBX11),xlib_libX11)
MPLAYER_DEPENDENCIES += $(if $(BR2_PACKAGE_XLIB_LIBXV),xlib_libXv)
# ARM optimizations
ifeq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),armv5te)
MPLAYER_CONF_OPTS += --enable-armv5te
endif
ifeq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),armv6j)
MPLAYER_CONF_OPTS += --enable-armv6
endif
ifeq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),armv7-a)
MPLAYER_CONF_OPTS += --enable-neon
endif
define MPLAYER_CONFIGURE_CMDS
(cd $(@D); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
CFLAGS="$(TARGET_CFLAGS) $(MPLAYER_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
./configure \
--prefix=/usr \
--confdir=/etc \
--target=$(GNU_TARGET_NAME) \
--host-cc=$(HOSTCC) \
--host-cc="$(HOSTCC)" \
--cc="$(TARGET_CC)" \
--as=$(TARGET_CROSS)as \
--with-extraincdir=$(STAGING_DIR)/usr/include \
--with-extralibdir=$(STAGING_DIR)/lib \
--as="$(TARGET_AS)" \
--charset=UTF-8 \
--extra-cflags="$(TARGET_CFLAGS)" \
--extra-ldflags="$(TARGET_LDFLAGS)" \
--enable-mad \
--enable-fbdev \
$(MPLAYER_ENDIAN) \
$(MPLAYER_LARGEFILE) \
$(MPLAYER_SDL) \
$(MPLAYER_FREETYPE) \
$(MPLAYER_ALSA) \
$(MPLAYER_CONF_OPTS) \
--enable-cross-compile \
--disable-ivtv \
--disable-tv \
--disable-live \
--enable-dynamic-plugins \
)
touch $@
endef
$(MPLAYER_DIR)/$(MPLAYER_BINARY): $(MPLAYER_DIR)/.configured
$(MAKE1) -C $(MPLAYER_DIR)
touch -c $@
# this is available on uClibc 0.9.31 even without ipv6 support, breaking the
# build in ffmpeg/libavformat/udp.c
ifneq ($(BR2_INET_IPV6),y)
define MPLAYER_FIXUP_IPV6_MREQ_DETECTION
$(SED) 's/\(#define HAVE_STRUCT_IPV6_MREQ\) 1/\1 0/' $(@D)/config.h
endef
$(TARGET_DIR)/$(MPLAYER_TARGET_BINARY): $(MPLAYER_DIR)/$(MPLAYER_BINARY)
$(INSTALL) -m 0755 -D $(MPLAYER_DIR)/$(MPLAYER_BINARY) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)
touch -c $@
mplayer: $(MPLAYER_DEPENDENCIES) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)
mplayer-source: $(DL_DIR)/$(MPLAYER_SOURCE)
mplayer-unpacked: $(MPLAYER_DIR)/.unpacked
mplayer-clean:
rm -f $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)
-$(MAKE) -C $(MPLAYER_DIR) clean
mplayer-dirclean:
rm -rf $(MPLAYER_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_MPLAYER),y)
TARGETS+=mplayer
MPLAYER_POST_CONFIGURE_HOOKS += MPLAYER_FIXUP_IPV6_MREQ_DETECTION
endif
define MPLAYER_BUILD_CMDS
$(MAKE) -C $(@D)
endef
define MPLAYER_INSTALL_TARGET_CMDS
$(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
endef
define MPLAYER_UNINSTALL_TARGET_CMDS
$(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) uninstall
endef
define MPLAYER_CLEAN_CMDS
$(MAKE) -C $(@D) clean
endef
$(eval $(call GENTARGETS,package/multimedia,mplayer))