[dpdk-dev] [dpdk-dev, 02/17] eal: add eal library to meson build

Bruce Richardson bruce.richardson at intel.com
Fri Sep 8 10:51:48 CEST 2017


On Thu, Sep 07, 2017 at 12:25:29PM -0400, Neil Horman wrote:
> On Fri, Sep 01, 2017 at 11:04:01AM +0100, Bruce Richardson wrote:
> > Support building the EAL with meson and ninja. This involves a number of
> > different meson.build files for iterating through all the different
> > subdirectories in the EAL. The library itself will be compiled on build but
> > the header files are only copied from their initial location once "ninja
> > install" is run. Instead, we use meson dependency tracking to ensure that
> > other libraries which use the EAL headers can find them in their original
> > locations.
> > 
> > Note: this does not include building kernel modules on either BSD or Linux
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > Reviewed-by: Harry van Haaren <harry.van.haaren at intel.com>
> > ---
> >  config/rte_config.h                                | 11 ++++
> >  lib/librte_eal/bsdapp/eal/meson.build              | 67 ++++++++++++++++++++
> >  lib/librte_eal/bsdapp/meson.build                  | 32 ++++++++++
> >  lib/librte_eal/common/arch/meson.build             | 33 ++++++++++
> >  lib/librte_eal/common/arch/x86/meson.build         | 32 ++++++++++
> >  lib/librte_eal/common/include/arch/meson.build     | 33 ++++++++++
> >  lib/librte_eal/common/include/arch/x86/meson.build | 48 +++++++++++++++
> >  lib/librte_eal/common/include/meson.build          | 71 +++++++++++++++++++++
> >  lib/librte_eal/common/meson.build                  | 71 +++++++++++++++++++++
> >  lib/librte_eal/linuxapp/eal/meson.build            | 72 ++++++++++++++++++++++
> >  lib/librte_eal/linuxapp/meson.build                | 32 ++++++++++
> >  lib/librte_eal/meson.build                         | 44 +++++++++++++
> >  lib/meson.build                                    | 32 ++++++++++
> >  meson.build                                        |  3 +-
> >  14 files changed, 580 insertions(+), 1 deletion(-)
> >  create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
> >  create mode 100644 lib/librte_eal/bsdapp/meson.build
> >  create mode 100644 lib/librte_eal/common/arch/meson.build
> >  create mode 100644 lib/librte_eal/common/arch/x86/meson.build
> >  create mode 100644 lib/librte_eal/common/include/arch/meson.build
> >  create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build
> >  create mode 100644 lib/librte_eal/common/include/meson.build
> >  create mode 100644 lib/librte_eal/common/meson.build
> >  create mode 100644 lib/librte_eal/linuxapp/eal/meson.build
> >  create mode 100644 lib/librte_eal/linuxapp/meson.build
> >  create mode 100644 lib/librte_eal/meson.build
> >  create mode 100644 lib/meson.build
> > 
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > index 79b0db90f..252b087ad 100644
> > --- a/config/rte_config.h
> > +++ b/config/rte_config.h
> > @@ -47,4 +47,15 @@
> >  
> >  #include <rte_build_config.h>
> >  
> > +/****** library defines ********/
> > +
> > +/* EAL defines */
> > +#define RTE_MAX_MEMSEG 512
> > +#define RTE_MAX_MEMZONE 2560
> > +#define RTE_MAX_TAILQ 32
> > +#define RTE_LOG_LEVEL RTE_LOG_INFO
> > +#define RTE_LOG_DP_LEVEL RTE_LOG_INFO
> > +#define RTE_BACKTRACE 1
> > +#define RTE_EAL_VFIO 1
> > +
> >  #endif /* _RTE_CONFIG_H_ */
> > diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
> > new file mode 100644
> > index 000000000..bc9c3f0cb
> > --- /dev/null
> > +++ b/lib/librte_eal/bsdapp/eal/meson.build
> > @@ -0,0 +1,67 @@
> > +#   BSD LICENSE
> > +#
> > +#   Copyright(c) 2017 Intel Corporation. All rights reserved.
> > +#   All rights reserved.
> > +#
> > +#   Redistribution and use in source and binary forms, with or without
> > +#   modification, are permitted provided that the following conditions
> > +#   are met:
> > +#
> > +#     * Redistributions of source code must retain the above copyright
> > +#       notice, this list of conditions and the following disclaimer.
> > +#     * Redistributions in binary form must reproduce the above copyright
> > +#       notice, this list of conditions and the following disclaimer in
> > +#       the documentation and/or other materials provided with the
> > +#       distribution.
> > +#     * Neither the name of Intel Corporation nor the names of its
> > +#       contributors may be used to endorse or promote products derived
> > +#       from this software without specific prior written permission.
> > +#
> > +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> > +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> > +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> > +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> > +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> > +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> > +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > +
> > +eal_inc += include_directories('include')
> > +install_subdir('include/exec-env', install_dir: 'include')
> > +
> > +sources = ['eal_alarm.c',
> > +		'eal_debug.c',
> > +		'eal_hugepage_info.c',
> > +		'eal_interrupts.c',
> > +		'eal_lcore.c',
> > +		'eal_thread.c',
> > +		'eal_timer.c',
> > +		'eal.c',
> > +		'eal_memory.c',
> > +		'eal_pci.c',
> > +]
> > +
> > +eal_extra_link_arg = '-lexecinfo'
> > +
> > +version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
> Odd quesion, only for my own education.  Does the version map get treated as a
> dependency here?  That is to say, if I update it, does the assocated library get
> rebuilt?  The current build system missed this, and it would be nice if it got
> included in the new one.
> 
That should be the case, as it explicitly called out as link dependency in
the library call below.

> > +eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
> > +			dependencies: dependency('threads'),
> > +			include_directories : eal_inc,
> > +			version: '@0 at .1'.format(version),
> > +			c_args: '-D_GNU_SOURCE',
> > +			link_depends: version_map,
> > +			link_args: [eal_extra_link_arg,
> > +				'-Wl,--version-script=' + version_map],
> > +			install: true
> > +)
> > +
> 
> 
> Neil
> 


More information about the dev mailing list