[dpdk-dev,RFCv2,02/40] build: create pkg-config file for DPDK

Message ID 20170814095208.166496-3-bruce.richardson@intel.com (mailing list archive)
State RFC, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson Aug. 14, 2017, 9:51 a.m. UTC
  Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
  

Patch

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"'
+)