From: Daniel Vetter <daniel@ffwll.ch>
To: Petri Latvala <petri.latvala@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2 1/1] meson: Refactor get_option() calls for directories
Date: Wed, 17 Jan 2018 11:32:22 +0100 [thread overview]
Message-ID: <20180117103222.GS2759@phenom.ffwll.local> (raw)
In-Reply-To: <20180115111456.1674-1-petri.latvala@intel.com>
On Mon, Jan 15, 2018 at 01:14:56PM +0200, Petri Latvala wrote:
> Fetch the configuration values in the toplevel meson.build for all
> subdirs to share.
>
> v2: Also remember tests/intel-ci/meson.build
>
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
I haven't tried, but why exactly can we drop all the calls to get_option?
-Daniel
> ---
> assembler/meson.build | 8 +++-----
> benchmarks/meson.build | 6 ++++--
> lib/meson.build | 3 +--
> man/meson.build | 2 +-
> meson.build | 9 +++++++++
> tests/intel-ci/meson.build | 2 +-
> tests/meson.build | 6 +-----
> tools/meson.build | 14 +++++---------
> 8 files changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/assembler/meson.build b/assembler/meson.build
> index b5ac678d..7517d82f 100644
> --- a/assembler/meson.build
> +++ b/assembler/meson.build
> @@ -35,13 +35,11 @@ executable('intel-gen4asm', 'main.c', lfiles, pfiles,
> executable('intel-gen4disasm', 'disasm-main.c',
> link_with : lib_brw, install : true)
>
> -pkgconfigdir = join_paths(get_option('libdir'), 'pgkconfig')
> -
> conf_data = configuration_data()
> -conf_data.set('prefix', get_option('prefix'))
> +conf_data.set('prefix', prefix)
> conf_data.set('exec_prefix', '${prefix}')
> -conf_data.set('libdir', join_paths('${prefix}', get_option('libdir')))
> -conf_data.set('includedir', join_paths('${prefix}', get_option('includedir')))
> +conf_data.set('libdir', join_paths('${prefix}', libdir))
> +conf_data.set('includedir', join_paths('${prefix}', includedir))
> conf_data.set('VERSION', meson.project_version())
> configure_file(input : 'intel-gen4asm.pc.in', output : 'intel-gen4asm.pc',
> configuration : conf_data, install_dir : pkgconfigdir)
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> index 26d65c4b..27836c1d 100644
> --- a/benchmarks/meson.build
> +++ b/benchmarks/meson.build
> @@ -27,16 +27,18 @@ if libdrm_intel.found()
> ]
> endif
>
> +benchmarksdir = join_paths(libexecdir, 'benchmarks')
> +
> foreach prog : benchmark_progs
> # FIXME meson doesn't like binaries with the same name
> # meanwhile just suffix with _bench
> executable(prog + '_bench', prog + '.c',
> install : true,
> - install_dir : join_paths(get_option('libexecdir'), 'intel-gpu-tools', 'benchmarks'),
> + install_dir : benchmarksdir,
> dependencies : test_deps)
> endforeach
>
> executable('gem_wsim_bench', 'gem_wsim.c',
> install : true,
> - install_dir : join_paths(get_option('libexecdir'), 'intel-gpu-tools', 'benchmarks'),
> + install_dir : benchmarksdir,
> dependencies : test_deps + [ lib_igt_perf ])
> diff --git a/lib/meson.build b/lib/meson.build
> index 311e2342..b3bbc311 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -145,7 +145,6 @@ if chamelium.found()
> lib_sources += 'igt_chamelium.c'
> endif
>
> -pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
> srcdir = join_paths(meson.source_root(), 'tests')
>
> lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
> @@ -160,7 +159,7 @@ foreach f: lib_sources
> include_directories: inc,
> dependencies : lib_deps,
> c_args : [
> - '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
> + '-DIGT_DATADIR="@0@"'.format(datadir),
> '-DIGT_SRCDIR="@0@"'.format(srcdir),
> '-DIGT_LOG_DOMAIN="@0@"'.format(f.split('.')[0]),
> ])
> diff --git a/man/meson.build b/man/meson.build
> index 351d025b..49b0686a 100644
> --- a/man/meson.build
> +++ b/man/meson.build
> @@ -34,6 +34,6 @@ if rst2man.found()
> input: manpage + '.rst',
> output : manpage + '.1.gz',
> install : true,
> - install_dir : join_paths(get_option('mandir'), 'man1'))
> + install_dir : join_paths(mandir, 'man1'))
> endforeach
> endif
> diff --git a/meson.build b/meson.build
> index 0950d3c7..d403ba5b 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -127,6 +127,15 @@ config.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family())
>
> configure_file(output: 'config.h', install: false, configuration: config)
>
> +prefix = get_option('prefix')
> +bindir = get_option('bindir')
> +datadir = join_paths(get_option('datadir'), 'intel-gpu-tools')
> +includedir = get_option('includedir')
> +libdir = get_option('libdir')
> +libexecdir = join_paths(get_option('libexecdir'), 'intel-gpu-tools')
> +mandir = get_option('mandir')
> +pkgconfigdir = join_paths(libdir, 'pkgconfig')
> +
> subdir('lib')
> subdir('tests')
> subdir('benchmarks')
> diff --git a/tests/intel-ci/meson.build b/tests/intel-ci/meson.build
> index 5394a2ff..b3abb848 100644
> --- a/tests/intel-ci/meson.build
> +++ b/tests/intel-ci/meson.build
> @@ -5,4 +5,4 @@ intelci_files = [
> 'README',
> ]
>
> -install_data(sources : intelci_files, install_dir : pkgdatadir)
> +install_data(sources : intelci_files, install_dir : datadir)
> diff --git a/tests/meson.build b/tests/meson.build
> index 4c4bee1d..2322217d 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -255,8 +255,6 @@ if alsa.found() and gsl.found()
> test_deps += alsa
> endif
>
> -libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'), 'intel-gpu-tools')
> -
> test_executables = []
>
> foreach prog : test_progs
> @@ -278,8 +276,6 @@ executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
> install : true)
> test_progs += 'testdisplay'
>
> -pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
> -
> gen_testlist = find_program('generate_testlist.sh')
> test_list = custom_target('testlist',
> output : 'test-list.txt',
> @@ -318,6 +314,6 @@ image_files = [
> '1080p-right.png',
> 'pass.png',
> ]
> -install_data(sources : image_files, install_dir : pkgdatadir)
> +install_data(sources : image_files, install_dir : datadir)
>
> subdir('intel-ci')
> diff --git a/tools/meson.build b/tools/meson.build
> index 7fc5390a..df65e0f8 100644
> --- a/tools/meson.build
> +++ b/tools/meson.build
> @@ -55,8 +55,6 @@ foreach prog : tools_progs
> install : true)
> endforeach
>
> -pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
> -
> if libudev.found()
> intel_dp_compliance_src = [
> 'intel_dp_compliance.c',
> @@ -77,14 +75,12 @@ executable('intel_reg', sources : intel_reg_src,
> dependencies : tool_deps,
> install : true,
> c_args : [
> - '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
> + '-DIGT_DATADIR="@0@"'.format(datadir),
> ])
>
> -bindir = join_paths(get_option('prefix'), get_option('bindir'))
> -
> install_data('intel_gpu_abrt', install_dir : bindir)
>
> -install_subdir('registers', install_dir : pkgdatadir,
> +install_subdir('registers', install_dir : datadir,
> exclude_files : [
> 'Makefile', 'Makefile.in', 'Makefile.am',
> ])
> @@ -95,10 +91,10 @@ shared_library('intel_aubdump', 'aubdump.c',
> install : true)
>
> conf_data = configuration_data()
> -conf_data.set('prefix', get_option('prefix'))
> +conf_data.set('prefix', prefix)
> conf_data.set('exec_prefix', '${prefix}')
> -conf_data.set('libdir', join_paths('${prefix}', get_option('libdir')))
> +conf_data.set('libdir', join_paths('${prefix}', libdir))
> configure_file(input : 'intel_aubdump.in', output : 'intel_aubdump',
> - configuration : conf_data, install_dir : get_option('bindir'))
> + configuration : conf_data, install_dir : bindir)
>
> subdir('null_state_gen')
> --
> 2.14.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-01-17 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-15 11:11 [PATCH i-g-t 1/1] meson: Refactor get_option() calls for directories Petri Latvala
2018-01-15 11:14 ` [PATCH i-g-t v2 " Petri Latvala
2018-01-17 10:32 ` Daniel Vetter [this message]
2018-01-17 10:33 ` Daniel Vetter
2018-01-15 14:22 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/1] meson: Refactor get_option() calls for directories (rev2) Patchwork
2018-01-15 17:10 ` ✗ Fi.CI.IGT: warning " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180117103222.GS2759@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.