On Thu, Jan 14, 2021 at 01:16:58PM +0100, David Marchand wrote: > On Thu, Jan 14, 2021 at 12:09 PM Bruce Richardson > <bruce.richard...@intel.com> wrote: > > > > To verify that all DPDK headers are ok for inclusion directly in a C > > file, and are not missing any other pre-requisite headers, we can > > auto-generate for each header an empty C file that includes that header. > > Compiling these files will throw errors if any header has unmet > > dependencies. > > Some drivers expose APIs to applications, their headers would need checks too. >
Yes, that is something that should be checked too, but I've left it as "further work" for now, and I'm not planning it in this set, as I view it as less important and this set is big-enough as it is for now. :-) > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > --- > > app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ > > app/chkincs/main.c | 4 +++ > > app/chkincs/meson.build | 28 ++++++++++++++++ > > app/meson.build | 1 + > > lib/meson.build | 1 + > > meson.build | 1 + > > meson_options.txt | 2 ++ > > 7 files changed, 86 insertions(+) > > create mode 100755 app/chkincs/gen_c_file_for_header.py > > create mode 100644 app/chkincs/main.c > > create mode 100644 app/chkincs/meson.build > > > > diff --git a/app/chkincs/gen_c_file_for_header.py > > b/app/chkincs/gen_c_file_for_header.py > > new file mode 100755 > > index 0000000000..f92f2b412c > > --- /dev/null > > +++ b/app/chkincs/gen_c_file_for_header.py > > @@ -0,0 +1,49 @@ > > +#! /usr/bin/env python3 > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright(c) 2020 Intel Corporation > > 2021* > Code actually was written in 2020 hence the date there. > > > + > > +from sys import argv > > +from os.path import abspath > > + > > +empty_contents = 'static const char *empty __attribute__((unused)) = > > "empty";' > > +# files which are not used directly, but included via others > > +exceptions = [ > > + 'rte_cmp_arm64.h', > > + 'rte_cmp_x86.h', > > + 'rte_crc_arm64.h', > > + 'rte_eal_interrupts.h', > > + 'rte_eth_ctrl.h', > > + 'rte_ethdev_core.h', > > + 'rte_ipsec_group.h', > > + 'rte_lpm_altivec.h', > > + 'rte_lpm_neon.h', > > + 'rte_lpm_sse.h', > > + 'rte_lpm_x86.h', > > + 'rte_lru_arm64.h', > > + 'rte_lru_x86.h', > > + 'rte_regexdev_core.h', > > + 'rte_ring_core.h', > > + 'rte_ring_generic.h', > > + 'rte_ring_hts_c11_mem.h', > > + 'rte_ring_hts.h', > > + 'rte_ring_peek_c11_mem.h', > > + 'rte_ring_peek.h', > > + 'rte_ring_peek_zc.h', > > + 'rte_ring_rts_c11_mem.h', > > + 'rte_ring_rts.h', > > + 'rte_stack_lf_c11.h', > > + 'rte_stack_lf_generic.h', > > + 'rte_stack_lf.h', > > + 'rte_stack_std.h', > > + 'rte_table_hash_func_arm64.h', > > + ] > > Can we instead flag those headers from the libraries themselves? > In addition of the headers current variable, something like a > internal_headers or private_headers variable? > Yes, we could do that, though we need a suitable name, since they aren't internal only or private. :-) Maybe just have it literally called "skip_chkincs_headers"? Open to more ideas... Thanks for the review! /Bruce