3 # Copyright(c) 2017 Intel Corporation.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
16 # * Neither the name of Intel Corporation nor the names of its
17 # contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 # process all libraries equally, as far as possible
34 # "core" libs first, then others alphebetically as far as possible
35 # NOTE: for speed of meson runs, the dependencies in the subdirectories
36 # sometimes skip deps that would be implied by others, e.g. if mempool is
37 # given as a dep, no need to mention ring. This is especially true for the
38 # core libs which are widely reused, so their deps are kept to a minimum.
39 libraries = [ 'compat', # just a header, used for versioning
40 'eal', 'ring', 'mempool', 'mbuf', 'net', 'ether', 'pci', # core
41 'metrics', # bitrate/latency stats depends on this
42 'hash', # efd depends on this
43 'kvargs', # cryptodev depends on this
44 'acl', 'bbdev', 'bitratestats', 'cfgfile',
45 'cmdline', 'cryptodev',
46 'distributor', 'efd', 'eventdev',
47 'gro', 'gso', 'ip_frag', 'jobstats',
48 'kni', 'latencystats', 'lpm', 'member',
49 'meter', 'power', 'pdump',
50 'reorder', 'sched', 'security', 'timer', 'vhost',
51 # add pkt framework libs which use other libs from above
52 'port', 'table', 'pipeline',
53 # flow_classify lib depends on pkt framework table lib
60 allow_experimental_apis = false
65 objs = [] # other object files to link against, used e.g. for
66 # instruction-set optimized versions of code
68 # use "deps" for internal DPDK dependencies, and "ext_deps" for
69 # external package/library requirements
71 deps = ['eal'] # eal is standard dependency except for itself
76 dir_name = 'librte_' + l
80 dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
81 install_headers(headers)
83 libname = 'rte_' + name
84 includes += include_directories(dir_name)
86 if sources.length() == 0
87 # if no C files, just set a dependency on header path
88 dep = declare_dependency(include_directories: includes)
92 dep_objs += [get_variable('dep_rte_' + d)]
95 if allow_experimental_apis
96 cflags += '-DALLOW_EXPERIMENTAL_API'
99 if get_option('per_library_versions')
100 lib_version = '@0@.1'.format(version)
101 so_version = '@0@'.format(version)
103 prj_ver = meson.project_version().split('.')
104 lib_version = '@0@.@1@'.format(
105 prj_ver.get(0), prj_ver.get(1))
106 so_version = lib_version
109 version_map = '@0@/@1@/rte_@2@_version.map'.format(
110 meson.current_source_dir(), dir_name, name)
111 lib = library(libname,
115 dependencies: dep_objs,
116 include_directories: includes,
117 link_args: '-Wl,--version-script=' + version_map,
118 link_depends: version_map,
119 version: lib_version,
120 soversion: so_version,
122 dep = declare_dependency(link_with: lib,
123 include_directories: includes,
124 dependencies: dep_objs)
126 dpdk_libraries = [lib] + dpdk_libraries
127 endif # sources.length() > 0
129 set_variable('dep_' + libname, dep)