On Thu, Jan 09, 2020 at 07:03:05PM +0100, David Marchand wrote:
> On Thu, Jan 9, 2020 at 4:31 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > The install parameter to configure_file is new in 0.50 and generates a
> > warning since it is newer than our minimum version of 0.47.1. The
> > parameter, however, is unneeded as the documentation states:
> >
> > "When omitted it defaults to true when install_dir is set and not empty,
> > false otherwise."
> >
> > Given that install_dir is not set for this file, install defaults to false
> > so no need to explicitly specify it.
> >
> > Fixes: 720b14db3ae2 ("build: generate API documentation with meson")
>
> Cc: stable@dpdk.org ? or does it depend on other changes?
>
I don't think it requires any other changes. Should probably go to 19.11
anyway - the 18.11 tree can skip it, I think.
Since kni no longer includes the ethtool code and so is faster to build, we no longer need the console parameter to have incremental screen updates as it builds. Therefore, we drop the keyword which removes the warning. Fixes: b78f32cff94d ("kni: support meson build") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org> --- kernel/linux/kni/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build index 955eec949..f93e97fa0 100644 --- a/kernel/linux/kni/meson.build +++ b/kernel/linux/kni/meson.build @@ -23,7 +23,6 @@ custom_target('rte_kni', ' -I' + meson.current_source_dir(), 'modules'], depends: kni_mkfile, - console: true, install: true, install_dir: kernel_dir + '/extra/dpdk', build_by_default: get_option('enable_kmods')) -- 2.24.1
The install parameter to configure_file is new in 0.50 and generates a warning since it is newer than our minimum version of 0.47.1. The parameter, however, is unneeded as the documentation states: "When omitted it defaults to true when install_dir is set and not empty, false otherwise." Given that install_dir is not set for this file, install defaults to false so no need to explicitly specify it. Fixes: 720b14db3ae2 ("build: generate API documentation with meson") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org> --- doc/api/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/api/meson.build b/doc/api/meson.build index 1c48b7672..23a7dfc75 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -38,8 +38,7 @@ if doxygen.found() doxy_conf = configure_file(input: 'doxy-api.conf.in', output: 'doxy-api.conf', - configuration: cdata, - install: false) + configuration: cdata) doxy_build = custom_target('doxygen', depends: example, -- 2.24.1
For building the guides, we can make the meson.build easier to read by using the subdir_done function to quit early. Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org> --- @stable, this may be considered for 19.11 backport to make other backporting to this file easier. --- doc/guides/meson.build | 44 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/doc/guides/meson.build b/doc/guides/meson.build index 7931ef3bb..80c21d168 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -3,26 +3,28 @@ sphinx = find_program('sphinx-build', required: get_option('enable_docs')) -if sphinx.found() - htmldir = join_paths('share', 'doc', 'dpdk') - html_guides_build = custom_target('html_guides_build', - input: meson.current_source_dir(), - output: 'guides', - command: [sphinx, '-b', 'html', - '-d', meson.current_build_dir() + '/.doctrees', - '@INPUT@', meson.current_build_dir() + '/guides'], - build_by_default: get_option('enable_docs'), - install: get_option('enable_docs'), - install_dir: htmldir) +if not sphinx.found() + subdir_done() +endif - doc_targets += html_guides_build - doc_target_names += 'HTML_Guides' +htmldir = join_paths('share', 'doc', 'dpdk') +html_guides = custom_target('html_guides', + input: meson.current_source_dir(), + output: 'guides', + command: [sphinx, '-b', 'html', + '-d', meson.current_build_dir() + '/.doctrees', + '@INPUT@', meson.current_build_dir() + '/guides'], + build_by_default: get_option('enable_docs'), + install: get_option('enable_docs'), + install_dir: htmldir) - # sphinx leaves a .buildinfo in the target directory, which we don't - # want to install. Note that sh -c has to be used, otherwise the - # env var does not get expanded if calling rm/install directly. - meson.add_install_script('sh', '-c', - 'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo') - meson.add_install_script('sh', '-c', - 'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css') -endif +doc_targets += html_guides +doc_target_names += 'HTML_Guides' + +# sphinx leaves a .buildinfo in the target directory, which we don't +# want to install. Note that sh -c has to be used, otherwise the +# env var does not get expanded if calling rm/install directly. +meson.add_install_script('sh', '-c', + 'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo') +meson.add_install_script('sh', '-c', + 'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css') -- 2.24.1
When building the API docs, we can make the meson.build file easier to read, and allow more code per line, by using subdir_done() to quit early. Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org> --- @stable, this patch may be considered for backporting to 19.11 to allow easier merging of other patches to the affected file. --- doc/api/meson.build | 98 +++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/doc/api/meson.build b/doc/api/meson.build index 23a7dfc75..c72b880e1 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -3,52 +3,54 @@ doxygen = find_program('doxygen', required: get_option('enable_docs')) -if doxygen.found() - # due to the CSS customisation script, which needs to run on a file that - # is in a subdirectory that is created at build time and thus it cannot - # be an individual custom_target, we need to wrap the doxygen call in a - # script to run the CSS modification afterwards - generate_doxygen = find_program('generate_doxygen.sh') - generate_examples = find_program('generate_examples.sh') - generate_css = find_program('doxy-html-custom.sh') - - inputdir = join_paths(meson.source_root(), 'examples') - htmldir = join_paths('share', 'doc', 'dpdk') - - # due to the following bug: https://github.com/mesonbuild/meson/issues/4107 - # if install is set to true it will override build_by_default and it will - # cause the target to always be built. If install were to be always set to - # false it would be impossible to install the docs. - # So use a configure option for now. - example = custom_target('examples.dox', - input: inputdir, - output: 'examples.dox', - command: [generate_examples, '@INPUT@', '@OUTPUT@'], - install: get_option('enable_docs'), - install_dir: htmldir, - build_by_default: get_option('enable_docs')) - - cdata = configuration_data() - cdata.set('VERSION', meson.project_version()) - cdata.set('API_EXAMPLES', join_paths(meson.build_root(), 'doc', 'api', 'examples.dox')) - cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api')) - cdata.set('HTML_OUTPUT', 'api') - cdata.set('TOPDIR', meson.source_root()) - cdata.set('STRIP_FROM_PATH', meson.source_root()) - - doxy_conf = configure_file(input: 'doxy-api.conf.in', - output: 'doxy-api.conf', - configuration: cdata) - - doxy_build = custom_target('doxygen', - depends: example, - input: doxy_conf, - output: 'api', - command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css], - install: get_option('enable_docs'), - install_dir: htmldir, - build_by_default: get_option('enable_docs')) - - doc_targets += doxy_build - doc_target_names += 'Doxygen_API' +if not doxygen.found() + subdir_done() endif + +# due to the CSS customisation script, which needs to run on a file that +# is in a subdirectory that is created at build time and thus it cannot +# be an individual custom_target, we need to wrap the doxygen call in a +# script to run the CSS modification afterwards +generate_doxygen = find_program('generate_doxygen.sh') +generate_examples = find_program('generate_examples.sh') +generate_css = find_program('doxy-html-custom.sh') + +inputdir = join_paths(meson.source_root(), 'examples') +htmldir = join_paths('share', 'doc', 'dpdk') + +# due to the following bug: https://github.com/mesonbuild/meson/issues/4107 +# if install is set to true it will override build_by_default and it will +# cause the target to always be built. If install were to be always set to +# false it would be impossible to install the docs. +# So use a configure option for now. +example = custom_target('examples.dox', + input: inputdir, + output: 'examples.dox', + command: [generate_examples, '@INPUT@', '@OUTPUT@'], + install: get_option('enable_docs'), + install_dir: htmldir, + build_by_default: get_option('enable_docs')) + +cdata = configuration_data() +cdata.set('VERSION', meson.project_version()) +cdata.set('API_EXAMPLES', join_paths(meson.build_root(), 'doc', 'api', 'examples.dox')) +cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api')) +cdata.set('HTML_OUTPUT', 'api') +cdata.set('TOPDIR', meson.source_root()) +cdata.set('STRIP_FROM_PATH', meson.source_root()) + +doxy_conf = configure_file(input: 'doxy-api.conf.in', + output: 'doxy-api.conf', + configuration: cdata) + +doxy_build = custom_target('doxygen', + depends: example, + input: doxy_conf, + output: 'api', + command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css], + install: get_option('enable_docs'), + install_dir: htmldir, + build_by_default: get_option('enable_docs')) + +doc_targets += doxy_build +doc_target_names += 'Doxygen_API' -- 2.24.1