qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH RFC server 01/11] vfio-user: build library


From: Jag Raman
Subject: Re: [PATCH RFC server 01/11] vfio-user: build library
Date: Tue, 20 Jul 2021 12:06:25 +0000


> On Jul 19, 2021, at 4:24 PM, John Levon <john.levon@nutanix.com> wrote:
> 
> On Mon, Jul 19, 2021 at 04:00:03PM -0400, Jagannathan Raman wrote:
> 
>> add the libvfio-user library as a submodule. build it as part of QEMU
>> 
>> diff --git a/meson.build b/meson.build
>> index 6e4d2d8..f2f9f86 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -1894,6 +1894,41 @@ if get_option('cfi') and slirp_opt == 'system'
>>          + ' Please configure with --enable-slirp=git')
>> endif
>> 
>> +vfiouser = not_found
>> +if have_system and multiprocess_allowed
>> +  have_internal = fs.exists(meson.current_source_dir() / 
>> 'libvfio-user/Makefile')
>> +
>> +  if not have_internal
>> +    error('libvfio-user source not found - please pull git submodule')
>> +  endif
>> +
>> +  vfiouser_files = [
>> +    'libvfio-user/lib/dma.c',
>> +    'libvfio-user/lib/irq.c',
>> +    'libvfio-user/lib/libvfio-user.c',
>> +    'libvfio-user/lib/migration.c',
>> +    'libvfio-user/lib/pci.c',
>> +    'libvfio-user/lib/pci_caps.c',
>> +    'libvfio-user/lib/tran_sock.c',
>> +  ]
>> +
>> +  vfiouser_inc = include_directories('libvfio-user/include', 
>> 'libvfio-user/lib')
>> +
>> +  json_c = dependency('json-c', required: false)
>> +  if not json_c.found()
>> +    json_c = dependency('libjson-c')
>> +  endif
>> +
>> +  libvfiouser = static_library('vfiouser',
>> +                               build_by_default: false,
>> +                               sources: vfiouser_files,
>> +                               dependencies: json_c,
>> +                               include_directories: vfiouser_inc)
>> +
>> +  vfiouser = declare_dependency(link_with: libvfiouser,
>> +                                include_directories: vfiouser_inc)
>> +endif
> 
> Why this way, rather than recursing into the submodule? Seems a bit fragile to
> encode details of the library here.

+maintainers of meson.build. I apologize for not adding them when I sent the
patches out initially. I copied the email list from Elena, but Elena did not 
make
any changes to meson.build - stupid me.

John, 

    This way appears to be present convention with QEMU - I’m also not very 
clear
on the reason for it.

For example submodules such as slirp (libslirp), capstone (libcapstone),
dtc (libfdt) are built this way.

I’m guessing it’s because QEMU doesn’t build all parts of a submodule. For
example, QEMU only builds libfdt in the doc submodule. Similarly,
libvfio-user only builds the core library without building the tests and 
samples.

> 
> regards
> john


reply via email to

[Prev in Thread] Current Thread [Next in Thread]