<div class="gmail_quote">On Tue, Oct 5, 2010 at 8:42 PM, Chih-Min Chao <span dir="ltr"><<a href="mailto:cmchao@gmail.com">cmchao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5">On Tue, Oct 5, 2010 at 4:22 PM, Martin Banky <<a href="mailto:martin.banky@gmail.com">martin.banky@gmail.com</a>> wrote:<br>
> Would have bumped the version, but someone smarter than me is going to have to<br>
> do it.<br>
><br>
> Signed-off-by: Martin Banky <<a href="mailto:Martin.Banky@gmail.com">Martin.Banky@gmail.com</a>><br>
> ---<br>
>  package/multimedia/mplayer/<a href="http://mplayer.mk" target="_blank">mplayer.mk</a> |   88 +++++++++++---------------------<br>
>  1 files changed, 30 insertions(+), 58 deletions(-)<br>
><br>
> diff --git a/package/multimedia/mplayer/<a href="http://mplayer.mk" target="_blank">mplayer.mk</a> b/package/multimedia/mplayer/<a href="http://mplayer.mk" target="_blank">mplayer.mk</a><br>
> index ac3a67e..a53c687 100644<br>
> --- a/package/multimedia/mplayer/<a href="http://mplayer.mk" target="_blank">mplayer.mk</a><br>
> +++ b/package/multimedia/mplayer/<a href="http://mplayer.mk" target="_blank">mplayer.mk</a><br>
> @@ -3,67 +3,54 @@<br>
>  # mplayer<br>
>  #<br>
>  #############################################################<br>
> -MPLAYER_VERSION:=1.0rc2<br>
> -MPLAYER_SOURCE:=MPlayer-$(MPLAYER_VERSION).tar.bz2<br>
> -MPLAYER_SITE:=<a href="http://www7.mplayerhq.hu/MPlayer/releases" target="_blank">http://www7.mplayerhq.hu/MPlayer/releases</a><br>
> -MPLAYER_DIR:=$(BUILD_DIR)/MPlayer-$(MPLAYER_VERSION)<br>
> -MPLAYER_CAT:=$(BZCAT)<br>
> -MPLAYER_BINARY:=mplayer<br>
> -MPLAYER_TARGET_BINARY:=usr/bin/$(MPLAYER_BINARY)<br>
> +MPLAYER_VERSION = 1.0rc2<br>
> +MPLAYER_SOURCE = MPlayer-$(MPLAYER_VERSION).tar.bz2<br>
> +MPLAYER_SITE = <a href="http://www.mplayerhq.hu/MPlayer/releases" target="_blank">http://www.mplayerhq.hu/MPlayer/releases</a><br>
><br>
>  MPLAYER_DEPENDENCIES = \<br>
>        $(if $(BR2_PACKAGE_LIBMAD),libmad) \<br>
>        $(if $(BR2_PACKAGE_ALSA_LIB),alsa-lib)<br>
><br>
>  ifeq ($(BR2_ENDIAN),"BIG")<br>
> -MPLAYER_ENDIAN:=--enable-big-endian<br>
> +MPLAYER_CONF_OPTS += --enable-big-endian<br>
>  else<br>
> -MPLAYER_ENDIAN:=--disable-big-endian<br>
> +MPLAYER_CONF_OPTS += --disable-big-endian<br>
>  endif<br>
<br>
</div></div>How about using  MPLAYER_CONF_OPT += --disable-sdl  rather than<br>
creating new var ?<br>
<div><div></div><div class="h5">><br>
> -# mplayer unfortunately uses --disable-largefileS, so we cannot use<br>
> +# mplayer unfortunately uses --disable-largefiles, so we cannot use<br>
>  # DISABLE_LARGEFILE<br>
>  ifeq ($(BR2_LARGEFILE),y)<br>
> -MPLAYER_LARGEFILE:=--enable-largefiles<br>
> +MPLAYER_CONF_OPTS += --enable-largefiles<br>
>  else<br>
>  # dvdread/dvdcss requires largefile support<br>
> -MPLAYER_LARGEFILE:=--disable-largefiles \<br>
> +MPLAYER_CONF_OPTS += --disable-largefiles \<br>
>                   --disable-dvdread-internal \<br>
>                   --disable-libdvdcss-internal<br>
>  endif<br>
><br>
>  ifeq ($(BR2_PACKAGE_SDL),y)<br>
> -MPLAYER_SDL:=--enable-sdl --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config<br>
> +MPLAYER_CONF_OPTS += --enable-sdl --with-sdl-config=$(STAGING_DIR)/usr/bin/sdl-config<br>
>  MPLAYER_DEPENDENCIES += sdl<br>
>  else<br>
> -MPLAYER_SDL:=--disable-sdl<br>
> +MPLAYER_CONF_OPTS += --disable-sdl<br>
>  endif<br>
><br>
>  ifeq ($(BR2_PACKAGE_FREETYPE),y)<br>
> -MPLAYER_FREETYPE:= \<br>
> +MPLAYER_CONF_OPTS +=  \<br>
>        --enable-freetype \<br>
>        --with-freetype-config=$(STAGING_DIR)/usr/bin/freetype-config<br>
>  MPLAYER_DEPENDENCIES += freetype<br>
>  else<br>
> -MPLAYER_FREETYPE:=--disable-freetype<br>
> +MPLAYER_CONF_OPTS += --disable-freetype<br>
>  endif<br>
><br>
>  ifeq ($(BR2_i386),y)<br>
>  # This seems to be required to compile some of the inline asm<br>
> -MPLAYER_CFLAGS:=-fomit-frame-pointer<br>
> +MPLAYER_CFLAGS = -fomit-frame-pointer<br>
>  endif<br>
><br>
> -$(DL_DIR)/$(MPLAYER_SOURCE):<br>
> -       $(call DOWNLOAD,$(MPLAYER_SITE),$(MPLAYER_SOURCE))<br>
> -<br>
> -$(MPLAYER_DIR)/.unpacked: $(DL_DIR)/$(MPLAYER_SOURCE)<br>
> -       $(MPLAYER_CAT) $(DL_DIR)/$(MPLAYER_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -<br>
> -       toolchain/patch-kernel.sh $(MPLAYER_DIR) package/multimedia/mplayer/ mplayer-$(MPLAYER_VERSION)\*.patch\*<br>
> -       $(CONFIG_UPDATE) $(MPLAYER_DIR)<br>
> -       touch $@<br>
> -<br>
> -$(MPLAYER_DIR)/.configured: $(MPLAYER_DIR)/.unpacked<br>
> -       (cd $(MPLAYER_DIR); rm -rf config.cache; \<br>
> +define MPLAYER_CONFIGURE_CMDS<br>
> +       (cd $(@D); rm -rf config.cache; \<br>
>                $(TARGET_CONFIGURE_OPTS) \<br>
>                $(TARGET_CONFIGURE_ARGS) \<br>
>                CFLAGS="$(TARGET_CFLAGS) $(MPLAYER_CFLAGS)" \<br>
> @@ -80,44 +67,29 @@ $(MPLAYER_DIR)/.configured: $(MPLAYER_DIR)/.unpacked<br>
>                --charset=UTF-8 \<br>
>                --enable-mad \<br>
>                --enable-fbdev \<br>
> -               $(MPLAYER_ENDIAN) \<br>
> -               $(MPLAYER_LARGEFILE) \<br>
> -               $(MPLAYER_SDL) \<br>
> -               $(MPLAYER_FREETYPE) \<br>
> +               $(MPLAYER_CONF_OPTS) \<br>
>                --enable-cross-compile \<br>
>                --disable-ivtv \<br>
>                --disable-tv \<br>
>                --disable-live \<br>
>                --enable-dynamic-plugins \<br>
>        )<br>
> -       touch $@<br>
> -<br>
> -$(MPLAYER_DIR)/$(MPLAYER_BINARY): $(MPLAYER_DIR)/.configured<br>
> -       $(MAKE1) -C $(MPLAYER_DIR)<br>
> -       touch -c $@<br>
> +endef<br>
</div></div>merge target option to (PKG)_CONF_OPT and defining CONFIGURE_CMDS   is<br>
not necessary<br>
<div class="im"><br>
><br>
> -$(TARGET_DIR)/$(MPLAYER_TARGET_BINARY): $(MPLAYER_DIR)/$(MPLAYER_BINARY)<br>
> -       $(INSTALL) -m 0755 -D $(MPLAYER_DIR)/$(MPLAYER_BINARY) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)<br>
> -       -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)<br>
> -       touch -c $@<br>
> +define MPLAYER_BUILD_CMDS<br>
> +       $(MAKE1) -C $(@D)<br>
> +endef<br>
<br>
</div>is it necessary ?<br>
<div class="im">><br>
> -mplayer: $(MPLAYER_DEPENDENCIES) $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)<br>
> +define MPLAYER_INSTALL_TARGET_CMDS<br>
> +       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install<br>
> +endef<br>
><br>
> -mplayer-source: $(DL_DIR)/$(MPLAYER_SOURCE)<br>
> +define MPLAYER_UNINSTALL_TARGET_CMDS<br>
> +       $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) uninstall<br>
> +endef<br>
><br>
> -mplayer-unpacked: $(MPLAYER_DIR)/.unpacked<br>
> +define MPLAYER_CLEAN_CMDS<br>
> +       $(MAKE) -C $(@D) clean<br>
> +endef<br>
><br>
> -mplayer-clean:<br>
> -       rm -f $(TARGET_DIR)/$(MPLAYER_TARGET_BINARY)<br>
> -       -$(MAKE) -C $(MPLAYER_DIR) clean<br>
> -<br>
> -mplayer-dirclean:<br>
> -       rm -rf $(MPLAYER_DIR)<br>
> -#############################################################<br>
> -#<br>
> -# Toplevel Makefile options<br>
> -#<br>
> -#############################################################<br>
> -ifeq ($(BR2_PACKAGE_MPLAYER),y)<br>
> -TARGETS+=mplayer<br>
> -endif<br>
> +$(eval $(call GENTARGETS,package/multimedia,mplayer))<br>
> --<br>
> 1.7.3.1<br>
><br>
</div>> _______________________________________________<br>
> buildroot mailing list<br>
> <a href="mailto:buildroot@busybox.net">buildroot@busybox.net</a><br>
> <a href="http://lists.busybox.net/mailman/listinfo/buildroot" target="_blank">http://lists.busybox.net/mailman/listinfo/buildroot</a><br>
><br>
</blockquote></div>This is a gentargets package, (PKG)_CONF_OPT is only available to autotargets. This is why I added the 'S' to the end of the variable name, to show that it's not an autotargets package. As for MAKE1, I'm not sure if it's necessary, but it was in the original package, so I used it.<br>

<br>Martin <br>