[MPlayer-dev-eng] [PATCH 1/3] configure: Drastically speed up generation of config.h/.asm/.mak

Alexander Strasser eclipse7 at gmx.net
Tue Dec 15 22:19:26 CET 2015


Hi,

On 2015-11-14 22:19 +0100, Alexander Strasser wrote:
> From: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
>
> Avoid spawning grep for every item in the list.

seems this was mainly a problem because some antivirus soft
greatly amplified the effect by slowing down file access.

  FWIW I have attached new patches that avoid the grep but
do not generate outputs with multiple definitions for the
same item. It is a little faster on my linux system and
halves configure time on my windows box. It is not tested
very much and with only a few AWK implementations.

  I am fine with dropping it completely, though the first
patch could be applied either way if anyone is in favor.

  Alexander

> Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
> ---
>  configure | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/configure b/configure
> index 0e37441..57e9cb7 100755
> --- a/configure
> +++ b/configure
> @@ -8310,11 +8310,10 @@ list=$(echo $1 | toupper)
>  item=$(echo $2 | toupper)
>  nprefix=$3;
>  for part in $list; do
> -  if $(echo $item | grep -q -E "(^| )$part($| )"); then
> -    echo "${nprefix}_$part = yes"
> -  else
> -    echo "${nprefix}_$part = no"
> -  fi
> +  echo "${nprefix}_$part = no"
> +done
> +for part in $item; do
> +  echo "${nprefix}_$part = yes"
>  done
>  }
>  
> @@ -8731,11 +8730,11 @@ _defineprefix=$3;
>  _postfix=$5;
>  test -z "$_nprefix" && _nprefix='CONFIG'
>  for part in $list; do
> -  if $(echo $item | grep -q -E "(^| )$part($| )"); then
> -    echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 1"
> -  else
> -    echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 0"
> -  fi
> +  echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 0"
> +done
> +for part in $item; do
> +  echo "${_defineprefix}undef ${_nprefix}_${part}${_postfix}"
> +  echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 1"
>  done
>  }
>  
> -- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-configure-ff_config_enable-Remove-empty-prefix-speci.patch
Type: text/x-diff
Size: 2584 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20151215/ea7378e5/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-configure-Speed-up-generating-config.h-.asm-.mak.patch
Type: text/x-diff
Size: 2290 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20151215/ea7378e5/attachment-0001.patch>


More information about the MPlayer-dev-eng mailing list