Re: [libav-devel] [PATCH 1/7] configure: Drop unnecessary variables, shifts, and quotes in helper functions

2018-02-13 Thread Diego Biurrun
On Sun, Feb 11, 2018 at 11:35:36PM -0300, James Almer wrote:
> On 2/11/2018 4:09 PM, Diego Biurrun wrote:
> > --- a/configure
> > +++ b/configure
> > @@ -1097,11 +1097,9 @@ check_struct(){
> >  check_builtin(){
> >  log check_builtin "$@"
> >  name=$1
> > -headers=$2
> > -builtin=$3
> > -shift 3
> > +shift
> >  disable "$name"
> > -check_code ld "$headers" "$builtin" "$@" && enable "$name"
> > +check_code ld "$@" && enable "$name"
> >  }
> >  
> >  check_compile_assert(){
> > @@ -1118,25 +1116,20 @@ require(){
> >  log require "$@"
> >  name_version="$1"
> >  name="${1%% *}"
> > -headers="$2"
> > -func="$3"
> > -shift 3
> > -check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not 
> > found"
> > +shift
> > +check_lib $name "$@" || die "ERROR: $name_version not found"
> >  }
> >  
> >  require_header(){
> >  log require_header "$@"
> >  headers="$1"
> > -shift
> > -check_header "$headers" "$@" || die "ERROR: $headers not found"
> > +check_header "$@" || die "ERROR: $headers not found"
> >  }
> >  
> >  require_cpp_condition(){
> >  log require_cpp_condition "$@"
> > -header="$1"
> >  condition="$2"
> > -shift 2
> > -check_cpp_condition "$header" "$condition" "$@" || die "ERROR: 
> > $condition not satisfied"
> > +check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
> >  }
> 
> Does passing "$@" keep and propagate the arguments split in a way
> check_code() and similar can properly identify and handle? Checks can
> use more than one header after all.

Yes. Notice that we rely on that behavior even before this patch.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 1/7] configure: Drop unnecessary variables, shifts, and quotes in helper functions

2018-02-11 Thread James Almer
On 2/11/2018 4:09 PM, Diego Biurrun wrote:
> ---
>  configure | 21 +++--
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/configure b/configure
> index ed930e6cd4..904131301d 100755
> --- a/configure
> +++ b/configure
> @@ -816,7 +816,7 @@ EOF
>  
>  check_insn(){
>  log check_insn "$@"
> -check_inline_asm ${1}_inline "\"$2\""
> +check_inline_asm ${1}_inline "$2"
>  echo "$2" | check_as && enable ${1}_external || disable ${1}_external
>  }
>  
> @@ -1097,11 +1097,9 @@ check_struct(){
>  check_builtin(){
>  log check_builtin "$@"
>  name=$1
> -headers=$2
> -builtin=$3
> -shift 3
> +shift
>  disable "$name"
> -check_code ld "$headers" "$builtin" "$@" && enable "$name"
> +check_code ld "$@" && enable "$name"
>  }
>  
>  check_compile_assert(){
> @@ -1118,25 +1116,20 @@ require(){
>  log require "$@"
>  name_version="$1"
>  name="${1%% *}"
> -headers="$2"
> -func="$3"
> -shift 3
> -check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not 
> found"
> +shift
> +check_lib $name "$@" || die "ERROR: $name_version not found"
>  }
>  
>  require_header(){
>  log require_header "$@"
>  headers="$1"
> -shift
> -check_header "$headers" "$@" || die "ERROR: $headers not found"
> +check_header "$@" || die "ERROR: $headers not found"
>  }
>  
>  require_cpp_condition(){
>  log require_cpp_condition "$@"
> -header="$1"
>  condition="$2"
> -shift 2
> -check_cpp_condition "$header" "$condition" "$@" || die "ERROR: 
> $condition not satisfied"
> +check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
>  }
>  
>  require_pkg_config(){

Does passing "$@" keep and propagate the arguments split in a way
check_code() and similar can properly identify and handle? Checks can
use more than one header after all.

Should be ok if that's the case.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 1/7] configure: Drop unnecessary variables, shifts, and quotes in helper functions

2018-02-11 Thread Diego Biurrun
---
 configure | 21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index ed930e6cd4..904131301d 100755
--- a/configure
+++ b/configure
@@ -816,7 +816,7 @@ EOF
 
 check_insn(){
 log check_insn "$@"
-check_inline_asm ${1}_inline "\"$2\""
+check_inline_asm ${1}_inline "$2"
 echo "$2" | check_as && enable ${1}_external || disable ${1}_external
 }
 
@@ -1097,11 +1097,9 @@ check_struct(){
 check_builtin(){
 log check_builtin "$@"
 name=$1
-headers=$2
-builtin=$3
-shift 3
+shift
 disable "$name"
-check_code ld "$headers" "$builtin" "$@" && enable "$name"
+check_code ld "$@" && enable "$name"
 }
 
 check_compile_assert(){
@@ -1118,25 +1116,20 @@ require(){
 log require "$@"
 name_version="$1"
 name="${1%% *}"
-headers="$2"
-func="$3"
-shift 3
-check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not 
found"
+shift
+check_lib $name "$@" || die "ERROR: $name_version not found"
 }
 
 require_header(){
 log require_header "$@"
 headers="$1"
-shift
-check_header "$headers" "$@" || die "ERROR: $headers not found"
+check_header "$@" || die "ERROR: $headers not found"
 }
 
 require_cpp_condition(){
 log require_cpp_condition "$@"
-header="$1"
 condition="$2"
-shift 2
-check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition 
not satisfied"
+check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
 }
 
 require_pkg_config(){
-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel