All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFCv2 00/40] Building DPDK with meson and ninja
@ 2017-08-14  9:51 Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 01/40] build: initial hooks for using meson with DPDK Bruce Richardson
                   ` (41 more replies)
  0 siblings, 42 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

there is still plenty to do on this, but please review and test it out.
I've kept the patches split so that the evolution of the work is a bit
clearer than having it all send in a monolithic patch. All feedback
welcome. I recommend one uses the latest meson release for this, though the
minimum version supported should be v0.4.

I've tested static and dynamic builds with clang and gcc on Fedora 26, and
done test builds on FreeBSD 11 with clang too. Build with other compilers
and on other OS's may have issues, so YMMV.

To do a basic build, using gcc and with shared libs, in a folder called "gcc-build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install

Other options can be adjusted by running "mesonconf" in the build
directory, i.e. gcc-build or clang-build in the examples above.


Bruce Richardson (40):
  build: initial hooks for using meson with DPDK
  build: create pkg-config file for DPDK
  build: build linuxapp EAL with meson and ninja
  build: add EAL support under BSD
  build: add core libraries to meson build system
  build: add i40e driver to meson build
  build: add pmdinfogen to build
  build: generate list of sources for pmdinfogen
  build: build i40e driver, including pmdinfo
  build: install usertools scripts
  build: simplify generation of pmd.c files
  build: generalize net driver build to higher level
  build: remove hard-coded enablement of vector driver
  build: add ixgbe driver to build
  build: set up standard deps for drivers
  build: add af_packet driver to build
  build: add pcap PMD support
  build: add symbol version map file support to libs
  build: build libraries in a loop for brevity
  build: version library .so files
  eal: add version information to meson build
  build: add mempool drivers to build
  build: add gro library to meson build
  build: tweak naming of pmd dependencies
  build: track driver include directories properly
  metrics: add metrics lib to meson build
  build: track dependencies recursively
  testpmd: compile testpmd with meson and ninja
  crypto/null: rename the version file to standard
  crypto/qat: remove dependency on ether library
  build: add cryptodev and some crypto drivers to build
  igb_uio: add igb_uio to meson build
  ip_frag: rename version file to standard name
  build: add most remaining libraries to meson build
  build: add packet framework libs to meson build
  acl: add acl library to meson build
  build: add ark and avp PMDs to build
  build: fix static library builds with base code
  build: fix driver dependencies for static builds
  examples: allow basic sample app build using pkg-config

 app/meson.build                                    |  32 ++++++
 app/test-pmd/meson.build                           |  74 +++++++++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++
 buildtools/meson.build                             |  34 ++++++
 buildtools/pmdinfogen/meson.build                  |  43 ++++++++
 config/meson.build                                 |  69 +++++++++++++
 config/rte_config.h                                | 114 +++++++++++++++++++++
 config/x86/meson.build                             |  70 +++++++++++++
 drivers/crypto/meson.build                         | 108 +++++++++++++++++++
 drivers/crypto/null/Makefile                       |   2 +-
 drivers/crypto/null/meson.build                    |  32 ++++++
 ...crypto_version.map => rte_pmd_null_version.map} |   0
 drivers/crypto/openssl/meson.build                 |  38 +++++++
 drivers/crypto/qat/meson.build                     |  41 ++++++++
 drivers/crypto/qat/qat_crypto.c                    |   1 -
 drivers/mempool/meson.build                        | 108 +++++++++++++++++++
 drivers/mempool/ring/meson.build                   |  32 ++++++
 drivers/mempool/stack/meson.build                  |  32 ++++++
 drivers/meson.build                                |  34 ++++++
 drivers/net/af_packet/meson.build                  |  35 +++++++
 drivers/net/ark/meson.build                        |  45 ++++++++
 drivers/net/avp/meson.build                        |  34 ++++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++++++
 drivers/net/i40e/meson.build                       |  61 +++++++++++
 drivers/net/ixgbe/base/meson.build                 |  60 +++++++++++
 drivers/net/ixgbe/meson.build                      |  58 +++++++++++
 drivers/net/meson.build                            | 108 +++++++++++++++++++
 drivers/net/pcap/meson.build                       |  41 ++++++++
 examples/helloworld/Makefile                       |  13 +++
 examples/l2fwd/Makefile                            |  13 +++
 lib/librte_acl/meson.build                         |  60 +++++++++++
 lib/librte_bitratestats/meson.build                |  34 ++++++
 lib/librte_cfgfile/meson.build                     |  35 +++++++
 lib/librte_cmdline/meson.build                     |  57 +++++++++++
 lib/librte_compat/meson.build                      |  36 +++++++
 lib/librte_cryptodev/meson.build                   |  40 ++++++++
 lib/librte_distributor/meson.build                 |  39 +++++++
 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/igb_uio/Kbuild             |   1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++
 lib/librte_eal/linuxapp/meson.build                |  42 ++++++++
 lib/librte_eal/meson.build                         |  44 ++++++++
 lib/librte_efd/meson.build                         |  34 ++++++
 lib/librte_ether/meson.build                       |  46 +++++++++
 lib/librte_eventdev/meson.build                    |  36 +++++++
 lib/librte_gro/meson.build                         |  34 ++++++
 lib/librte_hash/meson.build                        |  46 +++++++++
 lib/librte_ip_frag/Makefile                        |   2 +-
 lib/librte_ip_frag/meson.build                     |  39 +++++++
 ..._ipfrag_version.map => rte_ip_frag_version.map} |   0
 lib/librte_jobstats/meson.build                    |  34 ++++++
 lib/librte_kni/meson.build                         |  35 +++++++
 lib/librte_kvargs/meson.build                      |  35 +++++++
 lib/librte_latencystats/meson.build                |  34 ++++++
 lib/librte_lpm/meson.build                         |  35 +++++++
 lib/librte_mbuf/meson.build                        |  36 +++++++
 lib/librte_mempool/meson.build                     |  35 +++++++
 lib/librte_meter/meson.build                       |  34 ++++++
 lib/librte_metrics/meson.build                     |  34 ++++++
 lib/librte_net/meson.build                         |  46 +++++++++
 lib/librte_pdump/meson.build                       |  34 ++++++
 lib/librte_pipeline/meson.build                    |  35 +++++++
 lib/librte_port/meson.build                        |  58 +++++++++++
 lib/librte_power/meson.build                       |  35 +++++++
 lib/librte_reorder/meson.build                     |  34 ++++++
 lib/librte_ring/meson.build                        |  34 ++++++
 lib/librte_sched/meson.build                       |  36 +++++++
 lib/librte_table/meson.build                       |  52 ++++++++++
 lib/librte_timer/meson.build                       |  34 ++++++
 lib/librte_vhost/meson.build                       |  36 +++++++
 lib/meson.build                                    | 105 +++++++++++++++++++
 meson.build                                        |  88 ++++++++++++++++
 meson_options.txt                                  |   8 ++
 usertools/meson.build                              |  32 ++++++
 82 files changed, 3536 insertions(+), 3 deletions(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build
 create mode 100644 drivers/net/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 lib/librte_acl/meson.build
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 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/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
 create mode 100644 lib/librte_eal/linuxapp/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_gro/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} (100%)
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_metrics/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_ring/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_table/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 usertools/meson.build

-- 
2.13.4

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [RFCv2 01/40] build: initial hooks for using meson with DPDK
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 02/40] build: create pkg-config file for DPDK Bruce Richardson
                   ` (40 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build     | 47 ++++++++++++++++++++++++++++++++++
 config/rte_config.h    | 50 +++++++++++++++++++++++++++++++++++++
 config/x86/meson.build | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build            | 60 ++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt      |  1 +
 5 files changed, 226 insertions(+)
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt

diff --git a/config/meson.build b/config/meson.build
new file mode 100644
index 000000000..59247d784
--- /dev/null
+++ b/config/meson.build
@@ -0,0 +1,47 @@
+#   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.
+
+# set the machine type and cflags for it
+machine = get_option('machine')
+dpdk_conf.set('RTE_MACHINE', machine)
+add_project_arguments('-march=@0@'.format(machine), language: 'c')
+
+compile_time_cpuflags = []
+if host_machine.cpu_family().startswith('x86')
+	subdir('x86')
+endif
+dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
+
+
+# set the install path for the drivers
+dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', driver_install_path)
+
+install_headers('rte_config.h')
diff --git a/config/rte_config.h b/config/rte_config.h
new file mode 100644
index 000000000..79b0db90f
--- /dev/null
+++ b/config/rte_config.h
@@ -0,0 +1,50 @@
+/*
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 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.
+ */
+
+/**
+ * @file Header file containing DPDK compilation parameters
+ *
+ * Header file containing DPDK compilation parameters. Also include the
+ * meson-generated header file containing the detected parameters that
+ * are variable across builds or build environments.
+ *
+ * NOTE: This file is only used for meson+ninja builds. For builds done
+ * using make/gmake, the rte_config.h file is autogenerated from the
+ * defconfig_* files in the config directory.
+ */
+#ifndef _RTE_CONFIG_H_
+#define _RTE_CONFIG_H_
+
+#include <rte_build_config.h>
+
+#endif /* _RTE_CONFIG_H_ */
diff --git a/config/x86/meson.build b/config/x86/meson.build
new file mode 100644
index 000000000..8fa3a38c0
--- /dev/null
+++ b/config/x86/meson.build
@@ -0,0 +1,68 @@
+#   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.
+
+# for checking defines we need to use the correct compiler flags
+march_opt = '-march=@0@'.format(machine)
+
+# we require SSE4.2 for DPDK
+sse_errormsg = '''SSE4.2 instruction set is required for DPDK.
+Please set the machine type to "nehalem" or "corei7" or higher value'''
+
+if cc.get_define('__SSE4_2__', args: march_opt) == ''
+	error(sse_errormsg)
+endif
+
+dpdk_conf.set('RTE_ARCH_X86', 1)
+if (host_machine.cpu_family() == 'x86_64')
+	dpdk_conf.set('RTE_ARCH_X86_64', 1)
+	dpdk_conf.set('RTE_ARCH', 'x86_64')
+	dpdk_conf.set('RTE_ARCH_64', 1)
+else
+	dpdk_conf.set('RTE_ARCH_I686', 1)
+	dpdk_conf.set('RTE_ARCH', 'i686')
+endif
+
+if cc.get_define('__AES__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AES']
+endif
+if cc.get_define('__PCLMUL__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_PCLMULQDQ', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_PCLMULQDQ']
+endif
+if cc.get_define('__AVX__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AVX']
+endif
+if cc.get_define('__AVX2__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX2', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AVX2']
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000..8383d23b5
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,60 @@
+#   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.
+
+project('DPDK', 'C',
+	version: '17.05.0',
+	license: 'BSD',
+	default_options: ['buildtype=release'],
+	meson_version: '>= 0.40.1'
+)
+
+# set up some global vars for compiler, platform and configuration
+cc = meson.get_compiler('c')
+dpdk_conf = configuration_data()
+
+# for static libs, treat the drivers as regular libraries, otherwise
+# for shared libs, put them in a driver folder
+if get_option('default_library') == 'static'
+	driver_install_path = get_option('libdir')
+else
+	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
+endif
+
+# configure the build, and make sure configs here and in config folder are
+# able to be included in any file
+global_inc = include_directories('.', 'config')
+subdir('config')
+
+# write the build config
+build_cfg = 'rte_build_config.h'
+configure_file(output: build_cfg,
+		configuration: dpdk_conf,
+		install_dir: get_option('includedir'))
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 000000000..94365567e
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('machine', type : 'string', value : 'native', description : 'set the target machine type')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 02/40] build: create pkg-config file for DPDK
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 01/40] build: initial hooks for using meson with DPDK Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 03/40] build: build linuxapp EAL with meson and ninja Bruce Richardson
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 8383d23b5..d7acf174d 100644
--- a/meson.build
+++ b/meson.build
@@ -36,9 +36,10 @@ project('DPDK', 'C',
 	meson_version: '>= 0.40.1'
 )
 
-# set up some global vars for compiler, platform and configuration
+# set up some global vars for compiler, platform, configuration, etc.
 cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
+dpdk_libraries = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -58,3 +59,17 @@ build_cfg = 'rte_build_config.h'
 configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
+
+# the DPDK libs needs to be passed to the link command in reverse order
+dpdk_link_libs = []
+foreach lib: dpdk_libraries
+	dpdk_link_libs = [lib] + dpdk_link_libs
+endforeach
+
+pkg = import('pkgconfig')
+pkg.generate(name: meson.project_name(),
+	version: meson.project_version(),
+	libraries: dpdk_link_libs,
+	description: 'The Data Plane Development Kit (DPDK)',
+	extra_cflags: '-include "rte_config.h"'
+)
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 03/40] build: build linuxapp EAL with meson and ninja
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 01/40] build: initial hooks for using meson with DPDK Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 02/40] build: create pkg-config file for DPDK Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 04/40] build: add EAL support under BSD Bruce Richardson
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build                                 | 24 +++++++-
 config/rte_config.h                                |  9 +++
 config/x86/meson.build                             |  2 +
 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 | 47 ++++++++++++++
 lib/librte_eal/common/include/meson.build          | 71 ++++++++++++++++++++++
 lib/librte_eal/common/meson.build                  | 71 ++++++++++++++++++++++
 lib/librte_eal/linuxapp/eal/meson.build            | 62 +++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build                | 32 ++++++++++
 lib/librte_eal/meson.build                         | 40 ++++++++++++
 lib/meson.build                                    | 41 +++++++++++++
 meson.build                                        |  3 +
 meson_options.txt                                  |  7 ++-
 15 files changed, 504 insertions(+), 3 deletions(-)
 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/meson.build b/config/meson.build
index 59247d784..4a6a69d13 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -34,14 +34,34 @@ machine = get_option('machine')
 dpdk_conf.set('RTE_MACHINE', machine)
 add_project_arguments('-march=@0@'.format(machine), language: 'c')
 
+# add -include rte_config to cflags
+add_project_arguments('-include', 'rte_config.h', language: 'c')
+
+# disable any unwanted warnings
+unwanted_warnings = [
+	'-Wno-address-of-packed-member',
+	'-Wno-format-truncation'
+]
+foreach arg: unwanted_warnings
+	if cc.has_argument(arg)
+		add_project_arguments(arg, language: 'c')
+	endif
+endforeach
+
 compile_time_cpuflags = []
 if host_machine.cpu_family().startswith('x86')
-	subdir('x86')
+	arch_subdir = 'x86'
+	subdir(arch_subdir)
 endif
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
-
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', driver_install_path)
 
+# set other values pulled from the build options
+dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
+dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
+dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id'))
+
 install_headers('rte_config.h')
diff --git a/config/rte_config.h b/config/rte_config.h
index 79b0db90f..7724ebcbe 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -47,4 +47,13 @@
 
 #include <rte_build_config.h>
 
+/* 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/config/x86/meson.build b/config/x86/meson.build
index 8fa3a38c0..54f8bcdb6 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -66,3 +66,5 @@ if cc.get_define('__AVX2__', args: march_opt) != ''
 	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX2', 1)
 	compile_time_cpuflags += ['RTE_CPUFLAG_AVX2']
 endif
+
+dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
diff --git a/lib/librte_eal/common/arch/meson.build b/lib/librte_eal/common/arch/meson.build
new file mode 100644
index 000000000..863d7e4bb
--- /dev/null
+++ b/lib/librte_eal/common/arch/meson.build
@@ -0,0 +1,33 @@
+#   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(arch_subdir)
+subdir(arch_subdir)
diff --git a/lib/librte_eal/common/arch/x86/meson.build b/lib/librte_eal/common/arch/x86/meson.build
new file mode 100644
index 000000000..8fabad648
--- /dev/null
+++ b/lib/librte_eal/common/arch/x86/meson.build
@@ -0,0 +1,32 @@
+#   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_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c')
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
new file mode 100644
index 000000000..863d7e4bb
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -0,0 +1,33 @@
+#   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(arch_subdir)
+subdir(arch_subdir)
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
new file mode 100644
index 000000000..bd162938c
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -0,0 +1,47 @@
+#   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.
+
+install_headers(
+	'rte_atomic_32.h',
+	'rte_atomic_64.h',
+	'rte_atomic.h',
+	'rte_byteorder_32.h',
+	'rte_byteorder_64.h',
+	'rte_byteorder.h',
+	'rte_cpuflags.h',
+	'rte_cycles.h',
+	'rte_io.h',
+	'rte_memcpy.h',
+	'rte_prefetch.h',
+	'rte_rtm.h',
+	'rte_rwlock.h',
+	'rte_spinlock.h',
+	'rte_vect.h')
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
new file mode 100644
index 000000000..e92c4eb7c
--- /dev/null
+++ b/lib/librte_eal/common/include/meson.build
@@ -0,0 +1,71 @@
+#   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('.')
+
+common_headers = [
+	'rte_alarm.h',
+	'rte_branch_prediction.h',
+	'rte_bus.h',
+	'rte_common.h',
+	'rte_debug.h',
+	'rte_devargs.h',
+	'rte_dev.h',
+	'rte_eal.h',
+	'rte_eal_memconfig.h',
+	'rte_errno.h',
+	'rte_hexdump.h',
+	'rte_interrupts.h',
+	'rte_keepalive.h',
+	'rte_launch.h',
+	'rte_lcore.h',
+	'rte_log.h',
+	'rte_malloc.h',
+	'rte_malloc_heap.h',
+	'rte_memory.h',
+	'rte_memzone.h',
+	'rte_pci_dev_feature_defs.h',
+	'rte_pci_dev_features.h',
+	'rte_pci.h',
+	'rte_per_lcore.h',
+	'rte_random.h',
+	'rte_service.h',
+	'rte_service_component.h',
+	'rte_string_fns.h',
+	'rte_tailq.h',
+	'rte_time.h',
+	'rte_vdev.h',
+	'rte_version.h']
+
+install_headers(common_headers)
+install_subdir('generic', install_dir : 'include')
+
+subdir('arch')
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
new file mode 100644
index 000000000..4a3e73f69
--- /dev/null
+++ b/lib/librte_eal/common/meson.build
@@ -0,0 +1,71 @@
+#   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('.')
+
+eal_common_sources = files(
+	'eal_common_bus.c',
+	'eal_common_cpuflags.c',
+	'eal_common_devargs.c',
+	'eal_common_dev.c',
+	'eal_common_errno.c',
+	'eal_common_hexdump.c',
+	'eal_common_launch.c',
+	'eal_common_lcore.c',
+	'eal_common_log.c',
+	'eal_common_memory.c',
+	'eal_common_memzone.c',
+	'eal_common_options.c',
+	'eal_common_pci.c',
+	'eal_common_pci_uio.c',
+	'eal_common_proc.c',
+	'eal_common_string_fns.c',
+	'eal_common_tailqs.c',
+	'eal_common_thread.c',
+	'eal_common_timer.c',
+	'eal_common_vdev.c',
+	'eal_filesystem.h',
+	'eal_hugepages.h',
+	'eal_internal_cfg.h',
+	'eal_options.h',
+	'eal_private.h',
+	'eal_thread.h',
+	'malloc_elem.c',
+	'malloc_elem.h',
+	'malloc_heap.c',
+	'malloc_heap.h',
+	'rte_keepalive.c',
+	'rte_malloc.c',
+	'rte_service.c'
+)
+
+subdir('arch')
+subdir('include')
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
new file mode 100644
index 000000000..79fcff42f
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -0,0 +1,62 @@
+#   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_log.c',
+		'eal_pci_uio.c',
+		'eal_pci_vfio.c',
+		'eal_thread.c',
+		'eal_timer.c',
+		'eal_vfio.c',
+		'eal_vfio_mp_sync.c',
+		'eal.c',
+		'eal_memory.c',
+		'eal_pci.c',
+]
+
+eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
+			dependencies: dependency('threads'),
+			include_directories : eal_inc,
+			c_args: '-D_GNU_SOURCE',
+			link_args: '-ldl',
+			install: true
+)
+
+dpdk_libraries += ['-pthread', '-ldl', eal_lib]
+
+rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
new file mode 100644
index 000000000..bc9f22175
--- /dev/null
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('eal')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
new file mode 100644
index 000000000..f24799625
--- /dev/null
+++ b/lib/librte_eal/meson.build
@@ -0,0 +1,40 @@
+#   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 = [global_inc]
+subdir('common')
+if host_machine.system() == 'linux'
+	subdir('linuxapp')
+elif host_machine.system() == 'freebsd'
+	subdir('bsdapp')
+else
+	error('unsupported system type @0@'.format(hostmachine.system()))
+endif
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 000000000..e7249bc8d
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,41 @@
+#   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.
+
+subdir('librte_eal')
+#subdir('librte_ring')
+#subdir('librte_mempool')
+#subdir('librte_cmdline')
+#subdir('librte_mbuf')
+#subdir('librte_net')
+#subdir('librte_ether')
+#subdir('librte_compat')
+#subdir('librte_hash')
+#subdir('librte_kvargs')
diff --git a/meson.build b/meson.build
index d7acf174d..d797bbbb2 100644
--- a/meson.build
+++ b/meson.build
@@ -54,6 +54,9 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
+# now build libs and drivers
+subdir('lib')
+
 # write the build config
 build_cfg = 'rte_build_config.h'
 configure_file(output: build_cfg,
diff --git a/meson_options.txt b/meson_options.txt
index 94365567e..8f1db5330 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,6 @@
-option('machine', type : 'string', value : 'native', description : 'set the target machine type')
+option('machine', type: 'string', value: 'native', description: 'set the target machine type')
+option('max_lcores', type: 'string', value: '128', description: 'maximum number of cores/threads supported by EAL')
+option('max_numa_nodes', type: 'string', value: '4', description: 'maximum number of NUMA nodes supported by EAL')
+option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
+option('allow_invalid_socket_id', type: 'boolean', value: false,
+	 description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 04/40] build: add EAL support under BSD
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (2 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 03/40] build: build linuxapp EAL with meson and ninja Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 05/40] build: add core libraries to meson build system Bruce Richardson
                   ` (37 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/bsdapp/eal/meson.build | 58 +++++++++++++++++++++++++++++++++++
 lib/librte_eal/bsdapp/meson.build     | 32 +++++++++++++++++++
 lib/librte_eal/meson.build            |  2 ++
 3 files changed, 92 insertions(+)
 create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
 create mode 100644 lib/librte_eal/bsdapp/meson.build

diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
new file mode 100644
index 000000000..1df28d507
--- /dev/null
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -0,0 +1,58 @@
+#   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')
+dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
+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_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
+			dependencies: dependency('threads'),
+			include_directories : eal_inc,
+			c_args: '-D_GNU_SOURCE',
+			link_args: '-lexecinfo',
+			install: true
+)
+
+dpdk_libraries += ['-pthread', eal_lib]
+
+rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
diff --git a/lib/librte_eal/bsdapp/meson.build b/lib/librte_eal/bsdapp/meson.build
new file mode 100644
index 000000000..bc9f22175
--- /dev/null
+++ b/lib/librte_eal/bsdapp/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('eal')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index f24799625..219501c86 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -32,8 +32,10 @@
 eal_inc = [global_inc]
 subdir('common')
 if host_machine.system() == 'linux'
+	dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
 	subdir('linuxapp')
 elif host_machine.system() == 'freebsd'
+	dpdk_conf.set('RTE_EXEC_ENV_BSDAPP', 1)
 	subdir('bsdapp')
 else
 	error('unsupported system type @0@'.format(hostmachine.system()))
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 05/40] build: add core libraries to meson build system
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (3 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 04/40] build: add EAL support under BSD Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 06/40] build: add i40e driver to meson build Bruce Richardson
                   ` (36 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h            | 14 ++++++++++
 lib/librte_cmdline/meson.build | 63 ++++++++++++++++++++++++++++++++++++++++++
 lib/librte_compat/meson.build  | 35 +++++++++++++++++++++++
 lib/librte_ether/meson.build   | 49 ++++++++++++++++++++++++++++++++
 lib/librte_hash/meson.build    | 54 ++++++++++++++++++++++++++++++++++++
 lib/librte_kvargs/meson.build  | 43 ++++++++++++++++++++++++++++
 lib/librte_mbuf/meson.build    | 42 ++++++++++++++++++++++++++++
 lib/librte_mempool/meson.build | 43 ++++++++++++++++++++++++++++
 lib/librte_net/meson.build     | 52 ++++++++++++++++++++++++++++++++++
 lib/librte_ring/meson.build    | 43 ++++++++++++++++++++++++++++
 lib/meson.build                | 18 ++++++------
 11 files changed, 447 insertions(+), 9 deletions(-)
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_ring/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 7724ebcbe..4d5f7214c 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -56,4 +56,18 @@
 #define RTE_BACKTRACE 1
 #define RTE_EAL_VFIO 1
 
+/* mempool defines */
+#define RTE_MEMPOOL_CACHE_MAX_SIZE 512
+
+/* mbuf defines */
+#define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc"
+#define RTE_MBUF_REFCNT_ATOMIC 1
+#define RTE_PKTMBUF_HEADROOM 128
+
+/* ether defines */
+#define RTE_MAX_ETHPORTS 32
+#define RTE_MAX_QUEUES_PER_PORT 1024
+#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
+#define RTE_ETHDEV_RXTX_CALLBACKS 1
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
new file mode 100644
index 000000000..ceac0a429
--- /dev/null
+++ b/lib/librte_cmdline/meson.build
@@ -0,0 +1,63 @@
+#   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.
+
+sources = [ 'cmdline.c',
+	'cmdline_cirbuf.c',
+	'cmdline_parse.c',
+	'cmdline_parse_etheraddr.c',
+	'cmdline_parse_ipaddr.c',
+	'cmdline_parse_num.c',
+	'cmdline_parse_portlist.c',
+	'cmdline_parse_string.c',
+	'cmdline_rdline.c',
+	'cmdline_socket.c',
+	'cmdline_vt100.c']
+
+install_headers('cmdline.h',
+	'cmdline_parse.h',
+	'cmdline_parse_num.h',
+	'cmdline_parse_ipaddr.h',
+	'cmdline_parse_etheraddr.h',
+	'cmdline_parse_string.h',
+	'cmdline_rdline.h',
+	'cmdline_vt100.h',
+	'cmdline_socket.h',
+	'cmdline_cirbuf.h',
+	'cmdline_parse_portlist.h')
+
+cmdline_lib = library('rte_cmdline', sources, dependencies: rte_eal,
+		install: true)
+rte_cmdline = declare_dependency(link_with: cmdline_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += cmdline_lib
+
+dpdk_conf.set('RTE_LIBRTE_CMDLINE', 1)
diff --git a/lib/librte_compat/meson.build b/lib/librte_compat/meson.build
new file mode 100644
index 000000000..d4a994523
--- /dev/null
+++ b/lib/librte_compat/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+
+install_headers('rte_compat.h')
+
+rte_compat = declare_dependency(include_directories: include_directories('.'))
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
new file mode 100644
index 000000000..55eabd23a
--- /dev/null
+++ b/lib/librte_ether/meson.build
@@ -0,0 +1,49 @@
+#   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.
+
+
+sources = ['rte_ethdev.c', 'rte_flow.c']
+
+install_headers('rte_ethdev.h',
+	'rte_ethdev_pci.h',
+	'rte_ethdev_vdev.h',
+	'rte_eth_ctrl.h',
+	'rte_dev_info.h',
+	'rte_flow.h',
+	'rte_flow_driver.h')
+
+ether_lib = library('rte_ether', sources,
+	dependencies: [rte_eal, rte_ring, rte_mempool, rte_net, rte_mbuf],
+	install: true)
+rte_ether = declare_dependency(link_with: ether_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += ether_lib
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
new file mode 100644
index 000000000..6d8270b51
--- /dev/null
+++ b/lib/librte_hash/meson.build
@@ -0,0 +1,54 @@
+#   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.
+
+
+sources = ['rte_cuckoo_hash.c', 'rte_fbk_hash.c']
+
+headers = ['rte_cmp_arm64.h',
+	'rte_cmp_x86.h',
+	'rte_crc_arm64.h',
+	'rte_cuckoo_hash.h',
+	'rte_cuckoo_hash_x86.h',
+	'rte_fbk_hash.h',
+	'rte_hash_crc.h',
+	'rte_hash.h',
+	'rte_jhash.h',
+	'rte_thash.h']
+
+install_headers(headers)
+
+hash_lib = library('rte_hash', sources,
+	dependencies: [rte_eal, rte_ring, rte_compat],
+	install: true)
+rte_hash = declare_dependency(link_with: hash_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += hash_lib
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
new file mode 100644
index 000000000..6cd5ab377
--- /dev/null
+++ b/lib/librte_kvargs/meson.build
@@ -0,0 +1,43 @@
+#   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.
+
+
+sources = ['rte_kvargs.c']
+
+install_headers('rte_kvargs.h')
+
+kvargs_lib = library('rte_kvargs', sources,
+	dependencies: rte_eal,
+	install: true)
+rte_kvargs = declare_dependency(link_with: kvargs_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += kvargs_lib
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
new file mode 100644
index 000000000..7926e7236
--- /dev/null
+++ b/lib/librte_mbuf/meson.build
@@ -0,0 +1,42 @@
+#   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.
+
+sources = ['rte_mbuf.c', 'rte_mbuf_ptype.c']
+
+install_headers('rte_mbuf.h', 'rte_mbuf_ptype.h')
+
+mbuf_lib = library('rte_mbuf', sources,
+	dependencies: [rte_eal, rte_mempool, rte_ring],
+	install: true)
+rte_mbuf = declare_dependency(link_with: mbuf_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += mbuf_lib
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
new file mode 100644
index 000000000..6da2403cc
--- /dev/null
+++ b/lib/librte_mempool/meson.build
@@ -0,0 +1,43 @@
+#   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.
+
+
+sources = ['rte_mempool.c', 'rte_mempool_ops.c']
+
+install_headers('rte_mempool.h')
+
+mempool_lib = library('rte_mempool', sources,
+	dependencies: [rte_eal, rte_ring],
+	install: true)
+rte_mempool = declare_dependency(link_with: mempool_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += mempool_lib
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
new file mode 100644
index 000000000..7c8e323f6
--- /dev/null
+++ b/lib/librte_net/meson.build
@@ -0,0 +1,52 @@
+#   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.
+
+
+sources = ['rte_net.c', 'rte_net_crc.c']
+
+install_headers('rte_ip.h',
+	'rte_tcp.h',
+	'rte_udp.h',
+	'rte_sctp.h',
+	'rte_icmp.h',
+	'rte_arp.h',
+	'rte_ether.h',
+	'rte_gre.h',
+	'rte_net.h',
+	'rte_net_crc.h')
+
+net_lib = library('rte_net', sources,
+	dependencies: [rte_eal, rte_mbuf, rte_ring, rte_mempool],
+	install: true)
+rte_net = declare_dependency(link_with: net_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += net_lib
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
new file mode 100644
index 000000000..5832a7632
--- /dev/null
+++ b/lib/librte_ring/meson.build
@@ -0,0 +1,43 @@
+#   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.
+
+
+sources = ['rte_ring.c']
+
+install_headers('rte_ring.h')
+
+ring_lib = library('rte_ring', sources,
+	dependencies: rte_eal,
+	install: true)
+rte_ring = declare_dependency(link_with: ring_lib,
+	include_directories: include_directories('.'))
+
+dpdk_libraries += ring_lib
diff --git a/lib/meson.build b/lib/meson.build
index e7249bc8d..0ea608684 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,12 +30,12 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('librte_eal')
-#subdir('librte_ring')
-#subdir('librte_mempool')
-#subdir('librte_cmdline')
-#subdir('librte_mbuf')
-#subdir('librte_net')
-#subdir('librte_ether')
-#subdir('librte_compat')
-#subdir('librte_hash')
-#subdir('librte_kvargs')
+subdir('librte_ring')
+subdir('librte_mempool')
+subdir('librte_cmdline')
+subdir('librte_mbuf')
+subdir('librte_net')
+subdir('librte_ether')
+subdir('librte_compat')
+subdir('librte_hash')
+subdir('librte_kvargs')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 06/40] build: add i40e driver to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (4 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 05/40] build: add core libraries to meson build system Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 07/40] build: add pmdinfogen to build Bruce Richardson
                   ` (35 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h               | 14 ++++++++
 drivers/meson.build               | 32 ++++++++++++++++++
 drivers/net/i40e/base/meson.build | 55 ++++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build      | 70 +++++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build           | 32 ++++++++++++++++++
 meson.build                       |  7 ++++
 6 files changed, 210 insertions(+)
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 4d5f7214c..5b687bb8e 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -47,6 +47,8 @@
 
 #include <rte_build_config.h>
 
+/****** library defines ********/
+
 /* EAL defines */
 #define RTE_MAX_MEMSEG 512
 #define RTE_MAX_MEMZONE 2560
@@ -70,4 +72,16 @@
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 
+/****** driver defines ********/
+
+/* i40e defines */
+#define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1
+#define RTE_LIBRTE_I40E_INC_VECTOR 1
+#undef RTE_LIBRTE_I40E_16BYTE_RX_DESC
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF 64
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4
+/* interval up to 8160 us, aligned to 2 (or default value) */
+#define RTE_LIBRTE_I40E_ITR_INTERVAL -1
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/drivers/meson.build b/drivers/meson.build
new file mode 100644
index 000000000..57f47c36f
--- /dev/null
+++ b/drivers/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('net')
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
new file mode 100644
index 000000000..43399cb11
--- /dev/null
+++ b/drivers/net/i40e/base/meson.build
@@ -0,0 +1,55 @@
+#   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.
+
+sources = [
+	'i40e_adminq.c',
+	'i40e_common.c',
+	'i40e_dcb.c',
+	'i40e_diag.c',
+	'i40e_hmc.c',
+	'i40e_lan_hmc.c',
+	'i40e_nvm.c'
+]
+
+error_cflags = ['-Wno-sign-compare',
+		'-Wno-unused-value',
+		'-Wno-format',
+		'-Wno-unused-but-set-variable']
+c_args = i40e_cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('i40e_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
new file mode 100644
index 000000000..1e23e0820
--- /dev/null
+++ b/drivers/net/i40e/meson.build
@@ -0,0 +1,70 @@
+#   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.
+
+i40e_cflags = ['-DPF_DRIVER',
+	'-DVF_DRIVER',
+	'-DINTEGRATED_VF',
+	'-DX722_A0_SUPPORT']
+
+subdir('base')
+
+sources = [
+	'i40e_ethdev.c',
+	'i40e_rxtx.c',
+	'i40e_ethdev_vf.c',
+	'i40e_pf.c',
+	'i40e_fdir.c',
+	'i40e_flow.c',
+	'i40e_tm.c',
+	'rte_pmd_i40e.c'
+	]
+
+if arch_subdir == 'x86'
+	sources += 'i40e_rxtx_vec_sse.c'
+endif
+
+install_headers('rte_pmd_i40e.h')
+
+i40e_lib = library('rte_pmd_i40e', sources,
+	include_directories: include_directories('base'),
+	dependencies: [rte_eal, rte_net,
+			rte_mbuf, rte_ether,
+			rte_mempool, rte_ring,
+			rte_hash, rte_kvargs],
+	link_with: base_lib,
+	c_args: i40e_cflags,
+	install: true,
+	install_dir: 'dpdk/drivers')
+
+dpdk_drivers += i40e_lib
+
+i40e_pmd = declare_dependency(link_with: i40e_lib,
+	include_directories: include_directories('.'))
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
new file mode 100644
index 000000000..22237b1aa
--- /dev/null
+++ b/drivers/net/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('i40e')
diff --git a/meson.build b/meson.build
index d797bbbb2..930656da6 100644
--- a/meson.build
+++ b/meson.build
@@ -40,6 +40,7 @@ project('DPDK', 'C',
 cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
 dpdk_libraries = []
+dpdk_drivers = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -56,6 +57,7 @@ subdir('config')
 
 # now build libs and drivers
 subdir('lib')
+subdir('drivers')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
@@ -63,6 +65,11 @@ configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
 
+# for static builds, include the drivers directly
+if get_option('default_library') == 'static'
+	dpdk_libraries = dpdk_drivers + dpdk_libraries
+endif
+
 # the DPDK libs needs to be passed to the link command in reverse order
 dpdk_link_libs = []
 foreach lib: dpdk_libraries
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 07/40] build: add pmdinfogen to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (5 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 06/40] build: add i40e driver to meson build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 08/40] build: generate list of sources for pmdinfogen Bruce Richardson
                   ` (34 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/meson.build            | 32 +++++++++++++++++++++++++++++
 buildtools/pmdinfogen/meson.build | 43 +++++++++++++++++++++++++++++++++++++++
 meson.build                       |  1 +
 3 files changed, 76 insertions(+)
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build

diff --git a/buildtools/meson.build b/buildtools/meson.build
new file mode 100644
index 000000000..92206f912
--- /dev/null
+++ b/buildtools/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('pmdinfogen')
diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
new file mode 100644
index 000000000..6b8a13baa
--- /dev/null
+++ b/buildtools/pmdinfogen/meson.build
@@ -0,0 +1,43 @@
+#   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.
+
+error_cflags = ['-Wno-maybe-uninitialized']
+cflags = []
+foreach arg: error_cflags
+	if cc.has_argument(arg)
+		cflags += arg
+	endif
+endforeach
+
+pmdinfogen = executable('pmdinfogen',
+	'pmdinfogen.c',
+	include_directories: eal_inc,
+	c_args: cflags)
diff --git a/meson.build b/meson.build
index 930656da6..54bb4632e 100644
--- a/meson.build
+++ b/meson.build
@@ -57,6 +57,7 @@ subdir('config')
 
 # now build libs and drivers
 subdir('lib')
+subdir('buildtools')
 subdir('drivers')
 
 # write the build config
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 08/40] build: generate list of sources for pmdinfogen
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (6 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 07/40] build: add pmdinfogen to build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 09/40] build: build i40e driver, including pmdinfo Bruce Richardson
                   ` (33 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/meson.build | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 1e23e0820..a6d0bf4e4 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -36,7 +36,7 @@ i40e_cflags = ['-DPF_DRIVER',
 
 subdir('base')
 
-sources = [
+sources = files(
 	'i40e_ethdev.c',
 	'i40e_rxtx.c',
 	'i40e_ethdev_vf.c',
@@ -45,12 +45,15 @@ sources = [
 	'i40e_flow.c',
 	'i40e_tm.c',
 	'rte_pmd_i40e.c'
-	]
+	)
 
 if arch_subdir == 'x86'
-	sources += 'i40e_rxtx_vec_sse.c'
+	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
+pmdinfogen_srcs = run_command('grep', '--files-with-matches', 'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+message(pmdinfogen_srcs)
+
 install_headers('rte_pmd_i40e.h')
 
 i40e_lib = library('rte_pmd_i40e', sources,
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 09/40] build: build i40e driver, including pmdinfo
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (7 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 08/40] build: generate list of sources for pmdinfogen Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 10/40] build: install usertools scripts Bruce Richardson
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/gen-pmdinfo-cfile.sh                | 45 ++++++++++++++++++++++++++
 buildtools/meson.build                         |  2 ++
 drivers/net/i40e/meson.build                   | 30 ++++++++++++-----
 lib/librte_cmdline/meson.build                 | 17 +++++-----
 lib/librte_eal/common/include/arch/meson.build |  1 +
 lib/librte_eal/common/include/meson.build      |  1 +
 lib/librte_eal/linuxapp/eal/meson.build        |  1 +
 lib/librte_eal/meson.build                     |  1 +
 lib/librte_ether/meson.build                   |  5 ++-
 lib/librte_hash/meson.build                    |  5 ++-
 lib/librte_kvargs/meson.build                  |  5 ++-
 lib/librte_mbuf/meson.build                    |  5 ++-
 lib/librte_mempool/meson.build                 |  5 ++-
 lib/librte_net/meson.build                     |  5 ++-
 lib/librte_ring/meson.build                    |  5 ++-
 lib/meson.build                                | 31 ++++++++++++------
 meson.build                                    | 13 +++-----
 17 files changed, 122 insertions(+), 55 deletions(-)
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
new file mode 100755
index 000000000..a042375a8
--- /dev/null
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+#   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.
+
+input=$1
+output=$2
+pmdinfogen=$3
+CFLAGS=$4
+build_root=$5
+
+tmp_o=${output%.c.pmd.o}.o
+tmp_c=${output%.o}.c
+
+set -x
+cc -Wfatal-errors $CFLAGS -I$build_root -include rte_config.h -c $input -o $tmp_o && \
+		$pmdinfogen $tmp_o $tmp_c && \
+		cc -c $tmp_c -o $output
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 92206f912..a08000be0 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -30,3 +30,5 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('pmdinfogen')
+
+pmdinfo = find_program('gen-pmdinfo-cfile.sh')
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index a6d0bf4e4..e1c3e17a9 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -47,21 +47,35 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
+deps = [rte_eal, rte_net,
+	rte_mbuf, rte_ether,
+	rte_mempool, rte_ring,
+	rte_hash, rte_kvargs]
+
 if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-pmdinfogen_srcs = run_command('grep', '--files-with-matches', 'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-message(pmdinfogen_srcs)
-
 install_headers('rte_pmd_i40e.h')
 
-i40e_lib = library('rte_pmd_i40e', sources,
+pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+objs = []
+foreach src: pmdinfogen_srcs
+	out_filename = '@0@.pmd.o'.format(src.split('/')[-1])
+	pmd_o_file = custom_target(out_filename,
+			command: [pmdinfo, '@INPUT@', '@OUTPUT@',
+			pmdinfogen.full_path(),
+			' '.join(dpdk_includes + i40e_cflags + ['-march=@0@'.format(machine)]),
+			meson.build_root()],
+			input: src, output: out_filename,
+			depends: pmdinfogen)
+	objs += pmd_o_file
+endforeach
+
+i40e_lib = library('rte_pmd_i40e', sources, objs,
 	include_directories: include_directories('base'),
-	dependencies: [rte_eal, rte_net,
-			rte_mbuf, rte_ether,
-			rte_mempool, rte_ring,
-			rte_hash, rte_kvargs],
+	dependencies: deps,
 	link_with: base_lib,
 	c_args: i40e_cflags,
 	install: true,
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
index ceac0a429..0b909b77e 100644
--- a/lib/librte_cmdline/meson.build
+++ b/lib/librte_cmdline/meson.build
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = [ 'cmdline.c',
+sources = files('cmdline.c',
 	'cmdline_cirbuf.c',
 	'cmdline_parse.c',
 	'cmdline_parse_etheraddr.c',
@@ -39,9 +39,9 @@ sources = [ 'cmdline.c',
 	'cmdline_parse_string.c',
 	'cmdline_rdline.c',
 	'cmdline_socket.c',
-	'cmdline_vt100.c']
+	'cmdline_vt100.c')
 
-install_headers('cmdline.h',
+headers = ['cmdline.h',
 	'cmdline_parse.h',
 	'cmdline_parse_num.h',
 	'cmdline_parse_ipaddr.h',
@@ -51,13 +51,12 @@ install_headers('cmdline.h',
 	'cmdline_vt100.h',
 	'cmdline_socket.h',
 	'cmdline_cirbuf.h',
-	'cmdline_parse_portlist.h')
+	'cmdline_parse_portlist.h']
 
-cmdline_lib = library('rte_cmdline', sources, dependencies: rte_eal,
+install_headers(headers)
+
+lib = library('rte_cmdline', sources, dependencies: rte_eal,
 		install: true)
-rte_cmdline = declare_dependency(link_with: cmdline_lib,
+rte_cmdline = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += cmdline_lib
-
-dpdk_conf.set('RTE_LIBRTE_CMDLINE', 1)
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
index 863d7e4bb..0bf3ee94d 100644
--- a/lib/librte_eal/common/include/arch/meson.build
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -30,4 +30,5 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories(arch_subdir)
+dpdk_includes += '-I@0@/@1@'.format(meson.current_source_dir(), arch_subdir)
 subdir(arch_subdir)
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
index e92c4eb7c..6d61c8003 100644
--- a/lib/librte_eal/common/include/meson.build
+++ b/lib/librte_eal/common/include/meson.build
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('.')
+dpdk_includes += '-I@0@'.format(meson.current_source_dir())
 
 common_headers = [
 	'rte_alarm.h',
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index 79fcff42f..f8547a8a4 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
+dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index 219501c86..dec6baedd 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -31,6 +31,7 @@
 
 eal_inc = [global_inc]
 subdir('common')
+
 if host_machine.system() == 'linux'
 	dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
 	subdir('linuxapp')
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
index 55eabd23a..e9ef496ad 100644
--- a/lib/librte_ether/meson.build
+++ b/lib/librte_ether/meson.build
@@ -40,10 +40,9 @@ install_headers('rte_ethdev.h',
 	'rte_flow.h',
 	'rte_flow_driver.h')
 
-ether_lib = library('rte_ether', sources,
+lib = library('rte_ether', sources,
 	dependencies: [rte_eal, rte_ring, rte_mempool, rte_net, rte_mbuf],
 	install: true)
-rte_ether = declare_dependency(link_with: ether_lib,
+rte_ether = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += ether_lib
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
index 6d8270b51..48d0ecf80 100644
--- a/lib/librte_hash/meson.build
+++ b/lib/librte_hash/meson.build
@@ -45,10 +45,9 @@ headers = ['rte_cmp_arm64.h',
 
 install_headers(headers)
 
-hash_lib = library('rte_hash', sources,
+lib = library('rte_hash', sources,
 	dependencies: [rte_eal, rte_ring, rte_compat],
 	install: true)
-rte_hash = declare_dependency(link_with: hash_lib,
+rte_hash = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += hash_lib
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
index 6cd5ab377..bc79d55e9 100644
--- a/lib/librte_kvargs/meson.build
+++ b/lib/librte_kvargs/meson.build
@@ -34,10 +34,9 @@ sources = ['rte_kvargs.c']
 
 install_headers('rte_kvargs.h')
 
-kvargs_lib = library('rte_kvargs', sources,
+lib = library('rte_kvargs', sources,
 	dependencies: rte_eal,
 	install: true)
-rte_kvargs = declare_dependency(link_with: kvargs_lib,
+rte_kvargs = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += kvargs_lib
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
index 7926e7236..0a302f464 100644
--- a/lib/librte_mbuf/meson.build
+++ b/lib/librte_mbuf/meson.build
@@ -33,10 +33,9 @@ sources = ['rte_mbuf.c', 'rte_mbuf_ptype.c']
 
 install_headers('rte_mbuf.h', 'rte_mbuf_ptype.h')
 
-mbuf_lib = library('rte_mbuf', sources,
+lib = library('rte_mbuf', sources,
 	dependencies: [rte_eal, rte_mempool, rte_ring],
 	install: true)
-rte_mbuf = declare_dependency(link_with: mbuf_lib,
+rte_mbuf = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += mbuf_lib
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
index 6da2403cc..15c5e6695 100644
--- a/lib/librte_mempool/meson.build
+++ b/lib/librte_mempool/meson.build
@@ -34,10 +34,9 @@ sources = ['rte_mempool.c', 'rte_mempool_ops.c']
 
 install_headers('rte_mempool.h')
 
-mempool_lib = library('rte_mempool', sources,
+lib = library('rte_mempool', sources,
 	dependencies: [rte_eal, rte_ring],
 	install: true)
-rte_mempool = declare_dependency(link_with: mempool_lib,
+rte_mempool = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += mempool_lib
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
index 7c8e323f6..f4df1691f 100644
--- a/lib/librte_net/meson.build
+++ b/lib/librte_net/meson.build
@@ -43,10 +43,9 @@ install_headers('rte_ip.h',
 	'rte_net.h',
 	'rte_net_crc.h')
 
-net_lib = library('rte_net', sources,
+lib = library('rte_net', sources,
 	dependencies: [rte_eal, rte_mbuf, rte_ring, rte_mempool],
 	install: true)
-rte_net = declare_dependency(link_with: net_lib,
+rte_net = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += net_lib
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
index 5832a7632..20e623e9d 100644
--- a/lib/librte_ring/meson.build
+++ b/lib/librte_ring/meson.build
@@ -34,10 +34,9 @@ sources = ['rte_ring.c']
 
 install_headers('rte_ring.h')
 
-ring_lib = library('rte_ring', sources,
+lib = library('rte_ring', sources,
 	dependencies: rte_eal,
 	install: true)
-rte_ring = declare_dependency(link_with: ring_lib,
+rte_ring = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += ring_lib
diff --git a/lib/meson.build b/lib/meson.build
index 0ea608684..0af9eb706 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -29,13 +29,26 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+# special case for eal, not a simple lib
 subdir('librte_eal')
-subdir('librte_ring')
-subdir('librte_mempool')
-subdir('librte_cmdline')
-subdir('librte_mbuf')
-subdir('librte_net')
-subdir('librte_ether')
-subdir('librte_compat')
-subdir('librte_hash')
-subdir('librte_kvargs')
+
+# process all libraries equally, as far as possible
+libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'compat', 'hash', 'kvargs']
+foreach l:libs
+
+	dpdk_conf.set('RTE_LIBRTE_@0@'.format(l.to_upper()),1)
+	subdir('librte_@0@'.format(l))
+	dpdk_libraries = [lib] + dpdk_libraries
+	dpdk_includes += '-I@0@/librte_@1@'.format(meson.current_source_dir(), l)
+
+endforeach
+
+#subdir('librte_ring')
+#subdir('librte_mempool')
+#subdir('librte_cmdline')
+#subdir('librte_mbuf')
+#subdir('librte_net')
+#subdir('librte_ether')
+#subdir('librte_compat')
+#subdir('librte_hash')
+#subdir('librte_kvargs')
diff --git a/meson.build b/meson.build
index 54bb4632e..a0ab08252 100644
--- a/meson.build
+++ b/meson.build
@@ -51,8 +51,11 @@ else
 endif
 
 # configure the build, and make sure configs here and in config folder are
-# able to be included in any file
+# able to be included in any file. We also store a global array of include dirs
+# for passing to pmdinfogen scripts
 global_inc = include_directories('.', 'config')
+dpdk_includes = ['-I@0@'.format(meson.current_source_dir()),
+		'-I@0@/config'.format(meson.current_source_dir())]
 subdir('config')
 
 # now build libs and drivers
@@ -71,16 +74,10 @@ if get_option('default_library') == 'static'
 	dpdk_libraries = dpdk_drivers + dpdk_libraries
 endif
 
-# the DPDK libs needs to be passed to the link command in reverse order
-dpdk_link_libs = []
-foreach lib: dpdk_libraries
-	dpdk_link_libs = [lib] + dpdk_link_libs
-endforeach
-
 pkg = import('pkgconfig')
 pkg.generate(name: meson.project_name(),
 	version: meson.project_version(),
-	libraries: dpdk_link_libs,
+	libraries: dpdk_libraries,
 	description: 'The Data Plane Development Kit (DPDK)',
 	extra_cflags: '-include "rte_config.h"'
 )
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 10/40] build: install usertools scripts
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (8 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 09/40] build: build i40e driver, including pmdinfo Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 11/40] build: simplify generation of pmd.c files Bruce Richardson
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build           |  1 +
 usertools/meson.build | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 usertools/meson.build

diff --git a/meson.build b/meson.build
index a0ab08252..717ec070d 100644
--- a/meson.build
+++ b/meson.build
@@ -62,6 +62,7 @@ subdir('config')
 subdir('lib')
 subdir('buildtools')
 subdir('drivers')
+subdir('usertools')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
diff --git a/usertools/meson.build b/usertools/meson.build
new file mode 100644
index 000000000..977cd8b58
--- /dev/null
+++ b/usertools/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+install_data(['dpdk-devbind.py', 'dpdk-pmdinfo.py'], install_dir: 'bin')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 11/40] build: simplify generation of pmd.c files
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (9 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 10/40] build: install usertools scripts Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 12/40] build: generalize net driver build to higher level Bruce Richardson
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

rather than using the compiler to generate a temporary .o file, get meson
to do it, so we don't need to track dpdk includes directly, and pass in a
range of parameters

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/gen-pmdinfo-cfile.sh                | 14 +++++---------
 drivers/net/i40e/meson.build                   | 21 ++++++++++-----------
 lib/librte_eal/bsdapp/eal/meson.build          |  1 -
 lib/librte_eal/common/include/arch/meson.build |  1 -
 lib/librte_eal/common/include/meson.build      |  1 -
 lib/librte_eal/linuxapp/eal/meson.build        |  1 -
 lib/meson.build                                |  3 ---
 meson.build                                    |  2 --
 8 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
index a042375a8..fe88e627e 100755
--- a/buildtools/gen-pmdinfo-cfile.sh
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -30,16 +30,12 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-input=$1
+
+arfile=$1
 output=$2
 pmdinfogen=$3
-CFLAGS=$4
-build_root=$5
 
-tmp_o=${output%.c.pmd.o}.o
-tmp_c=${output%.o}.c
+tmp_o=${output%.c.pmd.c}.tmp.o
 
-set -x
-cc -Wfatal-errors $CFLAGS -I$build_root -include rte_config.h -c $input -o $tmp_o && \
-		$pmdinfogen $tmp_o $tmp_c && \
-		cc -c $tmp_c -o $output
+ar p $arfile > $tmp_o && \
+		$pmdinfogen $tmp_o $output
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index e1c3e17a9..7d103868d 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -60,20 +60,19 @@ install_headers('rte_pmd_i40e.h')
 
 pmdinfogen_srcs = run_command('grep', '--files-with-matches',
 		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-objs = []
 foreach src: pmdinfogen_srcs
-	out_filename = '@0@.pmd.o'.format(src.split('/')[-1])
-	pmd_o_file = custom_target(out_filename,
-			command: [pmdinfo, '@INPUT@', '@OUTPUT@',
-			pmdinfogen.full_path(),
-			' '.join(dpdk_includes + i40e_cflags + ['-march=@0@'.format(machine)]),
-			meson.build_root()],
-			input: src, output: out_filename,
-			depends: pmdinfogen)
-	objs += pmd_o_file
+	out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+	tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+		src, include_directories: include_directories('base'),
+		dependencies: deps,
+		c_args: i40e_cflags)
+	sources += custom_target(out_filename,
+			command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
+			output: out_filename,
+			depends: [pmdinfogen, tmp_lib])
 endforeach
 
-i40e_lib = library('rte_pmd_i40e', sources, objs,
+i40e_lib = library('rte_pmd_i40e', sources,
 	include_directories: include_directories('base'),
 	dependencies: deps,
 	link_with: base_lib,
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 1df28d507..008a719b8 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
-dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
index 0bf3ee94d..863d7e4bb 100644
--- a/lib/librte_eal/common/include/arch/meson.build
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -30,5 +30,4 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories(arch_subdir)
-dpdk_includes += '-I@0@/@1@'.format(meson.current_source_dir(), arch_subdir)
 subdir(arch_subdir)
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
index 6d61c8003..e92c4eb7c 100644
--- a/lib/librte_eal/common/include/meson.build
+++ b/lib/librte_eal/common/include/meson.build
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('.')
-dpdk_includes += '-I@0@'.format(meson.current_source_dir())
 
 common_headers = [
 	'rte_alarm.h',
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index f8547a8a4..79fcff42f 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
-dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
diff --git a/lib/meson.build b/lib/meson.build
index 0af9eb706..d628fd0ff 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -35,12 +35,9 @@ subdir('librte_eal')
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'compat', 'hash', 'kvargs']
 foreach l:libs
-
 	dpdk_conf.set('RTE_LIBRTE_@0@'.format(l.to_upper()),1)
 	subdir('librte_@0@'.format(l))
 	dpdk_libraries = [lib] + dpdk_libraries
-	dpdk_includes += '-I@0@/librte_@1@'.format(meson.current_source_dir(), l)
-
 endforeach
 
 #subdir('librte_ring')
diff --git a/meson.build b/meson.build
index 717ec070d..daadf7235 100644
--- a/meson.build
+++ b/meson.build
@@ -54,8 +54,6 @@ endif
 # able to be included in any file. We also store a global array of include dirs
 # for passing to pmdinfogen scripts
 global_inc = include_directories('.', 'config')
-dpdk_includes = ['-I@0@'.format(meson.current_source_dir()),
-		'-I@0@/config'.format(meson.current_source_dir())]
 subdir('config')
 
 # now build libs and drivers
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 12/40] build: generalize net driver build to higher level
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (10 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 11/40] build: simplify generation of pmd.c files Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 13/40] build: remove hard-coded enablement of vector driver Bruce Richardson
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Move the logic for generating the pmdinfo file and the driver library
itself to the meson.build file at the driver/net level, to avoid
duplicating code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/base/meson.build |  2 +-
 drivers/net/i40e/meson.build      | 31 ++++---------------------
 drivers/net/meson.build           | 48 ++++++++++++++++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 29 deletions(-)

diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
index 43399cb11..69f55497e 100644
--- a/drivers/net/i40e/base/meson.build
+++ b/drivers/net/i40e/base/meson.build
@@ -43,7 +43,7 @@ error_cflags = ['-Wno-sign-compare',
 		'-Wno-unused-value',
 		'-Wno-format',
 		'-Wno-unused-but-set-variable']
-c_args = i40e_cflags
+c_args = cflags
 foreach flag: error_cflags
 	if cc.has_argument(flag)
 		c_args += flag
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 7d103868d..4652b8ac9 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -29,12 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-i40e_cflags = ['-DPF_DRIVER',
+cflags = ['-DPF_DRIVER',
 	'-DVF_DRIVER',
 	'-DINTEGRATED_VF',
 	'-DX722_A0_SUPPORT']
 
 subdir('base')
+libs = [base_lib]
 
 sources = files(
 	'i40e_ethdev.c',
@@ -56,31 +57,7 @@ if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-install_headers('rte_pmd_i40e.h')
-
-pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-foreach src: pmdinfogen_srcs
-	out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
-	tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-		src, include_directories: include_directories('base'),
-		dependencies: deps,
-		c_args: i40e_cflags)
-	sources += custom_target(out_filename,
-			command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
-			output: out_filename,
-			depends: [pmdinfogen, tmp_lib])
-endforeach
+includes = include_directories('base', '.')
 
-i40e_lib = library('rte_pmd_i40e', sources,
-	include_directories: include_directories('base'),
-	dependencies: deps,
-	link_with: base_lib,
-	c_args: i40e_cflags,
-	install: true,
-	install_dir: 'dpdk/drivers')
-
-dpdk_drivers += i40e_lib
+install_headers('rte_pmd_i40e.h')
 
-i40e_pmd = declare_dependency(link_with: i40e_lib,
-	include_directories: include_directories('.'))
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 22237b1aa..db242d71b 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,4 +29,50 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-subdir('i40e')
+drivers = ['i40e']
+
+foreach drv:drivers
+	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+
+	# set up empty variables used for build
+	sources = []
+	libs = []
+	cflags = []
+	deps = []
+	includes = []
+
+	# pull in driver directory which should assign to each of the above
+	subdir(drv)
+
+	# generate pmdinfo sources
+	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+	foreach src: pmdinfogen_srcs
+		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+			src, include_directories: includes,
+			dependencies: deps,
+			c_args: cflags)
+		sources += custom_target(out_filename,
+				command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
+				output: out_filename,
+				depends: [pmdinfogen, tmp_lib])
+	endforeach
+
+	# now build the driver itself, and add to the drivers list
+	lib = library('rte_pmd_@0@'.format(drv), sources,
+		include_directories: includes,
+		dependencies: deps,
+		link_with: libs,
+		c_args: cflags,
+		install: true,
+		install_dir: driver_install_path)
+
+	dpdk_drivers += lib
+
+	# create a dependency object and add it to the global dictionary so
+	# testpmd or other built-in apps can find it if necessary
+	set_variable('dep_pmd_@0@'.format(drv),
+			declare_dependency(link_with: lib,
+			include_directories: includes))
+endforeach
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 13/40] build: remove hard-coded enablement of vector driver
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (11 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 12/40] build: generalize net driver build to higher level Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 14/40] build: add ixgbe driver to build Bruce Richardson
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h          | 1 -
 drivers/net/i40e/meson.build | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/rte_config.h b/config/rte_config.h
index 5b687bb8e..67028f682 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -76,7 +76,6 @@
 
 /* i40e defines */
 #define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1
-#define RTE_LIBRTE_I40E_INC_VECTOR 1
 #undef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF 64
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 4652b8ac9..ea7f73d8e 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -54,6 +54,7 @@ deps = [rte_eal, rte_net,
 	rte_hash, rte_kvargs]
 
 if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 14/40] build: add ixgbe driver to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (12 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 13/40] build: remove hard-coded enablement of vector driver Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 15/40] build: set up standard deps for drivers Bruce Richardson
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ixgbe/base/meson.build | 59 ++++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/meson.build      | 61 ++++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build            |  5 ++--
 3 files changed, 123 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build

diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
new file mode 100644
index 000000000..d5fb435e4
--- /dev/null
+++ b/drivers/net/ixgbe/base/meson.build
@@ -0,0 +1,59 @@
+#   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.
+
+sources = [
+	'ixgbe_82598.c',
+	'ixgbe_82599.c',
+	'ixgbe_api.c',
+	'ixgbe_common.c',
+	'ixgbe_dcb_82598.c',
+	'ixgbe_dcb_82599.c',
+	'ixgbe_dcb.c',
+	'ixgbe_hv_vf.c',
+	'ixgbe_mbx.c',
+	'ixgbe_phy.c',
+	'ixgbe_vf.c',
+	'ixgbe_x540.c',
+	'ixgbe_x550.c'
+]
+
+error_cflags = ['-Wno-unused-value',
+		'-Wno-unused-but-set-variable']
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('ixgbe_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
new file mode 100644
index 000000000..b1efd96be
--- /dev/null
+++ b/drivers/net/ixgbe/meson.build
@@ -0,0 +1,61 @@
+#   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.
+
+cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
+
+subdir('base')
+libs = [base_lib]
+
+sources = files(
+	'ixgbe_82599_bypass.c',
+	'ixgbe_bypass.c',
+	'ixgbe_ethdev.c',
+	'ixgbe_fdir.c',
+	'ixgbe_flow.c',
+	'ixgbe_pf.c',
+	'ixgbe_rxtx.c',
+	'ixgbe_tm.c',
+	'rte_pmd_ixgbe.c'
+)
+
+deps = [rte_eal, rte_net,
+	rte_mbuf, rte_ether,
+	rte_mempool, rte_ring,
+	rte_hash, rte_kvargs]
+
+if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1)
+	sources += files('ixgbe_rxtx_vec_sse.c')
+endif
+
+includes = include_directories('base', '.')
+
+install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index db242d71b..eccdc83d7 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-drivers = ['i40e']
+drivers = ['i40e', 'ixgbe']
 
 foreach drv:drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
@@ -60,7 +60,8 @@ foreach drv:drivers
 	endforeach
 
 	# now build the driver itself, and add to the drivers list
-	lib = library('rte_pmd_@0@'.format(drv), sources,
+	lib = library('rte_pmd_@0@'.format(drv),
+		sources,
 		include_directories: includes,
 		dependencies: deps,
 		link_with: libs,
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 15/40] build: set up standard deps for drivers
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (13 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 14/40] build: add ixgbe driver to build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 16/40] build: add af_packet driver to build Bruce Richardson
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Driver should not need to specify that they depend on EAL, mempool, mbuf
etc., since all drivers are likely to depend on those. Instead, have it
that drivers only need to append to the deps array any extra dependencies
they have.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/meson.build  | 7 ++-----
 drivers/net/ixgbe/meson.build | 7 ++-----
 drivers/net/meson.build       | 4 +++-
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index ea7f73d8e..3786af1ed 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -48,17 +48,14 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
-deps = [rte_eal, rte_net,
-	rte_mbuf, rte_ether,
-	rte_mempool, rte_ring,
-	rte_hash, rte_kvargs]
+deps += rte_hash
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base', '.')
+includes = include_directories('base')
 
 install_headers('rte_pmd_i40e.h')
 
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index b1efd96be..65c215271 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -46,16 +46,13 @@ sources = files(
 	'rte_pmd_ixgbe.c'
 )
 
-deps = [rte_eal, rte_net,
-	rte_mbuf, rte_ether,
-	rte_mempool, rte_ring,
-	rte_hash, rte_kvargs]
+deps += rte_hash
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1)
 	sources += files('ixgbe_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base', '.')
+includes = include_directories('base')
 
 install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index eccdc83d7..c1728e700 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -38,8 +38,10 @@ foreach drv:drivers
 	sources = []
 	libs = []
 	cflags = []
-	deps = []
 	includes = []
+	# set up standard deps. Drivers can append/override as necessary
+	deps = [rte_eal, rte_net, rte_mbuf, rte_ether,
+		rte_mempool, rte_ring, rte_kvargs]
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 16/40] build: add af_packet driver to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (14 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 15/40] build: set up standard deps for drivers Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 17/40] build: add pcap PMD support Bruce Richardson
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/af_packet/meson.build | 32 ++++++++++++++++++++++++++++++++
 drivers/net/meson.build           |  5 +++++
 2 files changed, 37 insertions(+)
 create mode 100644 drivers/net/af_packet/meson.build

diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
new file mode 100644
index 000000000..56ba22e73
--- /dev/null
+++ b/drivers/net/af_packet/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+sources = files('rte_eth_af_packet.c')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index c1728e700..df78c26d7 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -31,6 +31,11 @@
 
 drivers = ['i40e', 'ixgbe']
 
+# af_packet only works on linux
+if host_machine.system() == 'linux'
+	drivers += 'af_packet'
+endif
+
 foreach drv:drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 17/40] build: add pcap PMD support
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (15 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 16/40] build: add af_packet driver to build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 18/40] build: add symbol version map file support to libs Bruce Richardson
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/meson.build      | 13 ++++++++++---
 drivers/net/pcap/meson.build | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/pcap/meson.build

diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index df78c26d7..f64ab07f7 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,14 +29,21 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-drivers = ['i40e', 'ixgbe']
+net_drivers = ['i40e', 'ixgbe']
 
 # af_packet only works on linux
 if host_machine.system() == 'linux'
-	drivers += 'af_packet'
+	net_drivers += 'af_packet'
 endif
 
-foreach drv:drivers
+pcap_dep = dependency('pcap', required: false)
+# pcap doesn't use pkg-config, but future meson versions should support picking
+# it up as a dependency. For older versions <0.42 use find_program instead
+if pcap_dep.found() or find_program('pcap-config', required: false).found()
+	net_drivers += 'pcap'
+endif
+
+foreach drv:net_drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
 	# set up empty variables used for build
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
new file mode 100644
index 000000000..015f6bfeb
--- /dev/null
+++ b/drivers/net/pcap/meson.build
@@ -0,0 +1,38 @@
+#   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.
+
+sources = files('rte_eth_pcap.c')
+
+if pcap_dep.found()
+	deps += pcap_dep
+else
+	deps += cc.find_library('pcap')
+endif
\ No newline at end of file
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 18/40] build: add symbol version map file support to libs
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (16 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 17/40] build: add pcap PMD support Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 19/40] build: build libraries in a loop for brevity Bruce Richardson
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index f64ab07f7..2358194e0 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -74,12 +74,17 @@ foreach drv:net_drivers
 	endforeach
 
 	# now build the driver itself, and add to the drivers list
-	lib = library('rte_pmd_@0@'.format(drv),
+	drv_name = 'rte_pmd_@0@'.format(drv)
+	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+			meson.current_source_dir(), drv)
+	lib = library(drv_name,
 		sources,
 		include_directories: includes,
 		dependencies: deps,
 		link_with: libs,
 		c_args: cflags,
+		link_args: '-Wl,--version-script=' + version_map,
+		link_depends: version_map,
 		install: true,
 		install_dir: driver_install_path)
 
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 19/40] build: build libraries in a loop for brevity
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (17 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 18/40] build: add symbol version map file support to libs Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 20/40] build: version library .so files Bruce Richardson
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

now each library just has to specify it's source files, header files and
dependencies, and the higher level lib directory will take care of the
rest. Special case for eal, which is not just in one subdir, and is more
complicated. It is also used sometimes by e.g. base code drivers, so give
it it's own shortcut dependency in case needed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/i40e/meson.build            |  2 +-
 drivers/net/ixgbe/meson.build           |  2 +-
 drivers/net/meson.build                 | 19 +++++++++++----
 drivers/net/pcap/meson.build            |  6 ++---
 lib/librte_cmdline/meson.build          | 12 +++-------
 lib/librte_compat/meson.build           |  3 ++-
 lib/librte_eal/bsdapp/eal/meson.build   |  1 +
 lib/librte_eal/linuxapp/eal/meson.build |  1 +
 lib/librte_ether/meson.build            | 13 ++++------
 lib/librte_hash/meson.build             | 16 ++++---------
 lib/librte_kvargs/meson.build           | 13 +++-------
 lib/librte_mbuf/meson.build             | 12 +++-------
 lib/librte_mempool/meson.build          | 12 +++-------
 lib/librte_net/meson.build              | 12 +++-------
 lib/librte_ring/meson.build             | 14 +++--------
 lib/meson.build                         | 42 +++++++++++++++++++++++----------
 16 files changed, 79 insertions(+), 101 deletions(-)

diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 3786af1ed..3139fb001 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -48,7 +48,7 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
-deps += rte_hash
+deps += ['hash']
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 65c215271..1ea60b0e2 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -46,7 +46,7 @@ sources = files(
 	'rte_pmd_ixgbe.c'
 )
 
-deps += rte_hash
+deps += ['hash']
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1)
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 2358194e0..cd2328605 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -51,13 +51,21 @@ foreach drv:net_drivers
 	libs = []
 	cflags = []
 	includes = []
+	# dependency managment. External deps managed using dependency
+	# objects, internal deps managed by name of lib
+	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = [rte_eal, rte_net, rte_mbuf, rte_ether,
-		rte_mempool, rte_ring, rte_kvargs]
+	deps = ['eal', 'net', 'mbuf', 'ether', 'mempool', 'ring', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
+	# get dependency objs from strings
+	dep_objs = ext_deps
+	foreach d:deps
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
 	# generate pmdinfo sources
 	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
 		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
@@ -65,10 +73,11 @@ foreach drv:net_drivers
 		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
 		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
 			src, include_directories: includes,
-			dependencies: deps,
+			dependencies: dep_objs,
 			c_args: cflags)
 		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
+				command: [pmdinfo, tmp_lib.full_path(),
+					'@OUTPUT@', pmdinfogen],
 				output: out_filename,
 				depends: [pmdinfogen, tmp_lib])
 	endforeach
@@ -80,7 +89,7 @@ foreach drv:net_drivers
 	lib = library(drv_name,
 		sources,
 		include_directories: includes,
-		dependencies: deps,
+		dependencies: dep_objs,
 		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
index 015f6bfeb..a61668236 100644
--- a/drivers/net/pcap/meson.build
+++ b/drivers/net/pcap/meson.build
@@ -32,7 +32,7 @@
 sources = files('rte_eth_pcap.c')
 
 if pcap_dep.found()
-	deps += pcap_dep
+	ext_deps += pcap_dep
 else
-	deps += cc.find_library('pcap')
-endif
\ No newline at end of file
+	ext_deps += cc.find_library('pcap')
+endif
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
index 0b909b77e..ed24b0b0e 100644
--- a/lib/librte_cmdline/meson.build
+++ b/lib/librte_cmdline/meson.build
@@ -41,7 +41,7 @@ sources = files('cmdline.c',
 	'cmdline_socket.c',
 	'cmdline_vt100.c')
 
-headers = ['cmdline.h',
+headers = files('cmdline.h',
 	'cmdline_parse.h',
 	'cmdline_parse_num.h',
 	'cmdline_parse_ipaddr.h',
@@ -51,12 +51,6 @@ headers = ['cmdline.h',
 	'cmdline_vt100.h',
 	'cmdline_socket.h',
 	'cmdline_cirbuf.h',
-	'cmdline_parse_portlist.h']
-
-install_headers(headers)
-
-lib = library('rte_cmdline', sources, dependencies: rte_eal,
-		install: true)
-rte_cmdline = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+	'cmdline_parse_portlist.h')
 
+deps = ['eal']
diff --git a/lib/librte_compat/meson.build b/lib/librte_compat/meson.build
index d4a994523..6773e2203 100644
--- a/lib/librte_compat/meson.build
+++ b/lib/librte_compat/meson.build
@@ -32,4 +32,5 @@
 
 install_headers('rte_compat.h')
 
-rte_compat = declare_dependency(include_directories: include_directories('.'))
+set_variable('dep_rte_compat',
+	declare_dependency(include_directories: include_directories('.')))
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 008a719b8..ff2c2fee8 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -55,3 +55,4 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 dpdk_libraries += ['-pthread', eal_lib]
 
 rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index 79fcff42f..d290ae65e 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -60,3 +60,4 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 dpdk_libraries += ['-pthread', '-ldl', eal_lib]
 
 rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
index e9ef496ad..1c1f69802 100644
--- a/lib/librte_ether/meson.build
+++ b/lib/librte_ether/meson.build
@@ -30,19 +30,16 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_ethdev.c', 'rte_flow.c']
+sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
 
-install_headers('rte_ethdev.h',
+headers = files('rte_ethdev.h',
 	'rte_ethdev_pci.h',
 	'rte_ethdev_vdev.h',
 	'rte_eth_ctrl.h',
 	'rte_dev_info.h',
 	'rte_flow.h',
-	'rte_flow_driver.h')
+	'rte_flow_driver.h',
+	'rte_tm.h')
 
-lib = library('rte_ether', sources,
-	dependencies: [rte_eal, rte_ring, rte_mempool, rte_net, rte_mbuf],
-	install: true)
-rte_ether = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+deps = ['eal', 'ring', 'mempool', 'net', 'mbuf']
 
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
index 48d0ecf80..2a0d21520 100644
--- a/lib/librte_hash/meson.build
+++ b/lib/librte_hash/meson.build
@@ -29,10 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_cuckoo_hash.c', 'rte_fbk_hash.c']
-
-headers = ['rte_cmp_arm64.h',
+headers = files('rte_cmp_arm64.h',
 	'rte_cmp_x86.h',
 	'rte_crc_arm64.h',
 	'rte_cuckoo_hash.h',
@@ -41,13 +38,8 @@ headers = ['rte_cmp_arm64.h',
 	'rte_hash_crc.h',
 	'rte_hash.h',
 	'rte_jhash.h',
-	'rte_thash.h']
-
-install_headers(headers)
+	'rte_thash.h')
 
-lib = library('rte_hash', sources,
-	dependencies: [rte_eal, rte_ring, rte_compat],
-	install: true)
-rte_hash = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')
+deps = ['eal', 'ring', 'compat']
 
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
index bc79d55e9..f70c3970c 100644
--- a/lib/librte_kvargs/meson.build
+++ b/lib/librte_kvargs/meson.build
@@ -30,13 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_kvargs.c']
-
-install_headers('rte_kvargs.h')
-
-lib = library('rte_kvargs', sources,
-	dependencies: rte_eal,
-	install: true)
-rte_kvargs = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
-
+sources = files('rte_kvargs.c')
+headers = files('rte_kvargs.h')
+deps = ['eal']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
index 0a302f464..8235a2b28 100644
--- a/lib/librte_mbuf/meson.build
+++ b/lib/librte_mbuf/meson.build
@@ -29,13 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = ['rte_mbuf.c', 'rte_mbuf_ptype.c']
-
-install_headers('rte_mbuf.h', 'rte_mbuf_ptype.h')
-
-lib = library('rte_mbuf', sources,
-	dependencies: [rte_eal, rte_mempool, rte_ring],
-	install: true)
-rte_mbuf = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
+headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
+deps = ['eal', 'mempool', 'ring']
 
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
index 15c5e6695..1de47a6c9 100644
--- a/lib/librte_mempool/meson.build
+++ b/lib/librte_mempool/meson.build
@@ -30,13 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_mempool.c', 'rte_mempool_ops.c']
-
-install_headers('rte_mempool.h')
-
-lib = library('rte_mempool', sources,
-	dependencies: [rte_eal, rte_ring],
-	install: true)
-rte_mempool = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_mempool.c', 'rte_mempool_ops.c')
+headers = files('rte_mempool.h')
+deps = ['eal', 'ring']
 
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
index f4df1691f..493139d8c 100644
--- a/lib/librte_net/meson.build
+++ b/lib/librte_net/meson.build
@@ -29,10 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_net.c', 'rte_net_crc.c']
-
-install_headers('rte_ip.h',
+headers = files('rte_ip.h',
 	'rte_tcp.h',
 	'rte_udp.h',
 	'rte_sctp.h',
@@ -43,9 +40,6 @@ install_headers('rte_ip.h',
 	'rte_net.h',
 	'rte_net_crc.h')
 
-lib = library('rte_net', sources,
-	dependencies: [rte_eal, rte_mbuf, rte_ring, rte_mempool],
-	install: true)
-rte_net = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_net.c', 'rte_net_crc.c')
+deps = ['eal', 'mbuf', 'ring', 'mempool']
 
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
index 20e623e9d..e36977f4e 100644
--- a/lib/librte_ring/meson.build
+++ b/lib/librte_ring/meson.build
@@ -29,14 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_ring.c']
-
-install_headers('rte_ring.h')
-
-lib = library('rte_ring', sources,
-	dependencies: rte_eal,
-	install: true)
-rte_ring = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
-
+sources = files('rte_ring.c')
+headers = files('rte_ring.h')
+deps = ['eal']
diff --git a/lib/meson.build b/lib/meson.build
index d628fd0ff..a6b820661 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -29,23 +29,39 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# special case for eal, not a simple lib
+# special case for eal, not a simple lib, and compat, just a header
 subdir('librte_eal')
+subdir('librte_compat')
 
 # process all libraries equally, as far as possible
-libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'compat', 'hash', 'kvargs']
+libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash', 'kvargs']
+
 foreach l:libs
-	dpdk_conf.set('RTE_LIBRTE_@0@'.format(l.to_upper()),1)
-	subdir('librte_@0@'.format(l))
+	sources = []
+	headers = []
+	# use "deps" for internal DPDK dependencies, and "ext_deps" for
+	# external package/library requirements
+	deps = []
+	ext_deps = []
+
+	dpdk_conf.set('RTE_LIBRTE_' + l.to_upper(), 1)
+	dir_name = 'librte_' + l
+	subdir(dir_name)
+
+	install_headers(headers)
+
+	dep_objs = []
+	foreach d:deps
+		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
+	lib = library('rte_' + l, sources, dependencies: dep_objs,
+			include_directories: include_directories(dir_name),
+			install: true)
+	dep = declare_dependency(link_with: lib,
+			include_directories: include_directories(dir_name))
+	set_variable('dep_rte_' + l, dep)
+
 	dpdk_libraries = [lib] + dpdk_libraries
 endforeach
 
-#subdir('librte_ring')
-#subdir('librte_mempool')
-#subdir('librte_cmdline')
-#subdir('librte_mbuf')
-#subdir('librte_net')
-#subdir('librte_ether')
-#subdir('librte_compat')
-#subdir('librte_hash')
-#subdir('librte_kvargs')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 20/40] build: version library .so files
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (18 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 19/40] build: build libraries in a loop for brevity Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 21/40] eal: add version information to meson build Bruce Richardson
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Also rename the ether library to ethdev to maintain backwards compatibility

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/meson.build        |  2 ++
 lib/librte_cmdline/meson.build |  1 +
 lib/librte_ether/meson.build   |  1 +
 lib/librte_hash/meson.build    |  1 +
 lib/librte_kvargs/meson.build  |  2 +-
 lib/librte_mbuf/meson.build    |  1 +
 lib/librte_mempool/meson.build |  2 +-
 lib/librte_net/meson.build     |  1 +
 lib/meson.build                | 14 +++++++++++++-
 9 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index cd2328605..6b9177c05 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -47,6 +47,7 @@ foreach drv:net_drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
 	# set up empty variables used for build
+	version = 1
 	sources = []
 	libs = []
 	cflags = []
@@ -94,6 +95,7 @@ foreach drv:net_drivers
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
+		version: '@0@.1'.format(version),
 		install: true,
 		install_dir: driver_install_path)
 
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
index ed24b0b0e..c773f38c5 100644
--- a/lib/librte_cmdline/meson.build
+++ b/lib/librte_cmdline/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 2
 sources = files('cmdline.c',
 	'cmdline_cirbuf.c',
 	'cmdline_parse.c',
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
index 1c1f69802..ed9c29a78 100644
--- a/lib/librte_ether/meson.build
+++ b/lib/librte_ether/meson.build
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
+version = 6
 sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
 
 headers = files('rte_ethdev.h',
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
index 2a0d21520..e3fb9fe0d 100644
--- a/lib/librte_hash/meson.build
+++ b/lib/librte_hash/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 2
 headers = files('rte_cmp_arm64.h',
 	'rte_cmp_x86.h',
 	'rte_crc_arm64.h',
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
index f70c3970c..30599d06e 100644
--- a/lib/librte_kvargs/meson.build
+++ b/lib/librte_kvargs/meson.build
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
+version = 1
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
 deps = ['eal']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
index 8235a2b28..19cd68528 100644
--- a/lib/librte_mbuf/meson.build
+++ b/lib/librte_mbuf/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 3
 sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
 headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
 deps = ['eal', 'mempool', 'ring']
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
index 1de47a6c9..9617010dd 100644
--- a/lib/librte_mempool/meson.build
+++ b/lib/librte_mempool/meson.build
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
+version = 2
 sources = files('rte_mempool.c', 'rte_mempool_ops.c')
 headers = files('rte_mempool.h')
 deps = ['eal', 'ring']
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
index 493139d8c..0bfe53873 100644
--- a/lib/librte_net/meson.build
+++ b/lib/librte_net/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 1
 headers = files('rte_ip.h',
 	'rte_tcp.h',
 	'rte_udp.h',
diff --git a/lib/meson.build b/lib/meson.build
index a6b820661..55018173b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -37,6 +37,7 @@ subdir('librte_compat')
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash', 'kvargs']
 
 foreach l:libs
+	version = 1
 	sources = []
 	headers = []
 	# use "deps" for internal DPDK dependencies, and "ext_deps" for
@@ -55,8 +56,19 @@ foreach l:libs
 		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
-	lib = library('rte_' + l, sources, dependencies: dep_objs,
+	version_map = '@0@/@1@/rte_@2@_version.map'.format(
+			meson.current_source_dir(), dir_name, l)
+	libname = 'rte_' + l
+	if libname == 'rte_ether'
+		libname = 'rte_ethdev'
+	endif
+	lib = library(libname,
+			sources,
+			dependencies: dep_objs,
 			include_directories: include_directories(dir_name),
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@0@.1'.format(version),
 			install: true)
 	dep = declare_dependency(link_with: lib,
 			include_directories: include_directories(dir_name))
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 21/40] eal: add version information to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (19 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 20/40] build: version library .so files Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 22/40] build: add mempool drivers to build Bruce Richardson
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/bsdapp/eal/meson.build   | 6 +++++-
 lib/librte_eal/linuxapp/eal/meson.build | 6 +++++-
 lib/librte_eal/meson.build              | 1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index ff2c2fee8..6c5f5e93d 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -44,11 +44,15 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
 			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
 			c_args: '-D_GNU_SOURCE',
-			link_args: '-lexecinfo',
+			link_depends: version_map,
+			link_args: ['-lexecinfo',
+				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index d290ae65e..57bb5d52d 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -49,11 +49,15 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
 			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
 			c_args: '-D_GNU_SOURCE',
-			link_args: '-ldl',
+			link_depends: version_map,
+			link_args: ['-ldl',
+				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index dec6baedd..1b2556121 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 4  # the version of the EAL API
 eal_inc = [global_inc]
 subdir('common')
 
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 22/40] build: add mempool drivers to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (20 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 21/40] eal: add version information to meson build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 23/40] build: add gro library to meson build Bruce Richardson
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build       | 97 +++++++++++++++++++++++++++++++++++++++
 drivers/mempool/ring/meson.build  | 32 +++++++++++++
 drivers/mempool/stack/meson.build | 32 +++++++++++++
 drivers/meson.build               |  1 +
 4 files changed, 162 insertions(+)
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
new file mode 100644
index 000000000..869e75cb7
--- /dev/null
+++ b/drivers/mempool/meson.build
@@ -0,0 +1,97 @@
+#   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.
+
+mempool_drivers = ['ring', 'stack']
+
+foreach drv:mempool_drivers
+	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+
+	# set up empty variables used for build
+	version = 1
+	sources = []
+	libs = []
+	cflags = []
+	includes = []
+	# dependency managment. External deps managed using dependency
+	# objects, internal deps managed by name of lib
+	ext_deps = []
+	# set up standard deps. Drivers can append/override as necessary
+	deps = ['eal', 'mempool', 'ring']
+
+	# pull in driver directory which should assign to each of the above
+	subdir(drv)
+
+	# get dependency objs from strings
+	dep_objs = ext_deps
+	foreach d:deps
+		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
+	# generate pmdinfo sources
+	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+	foreach src: pmdinfogen_srcs
+		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+			src, include_directories: includes,
+			dependencies: dep_objs,
+			c_args: cflags)
+		sources += custom_target(out_filename,
+				command: [pmdinfo, tmp_lib.full_path(),
+					'@OUTPUT@', pmdinfogen],
+				output: out_filename,
+				depends: [pmdinfogen, tmp_lib])
+	endforeach
+
+	# now build the driver itself, and add to the drivers list
+	drv_name = 'rte_mempool_@0@'.format(drv)
+	version_map = '@0@/@1@/rte_mempool_@1@_version.map'.format(
+			meson.current_source_dir(), drv)
+	lib = library(drv_name,
+		sources,
+		include_directories: includes,
+		dependencies: dep_objs,
+		link_with: libs,
+		c_args: cflags,
+		link_args: '-Wl,--version-script=' + version_map,
+		link_depends: version_map,
+		version: '@0@.1'.format(version),
+		install: true,
+		install_dir: driver_install_path)
+
+	dpdk_drivers += lib
+
+	# create a dependency object and add it to the global dictionary so
+	# testpmd or other built-in apps can find it if necessary
+	set_variable('dep_pmd_@0@'.format(drv),
+			declare_dependency(link_with: lib,
+			include_directories: includes))
+endforeach
diff --git a/drivers/mempool/ring/meson.build b/drivers/mempool/ring/meson.build
new file mode 100644
index 000000000..72e104315
--- /dev/null
+++ b/drivers/mempool/ring/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+sources = files('rte_mempool_ring.c')
diff --git a/drivers/mempool/stack/meson.build b/drivers/mempool/stack/meson.build
new file mode 100644
index 000000000..84856a387
--- /dev/null
+++ b/drivers/mempool/stack/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+sources = files('rte_mempool_stack.c')
diff --git a/drivers/meson.build b/drivers/meson.build
index 57f47c36f..f8ad7d0e2 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -30,3 +30,4 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('net')
+subdir('mempool')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 23/40] build: add gro library to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (21 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 22/40] build: add mempool drivers to build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 24/40] build: tweak naming of pmd dependencies Bruce Richardson
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_gro/meson.build | 34 ++++++++++++++++++++++++++++++++++
 lib/meson.build            |  3 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_gro/meson.build

diff --git a/lib/librte_gro/meson.build b/lib/librte_gro/meson.build
new file mode 100644
index 000000000..3949575b7
--- /dev/null
+++ b/lib/librte_gro/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_gro.c', 'gro_tcp4.c')
+headers = files('rte_gro.h')
+deps = ['eal', 'mbuf', 'ether', 'net', 'mempool', 'ring']
diff --git a/lib/meson.build b/lib/meson.build
index 55018173b..ce74c609b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -34,7 +34,8 @@ subdir('librte_eal')
 subdir('librte_compat')
 
 # process all libraries equally, as far as possible
-libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash', 'kvargs']
+libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
+	'kvargs', 'gro']
 
 foreach l:libs
 	version = 1
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 24/40] build: tweak naming of pmd dependencies
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (22 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 23/40] build: add gro library to meson build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 25/40] build: track driver include directories properly Bruce Richardson
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build | 2 +-
 drivers/net/meson.build     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index 869e75cb7..1d003b757 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -91,7 +91,7 @@ foreach drv:mempool_drivers
 
 	# create a dependency object and add it to the global dictionary so
 	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_pmd_@0@'.format(drv),
+	set_variable('dep_rte_mempool_@0@'.format(drv),
 			declare_dependency(link_with: lib,
 			include_directories: includes))
 endforeach
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 6b9177c05..07f3f7969 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -103,7 +103,7 @@ foreach drv:net_drivers
 
 	# create a dependency object and add it to the global dictionary so
 	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_pmd_@0@'.format(drv),
+	set_variable('dep_rte_pmd_@0@'.format(drv),
 			declare_dependency(link_with: lib,
 			include_directories: includes))
 endforeach
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 25/40] build: track driver include directories properly
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (23 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 24/40] build: tweak naming of pmd dependencies Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 26/40] metrics: add metrics lib to meson build Bruce Richardson
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build   | 2 +-
 drivers/net/i40e/meson.build  | 2 +-
 drivers/net/ixgbe/meson.build | 2 +-
 drivers/net/meson.build       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index 1d003b757..daaabc5b6 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -39,7 +39,7 @@ foreach drv:mempool_drivers
 	sources = []
 	libs = []
 	cflags = []
-	includes = []
+	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index 3139fb001..dcc832b6f 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -55,7 +55,7 @@ if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base')
+includes += include_directories('base')
 
 install_headers('rte_pmd_i40e.h')
 
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 1ea60b0e2..3e164f97f 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -53,6 +53,6 @@ if arch_subdir == 'x86'
 	sources += files('ixgbe_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base')
+includes += include_directories('base')
 
 install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 07f3f7969..3e587d809 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -51,7 +51,7 @@ foreach drv:net_drivers
 	sources = []
 	libs = []
 	cflags = []
-	includes = []
+	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 26/40] metrics: add metrics lib to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (24 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 25/40] build: track driver include directories properly Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 27/40] build: track dependencies recursively Bruce Richardson
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_metrics/meson.build | 34 ++++++++++++++++++++++++++++++++++
 lib/meson.build                |  2 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_metrics/meson.build

diff --git a/lib/librte_metrics/meson.build b/lib/librte_metrics/meson.build
new file mode 100644
index 000000000..3b67fff56
--- /dev/null
+++ b/lib/librte_metrics/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_metrics.c')
+headers = files('rte_metrics.h')
+deps = ['eal']
diff --git a/lib/meson.build b/lib/meson.build
index ce74c609b..0caf7bc75 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -35,7 +35,7 @@ subdir('librte_compat')
 
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro']
+	'kvargs', 'gro', 'metrics']
 
 foreach l:libs
 	version = 1
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 27/40] build: track dependencies recursively
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (25 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 26/40] metrics: add metrics lib to meson build Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 28/40] testpmd: compile testpmd with meson and ninja Bruce Richardson
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build             | 3 ++-
 drivers/net/meson.build                 | 6 ++++--
 lib/librte_eal/bsdapp/eal/meson.build   | 5 ++++-
 lib/librte_eal/linuxapp/eal/meson.build | 5 ++++-
 lib/meson.build                         | 3 ++-
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index daaabc5b6..d998797ca 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -93,5 +93,6 @@ foreach drv:mempool_drivers
 	# testpmd or other built-in apps can find it if necessary
 	set_variable('dep_rte_mempool_@0@'.format(drv),
 			declare_dependency(link_with: lib,
-			include_directories: includes))
+			include_directories: includes,
+			dependencies: dep_objs))
 endforeach
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 3e587d809..00ee65988 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -56,7 +56,8 @@ foreach drv:net_drivers
 	# objects, internal deps managed by name of lib
 	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = ['eal', 'net', 'mbuf', 'ether', 'mempool', 'ring', 'kvargs']
+	# 'ether' as dep, also pulls in mbuf, net, mempool, ring, eal etc
+	deps = ['ether', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
@@ -105,5 +106,6 @@ foreach drv:net_drivers
 	# testpmd or other built-in apps can find it if necessary
 	set_variable('dep_rte_pmd_@0@'.format(drv),
 			declare_dependency(link_with: lib,
-			include_directories: includes))
+			include_directories: includes,
+			dependencies: dep_objs))
 endforeach
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 6c5f5e93d..86a9e3d14 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -58,5 +58,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 
 dpdk_libraries += ['-pthread', eal_lib]
 
-rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'),
+		link_args: '-lexecinfo')
 set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index 57bb5d52d..90ecfc394 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -63,5 +63,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 
 dpdk_libraries += ['-pthread', '-ldl', eal_lib]
 
-rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'),
+		link_args: '-ldl')
 set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/meson.build b/lib/meson.build
index 0caf7bc75..e0c9c3c81 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -72,7 +72,8 @@ foreach l:libs
 			version: '@0@.1'.format(version),
 			install: true)
 	dep = declare_dependency(link_with: lib,
-			include_directories: include_directories(dir_name))
+			include_directories: include_directories(dir_name),
+			dependencies: dep_objs)
 	set_variable('dep_rte_' + l, dep)
 
 	dpdk_libraries = [lib] + dpdk_libraries
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 28/40] testpmd: compile testpmd with meson and ninja
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (26 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 27/40] build: track dependencies recursively Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 29/40] crypto/null: rename the version file to standard Bruce Richardson
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Add testpmd to build. When done, it was found that the -ldl flag was
getting duplicated too many times in the build causing static linkage to
fail on testpmd as the commandline got to long. [Possible meson bug]. Fix
this by making testpmd link explicitly against libdl (or libexecinfo on
BSD) and don't have EAL track it as its dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build                         | 32 +++++++++++++++
 app/test-pmd/meson.build                | 71 +++++++++++++++++++++++++++++++++
 lib/librte_eal/bsdapp/eal/meson.build   |  9 +++--
 lib/librte_eal/linuxapp/eal/meson.build |  9 +++--
 meson.build                             |  6 ++-
 5 files changed, 118 insertions(+), 9 deletions(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build

diff --git a/app/meson.build b/app/meson.build
new file mode 100644
index 000000000..bdf043ead
--- /dev/null
+++ b/app/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+subdir('test-pmd')
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
new file mode 100644
index 000000000..9c60f4bc0
--- /dev/null
+++ b/app/test-pmd/meson.build
@@ -0,0 +1,71 @@
+#   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.
+
+sources = files('cmdline.c',
+	'cmdline_flow.c',
+	'config.c',
+	'csumonly.c',
+	'flowgen.c',
+	'icmpecho.c',
+	'ieee1588fwd.c',
+	'iofwd.c',
+	'macfwd.c',
+	'macswap.c',
+	'parameters.c',
+	'rxonly.c',
+	'testpmd.c',
+	'txonly.c')
+
+deps = ['rte_eal', 'rte_net', 'rte_ether', 'rte_mempool', 'rte_ring',
+	'rte_mbuf', 'rte_gro', 'rte_cmdline', 'rte_metrics']
+if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
+	deps += 'rte_pmd_i40e'
+endif
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'rte_pmd_ixgbe'
+endif
+
+dep_objs = []
+foreach d:deps
+	dep_objs += get_variable('dep_' + d)
+endforeach
+
+link_libs = []
+if get_option('default_library') == 'static'
+	link_libs = dpdk_drivers
+endif
+
+executable('dpdk-testpmd',
+	sources,
+	link_whole: link_libs,
+	dependencies: dep_objs,
+	link_args: eal_extra_link_arg, # add -ldl for linux, -lexecinfo for BSD
+	install: true)
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 86a9e3d14..96ad1cef7 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -44,6 +44,8 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+eal_extra_link_arg = '-lexecinfo'
+
 version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
@@ -51,15 +53,14 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			version: '@0@.1'.format(version),
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
-			link_args: ['-lexecinfo',
+			link_args: [eal_extra_link_arg,
 				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
-dpdk_libraries += ['-pthread', eal_lib]
+dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
-		dependencies: dependency('threads'),
-		link_args: '-lexecinfo')
+		dependencies: dependency('threads'))
 set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index 90ecfc394..30741519b 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -49,6 +49,8 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+eal_extra_link_arg = '-ldl'
+
 version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
@@ -56,15 +58,14 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			version: '@0@.1'.format(version),
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
-			link_args: ['-ldl',
+			link_args: [eal_extra_link_arg,
 				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
-dpdk_libraries += ['-pthread', '-ldl', eal_lib]
+dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
-		dependencies: dependency('threads'),
-		link_args: '-ldl')
+		dependencies: dependency('threads'))
 set_variable('dep_rte_eal', rte_eal)
diff --git a/meson.build b/meson.build
index daadf7235..dfcead92a 100644
--- a/meson.build
+++ b/meson.build
@@ -60,7 +60,10 @@ subdir('config')
 subdir('lib')
 subdir('buildtools')
 subdir('drivers')
+
+# build binaries and installable tools
 subdir('usertools')
+subdir('app')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
@@ -68,7 +71,8 @@ configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
 
-# for static builds, include the drivers directly
+# for static builds, include the drivers as libs, and also any
+# other dependent libs that DPDK needs to link against
 if get_option('default_library') == 'static'
 	dpdk_libraries = dpdk_drivers + dpdk_libraries
 endif
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 29/40] crypto/null: rename the version file to standard
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (27 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 28/40] testpmd: compile testpmd with meson and ninja Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 30/40] crypto/qat: remove dependency on ether library Bruce Richardson
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/null/Makefile                                            | 2 +-
 .../null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map}  | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)

diff --git a/drivers/crypto/null/Makefile b/drivers/crypto/null/Makefile
index bc2724b39..b12b6f797 100644
--- a/drivers/crypto/null/Makefile
+++ b/drivers/crypto/null/Makefile
@@ -42,7 +42,7 @@ CFLAGS += $(WERROR_FLAGS)
 LIBABIVER := 1
 
 # versioning export map
-EXPORT_MAP := rte_pmd_null_crypto_version.map
+EXPORT_MAP := rte_pmd_null_version.map
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null_crypto_pmd.c
diff --git a/drivers/crypto/null/rte_pmd_null_crypto_version.map b/drivers/crypto/null/rte_pmd_null_version.map
similarity index 100%
rename from drivers/crypto/null/rte_pmd_null_crypto_version.map
rename to drivers/crypto/null/rte_pmd_null_version.map
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 30/40] crypto/qat: remove dependency on ether library
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (28 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 29/40] crypto/null: rename the version file to standard Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:51 ` [RFCv2 31/40] build: add cryptodev and some crypto drivers to build Bruce Richardson
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/qat/qat_crypto.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 1f52cabfd..62ee175ba 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -46,7 +46,6 @@
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_tailq.h>
-#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 31/40] build: add cryptodev and some crypto drivers to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (29 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 30/40] crypto/qat: remove dependency on ether library Bruce Richardson
@ 2017-08-14  9:51 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 32/40] igb_uio: add igb_uio to meson build Bruce Richardson
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:51 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                |   9 ++++
 drivers/crypto/meson.build         | 103 +++++++++++++++++++++++++++++++++++++
 drivers/crypto/null/meson.build    |  32 ++++++++++++
 drivers/crypto/openssl/meson.build |  33 ++++++++++++
 drivers/crypto/qat/meson.build     |  36 +++++++++++++
 drivers/meson.build                |   3 +-
 lib/librte_cryptodev/meson.build   |  39 ++++++++++++++
 lib/meson.build                    |   2 +-
 8 files changed, 255 insertions(+), 2 deletions(-)
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 67028f682..6eb72415a 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -72,6 +72,9 @@
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 
+/* cryptodev defines */
+#define RTE_CRYPTO_MAX_DEVS 64
+#define RTE_CRYPTODEV_NAME_LEN 64
 /****** driver defines ********/
 
 /* i40e defines */
@@ -83,4 +86,10 @@
 /* interval up to 8160 us, aligned to 2 (or default value) */
 #define RTE_LIBRTE_I40E_ITR_INTERVAL -1
 
+/*
+ * Number of sessions to create in the session memory pool
+ * on a single QuickAssist device.
+ */
+#define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
new file mode 100644
index 000000000..c26e3d387
--- /dev/null
+++ b/drivers/crypto/meson.build
@@ -0,0 +1,103 @@
+#   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.
+
+crypto_drivers = ['null']
+
+libcrypto_dep = dependency('libcrypto', required: false)
+if libcrypto_dep.found()
+	crypto_drivers += ['qat', 'openssl']
+endif
+
+foreach drv:crypto_drivers
+	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+
+	# set up empty variables used for build
+	version = 1
+	sources = []
+	libs = []
+	cflags = []
+	includes = [include_directories(drv)]
+	# dependency managment. External deps managed using dependency
+	# objects, internal deps managed by name of lib
+	ext_deps = []
+	# set up standard deps. Drivers can append/override as necessary
+	deps = ['eal', 'mbuf', 'cryptodev', 'mempool', 'kvargs']
+
+	# pull in driver directory which should assign to each of the above
+	subdir(drv)
+
+	# get dependency objs from strings
+	dep_objs = ext_deps
+	foreach d:deps
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
+	# generate pmdinfo sources
+	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+	foreach src: pmdinfogen_srcs
+		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+			src, include_directories: includes,
+			dependencies: dep_objs,
+			c_args: cflags)
+		sources += custom_target(out_filename,
+				command: [pmdinfo, tmp_lib.full_path(),
+					'@OUTPUT@', pmdinfogen],
+				output: out_filename,
+				depends: [pmdinfogen, tmp_lib])
+	endforeach
+
+	# now build the driver itself, and add to the drivers list
+	drv_name = 'rte_pmd_@0@'.format(drv)
+	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+			meson.current_source_dir(), drv)
+	lib = library(drv_name,
+		sources,
+		include_directories: includes,
+		dependencies: dep_objs,
+		link_with: libs,
+		c_args: cflags,
+		link_args: '-Wl,--version-script=' + version_map,
+		link_depends: version_map,
+		version: '@0@.1'.format(version),
+		install: true,
+		install_dir: driver_install_path)
+
+	dpdk_drivers += lib
+
+	# create a dependency object and add it to the global dictionary so
+	# testpmd or other built-in apps can find it if necessary
+	set_variable('dep_rte_pmd_@0@'.format(drv),
+			declare_dependency(link_with: lib,
+			include_directories: includes,
+			dependencies: dep_objs))
+endforeach
diff --git a/drivers/crypto/null/meson.build b/drivers/crypto/null/meson.build
new file mode 100644
index 000000000..0a8d65ad5
--- /dev/null
+++ b/drivers/crypto/null/meson.build
@@ -0,0 +1,32 @@
+#   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.
+
+sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
new file mode 100644
index 000000000..b4337f85e
--- /dev/null
+++ b/drivers/crypto/openssl/meson.build
@@ -0,0 +1,33 @@
+#   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.
+
+sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
+ext_deps += libcrypto_dep
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
new file mode 100644
index 000000000..aa124a0a0
--- /dev/null
+++ b/drivers/crypto/qat/meson.build
@@ -0,0 +1,36 @@
+#   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.
+
+sources = files('qat_crypto.c', 'qat_qp.c',
+		'qat_adf/qat_algs_build_desc.c',
+		'rte_qat_cryptodev.c')
+includes += include_directories('qat_adf')
+ext_deps += libcrypto_dep
diff --git a/drivers/meson.build b/drivers/meson.build
index f8ad7d0e2..10c5912c0 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -29,5 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-subdir('net')
 subdir('mempool')
+subdir('net')
+subdir('crypto')
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
new file mode 100644
index 000000000..c732e2094
--- /dev/null
+++ b/lib/librte_cryptodev/meson.build
@@ -0,0 +1,39 @@
+#   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.
+
+sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
+headers = files('rte_cryptodev.h',
+	'rte_cryptodev_pci.h',
+	'rte_cryptodev_pmd.h',
+	'rte_cryptodev_vdev.h',
+	'rte_crypto.h',
+	'rte_crypto_sym.h')
+deps = ['eal', 'mempool', 'kvargs', 'mbuf']
diff --git a/lib/meson.build b/lib/meson.build
index e0c9c3c81..917eee7b2 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -35,7 +35,7 @@ subdir('librte_compat')
 
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro', 'metrics']
+	'kvargs', 'gro', 'metrics', 'cryptodev']
 
 foreach l:libs
 	version = 1
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 32/40] igb_uio: add igb_uio to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (30 preceding siblings ...)
  2017-08-14  9:51 ` [RFCv2 31/40] build: add cryptodev and some crypto drivers to build Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 33/40] ip_frag: rename version file to standard name Bruce Richardson
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/Kbuild      |  1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build | 47 +++++++++++++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build         | 10 ++++++
 meson_options.txt                           |  4 ++-
 4 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build

diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild b/lib/librte_eal/linuxapp/igb_uio/Kbuild
new file mode 100644
index 000000000..98c98fe52
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
@@ -0,0 +1 @@
+obj-m := igb_uio.o
diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build b/lib/librte_eal/linuxapp/igb_uio/meson.build
new file mode 100644
index 000000000..c046e1d66
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
@@ -0,0 +1,47 @@
+#   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.
+
+mkfile = custom_target('igb_uio_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+custom_target('igb_uio',
+	input: ['igb_uio.c', 'Kbuild'],
+	output: 'igb_uio.ko',
+	command: ['make', '-C', kernel_dir,
+		'M=' + meson.current_build_dir(),
+		'src=' + meson.current_source_dir(),
+		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
+			'/../../common/include',
+		'modules'],
+	depends: mkfile,
+	depend_files: [join_paths(kernel_dir, 'Kconfig')],
+	build_by_default: true)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
index bc9f22175..88164f297 100644
--- a/lib/librte_eal/linuxapp/meson.build
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -30,3 +30,13 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('eal')
+
+if get_option('enable_kmods')
+	kernel_dir = get_option('kernel_dir')
+	if kernel_dir == ''
+		kernel_version = run_command('uname', '-r').stdout().strip()
+		kernel_dir = '/lib/modules/' + kernel_version + '/build'
+	endif
+
+	subdir('igb_uio')
+endif
\ No newline at end of file
diff --git a/meson_options.txt b/meson_options.txt
index 8f1db5330..9c45b8159 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,4 +3,6 @@ option('max_lcores', type: 'string', value: '128', description: 'maximum number
 option('max_numa_nodes', type: 'string', value: '4', description: 'maximum number of NUMA nodes supported by EAL')
 option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
 option('allow_invalid_socket_id', type: 'boolean', value: false,
-	 description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('enable_kmods', type: 'boolean', value: true, description: 'build kernel modules')
+option('kernel_dir', type: 'string', value: '', description: 'path to the kernel for building kernel modules')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 33/40] ip_frag: rename version file to standard name
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (31 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 32/40] igb_uio: add igb_uio to meson build Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 34/40] build: add most remaining libraries to meson build Bruce Richardson
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

The version file did not quite match the directory name, as it was missing
an '_' between ip and frag.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_ip_frag/Makefile                                            | 2 +-
 lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} (100%)

diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index 4e693bf8f..2a8c3e374 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -37,7 +37,7 @@ LIB = librte_ip_frag.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
 
-EXPORT_MAP := rte_ipfrag_version.map
+EXPORT_MAP := rte_ip_frag_version.map
 
 LIBABIVER := 1
 
diff --git a/lib/librte_ip_frag/rte_ipfrag_version.map b/lib/librte_ip_frag/rte_ip_frag_version.map
similarity index 100%
rename from lib/librte_ip_frag/rte_ipfrag_version.map
rename to lib/librte_ip_frag/rte_ip_frag_version.map
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 34/40] build: add most remaining libraries to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (32 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 33/40] ip_frag: rename version file to standard name Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 35/40] build: add packet framework libs " Bruce Richardson
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Only libraries not included in meson build at this point are the three
packet framework libs, and the acl library (which needs some custom
handling for the different instruction set levels it has).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test-pmd/meson.build            |  3 +++
 config/meson.build                  |  2 ++
 config/rte_config.h                 | 19 ++++++++++++++++++
 drivers/mempool/meson.build         |  2 +-
 lib/librte_bitratestats/meson.build | 34 ++++++++++++++++++++++++++++++++
 lib/librte_cfgfile/meson.build      | 35 +++++++++++++++++++++++++++++++++
 lib/librte_cryptodev/meson.build    |  1 +
 lib/librte_distributor/meson.build  | 39 +++++++++++++++++++++++++++++++++++++
 lib/librte_efd/meson.build          | 34 ++++++++++++++++++++++++++++++++
 lib/librte_ether/meson.build        |  2 +-
 lib/librte_eventdev/meson.build     | 36 ++++++++++++++++++++++++++++++++++
 lib/librte_ip_frag/meson.build      | 39 +++++++++++++++++++++++++++++++++++++
 lib/librte_jobstats/meson.build     | 34 ++++++++++++++++++++++++++++++++
 lib/librte_kni/meson.build          | 35 +++++++++++++++++++++++++++++++++
 lib/librte_latencystats/meson.build | 34 ++++++++++++++++++++++++++++++++
 lib/librte_lpm/meson.build          | 35 +++++++++++++++++++++++++++++++++
 lib/librte_mbuf/meson.build         |  2 +-
 lib/librte_mempool/meson.build      |  3 +--
 lib/librte_meter/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_net/meson.build          |  2 +-
 lib/librte_pdump/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_power/meson.build        | 35 +++++++++++++++++++++++++++++++++
 lib/librte_reorder/meson.build      | 34 ++++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build        | 36 ++++++++++++++++++++++++++++++++++
 lib/librte_timer/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_vhost/meson.build        | 36 ++++++++++++++++++++++++++++++++++
 lib/meson.build                     | 24 +++++++++++++++++++----
 27 files changed, 648 insertions(+), 10 deletions(-)
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build

diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index 9c60f4bc0..843feb54f 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -46,6 +46,9 @@ sources = files('cmdline.c',
 
 deps = ['rte_eal', 'rte_net', 'rte_ether', 'rte_mempool', 'rte_ring',
 	'rte_mbuf', 'rte_gro', 'rte_cmdline', 'rte_metrics']
+if dpdk_conf.has('RTE_LIBRTE_PDUMP')
+	deps += 'rte_pdump'
+endif
 if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
 	deps += 'rte_pmd_i40e'
 endif
diff --git a/config/meson.build b/config/meson.build
index 4a6a69d13..3a6bcc58d 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -33,6 +33,8 @@
 machine = get_option('machine')
 dpdk_conf.set('RTE_MACHINE', machine)
 add_project_arguments('-march=@0@'.format(machine), language: 'c')
+# some libs depend on maths lib
+add_project_link_arguments('-lm', language: 'c')
 
 # add -include rte_config to cflags
 add_project_arguments('-include', 'rte_config.h', language: 'c')
diff --git a/config/rte_config.h b/config/rte_config.h
index 6eb72415a..651c9b5d6 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -75,6 +75,25 @@
 /* cryptodev defines */
 #define RTE_CRYPTO_MAX_DEVS 64
 #define RTE_CRYPTODEV_NAME_LEN 64
+
+/* eventdev defines */
+#define RTE_EVENT_MAX_DEVS 16
+#define RTE_EVENT_MAX_QUEUES_PER_DEV 64
+
+/* ip_fragmentation defines */
+#define RTE_LIBRTE_IP_FRAG_MAX_FRAG 4
+#undef RTE_LIBRTE_IP_FRAG_TBL_STAT
+
+/* rte_power defines */
+#define RTE_MAX_LCORE_FREQS 64
+
+/* rte_sched defines */
+#undef RTE_SCHED_RED
+#undef RTE_SCHED_COLLECT_STATS
+#undef RTE_SCHED_SUBPORT_TC_OV
+#define RTE_SCHED_PORT_N_GRINDERS 8
+#undef RTE_SCHED_VECTOR
+
 /****** driver defines ********/
 
 /* i40e defines */
diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index d998797ca..a426b8f92 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -52,7 +52,7 @@ foreach drv:mempool_drivers
 	# get dependency objs from strings
 	dep_objs = ext_deps
 	foreach d:deps
-		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
 	# generate pmdinfo sources
diff --git a/lib/librte_bitratestats/meson.build b/lib/librte_bitratestats/meson.build
new file mode 100644
index 000000000..6e58d68aa
--- /dev/null
+++ b/lib/librte_bitratestats/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_bitrate.c')
+headers = files('rte_bitrate.h')
+deps = ['eal', 'ether', 'metrics']
diff --git a/lib/librte_cfgfile/meson.build b/lib/librte_cfgfile/meson.build
new file mode 100644
index 000000000..4484f9b45
--- /dev/null
+++ b/lib/librte_cfgfile/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+version = 2
+sources = files('rte_cfgfile.c')
+headers = files('rte_cfgfile.h')
+deps = ['eal']
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
index c732e2094..226f2c790 100644
--- a/lib/librte_cryptodev/meson.build
+++ b/lib/librte_cryptodev/meson.build
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 3
 sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
 headers = files('rte_cryptodev.h',
 	'rte_cryptodev_pci.h',
diff --git a/lib/librte_distributor/meson.build b/lib/librte_distributor/meson.build
new file mode 100644
index 000000000..09595d75f
--- /dev/null
+++ b/lib/librte_distributor/meson.build
@@ -0,0 +1,39 @@
+#   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.
+
+sources = files('rte_distributor.c', 'rte_distributor_v20.c')
+if arch_subdir == 'x86'
+	sources += files('rte_distributor_match_sse.c')
+else
+	sources += files('rte_distributor_match_generic.c')
+endif
+headers = files('rte_distributor.h')
+deps = ['eal', 'mbuf', 'compat']
diff --git a/lib/librte_efd/meson.build b/lib/librte_efd/meson.build
new file mode 100644
index 000000000..299381522
--- /dev/null
+++ b/lib/librte_efd/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_efd.c')
+headers = files('rte_efd.h')
+deps = ['eal', 'ring', 'hash']
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
index ed9c29a78..65c054e0d 100644
--- a/lib/librte_ether/meson.build
+++ b/lib/librte_ether/meson.build
@@ -42,5 +42,5 @@ headers = files('rte_ethdev.h',
 	'rte_flow_driver.h',
 	'rte_tm.h')
 
-deps = ['eal', 'ring', 'mempool', 'net', 'mbuf']
+deps = ['net']
 
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
new file mode 100644
index 000000000..4da39fa0d
--- /dev/null
+++ b/lib/librte_eventdev/meson.build
@@ -0,0 +1,36 @@
+#   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.
+
+sources = files('rte_eventdev.c', 'rte_event_ring.c')
+headers = files('rte_eventdev.h', 'rte_eventdev_pmd.h',
+		'rte_eventdev_pmd_pci.h', 'rte_eventdev_pmd_vdev.h',
+		'rte_event_ring.h')
+deps = ['eal', 'ring']
diff --git a/lib/librte_ip_frag/meson.build b/lib/librte_ip_frag/meson.build
new file mode 100644
index 000000000..6c7765cf7
--- /dev/null
+++ b/lib/librte_ip_frag/meson.build
@@ -0,0 +1,39 @@
+#   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.
+
+sources = files('rte_ipv4_fragmentation.c',
+		'rte_ipv6_fragmentation.c',
+		'rte_ipv4_reassembly.c',
+		'rte_ipv6_reassembly.c',
+		'rte_ip_frag_common.c',
+		'ip_frag_internal.c')
+headers = files('rte_ip_frag.h')
+deps = ['eal', 'mempool', 'mbuf', 'ether', 'hash']
diff --git a/lib/librte_jobstats/meson.build b/lib/librte_jobstats/meson.build
new file mode 100644
index 000000000..4bb5b6e49
--- /dev/null
+++ b/lib/librte_jobstats/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_jobstats.c')
+headers = files('rte_jobstats.h')
+deps = ['eal']
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
new file mode 100644
index 000000000..95c5edf96
--- /dev/null
+++ b/lib/librte_kni/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+version = 2
+sources = files('rte_kni.c')
+headers = files('rte_kni.h')
+deps = ['eal', 'mempool', 'mbuf', 'ether']
diff --git a/lib/librte_latencystats/meson.build b/lib/librte_latencystats/meson.build
new file mode 100644
index 000000000..0efade639
--- /dev/null
+++ b/lib/librte_latencystats/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_latencystats.c')
+headers = files('rte_latencystats.h')
+deps = ['eal', 'metrics', 'ether', 'mbuf']
diff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build
new file mode 100644
index 000000000..9d276d55f
--- /dev/null
+++ b/lib/librte_lpm/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+version = 2
+sources = files('rte_lpm.c', 'rte_lpm6.c')
+headers = files('rte_lpm.h', 'rte_lpm6.h')
+deps = ['eal', 'compat']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
index 19cd68528..1477cb0a3 100644
--- a/lib/librte_mbuf/meson.build
+++ b/lib/librte_mbuf/meson.build
@@ -32,5 +32,5 @@
 version = 3
 sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
 headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
-deps = ['eal', 'mempool', 'ring']
+deps = ['mempool']
 
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
index 9617010dd..3d39ab119 100644
--- a/lib/librte_mempool/meson.build
+++ b/lib/librte_mempool/meson.build
@@ -32,5 +32,4 @@
 version = 2
 sources = files('rte_mempool.c', 'rte_mempool_ops.c')
 headers = files('rte_mempool.h')
-deps = ['eal', 'ring']
-
+deps = ['ring']
diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build
new file mode 100644
index 000000000..ada4dfa01
--- /dev/null
+++ b/lib/librte_meter/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_meter.c')
+headers = files('rte_meter.h')
+deps = ['eal']
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
index 0bfe53873..9d92770fa 100644
--- a/lib/librte_net/meson.build
+++ b/lib/librte_net/meson.build
@@ -42,5 +42,5 @@ headers = files('rte_ip.h',
 	'rte_net_crc.h')
 
 sources = files('rte_net.c', 'rte_net_crc.c')
-deps = ['eal', 'mbuf', 'ring', 'mempool']
+deps = ['mbuf']
 
diff --git a/lib/librte_pdump/meson.build b/lib/librte_pdump/meson.build
new file mode 100644
index 000000000..9b8d53b87
--- /dev/null
+++ b/lib/librte_pdump/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_pdump.c')
+headers = files('rte_pdump.h')
+deps = ['eal', 'mbuf', 'ether']
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
new file mode 100644
index 000000000..bd32714d3
--- /dev/null
+++ b/lib/librte_power/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+sources = files('rte_power.c', 'rte_power_acpi_cpufreq.c',
+		'rte_power_kvm_vm.c', 'guest_channel.c')
+headers = files('rte_power.h')
+deps = ['eal']
diff --git a/lib/librte_reorder/meson.build b/lib/librte_reorder/meson.build
new file mode 100644
index 000000000..4f6d732ba
--- /dev/null
+++ b/lib/librte_reorder/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_reorder.c')
+headers = files('rte_reorder.h')
+deps = ['eal', 'mbuf']
diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build
new file mode 100644
index 000000000..7443cd650
--- /dev/null
+++ b/lib/librte_sched/meson.build
@@ -0,0 +1,36 @@
+#   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.
+
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c',
+		'rte_reciprocal.c')
+headers = files('rte_sched.h', 'rte_bitmap.h', 'rte_sched_common.h',
+		'rte_red.h', 'rte_approx.h', 'rte_reciprocal.h')
+deps = ['mbuf', 'meter']
diff --git a/lib/librte_timer/meson.build b/lib/librte_timer/meson.build
new file mode 100644
index 000000000..708712097
--- /dev/null
+++ b/lib/librte_timer/meson.build
@@ -0,0 +1,34 @@
+#   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.
+
+sources = files('rte_timer.c')
+headers = files('rte_timer.h')
+deps = ['eal']
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
new file mode 100644
index 000000000..d0a1382b3
--- /dev/null
+++ b/lib/librte_vhost/meson.build
@@ -0,0 +1,36 @@
+#   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.
+
+version = 4
+sources = files('fd_man.c', 'socket.c', 'vhost.c', 'vhost_user.c',
+		'virtio_net.c')
+headers = files('rte_vhost.h')
+deps = ['eal', 'mbuf', 'ether']
diff --git a/lib/meson.build b/lib/meson.build
index 917eee7b2..453d6ee0d 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -34,8 +34,24 @@ subdir('librte_eal')
 subdir('librte_compat')
 
 # process all libraries equally, as far as possible
-libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro', 'metrics', 'cryptodev']
+# "core" libs first, then others alphebetically as far as possible
+# NOTE: for speed of meson runs, the dependencies in the subdirectories
+# sometimes skip deps that would be implied by others, e.g. if mempool is
+# given as a dep, no need to mention ring. This is especially true for the
+# core libs which are widely reused, so their deps are kept to a minimum.
+libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+	'metrics', # bitrate/latency stats depends on this
+	'hash',    # efd depends on this
+	'kvargs',  # cryptodev depends on this
+	'bitratestats', 'cfgfile', 'cmdline', 'cryptodev', 'distributor',
+	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
+	'timer']
+# pipeline, port, table, acl # todo
+
+if host_machine.system() == 'linux'
+	libs += ['kni', 'power', 'vhost']
+endif
 
 foreach l:libs
 	version = 1
@@ -52,9 +68,9 @@ foreach l:libs
 
 	install_headers(headers)
 
-	dep_objs = []
+	dep_objs = ext_deps
 	foreach d:deps
-		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
 	version_map = '@0@/@1@/rte_@2@_version.map'.format(
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 35/40] build: add packet framework libs to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (33 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 34/40] build: add most remaining libraries to meson build Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 36/40] acl: add acl library " Bruce Richardson
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_pipeline/meson.build | 35 +++++++++++++++++++++++++
 lib/librte_port/meson.build     | 58 +++++++++++++++++++++++++++++++++++++++++
 lib/librte_table/meson.build    | 52 ++++++++++++++++++++++++++++++++++++
 lib/meson.build                 |  6 ++++-
 4 files changed, 150 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_table/meson.build

diff --git a/lib/librte_pipeline/meson.build b/lib/librte_pipeline/meson.build
new file mode 100644
index 000000000..56a3cf69f
--- /dev/null
+++ b/lib/librte_pipeline/meson.build
@@ -0,0 +1,35 @@
+#   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.
+
+version = 3
+sources = files('rte_pipeline.c')
+headers = files('rte_pipeline.h')
+deps += ['port', 'table']
\ No newline at end of file
diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
new file mode 100644
index 000000000..a130f6eb6
--- /dev/null
+++ b/lib/librte_port/meson.build
@@ -0,0 +1,58 @@
+#   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.
+
+version = 3
+sources = files(
+	'rte_port_ethdev.c',
+	'rte_port_fd.c',
+	'rte_port_ring.c',
+	'rte_port_sched.c',
+	'rte_port_source_sink.c')
+headers = files(
+	'rte_port_ethdev.h',
+	'rte_port_fd.h',
+	'rte_port.h',
+	'rte_port_ring.h',
+	'rte_port_sched.h',
+	'rte_port_source_sink.h')
+deps = ['ether', 'sched']
+
+if dpdk_conf.has('RTE_LIBRTE_IP_FRAG')
+	sources += files('rte_port_frag.c', 'rte_port_ras.c')
+	headers += files('rte_port_frag.h', 'rte_port_ras.h')
+	deps += ['ip_frag']
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+	sources += files('rte_port_kni.c')
+	headers += files('rte_port_kni.h')
+	deps += 'kni'
+endif
diff --git a/lib/librte_table/meson.build b/lib/librte_table/meson.build
new file mode 100644
index 000000000..66069a74b
--- /dev/null
+++ b/lib/librte_table/meson.build
@@ -0,0 +1,52 @@
+#   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.
+
+version = 2
+sources = files('rte_table_lpm.c', 'rte_table_lpm_ipv6.c',
+		'rte_table_hash_cuckoo.c', 'rte_table_hash_key8.c',
+		'rte_table_hash_key16.c', 'rte_table_hash_key32.c',
+		'rte_table_hash_ext.c', 'rte_table_hash_lru.c',
+		'rte_table_array.c', 'rte_table_stub.c')
+headers = files('rte_table.h', 'rte_table_lpm.h',
+		'rte_table_lpm_ipv6.h', 'rte_table_hash.h',
+		'rte_lru.h', 'rte_table_array.h',
+		'rte_table_stub.h')
+deps = ['mbuf', 'port', 'lpm', 'hash']
+
+if arch_subdir == 'x86'
+	headers += files('rte_lru_x86.h')
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_ACL')
+	sources += files('rte_table_acl.c')
+	headers += files('rte_table_acl.h')
+	deps += ['acl']
+endif
\ No newline at end of file
diff --git a/lib/meson.build b/lib/meson.build
index 453d6ee0d..92d26b8aa 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -47,12 +47,16 @@ libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
 	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
 	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
 	'timer']
-# pipeline, port, table, acl # todo
+# acl - todo
 
 if host_machine.system() == 'linux'
 	libs += ['kni', 'power', 'vhost']
 endif
 
+# add pkt framework libs which use other libs from above, including optional
+# ones for linux
+libs += ['port', 'table', 'pipeline']
+
 foreach l:libs
 	version = 1
 	sources = []
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 36/40] acl: add acl library to meson build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (34 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 35/40] build: add packet framework libs " Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 37/40] build: add ark and avp PMDs to build Bruce Richardson
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_acl/meson.build | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/meson.build            | 18 ++++++++------
 2 files changed, 71 insertions(+), 7 deletions(-)
 create mode 100644 lib/librte_acl/meson.build

diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build
new file mode 100644
index 000000000..ddaf29bf5
--- /dev/null
+++ b/lib/librte_acl/meson.build
@@ -0,0 +1,60 @@
+#   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.
+
+version = 2
+sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
+		'rte_acl.c', 'tb_mem.c')
+headers = files('rte_acl.h', 'rte_acl_osdep.h')
+deps += ['eal']
+
+if arch_subdir == 'x86'
+	sources += files('acl_run_sse.c')
+
+	# compile AVX2 version if either:
+	# a. we have AVX supported in minimum instruction set baseline
+	# b. it's not minimum instruction set, but supported by compiler
+	#
+	# in former case, just add avx2 C file to files list
+	# in latter case, compile c file to static lib, using correct compiler
+	# flags, and then have the .o file from static lib linked into main lib.
+	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+		sources += files('acl_run_avx2.c')
+		cflags += '-DCC_AVX2_SUPPORT'
+	elif cc.has_argument('-mavx2')
+		avx2_tmplib = static_library('avx2_tmp',
+				'acl_run_avx2.c',
+				dependencies: rte_eal,
+				c_args: '-mavx2')
+		objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
+		cflags += '-DCC_AVX2_SUPPORT'
+	endif
+
+endif
diff --git a/lib/meson.build b/lib/meson.build
index 92d26b8aa..54efb4ba7 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -39,28 +39,30 @@ subdir('librte_compat')
 # sometimes skip deps that would be implied by others, e.g. if mempool is
 # given as a dep, no need to mention ring. This is especially true for the
 # core libs which are widely reused, so their deps are kept to a minimum.
-libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
 	'metrics', # bitrate/latency stats depends on this
 	'hash',    # efd depends on this
 	'kvargs',  # cryptodev depends on this
-	'bitratestats', 'cfgfile', 'cmdline', 'cryptodev', 'distributor',
-	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
+	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
 	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
 	'timer']
-# acl - todo
 
 if host_machine.system() == 'linux'
-	libs += ['kni', 'power', 'vhost']
+	libraries += ['kni', 'power', 'vhost']
 endif
 
 # add pkt framework libs which use other libs from above, including optional
 # ones for linux
-libs += ['port', 'table', 'pipeline']
+libraries += ['port', 'table', 'pipeline']
 
-foreach l:libs
+foreach l:libraries
 	version = 1
 	sources = []
 	headers = []
+	cflags = []
+	objs = [] # other object files to link against, used e.g. for instruction-
+	          # optimized versions of code
 	# use "deps" for internal DPDK dependencies, and "ext_deps" for
 	# external package/library requirements
 	deps = []
@@ -85,6 +87,8 @@ foreach l:libs
 	endif
 	lib = library(libname,
 			sources,
+			objects: objs,
+			c_args: cflags,
 			dependencies: dep_objs,
 			include_directories: include_directories(dir_name),
 			link_args: '-Wl,--version-script=' + version_map,
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 37/40] build: add ark and avp PMDs to build
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (35 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 36/40] acl: add acl library " Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 38/40] build: fix static library builds with base code Bruce Richardson
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/ark/meson.build | 44 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/avp/meson.build | 36 ++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build     |  2 +-
 3 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build

diff --git a/drivers/net/ark/meson.build b/drivers/net/ark/meson.build
new file mode 100644
index 000000000..a94d70383
--- /dev/null
+++ b/drivers/net/ark/meson.build
@@ -0,0 +1,44 @@
+#   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.
+
+sources = files('ark_ddm.c',
+		'ark_ethdev.c',
+		'ark_ethdev_rx.c',
+		'ark_ethdev_tx.c',
+		'ark_mpu.c',
+		'ark_pktchkr.c',
+		'ark_pktdir.c',
+		'ark_pktgen.c',
+		'ark_rqp.c',
+		'ark_udm.c')
+if host_machine.system() == 'linux'
+	ext_deps += cc.find_library('dl')
+endif
diff --git a/drivers/net/avp/meson.build b/drivers/net/avp/meson.build
new file mode 100644
index 000000000..b42ed9df5
--- /dev/null
+++ b/drivers/net/avp/meson.build
@@ -0,0 +1,36 @@
+#   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.
+
+if host_machine.system() != 'linux'
+	build = false
+endif
+sources = files('avp_ethdev.c')
+install_headers('rte_avp_common.h', 'rte_avp_fifo.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 00ee65988..0c804d073 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-net_drivers = ['i40e', 'ixgbe']
+net_drivers = ['ark', 'avp', 'i40e', 'ixgbe']
 
 # af_packet only works on linux
 if host_machine.system() == 'linux'
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 38/40] build: fix static library builds with base code
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (36 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 37/40] build: add ark and avp PMDs to build Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 39/40] build: fix driver dependencies for static builds Bruce Richardson
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

for static library builds, we miss the base code, as the base code .a file
is not included in the overall driver .a file. Instead mark the objects in
the base code lib to be included in the overall library.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build         | 6 +++---
 drivers/mempool/meson.build        | 4 ++--
 drivers/net/i40e/base/meson.build  | 1 +
 drivers/net/i40e/meson.build       | 2 +-
 drivers/net/ixgbe/base/meson.build | 1 +
 drivers/net/ixgbe/meson.build      | 2 +-
 drivers/net/meson.build            | 4 ++--
 7 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index c26e3d387..495e9350c 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -42,14 +42,14 @@ foreach drv:crypto_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = ['eal', 'mbuf', 'cryptodev', 'mempool', 'kvargs']
+	deps = ['mbuf', 'cryptodev', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
@@ -82,9 +82,9 @@ foreach drv:crypto_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index a426b8f92..32763b326 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -37,7 +37,7 @@ foreach drv:mempool_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
@@ -77,9 +77,9 @@ foreach drv:mempool_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
index 69f55497e..ef19e358d 100644
--- a/drivers/net/i40e/base/meson.build
+++ b/drivers/net/i40e/base/meson.build
@@ -53,3 +53,4 @@ endforeach
 base_lib = static_library('i40e_base', sources,
 	dependencies: rte_eal,
 	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index dcc832b6f..da3f0b6dc 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -35,7 +35,7 @@ cflags = ['-DPF_DRIVER',
 	'-DX722_A0_SUPPORT']
 
 subdir('base')
-libs = [base_lib]
+objs = [base_objs]
 
 sources = files(
 	'i40e_ethdev.c',
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
index d5fb435e4..2f3fe0491 100644
--- a/drivers/net/ixgbe/base/meson.build
+++ b/drivers/net/ixgbe/base/meson.build
@@ -57,3 +57,4 @@ endforeach
 base_lib = static_library('ixgbe_base', sources,
 	dependencies: rte_eal,
 	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 3e164f97f..32c10a5e2 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -32,7 +32,7 @@
 cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
 subdir('base')
-libs = [base_lib]
+objs = [base_objs]
 
 sources = files(
 	'ixgbe_82599_bypass.c',
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 0c804d073..2fb7577fa 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -49,7 +49,7 @@ foreach drv:net_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
@@ -90,9 +90,9 @@ foreach drv:net_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 39/40] build: fix driver dependencies for static builds
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (37 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 38/40] build: fix static library builds with base code Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-14  9:52 ` [RFCv2 40/40] examples: allow basic sample app build using pkg-config Bruce Richardson
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

For static builds we need to better track the dependencies of drivers,
because, unlike with shared libs, the static libs don't track them
themselves. Because of this we have a new global list of external
dependencies which is used for creating the pkg-config file. We also move
the logic for what dependencies a driver has, and if those deps are met,
from the higher level build file to the drivers themselves.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build                         | 115 ++++++++++---------
 drivers/crypto/openssl/meson.build                 |   7 +-
 drivers/crypto/qat/meson.build                     |   7 +-
 drivers/mempool/meson.build                        | 110 +++++++++---------
 drivers/net/af_packet/meson.build                  |   3 +
 drivers/net/ark/meson.build                        |   1 +
 drivers/net/meson.build                            | 123 ++++++++++-----------
 drivers/net/pcap/meson.build                       |  11 +-
 lib/librte_eal/bsdapp/eal/meson.build              |   3 +-
 lib/librte_eal/common/include/arch/x86/meson.build |   1 +
 lib/librte_eal/linuxapp/eal/meson.build            |   3 +-
 meson.build                                        |   4 +-
 12 files changed, 211 insertions(+), 177 deletions(-)

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index 495e9350c..d27889088 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -29,75 +29,80 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-crypto_drivers = ['null']
-
-libcrypto_dep = dependency('libcrypto', required: false)
-if libcrypto_dep.found()
-	crypto_drivers += ['qat', 'openssl']
-endif
-
-foreach drv:crypto_drivers
-	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+drivers = ['null', 'qat', 'openssl']
+std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 
+foreach drv:drivers
 	# set up empty variables used for build
+	build = true # set to false to disable, e.g. missing deps
 	version = 1
 	sources = []
 	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
-	# dependency managment. External deps managed using dependency
-	# objects, internal deps managed by name of lib
+	# set up internal deps. Drivers can append/override as necessary
+	deps = std_deps
+	# ext_deps: Stores external library dependency got
+	# using dependency() or cc.find_library(). For most cases, we
+	# probably also need to specify the "-l" flags in
+	# pkgconfig_extra_libs variable too, so that it can be reflected
+	# in the pkgconfig output for static builds
 	ext_deps = []
-	# set up standard deps. Drivers can append/override as necessary
-	deps = ['mbuf', 'cryptodev', 'kvargs']
+	pkgconfig_extra_libs = []
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
-	# get dependency objs from strings
-	dep_objs = ext_deps
-	foreach d:deps
-		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
-	endforeach
-
-	# generate pmdinfo sources
-	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-	foreach src: pmdinfogen_srcs
-		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
-		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-			src, include_directories: includes,
-			dependencies: dep_objs,
-			c_args: cflags)
-		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(),
-					'@OUTPUT@', pmdinfogen],
-				output: out_filename,
-				depends: [pmdinfogen, tmp_lib])
-	endforeach
+	if build
+		dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
-	# now build the driver itself, and add to the drivers list
-	drv_name = 'rte_pmd_@0@'.format(drv)
-	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
-			meson.current_source_dir(), drv)
-	lib = library(drv_name,
-		sources,
-		objects: objs,
-		include_directories: includes,
-		dependencies: dep_objs,
-		c_args: cflags,
-		link_args: '-Wl,--version-script=' + version_map,
-		link_depends: version_map,
-		version: '@0@.1'.format(version),
-		install: true,
-		install_dir: driver_install_path)
+		# get dependency objs from strings
+		dep_objs = []
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+		endforeach
+		dep_objs += ext_deps
+		dpdk_extra_ldflags += pkgconfig_extra_libs
 
-	dpdk_drivers += lib
+		# generate pmdinfo sources
+		pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+			'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+		foreach src: pmdinfogen_srcs
+			out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+			tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+				src, include_directories: includes,
+				dependencies: dep_objs,
+				c_args: cflags)
+			sources += custom_target(out_filename,
+					command: [pmdinfo, tmp_lib.full_path(),
+						'@OUTPUT@', pmdinfogen],
+					output: out_filename,
+					depends: [pmdinfogen, tmp_lib])
+		endforeach
 
-	# create a dependency object and add it to the global dictionary so
-	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_rte_pmd_@0@'.format(drv),
-			declare_dependency(link_with: lib,
+		# now build the driver itself, and add to the drivers list
+		drv_name = 'rte_pmd_@0@'.format(drv)
+		version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+				meson.current_source_dir(), drv)
+		lib = library(drv_name,
+			sources,
+			objects: objs,
 			include_directories: includes,
-			dependencies: dep_objs))
+			dependencies: dep_objs,
+			c_args: cflags,
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@0@.1'.format(version),
+			install: true,
+			install_dir: driver_install_path)
+
+		dpdk_drivers += lib
+
+		# create a dependency object and add it to the global dictionary so
+		# testpmd or other built-in apps can find it if necessary
+		set_variable('dep_rte_pmd_@0@'.format(drv),
+				declare_dependency(link_with: lib,
+				include_directories: includes,
+				dependencies: dep_objs))
+	endif # build
 endforeach
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
index b4337f85e..eb7f10226 100644
--- a/drivers/crypto/openssl/meson.build
+++ b/drivers/crypto/openssl/meson.build
@@ -29,5 +29,10 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+dep = dependency('libcrypto', required: false)
+if not dep.found()
+	build = false
+endif
 sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
-ext_deps += libcrypto_dep
+ext_deps += dep
+pkgconfig_extra_libs += '-lcrypto'
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
index aa124a0a0..7d959e7f5 100644
--- a/drivers/crypto/qat/meson.build
+++ b/drivers/crypto/qat/meson.build
@@ -29,8 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+dep = dependency('libcrypto', required: false)
+if not dep.found()
+	build = false
+endif
 sources = files('qat_crypto.c', 'qat_qp.c',
 		'qat_adf/qat_algs_build_desc.c',
 		'rte_qat_cryptodev.c')
 includes += include_directories('qat_adf')
-ext_deps += libcrypto_dep
+ext_deps += dep
+pkgconfig_extra_libs += '-lcrypto'
diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
index 32763b326..cdacbe9be 100644
--- a/drivers/mempool/meson.build
+++ b/drivers/mempool/meson.build
@@ -29,70 +29,80 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-mempool_drivers = ['ring', 'stack']
-
-foreach drv:mempool_drivers
-	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+drivers = ['ring', 'stack']
+std_deps = ['mempool']
 
+foreach drv:drivers
 	# set up empty variables used for build
+	build = true # set to false to disable, e.g. missing deps
 	version = 1
 	sources = []
 	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
-	# dependency managment. External deps managed using dependency
-	# objects, internal deps managed by name of lib
+	# set up internal deps. Drivers can append/override as necessary
+	deps = std_deps
+	# ext_deps: Stores external library dependency got
+	# using dependency() or cc.find_library(). For most cases, we
+	# probably also need to specify the "-l" flags in
+	# pkgconfig_extra_libs variable too, so that it can be reflected
+	# in the pkgconfig output for static builds
 	ext_deps = []
-	# set up standard deps. Drivers can append/override as necessary
-	deps = ['eal', 'mempool', 'ring']
+	pkgconfig_extra_libs = []
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
-	# get dependency objs from strings
-	dep_objs = ext_deps
-	foreach d:deps
-		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
-	endforeach
-
-	# generate pmdinfo sources
-	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-	foreach src: pmdinfogen_srcs
-		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
-		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-			src, include_directories: includes,
-			dependencies: dep_objs,
-			c_args: cflags)
-		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(),
-					'@OUTPUT@', pmdinfogen],
-				output: out_filename,
-				depends: [pmdinfogen, tmp_lib])
-	endforeach
+	if build
+		dpdk_conf.set('RTE_LIBRTE_@0@_MEMPOOL'.format(drv.to_upper()),1)
 
-	# now build the driver itself, and add to the drivers list
-	drv_name = 'rte_mempool_@0@'.format(drv)
-	version_map = '@0@/@1@/rte_mempool_@1@_version.map'.format(
-			meson.current_source_dir(), drv)
-	lib = library(drv_name,
-		sources,
-		objects: objs,
-		include_directories: includes,
-		dependencies: dep_objs,
-		c_args: cflags,
-		link_args: '-Wl,--version-script=' + version_map,
-		link_depends: version_map,
-		version: '@0@.1'.format(version),
-		install: true,
-		install_dir: driver_install_path)
+		# get dependency objs from strings
+		dep_objs = []
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+		endforeach
+		dep_objs += ext_deps
+		dpdk_extra_ldflags += pkgconfig_extra_libs
 
-	dpdk_drivers += lib
+		# generate pmdinfo sources
+		pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+			'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+		foreach src: pmdinfogen_srcs
+			out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+			tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+				src, include_directories: includes,
+				dependencies: dep_objs,
+				c_args: cflags)
+			sources += custom_target(out_filename,
+					command: [pmdinfo, tmp_lib.full_path(),
+						'@OUTPUT@', pmdinfogen],
+					output: out_filename,
+					depends: [pmdinfogen, tmp_lib])
+		endforeach
 
-	# create a dependency object and add it to the global dictionary so
-	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_rte_mempool_@0@'.format(drv),
-			declare_dependency(link_with: lib,
+		# now build the driver itself, and add to the drivers list
+		drv_name = 'rte_mempool_@0@'.format(drv)
+		version_map = '@0@/@1@/rte_mempool_@1@_version.map'.format(
+				meson.current_source_dir(), drv)
+		lib = library(drv_name,
+			sources,
+			objects: objs,
 			include_directories: includes,
-			dependencies: dep_objs))
+			dependencies: dep_objs,
+			c_args: cflags,
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@0@.1'.format(version),
+			install: true,
+			install_dir: driver_install_path)
+
+		dpdk_drivers += lib
+
+		# create a dependency object and add it to the global dictionary so
+		# testpmd or other built-in apps can find it if necessary
+		set_variable('dep_rte_mempool_@0@'.format(drv),
+				declare_dependency(link_with: lib,
+				include_directories: includes,
+				dependencies: dep_objs))
+	endif # build
 endforeach
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
index 56ba22e73..c0dcc9b1f 100644
--- a/drivers/net/af_packet/meson.build
+++ b/drivers/net/af_packet/meson.build
@@ -29,4 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+if host_machine.system() != 'linux'
+	build = false
+endif
 sources = files('rte_eth_af_packet.c')
diff --git a/drivers/net/ark/meson.build b/drivers/net/ark/meson.build
index a94d70383..385413af1 100644
--- a/drivers/net/ark/meson.build
+++ b/drivers/net/ark/meson.build
@@ -41,4 +41,5 @@ sources = files('ark_ddm.c',
 		'ark_udm.c')
 if host_machine.system() == 'linux'
 	ext_deps += cc.find_library('dl')
+	pkgconfig_extra_libs += '-ldl'
 endif
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 2fb7577fa..cf06edce8 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,83 +29,80 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-net_drivers = ['ark', 'avp', 'i40e', 'ixgbe']
-
-# af_packet only works on linux
-if host_machine.system() == 'linux'
-	net_drivers += 'af_packet'
-endif
-
-pcap_dep = dependency('pcap', required: false)
-# pcap doesn't use pkg-config, but future meson versions should support picking
-# it up as a dependency. For older versions <0.42 use find_program instead
-if pcap_dep.found() or find_program('pcap-config', required: false).found()
-	net_drivers += 'pcap'
-endif
-
-foreach drv:net_drivers
-	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+drivers = ['af_packet', 'ark', 'avp', 'i40e', 'ixgbe', 'pcap']
+std_deps = ['ether', 'kvargs'] 	# 'ether' as dep, also pulls in mbuf, net, mempool, eal etc
 
+foreach drv:drivers
 	# set up empty variables used for build
+	build = true # set to false to disable, e.g. missing deps
 	version = 1
 	sources = []
 	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
-	# dependency managment. External deps managed using dependency
-	# objects, internal deps managed by name of lib
+	# set up internal deps. Drivers can append/override as necessary
+	deps = std_deps
+	# ext_deps: Stores external library dependency got
+	# using dependency() or cc.find_library(). For most cases, we
+	# probably also need to specify the "-l" flags in
+	# pkgconfig_extra_libs variable too, so that it can be reflected
+	# in the pkgconfig output for static builds
 	ext_deps = []
-	# set up standard deps. Drivers can append/override as necessary
-	# 'ether' as dep, also pulls in mbuf, net, mempool, ring, eal etc
-	deps = ['ether', 'kvargs']
+	pkgconfig_extra_libs = []
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
-	# get dependency objs from strings
-	dep_objs = ext_deps
-	foreach d:deps
-		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
-	endforeach
-
-	# generate pmdinfo sources
-	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-	foreach src: pmdinfogen_srcs
-		out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
-		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-			src, include_directories: includes,
-			dependencies: dep_objs,
-			c_args: cflags)
-		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(),
-					'@OUTPUT@', pmdinfogen],
-				output: out_filename,
-				depends: [pmdinfogen, tmp_lib])
-	endforeach
+	if build
+		dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
-	# now build the driver itself, and add to the drivers list
-	drv_name = 'rte_pmd_@0@'.format(drv)
-	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
-			meson.current_source_dir(), drv)
-	lib = library(drv_name,
-		sources,
-		objects: objs,
-		include_directories: includes,
-		dependencies: dep_objs,
-		c_args: cflags,
-		link_args: '-Wl,--version-script=' + version_map,
-		link_depends: version_map,
-		version: '@0@.1'.format(version),
-		install: true,
-		install_dir: driver_install_path)
+		# get dependency objs from strings
+		dep_objs = []
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+		endforeach
+		dep_objs += ext_deps
+		dpdk_extra_ldflags += pkgconfig_extra_libs
 
-	dpdk_drivers += lib
+		# generate pmdinfo sources
+		pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+			'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+		foreach src: pmdinfogen_srcs
+			out_filename = '@0@.pmd.c'.format(src.split('/')[-1])
+			tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+				src, include_directories: includes,
+				dependencies: dep_objs,
+				c_args: cflags)
+			sources += custom_target(out_filename,
+					command: [pmdinfo, tmp_lib.full_path(),
+						'@OUTPUT@', pmdinfogen],
+					output: out_filename,
+					depends: [pmdinfogen, tmp_lib])
+		endforeach
 
-	# create a dependency object and add it to the global dictionary so
-	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_rte_pmd_@0@'.format(drv),
-			declare_dependency(link_with: lib,
+		# now build the driver itself, and add to the drivers list
+		drv_name = 'rte_pmd_@0@'.format(drv)
+		version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+				meson.current_source_dir(), drv)
+		lib = library(drv_name,
+			sources,
+			objects: objs,
 			include_directories: includes,
-			dependencies: dep_objs))
+			dependencies: dep_objs,
+			c_args: cflags,
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@0@.1'.format(version),
+			install: true,
+			install_dir: driver_install_path)
+
+		dpdk_drivers += lib
+
+		# create a dependency object and add it to the global dictionary so
+		# testpmd or other built-in apps can find it if necessary
+		set_variable('dep_rte_pmd_@0@'.format(drv),
+				declare_dependency(link_with: lib,
+				include_directories: includes,
+				dependencies: dep_objs))
+	endif # build
 endforeach
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
index a61668236..2cfe76410 100644
--- a/drivers/net/pcap/meson.build
+++ b/drivers/net/pcap/meson.build
@@ -29,10 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = files('rte_eth_pcap.c')
-
-if pcap_dep.found()
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found() == true
 	ext_deps += pcap_dep
-else
+elif find_program('pcap-config', required: false).found() == true
 	ext_deps += cc.find_library('pcap')
+else
+	build = false
 endif
+sources = files('rte_eth_pcap.c')
+pkgconfig_extra_libs += '-lpcap'
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 96ad1cef7..bc9c3f0cb 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -58,7 +58,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			install: true
 )
 
-dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
index bd162938c..ad0949a92 100644
--- a/lib/librte_eal/common/include/arch/x86/meson.build
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -41,6 +41,7 @@ install_headers(
 	'rte_io.h',
 	'rte_memcpy.h',
 	'rte_prefetch.h',
+	'rte_pause.h',
 	'rte_rtm.h',
 	'rte_rwlock.h',
 	'rte_spinlock.h',
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index 30741519b..886bcbf0e 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -63,7 +63,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			install: true
 )
 
-dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
diff --git a/meson.build b/meson.build
index dfcead92a..ca495ec7e 100644
--- a/meson.build
+++ b/meson.build
@@ -41,6 +41,7 @@ cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
 dpdk_libraries = []
 dpdk_drivers = []
+dpdk_extra_ldflags = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -74,7 +75,8 @@ configure_file(output: build_cfg,
 # for static builds, include the drivers as libs, and also any
 # other dependent libs that DPDK needs to link against
 if get_option('default_library') == 'static'
-	dpdk_libraries = dpdk_drivers + dpdk_libraries
+	dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+	dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
 endif
 
 pkg = import('pkgconfig')
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFCv2 40/40] examples: allow basic sample app build using pkg-config
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (38 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 39/40] build: fix driver dependencies for static builds Bruce Richardson
@ 2017-08-14  9:52 ` Bruce Richardson
  2017-08-15 10:56 ` [RFCv2 00/40] Building DPDK with meson and ninja Luca Boccassi
  2017-08-17 14:10 ` Marco Varlese
  41 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-14  9:52 UTC (permalink / raw)
  To: dev; +Cc: thomas, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/helloworld/Makefile | 13 +++++++++++++
 examples/l2fwd/Makefile      | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
index c83ec01e8..270f02f91 100644
--- a/examples/helloworld/Makefile
+++ b/examples/helloworld/Makefile
@@ -29,6 +29,17 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+ifeq ($(shell pkg-config --exists DPDK || echo 1),)
+# we have pkg-config install DPDK
+
+CFLAGS += $(shell pkg-config --cflags DPDK)
+LDFLAGS += $(shell pkg-config --libs DPDK)
+
+helloworld: main.o
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+else # legacy build system
+
 ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
@@ -48,3 +59,5 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 include $(RTE_SDK)/mk/rte.extapp.mk
+
+endif
diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile
index 8896ab452..d631c7d35 100644
--- a/examples/l2fwd/Makefile
+++ b/examples/l2fwd/Makefile
@@ -29,6 +29,17 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+ifeq ($(shell pkg-config --exists DPDK || echo 1),)
+# we have pkg-config install DPDK
+
+CFLAGS += $(shell pkg-config --cflags DPDK)
+LDFLAGS += $(shell pkg-config --libs DPDK)
+
+l2fwd: main.o
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+else # legacy build system
+
 ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
@@ -48,3 +59,5 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 include $(RTE_SDK)/mk/rte.extapp.mk
+
+endif
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (39 preceding siblings ...)
  2017-08-14  9:52 ` [RFCv2 40/40] examples: allow basic sample app build using pkg-config Bruce Richardson
@ 2017-08-15 10:56 ` Luca Boccassi
  2017-08-15 11:31   ` Bruce Richardson
  2017-08-17 14:10 ` Marco Varlese
  41 siblings, 1 reply; 50+ messages in thread
From: Luca Boccassi @ 2017-08-15 10:56 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/2
> 5104/]
> here is a second draft implementation for building DPDK with meson
> and
> ninja. While still not building all of DPDK, and needing patch
> cleanup so
> that patches don't overwrite previous work, it is more complete in
> many
> ways than the previous version and includes:
> 
> * dynamic build configuration e.g. building pcap driver only if pcap
> is
>   found, only build af_packet if the target is linux, and only
> building QAT
>   and openssl crypto drivers if libcrypto is found
> * support for pmdinfo inside the PMDs(for shared builds) and binaries
> (for
>   static builds)
> * generalized/standardized way of building libs and drivers, though
> the
>   drivers code still needs generalization at the driver, rather than
>   driver-class level.
> * support for having a pkgconfig file for DPDK on install, and
> helloworld
>   and l2fwd can be built using the pkgconfig info (via make, not
> ninja)
> * support for library versions
> * an implementation for FreeBSD as well as Linux
> * all libraries are included in the build, as well as a number of
> NIC,
>   crypto, and mempool drivers
> * the igb_uio kernel module is build via the kernel Kbuild system as
> part
>   of a meson/ninja DPDK build
> 
> there is still plenty to do on this, but please review and test it
> out.
> I've kept the patches split so that the evolution of the work is a
> bit
> clearer than having it all send in a monolithic patch. All feedback
> welcome. I recommend one uses the latest meson release for this,
> though the
> minimum version supported should be v0.4.
> 
> I've tested static and dynamic builds with clang and gcc on Fedora
> 26, and
> done test builds on FreeBSD 11 with clang too. Build with other
> compilers
> and on other OS's may have issues, so YMMV.
> 
> To do a basic build, using gcc and with shared libs, in a folder
> called "gcc-build":
> 
> 	user@host:dpdk$ meson gcc-build
> 	....
> 	user@host:dpdk$ cd gcc-build
> 	user@host:gcc-build$ ninja
> 	user@host:gcc-build$ sudo ninja install
> 
> To do a build with clang, using static libs:
> 
> 	user@host:dpdk$ CC=clang meson --default_library=static clang-
> build
> 	....
> 	user@host:dpdk$ cd clang-build
> 	user@host:clang-build$ ninja
> 	user@host:clang-build$ sudo ninja install
> 
> Other options can be adjusted by running "mesonconf" in the build
> directory, i.e. gcc-build or clang-build in the examples above.

Hi Bruce,

This is great, thank you!

I'll try to give this set a run in the Debian context as soon as I have
time.

It's also great to see a pkg-config file!

I haven't gone through the diff yet, but do you think it would be
possible, now or later on, to add the option to install architecture-
specific headers in a different directory than the arch-independent
ones?

This is in the context of multi-arch: on Debian and Ubuntu there's a
lot of effort to make sure libraries built on different architectures
are co-installable. Which means either the files must be identical, or
in arch-specific paths (eg: /usr/include/x86_64-linux-gnu/ and
/usr/lib/x86_64-linux-gnu/).

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-15 10:56 ` [RFCv2 00/40] Building DPDK with meson and ninja Luca Boccassi
@ 2017-08-15 11:31   ` Bruce Richardson
  0 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-15 11:31 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

On Tue, Aug 15, 2017 at 11:56:38AM +0100, Luca Boccassi wrote:
> On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/2
> > 5104/]
> > here is a second draft implementation for building DPDK with meson
> > and
> > ninja. While still not building all of DPDK, and needing patch
> > cleanup so
> > that patches don't overwrite previous work, it is more complete in
> > many
> > ways than the previous version and includes:
> > 
> > * dynamic build configuration e.g. building pcap driver only if pcap
> > is
> >   found, only build af_packet if the target is linux, and only
> > building QAT
> >   and openssl crypto drivers if libcrypto is found
> > * support for pmdinfo inside the PMDs(for shared builds) and binaries
> > (for
> >   static builds)
> > * generalized/standardized way of building libs and drivers, though
> > the
> >   drivers code still needs generalization at the driver, rather than
> >   driver-class level.
> > * support for having a pkgconfig file for DPDK on install, and
> > helloworld
> >   and l2fwd can be built using the pkgconfig info (via make, not
> > ninja)
> > * support for library versions
> > * an implementation for FreeBSD as well as Linux
> > * all libraries are included in the build, as well as a number of
> > NIC,
> >   crypto, and mempool drivers
> > * the igb_uio kernel module is build via the kernel Kbuild system as
> > part
> >   of a meson/ninja DPDK build
> > 
> > there is still plenty to do on this, but please review and test it
> > out.
> > I've kept the patches split so that the evolution of the work is a
> > bit
> > clearer than having it all send in a monolithic patch. All feedback
> > welcome. I recommend one uses the latest meson release for this,
> > though the
> > minimum version supported should be v0.4.
> > 
> > I've tested static and dynamic builds with clang and gcc on Fedora
> > 26, and
> > done test builds on FreeBSD 11 with clang too. Build with other
> > compilers
> > and on other OS's may have issues, so YMMV.
> > 
> > To do a basic build, using gcc and with shared libs, in a folder
> > called "gcc-build":
> > 
> > 	user@host:dpdk$ meson gcc-build
> > 	....
> > 	user@host:dpdk$ cd gcc-build
> > 	user@host:gcc-build$ ninja
> > 	user@host:gcc-build$ sudo ninja install
> > 
> > To do a build with clang, using static libs:
> > 
> > 	user@host:dpdk$ CC=clang meson --default_library=static clang-
> > build
> > 	....
> > 	user@host:dpdk$ cd clang-build
> > 	user@host:clang-build$ ninja
> > 	user@host:clang-build$ sudo ninja install
> > 
> > Other options can be adjusted by running "mesonconf" in the build
> > directory, i.e. gcc-build or clang-build in the examples above.
> 
> Hi Bruce,
> 
> This is great, thank you!
> 
> I'll try to give this set a run in the Debian context as soon as I have
> time.
> 
Please do, thanks. Let me know any issues you hit, or further
suggestions for improvement. Please also check the reproducible build
aspects, as I may have let some absolute paths sneek in some places
inadvertently, while getting the more awkward stuff (like pmdinfo)
ported over.

> It's also great to see a pkg-config file!
> 
I'm not sure what others think, but I believe we need to move away from
any requirement for external apps, or even our examples, to have a
particular way of being built. Instead, everything should be done
through the pkg-config, where possible.

> I haven't gone through the diff yet, but do you think it would be
> possible, now or later on, to add the option to install architecture-
> specific headers in a different directory than the arch-independent
> ones?
> 
I'm sure it's possible, it's just a matter of how awkward it would be.
:-)

> This is in the context of multi-arch: on Debian and Ubuntu there's a
> lot of effort to make sure libraries built on different architectures
> are co-installable. Which means either the files must be identical, or
> in arch-specific paths (eg: /usr/include/x86_64-linux-gnu/ and
> /usr/lib/x86_64-linux-gnu/).
> 
> -- 
> Kind regards,
> Luca Boccassi

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
                   ` (40 preceding siblings ...)
  2017-08-15 10:56 ` [RFCv2 00/40] Building DPDK with meson and ninja Luca Boccassi
@ 2017-08-17 14:10 ` Marco Varlese
  2017-08-17 15:25   ` Luca Boccassi
       [not found]   ` <1502983469.31476.3.camel@gmail.com>
  41 siblings, 2 replies; 50+ messages in thread
From: Marco Varlese @ 2017-08-17 14:10 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: thomas


Hi Bruce,

On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/25104/]
> here is a second draft implementation for building DPDK with meson and
> ninja. While still not building all of DPDK, and needing patch cleanup so
> that patches don't overwrite previous work, it is more complete in many
> ways than the previous version and includes:
> 
> * dynamic build configuration e.g. building pcap driver only if pcap is
>   found, only build af_packet if the target is linux, and only building QAT
>   and openssl crypto drivers if libcrypto is found
> * support for pmdinfo inside the PMDs(for shared builds) and binaries (for
>   static builds)
> * generalized/standardized way of building libs and drivers, though the
>   drivers code still needs generalization at the driver, rather than
>   driver-class level.
> * support for having a pkgconfig file for DPDK on install, and helloworld
>   and l2fwd can be built using the pkgconfig info (via make, not ninja)
> * support for library versions
> * an implementation for FreeBSD as well as Linux
> * all libraries are included in the build, as well as a number of NIC,
>   crypto, and mempool drivers
> * the igb_uio kernel module is build via the kernel Kbuild system as part
>   of a meson/ninja DPDK build

This is really great to see. I do have one suggestion.
Would it be possible to version the libraries built by the build-system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:
# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system. 

For example, we could have the following scenario:

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Is this something which could be incorporated as part of this work?

> 
> there is still plenty to do on this, but please review and test it out.
> I've kept the patches split so that the evolution of the work is a bit
> clearer than having it all send in a monolithic patch. All feedback
> welcome. I recommend one uses the latest meson release for this, though the
> minimum version supported should be v0.4.
> 
> I've tested static and dynamic builds with clang and gcc on Fedora 26, and
> done test builds on FreeBSD 11 with clang too. Build with other compilers
> and on other OS's may have issues, so YMMV.
I'll give it a try on openSUSE and let you know of any issues I might face.


Cheers,
Marco

> 
> To do a basic build, using gcc and with shared libs, in a folder called "gcc-
> build":
> 
> 	user@host:dpdk$ meson gcc-build
> 	....
> 	user@host:dpdk$ cd gcc-build
> 	user@host:gcc-build$ ninja
> 	user@host:gcc-build$ sudo ninja install
> 
> To do a build with clang, using static libs:
> 
> 	user@host:dpdk$ CC=clang meson --default_library=static clang-build
> 	....
> 	user@host:dpdk$ cd clang-build
> 	user@host:clang-build$ ninja
> 	user@host:clang-build$ sudo ninja install
> 
> Other options can be adjusted by running "mesonconf" in the build
> directory, i.e. gcc-build or clang-build in the examples above.
> 
> 
> Bruce Richardson (40):
>   build: initial hooks for using meson with DPDK
>   build: create pkg-config file for DPDK
>   build: build linuxapp EAL with meson and ninja
>   build: add EAL support under BSD
>   build: add core libraries to meson build system
>   build: add i40e driver to meson build
>   build: add pmdinfogen to build
>   build: generate list of sources for pmdinfogen
>   build: build i40e driver, including pmdinfo
>   build: install usertools scripts
>   build: simplify generation of pmd.c files
>   build: generalize net driver build to higher level
>   build: remove hard-coded enablement of vector driver
>   build: add ixgbe driver to build
>   build: set up standard deps for drivers
>   build: add af_packet driver to build
>   build: add pcap PMD support
>   build: add symbol version map file support to libs
>   build: build libraries in a loop for brevity
>   build: version library .so files
>   eal: add version information to meson build
>   build: add mempool drivers to build
>   build: add gro library to meson build
>   build: tweak naming of pmd dependencies
>   build: track driver include directories properly
>   metrics: add metrics lib to meson build
>   build: track dependencies recursively
>   testpmd: compile testpmd with meson and ninja
>   crypto/null: rename the version file to standard
>   crypto/qat: remove dependency on ether library
>   build: add cryptodev and some crypto drivers to build
>   igb_uio: add igb_uio to meson build
>   ip_frag: rename version file to standard name
>   build: add most remaining libraries to meson build
>   build: add packet framework libs to meson build
>   acl: add acl library to meson build
>   build: add ark and avp PMDs to build
>   build: fix static library builds with base code
>   build: fix driver dependencies for static builds
>   examples: allow basic sample app build using pkg-config
> 
>  app/meson.build                                    |  32 ++++++
>  app/test-pmd/meson.build                           |  74 +++++++++++++
>  buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++
>  buildtools/meson.build                             |  34 ++++++
>  buildtools/pmdinfogen/meson.build                  |  43 ++++++++
>  config/meson.build                                 |  69 +++++++++++++
>  config/rte_config.h                                | 114
> +++++++++++++++++++++
>  config/x86/meson.build                             |  70 +++++++++++++
>  drivers/crypto/meson.build                         | 108 +++++++++++++++++++
>  drivers/crypto/null/Makefile                       |   2 +-
>  drivers/crypto/null/meson.build                    |  32 ++++++
>  ...crypto_version.map => rte_pmd_null_version.map} |   0
>  drivers/crypto/openssl/meson.build                 |  38 +++++++
>  drivers/crypto/qat/meson.build                     |  41 ++++++++
>  drivers/crypto/qat/qat_crypto.c                    |   1 -
>  drivers/mempool/meson.build                        | 108 +++++++++++++++++++
>  drivers/mempool/ring/meson.build                   |  32 ++++++
>  drivers/mempool/stack/meson.build                  |  32 ++++++
>  drivers/meson.build                                |  34 ++++++
>  drivers/net/af_packet/meson.build                  |  35 +++++++
>  drivers/net/ark/meson.build                        |  45 ++++++++
>  drivers/net/avp/meson.build                        |  34 ++++++
>  drivers/net/i40e/base/meson.build                  |  56 ++++++++++
>  drivers/net/i40e/meson.build                       |  61 +++++++++++
>  drivers/net/ixgbe/base/meson.build                 |  60 +++++++++++
>  drivers/net/ixgbe/meson.build                      |  58 +++++++++++
>  drivers/net/meson.build                            | 108 +++++++++++++++++++
>  drivers/net/pcap/meson.build                       |  41 ++++++++
>  examples/helloworld/Makefile                       |  13 +++
>  examples/l2fwd/Makefile                            |  13 +++
>  lib/librte_acl/meson.build                         |  60 +++++++++++
>  lib/librte_bitratestats/meson.build                |  34 ++++++
>  lib/librte_cfgfile/meson.build                     |  35 +++++++
>  lib/librte_cmdline/meson.build                     |  57 +++++++++++
>  lib/librte_compat/meson.build                      |  36 +++++++
>  lib/librte_cryptodev/meson.build                   |  40 ++++++++
>  lib/librte_distributor/meson.build                 |  39 +++++++
>  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/igb_uio/Kbuild             |   1 +
>  lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++
>  lib/librte_eal/linuxapp/meson.build                |  42 ++++++++
>  lib/librte_eal/meson.build                         |  44 ++++++++
>  lib/librte_efd/meson.build                         |  34 ++++++
>  lib/librte_ether/meson.build                       |  46 +++++++++
>  lib/librte_eventdev/meson.build                    |  36 +++++++
>  lib/librte_gro/meson.build                         |  34 ++++++
>  lib/librte_hash/meson.build                        |  46 +++++++++
>  lib/librte_ip_frag/Makefile                        |   2 +-
>  lib/librte_ip_frag/meson.build                     |  39 +++++++
>  ..._ipfrag_version.map => rte_ip_frag_version.map} |   0
>  lib/librte_jobstats/meson.build                    |  34 ++++++
>  lib/librte_kni/meson.build                         |  35 +++++++
>  lib/librte_kvargs/meson.build                      |  35 +++++++
>  lib/librte_latencystats/meson.build                |  34 ++++++
>  lib/librte_lpm/meson.build                         |  35 +++++++
>  lib/librte_mbuf/meson.build                        |  36 +++++++
>  lib/librte_mempool/meson.build                     |  35 +++++++
>  lib/librte_meter/meson.build                       |  34 ++++++
>  lib/librte_metrics/meson.build                     |  34 ++++++
>  lib/librte_net/meson.build                         |  46 +++++++++
>  lib/librte_pdump/meson.build                       |  34 ++++++
>  lib/librte_pipeline/meson.build                    |  35 +++++++
>  lib/librte_port/meson.build                        |  58 +++++++++++
>  lib/librte_power/meson.build                       |  35 +++++++
>  lib/librte_reorder/meson.build                     |  34 ++++++
>  lib/librte_ring/meson.build                        |  34 ++++++
>  lib/librte_sched/meson.build                       |  36 +++++++
>  lib/librte_table/meson.build                       |  52 ++++++++++
>  lib/librte_timer/meson.build                       |  34 ++++++
>  lib/librte_vhost/meson.build                       |  36 +++++++
>  lib/meson.build                                    | 105 +++++++++++++++++++
>  meson.build                                        |  88 ++++++++++++++++
>  meson_options.txt                                  |   8 ++
>  usertools/meson.build                              |  32 ++++++
>  82 files changed, 3536 insertions(+), 3 deletions(-)
>  create mode 100644 app/meson.build
>  create mode 100644 app/test-pmd/meson.build
>  create mode 100755 buildtools/gen-pmdinfo-cfile.sh
>  create mode 100644 buildtools/meson.build
>  create mode 100644 buildtools/pmdinfogen/meson.build
>  create mode 100644 config/meson.build
>  create mode 100644 config/rte_config.h
>  create mode 100644 config/x86/meson.build
>  create mode 100644 drivers/crypto/meson.build
>  create mode 100644 drivers/crypto/null/meson.build
>  rename drivers/crypto/null/{rte_pmd_null_crypto_version.map =>
> rte_pmd_null_version.map} (100%)
>  create mode 100644 drivers/crypto/openssl/meson.build
>  create mode 100644 drivers/crypto/qat/meson.build
>  create mode 100644 drivers/mempool/meson.build
>  create mode 100644 drivers/mempool/ring/meson.build
>  create mode 100644 drivers/mempool/stack/meson.build
>  create mode 100644 drivers/meson.build
>  create mode 100644 drivers/net/af_packet/meson.build
>  create mode 100644 drivers/net/ark/meson.build
>  create mode 100644 drivers/net/avp/meson.build
>  create mode 100644 drivers/net/i40e/base/meson.build
>  create mode 100644 drivers/net/i40e/meson.build
>  create mode 100644 drivers/net/ixgbe/base/meson.build
>  create mode 100644 drivers/net/ixgbe/meson.build
>  create mode 100644 drivers/net/meson.build
>  create mode 100644 drivers/net/pcap/meson.build
>  create mode 100644 lib/librte_acl/meson.build
>  create mode 100644 lib/librte_bitratestats/meson.build
>  create mode 100644 lib/librte_cfgfile/meson.build
>  create mode 100644 lib/librte_cmdline/meson.build
>  create mode 100644 lib/librte_compat/meson.build
>  create mode 100644 lib/librte_cryptodev/meson.build
>  create mode 100644 lib/librte_distributor/meson.build
>  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/igb_uio/Kbuild
>  create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
>  create mode 100644 lib/librte_eal/linuxapp/meson.build
>  create mode 100644 lib/librte_eal/meson.build
>  create mode 100644 lib/librte_efd/meson.build
>  create mode 100644 lib/librte_ether/meson.build
>  create mode 100644 lib/librte_eventdev/meson.build
>  create mode 100644 lib/librte_gro/meson.build
>  create mode 100644 lib/librte_hash/meson.build
>  create mode 100644 lib/librte_ip_frag/meson.build
>  rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map}
> (100%)
>  create mode 100644 lib/librte_jobstats/meson.build
>  create mode 100644 lib/librte_kni/meson.build
>  create mode 100644 lib/librte_kvargs/meson.build
>  create mode 100644 lib/librte_latencystats/meson.build
>  create mode 100644 lib/librte_lpm/meson.build
>  create mode 100644 lib/librte_mbuf/meson.build
>  create mode 100644 lib/librte_mempool/meson.build
>  create mode 100644 lib/librte_meter/meson.build
>  create mode 100644 lib/librte_metrics/meson.build
>  create mode 100644 lib/librte_net/meson.build
>  create mode 100644 lib/librte_pdump/meson.build
>  create mode 100644 lib/librte_pipeline/meson.build
>  create mode 100644 lib/librte_port/meson.build
>  create mode 100644 lib/librte_power/meson.build
>  create mode 100644 lib/librte_reorder/meson.build
>  create mode 100644 lib/librte_ring/meson.build
>  create mode 100644 lib/librte_sched/meson.build
>  create mode 100644 lib/librte_table/meson.build
>  create mode 100644 lib/librte_timer/meson.build
>  create mode 100644 lib/librte_vhost/meson.build
>  create mode 100644 lib/meson.build
>  create mode 100644 meson.build
>  create mode 100644 meson_options.txt
>  create mode 100644 usertools/meson.build
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-17 14:10 ` Marco Varlese
@ 2017-08-17 15:25   ` Luca Boccassi
  2017-08-18  8:35     ` Bruce Richardson
       [not found]   ` <1502983469.31476.3.camel@gmail.com>
  1 sibling, 1 reply; 50+ messages in thread
From: Luca Boccassi @ 2017-08-17 15:25 UTC (permalink / raw)
  To: Marco Varlese, Bruce Richardson, dev; +Cc: thomas

On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> Hi Bruce,
> 
> On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
> > /25104/]
> > here is a second draft implementation for building DPDK with meson
> > and
> > ninja. While still not building all of DPDK, and needing patch
> > cleanup so
> > that patches don't overwrite previous work, it is more complete in
> > many
> > ways than the previous version and includes:
> > 
> > * dynamic build configuration e.g. building pcap driver only if
> > pcap is
> >   found, only build af_packet if the target is linux, and only
> > building QAT
> >   and openssl crypto drivers if libcrypto is found
> > * support for pmdinfo inside the PMDs(for shared builds) and
> > binaries (for
> >   static builds)
> > * generalized/standardized way of building libs and drivers, though
> > the
> >   drivers code still needs generalization at the driver, rather
> > than
> >   driver-class level.
> > * support for having a pkgconfig file for DPDK on install, and
> > helloworld
> >   and l2fwd can be built using the pkgconfig info (via make, not
> > ninja)
> > * support for library versions
> > * an implementation for FreeBSD as well as Linux
> > * all libraries are included in the build, as well as a number of
> > NIC,
> >   crypto, and mempool drivers
> > * the igb_uio kernel module is build via the kernel Kbuild system
> > as part
> >   of a meson/ninja DPDK build
> 
> This is really great to see. I do have one suggestion.
> Would it be possible to version the libraries built by the build-
> system
> following the same version of the DPDK release?
> 
> For instance, in DPDK 17.08 we currently have:
> # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
>   SONAME               librte_pmd_ixgbe.so.1
> 
> Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> 
> I think it would help to facilitate the installation of multiple DPDK
> library
> versions on the same system. 
> 
> For example, we could have the following scenario:
> 
> 1) OpenVSwithc linked with version 17.02 of DPDK
> 2) VPP linked with version 17.08 of DPDK
> 3) DPDK 18.xx installed in the system for any cutting-edge
> application
> prototyping.
> 
> Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in
the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
it in Debian and Ubuntu for the reasons you mentioned.

And if it's not been translated yet, I agree it's an important one.

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
       [not found]   ` <1502983469.31476.3.camel@gmail.com>
@ 2017-08-18  8:00     ` Marco Varlese
  0 siblings, 0 replies; 50+ messages in thread
From: Marco Varlese @ 2017-08-18  8:00 UTC (permalink / raw)
  To: Luca Boccassi, Bruce Richardson, dev

Hi Luca,

On Thu, 2017-08-17 at 16:24 +0100, Luca Boccassi wrote:
> On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> > 
> > Hi Bruce,
> > 
> > On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > > 
> > > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
> > > /25104/]
> > > here is a second draft implementation for building DPDK with meson
> > > and
> > > ninja. While still not building all of DPDK, and needing patch
> > > cleanup so
> > > that patches don't overwrite previous work, it is more complete in
> > > many
> > > ways than the previous version and includes:
> > > 
> > > * dynamic build configuration e.g. building pcap driver only if
> > > pcap is
> > >   found, only build af_packet if the target is linux, and only
> > > building QAT
> > >   and openssl crypto drivers if libcrypto is found
> > > * support for pmdinfo inside the PMDs(for shared builds) and
> > > binaries (for
> > >   static builds)
> > > * generalized/standardized way of building libs and drivers, though
> > > the
> > >   drivers code still needs generalization at the driver, rather
> > > than
> > >   driver-class level.
> > > * support for having a pkgconfig file for DPDK on install, and
> > > helloworld
> > >   and l2fwd can be built using the pkgconfig info (via make, not
> > > ninja)
> > > * support for library versions
> > > * an implementation for FreeBSD as well as Linux
> > > * all libraries are included in the build, as well as a number of
> > > NIC,
> > >   crypto, and mempool drivers
> > > * the igb_uio kernel module is build via the kernel Kbuild system
> > > as part
> > >   of a meson/ninja DPDK build
> > 
> > This is really great to see. I do have one suggestion.
> > Would it be possible to version the libraries built by the build-
> > system
> > following the same version of the DPDK release?
> > 
> > For instance, in DPDK 17.08 we currently have:
> > # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
> >   SONAME               librte_pmd_ixgbe.so.1
> > 
> > Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> > 
> > I think it would help to facilitate the installation of multiple DPDK
> > library
> > versions on the same system. 
> > 
> > For example, we could have the following scenario:
> > 
> > 1) OpenVSwithc linked with version 17.02 of DPDK
> > 2) VPP linked with version 17.08 of DPDK
> > 3) DPDK 18.xx installed in the system for any cutting-edge
> > application
> > prototyping.
> > 
> > Is this something which could be incorporated as part of this work?
> 
> Christian sent a patch a while ago, which was merged, to enable this in
> the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
> it in Debian and Ubuntu for the reasons you mentioned.
Thanks for your input, very much appreciated.
I'll give it a try right away.

> 
> And if it's not been translated yet, I agree it's an important one.
> 
> > 
> > > 
> > > there is still plenty to do on this, but please review and test it
> > > out.
> > > I've kept the patches split so that the evolution of the work is a
> > > bit
> > > clearer than having it all send in a monolithic patch. All feedback
> > > welcome. I recommend one uses the latest meson release for this,
> > > though the
> > > minimum version supported should be v0.4.
> > > 
> > > I've tested static and dynamic builds with clang and gcc on Fedora
> > > 26, and
> > > done test builds on FreeBSD 11 with clang too. Build with other
> > > compilers
> > > and on other OS's may have issues, so YMMV.
> > 
> > I'll give it a try on openSUSE and let you know of any issues I might
> > face.
> > 
> > 
> > Cheers,
> > Marco
> > 
> > > 
> > > 
> > > To do a basic build, using gcc and with shared libs, in a folder
> > > called "gcc-
> > > build":
> > > 
> > > 	user@host:dpdk$ meson gcc-build
> > > 	....
> > > 	user@host:dpdk$ cd gcc-build
> > > 	user@host:gcc-build$ ninja
> > > 	user@host:gcc-build$ sudo ninja install
> > > 
> > > To do a build with clang, using static libs:
> > > 
> > > 	user@host:dpdk$ CC=clang meson --default_library=static clang-
> > > build
> > > 	....
> > > 	user@host:dpdk$ cd clang-build
> > > 	user@host:clang-build$ ninja
> > > 	user@host:clang-build$ sudo ninja install
> > > 
> > > Other options can be adjusted by running "mesonconf" in the build
> > > directory, i.e. gcc-build or clang-build in the examples above.
> > > 
> > > 
> > > Bruce Richardson (40):
> > >   build: initial hooks for using meson with DPDK
> > >   build: create pkg-config file for DPDK
> > >   build: build linuxapp EAL with meson and ninja
> > >   build: add EAL support under BSD
> > >   build: add core libraries to meson build system
> > >   build: add i40e driver to meson build
> > >   build: add pmdinfogen to build
> > >   build: generate list of sources for pmdinfogen
> > >   build: build i40e driver, including pmdinfo
> > >   build: install usertools scripts
> > >   build: simplify generation of pmd.c files
> > >   build: generalize net driver build to higher level
> > >   build: remove hard-coded enablement of vector driver
> > >   build: add ixgbe driver to build
> > >   build: set up standard deps for drivers
> > >   build: add af_packet driver to build
> > >   build: add pcap PMD support
> > >   build: add symbol version map file support to libs
> > >   build: build libraries in a loop for brevity
> > >   build: version library .so files
> > >   eal: add version information to meson build
> > >   build: add mempool drivers to build
> > >   build: add gro library to meson build
> > >   build: tweak naming of pmd dependencies
> > >   build: track driver include directories properly
> > >   metrics: add metrics lib to meson build
> > >   build: track dependencies recursively
> > >   testpmd: compile testpmd with meson and ninja
> > >   crypto/null: rename the version file to standard
> > >   crypto/qat: remove dependency on ether library
> > >   build: add cryptodev and some crypto drivers to build
> > >   igb_uio: add igb_uio to meson build
> > >   ip_frag: rename version file to standard name
> > >   build: add most remaining libraries to meson build
> > >   build: add packet framework libs to meson build
> > >   acl: add acl library to meson build
> > >   build: add ark and avp PMDs to build
> > >   build: fix static library builds with base code
> > >   build: fix driver dependencies for static builds
> > >   examples: allow basic sample app build using pkg-config
> > > 
> > >  app/meson.build                                    |  32 ++++++
> > >  app/test-pmd/meson.build                           |  74
> > > +++++++++++++
> > >  buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++
> > >  buildtools/meson.build                             |  34 ++++++
> > >  buildtools/pmdinfogen/meson.build                  |  43 ++++++++
> > >  config/meson.build                                 |  69
> > > +++++++++++++
> > >  config/rte_config.h                                | 114
> > > +++++++++++++++++++++
> > >  config/x86/meson.build                             |  70
> > > +++++++++++++
> > >  drivers/crypto/meson.build                         | 108
> > > +++++++++++++++++++
> > >  drivers/crypto/null/Makefile                       |   2 +-
> > >  drivers/crypto/null/meson.build                    |  32 ++++++
> > >  ...crypto_version.map => rte_pmd_null_version.map} |   0
> > >  drivers/crypto/openssl/meson.build                 |  38 +++++++
> > >  drivers/crypto/qat/meson.build                     |  41 ++++++++
> > >  drivers/crypto/qat/qat_crypto.c                    |   1 -
> > >  drivers/mempool/meson.build                        | 108
> > > +++++++++++++++++++
> > >  drivers/mempool/ring/meson.build                   |  32 ++++++
> > >  drivers/mempool/stack/meson.build                  |  32 ++++++
> > >  drivers/meson.build                                |  34 ++++++
> > >  drivers/net/af_packet/meson.build                  |  35 +++++++
> > >  drivers/net/ark/meson.build                        |  45 ++++++++
> > >  drivers/net/avp/meson.build                        |  34 ++++++
> > >  drivers/net/i40e/base/meson.build                  |  56
> > > ++++++++++
> > >  drivers/net/i40e/meson.build                       |  61
> > > +++++++++++
> > >  drivers/net/ixgbe/base/meson.build                 |  60
> > > +++++++++++
> > >  drivers/net/ixgbe/meson.build                      |  58
> > > +++++++++++
> > >  drivers/net/meson.build                            | 108
> > > +++++++++++++++++++
> > >  drivers/net/pcap/meson.build                       |  41 ++++++++
> > >  examples/helloworld/Makefile                       |  13 +++
> > >  examples/l2fwd/Makefile                            |  13 +++
> > >  lib/librte_acl/meson.build                         |  60
> > > +++++++++++
> > >  lib/librte_bitratestats/meson.build                |  34 ++++++
> > >  lib/librte_cfgfile/meson.build                     |  35 +++++++
> > >  lib/librte_cmdline/meson.build                     |  57
> > > +++++++++++
> > >  lib/librte_compat/meson.build                      |  36 +++++++
> > >  lib/librte_cryptodev/meson.build                   |  40 ++++++++
> > >  lib/librte_distributor/meson.build                 |  39 +++++++
> > >  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/igb_uio/Kbuild             |   1 +
> > >  lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++
> > >  lib/librte_eal/linuxapp/meson.build                |  42 ++++++++
> > >  lib/librte_eal/meson.build                         |  44 ++++++++
> > >  lib/librte_efd/meson.build                         |  34 ++++++
> > >  lib/librte_ether/meson.build                       |  46 +++++++++
> > >  lib/librte_eventdev/meson.build                    |  36 +++++++
> > >  lib/librte_gro/meson.build                         |  34 ++++++
> > >  lib/librte_hash/meson.build                        |  46 +++++++++
> > >  lib/librte_ip_frag/Makefile                        |   2 +-
> > >  lib/librte_ip_frag/meson.build                     |  39 +++++++
> > >  ..._ipfrag_version.map => rte_ip_frag_version.map} |   0
> > >  lib/librte_jobstats/meson.build                    |  34 ++++++
> > >  lib/librte_kni/meson.build                         |  35 +++++++
> > >  lib/librte_kvargs/meson.build                      |  35 +++++++
> > >  lib/librte_latencystats/meson.build                |  34 ++++++
> > >  lib/librte_lpm/meson.build                         |  35 +++++++
> > >  lib/librte_mbuf/meson.build                        |  36 +++++++
> > >  lib/librte_mempool/meson.build                     |  35 +++++++
> > >  lib/librte_meter/meson.build                       |  34 ++++++
> > >  lib/librte_metrics/meson.build                     |  34 ++++++
> > >  lib/librte_net/meson.build                         |  46 +++++++++
> > >  lib/librte_pdump/meson.build                       |  34 ++++++
> > >  lib/librte_pipeline/meson.build                    |  35 +++++++
> > >  lib/librte_port/meson.build                        |  58
> > > +++++++++++
> > >  lib/librte_power/meson.build                       |  35 +++++++
> > >  lib/librte_reorder/meson.build                     |  34 ++++++
> > >  lib/librte_ring/meson.build                        |  34 ++++++
> > >  lib/librte_sched/meson.build                       |  36 +++++++
> > >  lib/librte_table/meson.build                       |  52
> > > ++++++++++
> > >  lib/librte_timer/meson.build                       |  34 ++++++
> > >  lib/librte_vhost/meson.build                       |  36 +++++++
> > >  lib/meson.build                                    | 105
> > > +++++++++++++++++++
> > >  meson.build                                        |  88
> > > ++++++++++++++++
> > >  meson_options.txt                                  |   8 ++
> > >  usertools/meson.build                              |  32 ++++++
> > >  82 files changed, 3536 insertions(+), 3 deletions(-)
> > >  create mode 100644 app/meson.build
> > >  create mode 100644 app/test-pmd/meson.build
> > >  create mode 100755 buildtools/gen-pmdinfo-cfile.sh
> > >  create mode 100644 buildtools/meson.build
> > >  create mode 100644 buildtools/pmdinfogen/meson.build
> > >  create mode 100644 config/meson.build
> > >  create mode 100644 config/rte_config.h
> > >  create mode 100644 config/x86/meson.build
> > >  create mode 100644 drivers/crypto/meson.build
> > >  create mode 100644 drivers/crypto/null/meson.build
> > >  rename drivers/crypto/null/{rte_pmd_null_crypto_version.map =>
> > > rte_pmd_null_version.map} (100%)
> > >  create mode 100644 drivers/crypto/openssl/meson.build
> > >  create mode 100644 drivers/crypto/qat/meson.build
> > >  create mode 100644 drivers/mempool/meson.build
> > >  create mode 100644 drivers/mempool/ring/meson.build
> > >  create mode 100644 drivers/mempool/stack/meson.build
> > >  create mode 100644 drivers/meson.build
> > >  create mode 100644 drivers/net/af_packet/meson.build
> > >  create mode 100644 drivers/net/ark/meson.build
> > >  create mode 100644 drivers/net/avp/meson.build
> > >  create mode 100644 drivers/net/i40e/base/meson.build
> > >  create mode 100644 drivers/net/i40e/meson.build
> > >  create mode 100644 drivers/net/ixgbe/base/meson.build
> > >  create mode 100644 drivers/net/ixgbe/meson.build
> > >  create mode 100644 drivers/net/meson.build
> > >  create mode 100644 drivers/net/pcap/meson.build
> > >  create mode 100644 lib/librte_acl/meson.build
> > >  create mode 100644 lib/librte_bitratestats/meson.build
> > >  create mode 100644 lib/librte_cfgfile/meson.build
> > >  create mode 100644 lib/librte_cmdline/meson.build
> > >  create mode 100644 lib/librte_compat/meson.build
> > >  create mode 100644 lib/librte_cryptodev/meson.build
> > >  create mode 100644 lib/librte_distributor/meson.build
> > >  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/igb_uio/Kbuild
> > >  create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
> > >  create mode 100644 lib/librte_eal/linuxapp/meson.build
> > >  create mode 100644 lib/librte_eal/meson.build
> > >  create mode 100644 lib/librte_efd/meson.build
> > >  create mode 100644 lib/librte_ether/meson.build
> > >  create mode 100644 lib/librte_eventdev/meson.build
> > >  create mode 100644 lib/librte_gro/meson.build
> > >  create mode 100644 lib/librte_hash/meson.build
> > >  create mode 100644 lib/librte_ip_frag/meson.build
> > >  rename lib/librte_ip_frag/{rte_ipfrag_version.map =>
> > > rte_ip_frag_version.map}
> > > (100%)
> > >  create mode 100644 lib/librte_jobstats/meson.build
> > >  create mode 100644 lib/librte_kni/meson.build
> > >  create mode 100644 lib/librte_kvargs/meson.build
> > >  create mode 100644 lib/librte_latencystats/meson.build
> > >  create mode 100644 lib/librte_lpm/meson.build
> > >  create mode 100644 lib/librte_mbuf/meson.build
> > >  create mode 100644 lib/librte_mempool/meson.build
> > >  create mode 100644 lib/librte_meter/meson.build
> > >  create mode 100644 lib/librte_metrics/meson.build
> > >  create mode 100644 lib/librte_net/meson.build
> > >  create mode 100644 lib/librte_pdump/meson.build
> > >  create mode 100644 lib/librte_pipeline/meson.build
> > >  create mode 100644 lib/librte_port/meson.build
> > >  create mode 100644 lib/librte_power/meson.build
> > >  create mode 100644 lib/librte_reorder/meson.build
> > >  create mode 100644 lib/librte_ring/meson.build
> > >  create mode 100644 lib/librte_sched/meson.build
> > >  create mode 100644 lib/librte_table/meson.build
> > >  create mode 100644 lib/librte_timer/meson.build
> > >  create mode 100644 lib/librte_vhost/meson.build
> > >  create mode 100644 lib/meson.build
> > >  create mode 100644 meson.build
> > >  create mode 100644 meson_options.txt
> > >  create mode 100644 usertools/meson.build
> > > 
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-17 15:25   ` Luca Boccassi
@ 2017-08-18  8:35     ` Bruce Richardson
  2017-08-18  8:52       ` Marco Varlese
  2017-08-18  9:33       ` Luca Boccassi
  0 siblings, 2 replies; 50+ messages in thread
From: Bruce Richardson @ 2017-08-18  8:35 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Marco Varlese, dev, thomas

On Thu, Aug 17, 2017 at 04:25:36PM +0100, Luca Boccassi wrote:
> On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> > Hi Bruce,
> > 
> > On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
> > > /25104/]
> > > here is a second draft implementation for building DPDK with meson
> > > and
> > > ninja. While still not building all of DPDK, and needing patch
> > > cleanup so
> > > that patches don't overwrite previous work, it is more complete in
> > > many
> > > ways than the previous version and includes:
> > > 
> > > * dynamic build configuration e.g. building pcap driver only if
> > > pcap is
> > >   found, only build af_packet if the target is linux, and only
> > > building QAT
> > >   and openssl crypto drivers if libcrypto is found
> > > * support for pmdinfo inside the PMDs(for shared builds) and
> > > binaries (for
> > >   static builds)
> > > * generalized/standardized way of building libs and drivers, though
> > > the
> > >   drivers code still needs generalization at the driver, rather
> > > than
> > >   driver-class level.
> > > * support for having a pkgconfig file for DPDK on install, and
> > > helloworld
> > >   and l2fwd can be built using the pkgconfig info (via make, not
> > > ninja)
> > > * support for library versions
> > > * an implementation for FreeBSD as well as Linux
> > > * all libraries are included in the build, as well as a number of
> > > NIC,
> > >   crypto, and mempool drivers
> > > * the igb_uio kernel module is build via the kernel Kbuild system
> > > as part
> > >   of a meson/ninja DPDK build
> > 
> > This is really great to see. I do have one suggestion.
> > Would it be possible to version the libraries built by the build-
> > system
> > following the same version of the DPDK release?
> > 
> > For instance, in DPDK 17.08 we currently have:
> > # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
> >   SONAME               librte_pmd_ixgbe.so.1
> > 
> > Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> > 
> > I think it would help to facilitate the installation of multiple DPDK
> > library
> > versions on the same system. 
> > 
> > For example, we could have the following scenario:
> > 
> > 1) OpenVSwithc linked with version 17.02 of DPDK
> > 2) VPP linked with version 17.08 of DPDK
> > 3) DPDK 18.xx installed in the system for any cutting-edge
> > application
> > prototyping.
> > 
> > Is this something which could be incorporated as part of this work?
> 
> Christian sent a patch a while ago, which was merged, to enable this in
> the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
> it in Debian and Ubuntu for the reasons you mentioned.
> 
> And if it's not been translated yet, I agree it's an important one.
> 
No, it's not translated yet - mainly for the reasons that I had forgotten
it existed, and that there is a lot yet unported.

General question: should this be the default or not? It looks to me that
it should probably be, but what do others think?

/Bruce

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-18  8:35     ` Bruce Richardson
@ 2017-08-18  8:52       ` Marco Varlese
  2017-08-18  9:17         ` Marco Varlese
  2017-08-18  9:33       ` Luca Boccassi
  1 sibling, 1 reply; 50+ messages in thread
From: Marco Varlese @ 2017-08-18  8:52 UTC (permalink / raw)
  To: Bruce Richardson, Luca Boccassi; +Cc: dev, thomas

On Fri, 2017-08-18 at 09:35 +0100, Bruce Richardson wrote:
> On Thu, Aug 17, 2017 at 04:25:36PM +0100, Luca Boccassi wrote:
> > 
> > On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> > > 
> > > Hi Bruce,
> > > 
> > > On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > > > 
> > > > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
> > > > /25104/]
> > > > here is a second draft implementation for building DPDK with meson
> > > > and
> > > > ninja. While still not building all of DPDK, and needing patch
> > > > cleanup so
> > > > that patches don't overwrite previous work, it is more complete in
> > > > many
> > > > ways than the previous version and includes:
> > > > 
> > > > * dynamic build configuration e.g. building pcap driver only if
> > > > pcap is
> > > >   found, only build af_packet if the target is linux, and only
> > > > building QAT
> > > >   and openssl crypto drivers if libcrypto is found
> > > > * support for pmdinfo inside the PMDs(for shared builds) and
> > > > binaries (for
> > > >   static builds)
> > > > * generalized/standardized way of building libs and drivers, though
> > > > the
> > > >   drivers code still needs generalization at the driver, rather
> > > > than
> > > >   driver-class level.
> > > > * support for having a pkgconfig file for DPDK on install, and
> > > > helloworld
> > > >   and l2fwd can be built using the pkgconfig info (via make, not
> > > > ninja)
> > > > * support for library versions
> > > > * an implementation for FreeBSD as well as Linux
> > > > * all libraries are included in the build, as well as a number of
> > > > NIC,
> > > >   crypto, and mempool drivers
> > > > * the igb_uio kernel module is build via the kernel Kbuild system
> > > > as part
> > > >   of a meson/ninja DPDK build
> > > 
> > > This is really great to see. I do have one suggestion.
> > > Would it be possible to version the libraries built by the build-
> > > system
> > > following the same version of the DPDK release?
> > > 
> > > For instance, in DPDK 17.08 we currently have:
> > > # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
> > >   SONAME               librte_pmd_ixgbe.so.1
> > > 
> > > Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> > > 
> > > I think it would help to facilitate the installation of multiple DPDK
> > > library
> > > versions on the same system. 
> > > 
> > > For example, we could have the following scenario:
> > > 
> > > 1) OpenVSwithc linked with version 17.02 of DPDK
> > > 2) VPP linked with version 17.08 of DPDK
> > > 3) DPDK 18.xx installed in the system for any cutting-edge
> > > application
> > > prototyping.
> > > 
> > > Is this something which could be incorporated as part of this work?
> > 
> > Christian sent a patch a while ago, which was merged, to enable this in
> > the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
> > it in Debian and Ubuntu for the reasons you mentioned.
> > 
> > And if it's not been translated yet, I agree it's an important one.
> > 
> No, it's not translated yet - mainly for the reasons that I had forgotten
> it existed, and that there is a lot yet unported.
> 
> General question: should this be the default or not? It looks to me that
> it should probably be, but what do others think?
I do think it should be the default too. 

> 
> /Bruce
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-18  8:52       ` Marco Varlese
@ 2017-08-18  9:17         ` Marco Varlese
  0 siblings, 0 replies; 50+ messages in thread
From: Marco Varlese @ 2017-08-18  9:17 UTC (permalink / raw)
  To: Bruce Richardson, Luca Boccassi; +Cc: dev, thomas

On Fri, 2017-08-18 at 10:52 +0200, Marco Varlese wrote:
> On Fri, 2017-08-18 at 09:35 +0100, Bruce Richardson wrote:
> > 
> > On Thu, Aug 17, 2017 at 04:25:36PM +0100, Luca Boccassi wrote:
> > > 
> > > 
> > > On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> > > > 
> > > > 
> > > > Hi Bruce,
> > > > 
> > > > On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > > > > 
> > > > > 
> > > > > Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
> > > > > /25104/]
> > > > > here is a second draft implementation for building DPDK with meson
> > > > > and
> > > > > ninja. While still not building all of DPDK, and needing patch
> > > > > cleanup so
> > > > > that patches don't overwrite previous work, it is more complete in
> > > > > many
> > > > > ways than the previous version and includes:
> > > > > 
> > > > > * dynamic build configuration e.g. building pcap driver only if
> > > > > pcap is
> > > > >   found, only build af_packet if the target is linux, and only
> > > > > building QAT
> > > > >   and openssl crypto drivers if libcrypto is found
> > > > > * support for pmdinfo inside the PMDs(for shared builds) and
> > > > > binaries (for
> > > > >   static builds)
> > > > > * generalized/standardized way of building libs and drivers, though
> > > > > the
> > > > >   drivers code still needs generalization at the driver, rather
> > > > > than
> > > > >   driver-class level.
> > > > > * support for having a pkgconfig file for DPDK on install, and
> > > > > helloworld
> > > > >   and l2fwd can be built using the pkgconfig info (via make, not
> > > > > ninja)
> > > > > * support for library versions
> > > > > * an implementation for FreeBSD as well as Linux
> > > > > * all libraries are included in the build, as well as a number of
> > > > > NIC,
> > > > >   crypto, and mempool drivers
> > > > > * the igb_uio kernel module is build via the kernel Kbuild system
> > > > > as part
> > > > >   of a meson/ninja DPDK build
> > > > 
> > > > This is really great to see. I do have one suggestion.
> > > > Would it be possible to version the libraries built by the build-
> > > > system
> > > > following the same version of the DPDK release?
> > > > 
> > > > For instance, in DPDK 17.08 we currently have:
> > > > # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
> > > >   SONAME               librte_pmd_ixgbe.so.1
> > > > 
> > > > Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> > > > 
> > > > I think it would help to facilitate the installation of multiple DPDK
> > > > library
> > > > versions on the same system. 
> > > > 
> > > > For example, we could have the following scenario:
> > > > 
> > > > 1) OpenVSwithc linked with version 17.02 of DPDK
> > > > 2) VPP linked with version 17.08 of DPDK
> > > > 3) DPDK 18.xx installed in the system for any cutting-edge
> > > > application
> > > > prototyping.
> > > > 
> > > > Is this something which could be incorporated as part of this work?
> > > 
> > > Christian sent a patch a while ago, which was merged, to enable this in
> > > the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
> > > it in Debian and Ubuntu for the reasons you mentioned.
> > > 
> > > And if it's not been translated yet, I agree it's an important one.
> > > 
> > No, it's not translated yet - mainly for the reasons that I had forgotten
> > it existed, and that there is a lot yet unported.
> > 
> > General question: should this be the default or not? It looks to me that
> > it should probably be, but what do others think?
> I do think it should be the default too. 
And - since you're at it - it would be a good idea to add the versioning to the
built executables (e.g. test_pmd) similarly to what other software (e.g. gcc) do
to make sure you can also have cohexistance of executables. Otherwise, dpdk
executables would be overwritten with subsequent installations.
Does it make sense?

> 
> > 
> > 
> > /Bruce
> > 
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFCv2 00/40] Building DPDK with meson and ninja
  2017-08-18  8:35     ` Bruce Richardson
  2017-08-18  8:52       ` Marco Varlese
@ 2017-08-18  9:33       ` Luca Boccassi
  1 sibling, 0 replies; 50+ messages in thread
From: Luca Boccassi @ 2017-08-18  9:33 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Marco Varlese, dev, thomas

On Fri, 2017-08-18 at 09:35 +0100, Bruce Richardson wrote:
> On Thu, Aug 17, 2017 at 04:25:36PM +0100, Luca Boccassi wrote:
> > On Thu, 2017-08-17 at 16:10 +0200, Marco Varlese wrote:
> > > Hi Bruce,
> > > 
> > > On Mon, 2017-08-14 at 10:51 +0100, Bruce Richardson wrote:
> > > > Following on from previous RFC [http://dpdk.org/dev/patchwork/p
> > > > atch
> > > > /25104/]
> > > > here is a second draft implementation for building DPDK with
> > > > meson
> > > > and
> > > > ninja. While still not building all of DPDK, and needing patch
> > > > cleanup so
> > > > that patches don't overwrite previous work, it is more complete
> > > > in
> > > > many
> > > > ways than the previous version and includes:
> > > > 
> > > > * dynamic build configuration e.g. building pcap driver only if
> > > > pcap is
> > > >   found, only build af_packet if the target is linux, and only
> > > > building QAT
> > > >   and openssl crypto drivers if libcrypto is found
> > > > * support for pmdinfo inside the PMDs(for shared builds) and
> > > > binaries (for
> > > >   static builds)
> > > > * generalized/standardized way of building libs and drivers,
> > > > though
> > > > the
> > > >   drivers code still needs generalization at the driver, rather
> > > > than
> > > >   driver-class level.
> > > > * support for having a pkgconfig file for DPDK on install, and
> > > > helloworld
> > > >   and l2fwd can be built using the pkgconfig info (via make,
> > > > not
> > > > ninja)
> > > > * support for library versions
> > > > * an implementation for FreeBSD as well as Linux
> > > > * all libraries are included in the build, as well as a number
> > > > of
> > > > NIC,
> > > >   crypto, and mempool drivers
> > > > * the igb_uio kernel module is build via the kernel Kbuild
> > > > system
> > > > as part
> > > >   of a meson/ninja DPDK build
> > > 
> > > This is really great to see. I do have one suggestion.
> > > Would it be possible to version the libraries built by the build-
> > > system
> > > following the same version of the DPDK release?
> > > 
> > > For instance, in DPDK 17.08 we currently have:
> > > # objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
> > >   SONAME               librte_pmd_ixgbe.so.1
> > > 
> > > Would it make sense to instead have librte_pmd_ixgbe.so.17.08
> > > 
> > > I think it would help to facilitate the installation of multiple
> > > DPDK
> > > library
> > > versions on the same system. 
> > > 
> > > For example, we could have the following scenario:
> > > 
> > > 1) OpenVSwithc linked with version 17.02 of DPDK
> > > 2) VPP linked with version 17.08 of DPDK
> > > 3) DPDK 18.xx installed in the system for any cutting-edge
> > > application
> > > prototyping.
> > > 
> > > Is this something which could be incorporated as part of this
> > > work?
> > 
> > Christian sent a patch a while ago, which was merged, to enable
> > this in
> > the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we
> > use
> > it in Debian and Ubuntu for the reasons you mentioned.
> > 
> > And if it's not been translated yet, I agree it's an important one.
> > 
> 
> No, it's not translated yet - mainly for the reasons that I had
> forgotten
> it existed, and that there is a lot yet unported.
> 
> General question: should this be the default or not? It looks to me
> that
> it should probably be, but what do others think?
> 
> /Bruce

Well, to maintain backward compatibility, you might not want to have it
on by default - it's the equivalent of declaring all ABIs compatibility
broken on all releases, some users might not like that.

For us distro maintainers it's very easy to enable.

But I don't have a strong opinion either way - just thinking about
consequences for others.

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2017-08-18  9:33 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14  9:51 [RFCv2 00/40] Building DPDK with meson and ninja Bruce Richardson
2017-08-14  9:51 ` [RFCv2 01/40] build: initial hooks for using meson with DPDK Bruce Richardson
2017-08-14  9:51 ` [RFCv2 02/40] build: create pkg-config file for DPDK Bruce Richardson
2017-08-14  9:51 ` [RFCv2 03/40] build: build linuxapp EAL with meson and ninja Bruce Richardson
2017-08-14  9:51 ` [RFCv2 04/40] build: add EAL support under BSD Bruce Richardson
2017-08-14  9:51 ` [RFCv2 05/40] build: add core libraries to meson build system Bruce Richardson
2017-08-14  9:51 ` [RFCv2 06/40] build: add i40e driver to meson build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 07/40] build: add pmdinfogen to build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 08/40] build: generate list of sources for pmdinfogen Bruce Richardson
2017-08-14  9:51 ` [RFCv2 09/40] build: build i40e driver, including pmdinfo Bruce Richardson
2017-08-14  9:51 ` [RFCv2 10/40] build: install usertools scripts Bruce Richardson
2017-08-14  9:51 ` [RFCv2 11/40] build: simplify generation of pmd.c files Bruce Richardson
2017-08-14  9:51 ` [RFCv2 12/40] build: generalize net driver build to higher level Bruce Richardson
2017-08-14  9:51 ` [RFCv2 13/40] build: remove hard-coded enablement of vector driver Bruce Richardson
2017-08-14  9:51 ` [RFCv2 14/40] build: add ixgbe driver to build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 15/40] build: set up standard deps for drivers Bruce Richardson
2017-08-14  9:51 ` [RFCv2 16/40] build: add af_packet driver to build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 17/40] build: add pcap PMD support Bruce Richardson
2017-08-14  9:51 ` [RFCv2 18/40] build: add symbol version map file support to libs Bruce Richardson
2017-08-14  9:51 ` [RFCv2 19/40] build: build libraries in a loop for brevity Bruce Richardson
2017-08-14  9:51 ` [RFCv2 20/40] build: version library .so files Bruce Richardson
2017-08-14  9:51 ` [RFCv2 21/40] eal: add version information to meson build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 22/40] build: add mempool drivers to build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 23/40] build: add gro library to meson build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 24/40] build: tweak naming of pmd dependencies Bruce Richardson
2017-08-14  9:51 ` [RFCv2 25/40] build: track driver include directories properly Bruce Richardson
2017-08-14  9:51 ` [RFCv2 26/40] metrics: add metrics lib to meson build Bruce Richardson
2017-08-14  9:51 ` [RFCv2 27/40] build: track dependencies recursively Bruce Richardson
2017-08-14  9:51 ` [RFCv2 28/40] testpmd: compile testpmd with meson and ninja Bruce Richardson
2017-08-14  9:51 ` [RFCv2 29/40] crypto/null: rename the version file to standard Bruce Richardson
2017-08-14  9:51 ` [RFCv2 30/40] crypto/qat: remove dependency on ether library Bruce Richardson
2017-08-14  9:51 ` [RFCv2 31/40] build: add cryptodev and some crypto drivers to build Bruce Richardson
2017-08-14  9:52 ` [RFCv2 32/40] igb_uio: add igb_uio to meson build Bruce Richardson
2017-08-14  9:52 ` [RFCv2 33/40] ip_frag: rename version file to standard name Bruce Richardson
2017-08-14  9:52 ` [RFCv2 34/40] build: add most remaining libraries to meson build Bruce Richardson
2017-08-14  9:52 ` [RFCv2 35/40] build: add packet framework libs " Bruce Richardson
2017-08-14  9:52 ` [RFCv2 36/40] acl: add acl library " Bruce Richardson
2017-08-14  9:52 ` [RFCv2 37/40] build: add ark and avp PMDs to build Bruce Richardson
2017-08-14  9:52 ` [RFCv2 38/40] build: fix static library builds with base code Bruce Richardson
2017-08-14  9:52 ` [RFCv2 39/40] build: fix driver dependencies for static builds Bruce Richardson
2017-08-14  9:52 ` [RFCv2 40/40] examples: allow basic sample app build using pkg-config Bruce Richardson
2017-08-15 10:56 ` [RFCv2 00/40] Building DPDK with meson and ninja Luca Boccassi
2017-08-15 11:31   ` Bruce Richardson
2017-08-17 14:10 ` Marco Varlese
2017-08-17 15:25   ` Luca Boccassi
2017-08-18  8:35     ` Bruce Richardson
2017-08-18  8:52       ` Marco Varlese
2017-08-18  9:17         ` Marco Varlese
2017-08-18  9:33       ` Luca Boccassi
     [not found]   ` <1502983469.31476.3.camel@gmail.com>
2017-08-18  8:00     ` Marco Varlese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.