From patchwork Mon Jan 15 11:11:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 10163581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A863601C0 for ; Mon, 15 Jan 2018 11:11:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55EC428987 for ; Mon, 15 Jan 2018 11:11:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54A2E289BF; Mon, 15 Jan 2018 11:11:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DE92428B44 for ; Mon, 15 Jan 2018 11:11:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FB5589F89; Mon, 15 Jan 2018 11:11:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1BE789F89 for ; Mon, 15 Jan 2018 11:11:17 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2018 03:11:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,363,1511856000"; d="scan'208";a="22249515" Received: from thrakatuluk.fi.intel.com (HELO thrakatuluk) ([10.237.68.137]) by fmsmga001.fm.intel.com with ESMTP; 15 Jan 2018 03:11:16 -0800 Received: from platvala by thrakatuluk with local (Exim 4.89) (envelope-from ) id 1eb2fb-0000H7-BR; Mon, 15 Jan 2018 13:11:15 +0200 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Jan 2018 13:11:07 +0200 Message-Id: <20180115111107.1006-1-petri.latvala@intel.com> X-Mailer: git-send-email 2.14.1 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t 1/1] meson: Refactor get_option() calls for directories X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Fetch the configuration values in the toplevel meson.build for all subdirs to share. Signed-off-by: Petri Latvala Cc: Daniel Vetter --- assembler/meson.build | 8 +++----- benchmarks/meson.build | 6 ++++-- lib/meson.build | 3 +-- man/meson.build | 2 +- meson.build | 9 +++++++++ tests/meson.build | 6 +----- tools/meson.build | 14 +++++--------- 7 files changed, 24 insertions(+), 24 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/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')