Re: [PATCH spice-common] squash! build: Ensure we link with -lm if needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dunno if we should go out of our way for this test, or if we could just
unconditionnally link libm.

either way is fine with me, and the proposed patch looks fine. I would
drop 'func' from it, and use 'hypot' directly.

Christophe

On Mon, Jun 04, 2018 at 02:03:43PM +0100, Frediano Ziglio wrote:
> ---
>  meson.build | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index de777db..27f70a9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -87,6 +87,14 @@ foreach func : functions
>    endif
>  endforeach
>  
> +func = 'hypot'
> +libm = compiler.find_library('m', required : false)
> +if compiler.has_function(func, prefix : '#include <math.h>')
> +  spice_common_config_data.set('HAVE_@0@'.format(func.to_upper()), '1')
> +elif compiler.has_function(func, prefix : '#include <math.h>', dependencies : libm)
> +  spice_common_deps += libm
> +  spice_common_config_data.set('HAVE_@0@'.format(func.to_upper()), '1')
> +endif
>  
>  #
>  # check for mandatory dependencies
> -- 
> 2.17.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]