[pacman-dev] [PATCH 2/5] meson.build: Fix detection of symbols

Allan McRae allan at archlinux.org
Mon Apr 19 07:10:26 UTC 2021


On 17/4/21 1:45 pm, Mark Weiman wrote:
> This patch changes the behavior of meson to define configuration options
> *only* when the symbol checked is present. Currently, it defines all of
> them in config.h whether the symbol exists or not and the code that
> looks for it doesn't check the macro's value, but whether it's defined.
> 

Remember back when we used autotools and all this just worked!  :D

Patch looks good to me.

Allan

> Signed-off-by: Mark Weiman <mark.weiman at markzz.com>
> ---
>  meson.build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 483c4fbd..14b3381a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -146,7 +146,9 @@ foreach sym : [
>      'tcflush',
>    ]
>    have = cc.has_function(sym, args : '-D_GNU_SOURCE')
> -  conf.set10('HAVE_' + sym.to_upper(), have)
> +  if have
> +    conf.set10('HAVE_' + sym.to_upper(), have)
> +  endif
>  endforeach
>  
>  foreach member : [
> 


More information about the pacman-dev mailing list