From 4e73ad7d19f1ee569c3853b7a9e802bbb43fa8af Mon Sep 17 00:00:00 2001 From: Paul I Date: Fri, 23 Mar 2018 09:47:46 +0300 Subject: [PATCH] Meson: some cleanup (#9753) --- libr/anal/meson.build | 22 ++++++++-------- libr/asm/meson.build | 22 ++++++++-------- libr/bin/meson.build | 21 ++++++++------- libr/bp/meson.build | 22 ++++++++-------- libr/config/meson.build | 22 ++++++++-------- libr/cons/meson.build | 22 ++++++++-------- libr/core/meson.build | 25 +++++++++--------- libr/debug/meson.build | 31 +++++++++++----------- libr/egg/meson.build | 22 ++++++++-------- libr/flag/meson.build | 22 ++++++++-------- libr/fs/meson.build | 22 ++++++++-------- libr/hash/meson.build | 22 ++++++++-------- libr/io/meson.build | 42 ++++++++++++++--------------- libr/lang/meson.build | 22 ++++++++-------- libr/magic/meson.build | 22 ++++++++-------- libr/meson.build | 39 ++++++++++++++++++++++++++- libr/parse/meson.build | 22 ++++++++-------- libr/reg/meson.build | 22 ++++++++-------- libr/search/meson.build | 22 ++++++++-------- libr/socket/meson.build | 22 ++++++++-------- libr/syscall/meson.build | 21 +++++++-------- libr/util/meson.build | 17 ++++++------ meson.build | 57 ++++++++++++++++++++-------------------- 23 files changed, 310 insertions(+), 273 deletions(-) diff --git a/libr/anal/meson.build b/libr/anal/meson.build index 782c2f31c4..edc5916986 100644 --- a/libr/anal/meson.build +++ b/libr/anal/meson.build @@ -115,14 +115,14 @@ r_anal = library('r_anal', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_anal], - subdirs: 'libr', - version: r2version, - name: 'r_anal', - filebase: 'r_anal', - requires: [ - 'r_util', 'r_reg', 'r_asm', 'r_syscall', 'r_search', 'r_cons', 'r_flag' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_anal], + subdirs: 'libr', + version: r2version, + name: 'r_anal', + filebase: 'r_anal', + requires: [ + 'r_util', 'r_reg', 'r_asm', 'r_syscall', 'r_search', 'r_cons', 'r_flag' + ], + description: 'radare foundation libraries' +) diff --git a/libr/asm/meson.build b/libr/asm/meson.build index eb772596b0..1756908829 100644 --- a/libr/asm/meson.build +++ b/libr/asm/meson.build @@ -170,14 +170,14 @@ r_asm = library('r_asm', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_asm], - subdirs: 'libr', - version: r2version, - name: 'r_asm', - filebase: 'r_asm', - requires: [ - 'r_util', 'r_syscall', 'r_parse', 'r_lang', 'r_flag', 'r_socket' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_asm], + subdirs: 'libr', + version: r2version, + name: 'r_asm', + filebase: 'r_asm', + requires: [ + 'r_util', 'r_syscall', 'r_parse', 'r_lang', 'r_flag', 'r_socket' + ], + description: 'radare foundation libraries' +) diff --git a/libr/bin/meson.build b/libr/bin/meson.build index 3367afc6bd..5bb037200f 100644 --- a/libr/bin/meson.build +++ b/libr/bin/meson.build @@ -125,13 +125,14 @@ r_bin = library('r_bin', files, implicit_include_directories: false ) -pkg = import('pkgconfig') -pkg.generate(libraries: [r_bin], - subdirs: 'libr', - version: r2version, - name: 'r_bin', - filebase: 'r_bin', - requires: [ - 'r_util', 'r_io', 'r_socket', 'r_magic' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_bin], + subdirs: 'libr', + version: r2version, + name: 'r_bin', + filebase: 'r_bin', + requires: [ + 'r_util', 'r_io', 'r_socket', 'r_magic' + ], + description: 'radare foundation libraries' +) diff --git a/libr/bp/meson.build b/libr/bp/meson.build index f5c7f5cf12..05141ea47f 100644 --- a/libr/bp/meson.build +++ b/libr/bp/meson.build @@ -20,14 +20,14 @@ r_bp = library('r_bp', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_bp], - subdirs: 'libr', - version: r2version, - name: 'r_bp', - filebase: 'r_bp', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_bp], + subdirs: 'libr', + version: r2version, + name: 'r_bp', + filebase: 'r_bp', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/config/meson.build b/libr/config/meson.build index 4ae0a5bbc4..13873d5b7a 100644 --- a/libr/config/meson.build +++ b/libr/config/meson.build @@ -10,14 +10,14 @@ r_config = library('r_config', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_config], - subdirs: 'libr', - version: r2version, - name: 'r_config', - filebase: 'r_config', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_config], + subdirs: 'libr', + version: r2version, + name: 'r_config', + filebase: 'r_config', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/cons/meson.build b/libr/cons/meson.build index 000ce50428..b1e6e382fe 100644 --- a/libr/cons/meson.build +++ b/libr/cons/meson.build @@ -24,14 +24,14 @@ r_cons = library('r_cons', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_cons], - subdirs: 'libr', - version: r2version, - name: 'r_cons', - filebase: 'r_cons', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_cons], + subdirs: 'libr', + version: r2version, + name: 'r_cons', + filebase: 'r_cons', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/core/meson.build b/libr/core/meson.build index d960de11d8..a342ed19de 100644 --- a/libr/core/meson.build +++ b/libr/core/meson.build @@ -82,15 +82,16 @@ r_core = library('r_core', files, implicit_include_directories: false ) -pkg = import('pkgconfig') -pkg.generate(libraries: [r_core], - subdirs: 'libr', - version: r2version, - name: 'r_core', - filebase: 'r_core', - requires: [ - 'r_util', 'r_reg', 'r_syscall', 'r_search', 'r_cons', 'r_anal', 'r_socket', 'r_io', 'r_fs', - 'r_lang', 'r_hash', 'r_flag', 'r_parse', 'r_egg', 'r_debug', 'r_magic', 'r_crypto', 'r_config', - 'r_bin', 'r_asm', 'r_bp' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_core], + subdirs: 'libr', + version: r2version, + name: 'r_core', + filebase: 'r_core', + requires: [ + 'r_util', 'r_reg', 'r_syscall', 'r_search', 'r_cons', 'r_anal', 'r_socket', 'r_io', 'r_fs', + 'r_lang', 'r_hash', 'r_flag', 'r_parse', 'r_egg', 'r_debug', 'r_magic', 'r_crypto', 'r_config', + 'r_bin', 'r_asm', 'r_bp' + ], + description: 'radare foundation libraries' +) diff --git a/libr/debug/meson.build b/libr/debug/meson.build index cc52b35928..10d648ac21 100644 --- a/libr/debug/meson.build +++ b/libr/debug/meson.build @@ -31,19 +31,20 @@ files = [ 'trace.c', ] -if host_os == 'linux' +if host_machine.system() == 'linux' files += [ 'p/native/linux/linux_debug.c', 'p/native/linux/linux_coredump.c' ] endif -if host_os != 'windows' + +if host_machine.system() != 'windows' files += [ 'p/native/procfs.c' ] endif -if host_os == 'darwin' +if host_machine.system() == 'darwin' files += [ 'p/native/xnu/xnu_debug.c', #'p/native/xnu/trap_arm.c', @@ -71,15 +72,15 @@ r_debug = library('r_debug', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_debug], - subdirs: 'libr', - version: r2version, - name: 'r_debug', - filebase: 'r_debug', - requires: [ - 'r_util', 'r_hash', 'r_reg', 'r_syscall', 'r_anal', 'r_flag', 'r_io', 'r_bp', 'r_search', - 'r_cons', 'r_lang', 'r_egg', 'r_socket' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_debug], + subdirs: 'libr', + version: r2version, + name: 'r_debug', + filebase: 'r_debug', + requires: [ + 'r_util', 'r_hash', 'r_reg', 'r_syscall', 'r_anal', 'r_flag', 'r_io', 'r_bp', 'r_search', + 'r_cons', 'r_lang', 'r_egg', 'r_socket' + ], + description: 'radare foundation libraries' +) diff --git a/libr/egg/meson.build b/libr/egg/meson.build index 3e94141b56..0cc2fdc9da 100644 --- a/libr/egg/meson.build +++ b/libr/egg/meson.build @@ -23,14 +23,14 @@ r_egg = library('r_egg', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_egg], - subdirs: 'libr', - version: r2version, - name: 'r_egg', - filebase: 'r_egg', - requires: [ - 'r_util', 'r_asm', 'r_syscall' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_egg], + subdirs: 'libr', + version: r2version, + name: 'r_egg', + filebase: 'r_egg', + requires: [ + 'r_util', 'r_asm', 'r_syscall' + ], + description: 'radare foundation libraries' +) diff --git a/libr/flag/meson.build b/libr/flag/meson.build index 31c6263a48..a78709061b 100644 --- a/libr/flag/meson.build +++ b/libr/flag/meson.build @@ -12,14 +12,14 @@ r_flag = library('r_flag', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_flag], - subdirs: 'libr', - version: r2version, - name: 'r_flag', - filebase: 'r_flag', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_flag], + subdirs: 'libr', + version: r2version, + name: 'r_flag', + filebase: 'r_flag', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/fs/meson.build b/libr/fs/meson.build index a688c49513..2ab04fd778 100644 --- a/libr/fs/meson.build +++ b/libr/fs/meson.build @@ -36,14 +36,14 @@ r_fs = library('r_fs', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_fs], - subdirs: 'libr', - version: r2version, - name: 'r_fs', - filebase: 'r_fs', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_fs], + subdirs: 'libr', + version: r2version, + name: 'r_fs', + filebase: 'r_fs', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/hash/meson.build b/libr/hash/meson.build index 4b9ca68570..df9c715abf 100644 --- a/libr/hash/meson.build +++ b/libr/hash/meson.build @@ -22,14 +22,14 @@ r_hash = library('r_hash', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_hash], - subdirs: 'libr', - version: r2version, - name: 'r_hash', - filebase: 'r_hash', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_hash], + subdirs: 'libr', + version: r2version, + name: 'r_hash', + filebase: 'r_hash', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/io/meson.build b/libr/io/meson.build index 2e9c27265a..0e5b7695b0 100644 --- a/libr/io/meson.build +++ b/libr/io/meson.build @@ -41,18 +41,18 @@ files = [ 'p/io_zip.c', ] -if host_os == 'linux' -files += [ - 'p/io_r2k_linux.c', -] +if host_machine.system() == 'linux' + files += [ + 'p/io_r2k_linux.c', + ] endif -if host_os == 'windows' -files += [ - 'p/io_r2k_windows.c', - 'p/io_w32.c', - 'p/io_w32dbg.c', -] +if host_machine.system() == 'windows' + files += [ + 'p/io_r2k_windows.c', + 'p/io_w32.c', + 'p/io_w32dbg.c', + ] endif r_io = library('r_io', files, @@ -75,14 +75,14 @@ r_io = library('r_io', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_io], - subdirs: 'libr', - version: r2version, - name: 'r_io', - filebase: 'r_io', - requires: [ - 'r_util', 'r_socket' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_io], + subdirs: 'libr', + version: r2version, + name: 'r_io', + filebase: 'r_io', + requires: [ + 'r_util', 'r_socket' + ], + description: 'radare foundation libraries' +) diff --git a/libr/lang/meson.build b/libr/lang/meson.build index 6bb0b3c4cd..b8a7cd21f8 100644 --- a/libr/lang/meson.build +++ b/libr/lang/meson.build @@ -16,14 +16,14 @@ r_lang = library('r_lang', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_lang], - subdirs: 'libr', - version: r2version, - name: 'r_lang', - filebase: 'r_lang', - requires: [ - 'r_util', 'r_cons' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_lang], + subdirs: 'libr', + version: r2version, + name: 'r_lang', + filebase: 'r_lang', + requires: [ + 'r_util', 'r_cons' + ], + description: 'radare foundation libraries' +) diff --git a/libr/magic/meson.build b/libr/magic/meson.build index ac3ccfc4a7..67ba8b5f59 100644 --- a/libr/magic/meson.build +++ b/libr/magic/meson.build @@ -17,14 +17,14 @@ r_magic = library('r_magic', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_magic], - subdirs: 'libr', - version: r2version, - name: 'r_magic', - filebase: 'r_magic', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_magic], + subdirs: 'libr', + version: r2version, + name: 'r_magic', + filebase: 'r_magic', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/meson.build b/libr/meson.build index 756e072f35..fdea4d3b0b 100644 --- a/libr/meson.build +++ b/libr/meson.build @@ -243,7 +243,7 @@ io = [ 'winedbg' ] -if host_os == 'windows' +if host_machine.system() == 'windows' io += [ 'w32dbg', 'w32', @@ -267,3 +267,40 @@ parse = [ 'avr_pseudo', 'x86_pseudo', ] + +include_files = run_command(glob_cmd + ['include/*.h']).stdout().strip().split(';') +install_headers(include_files, subdir: 'libr') + +r_util_files = run_command(glob_cmd + ['include/r_util/*.h']).stdout().strip().split(';') +install_headers(r_util_files, subdir: 'libr/r_util') + +sdb_files = run_command(glob_cmd + ['include/sdb/*.h']).stdout().strip().split(';') +install_headers(sdb_files, subdir: 'libr/sdb') + +sflib_common_files = [ + 'include/sflib/common/sftypes.h', + 'include/sflib/common/sfsocketcall.h' +] + +sflib_arch = [ + 'linux-x86-64', + 'linux-x86-32', + 'linux-arm-64', + 'linux-arm-32', + 'darwin-x86-64', + 'darwin-x86-32', + 'darwin-arm-64' +] + +sflib_arch_files = [ + 'sflib.h', + 'sfsyscall.h', + 'sfsysnr.h' +] + +install_headers(sflib_common_files, subdir: 'libr/sflib/common') +foreach arch : sflib_arch + foreach file : sflib_arch_files + install_headers(join_paths('include/sflib', arch, file), subdir: join_paths('libr/sflib', arch)) + endforeach +endforeach diff --git a/libr/parse/meson.build b/libr/parse/meson.build index 8e6f134185..a652d2c761 100644 --- a/libr/parse/meson.build +++ b/libr/parse/meson.build @@ -30,14 +30,14 @@ r_parse = library('r_parse', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_parse], - subdirs: 'libr', - version: r2version, - name: 'r_parse', - filebase: 'r_parse', - requires: [ - 'r_util', 'r_flag', 'r_syscall', 'r_reg' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_parse], + subdirs: 'libr', + version: r2version, + name: 'r_parse', + filebase: 'r_parse', + requires: [ + 'r_util', 'r_flag', 'r_syscall', 'r_reg' + ], + description: 'radare foundation libraries' +) diff --git a/libr/reg/meson.build b/libr/reg/meson.build index f52e2e4952..6522e19d1c 100644 --- a/libr/reg/meson.build +++ b/libr/reg/meson.build @@ -14,14 +14,14 @@ r_reg = library('r_reg', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_reg], - subdirs: 'libr', - version: r2version, - name: 'r_reg', - filebase: 'r_reg', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_reg], + subdirs: 'libr', + version: r2version, + name: 'r_reg', + filebase: 'r_reg', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/search/meson.build b/libr/search/meson.build index c494bfc827..72822547ba 100644 --- a/libr/search/meson.build +++ b/libr/search/meson.build @@ -17,14 +17,14 @@ r_search = library('r_search', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_search], - subdirs: 'libr', - version: r2version, - name: 'r_search', - filebase: 'r_search', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_search], + subdirs: 'libr', + version: r2version, + name: 'r_search', + filebase: 'r_search', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/socket/meson.build b/libr/socket/meson.build index 4d9642b590..0a1fa662d6 100644 --- a/libr/socket/meson.build +++ b/libr/socket/meson.build @@ -18,14 +18,14 @@ r_socket = library('r_socket', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_socket], - subdirs: 'libr', - version: r2version, - name: 'r_socket', - filebase: 'r_socket', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_socket], + subdirs: 'libr', + version: r2version, + name: 'r_socket', + filebase: 'r_socket', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/syscall/meson.build b/libr/syscall/meson.build index 505431a43e..553a4e51c0 100644 --- a/libr/syscall/meson.build +++ b/libr/syscall/meson.build @@ -10,14 +10,13 @@ r_syscall = library('r_syscall', files, implicit_include_directories: false ) - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_syscall], - subdirs: 'libr', - version: r2version, - name: 'r_syscall', - filebase: 'r_syscall', - requires: [ - 'r_util' - ], - description: 'radare foundation libraries') +pkgconfig_mod.generate(libraries: [r_syscall], + subdirs: 'libr', + version: r2version, + name: 'r_syscall', + filebase: 'r_syscall', + requires: [ + 'r_util' + ], + description: 'radare foundation libraries' +) diff --git a/libr/util/meson.build b/libr/util/meson.build index 8c5b857f7b..22c7d13ee9 100644 --- a/libr/util/meson.build +++ b/libr/util/meson.build @@ -93,12 +93,11 @@ r_util = library('r_util', files, implicit_include_directories: false ) - - -pkg = import('pkgconfig') -pkg.generate(libraries: [r_util], - subdirs: 'libr', - version: r2version, - name: 'r_util', - filebase: 'r_util', - description: 'radare foundation libraries') +pkgconfig_mod.generate( + libraries: [r_util], + subdirs: 'libr', + version: r2version, + name: 'r_util', + filebase: 'r_util', + description: 'radare foundation libraries' +) diff --git a/meson.build b/meson.build index b1d6306aa9..42eea6e5b5 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,8 @@ project('radare2', 'c', meson_version: '>=0.45.0') py3_exe = import('python3').find_python() git_exe = find_program('git') +pkgconfig_mod = import('pkgconfig') +glob_cmd = [py3_exe, '-c', 'from sys import argv; print(";".join(__import__("glob").glob(argv[1])))'] # Get r2 version r2version = run_command(py3_exe, 'sys/version.py') @@ -68,19 +70,11 @@ pth = cc.find_library('pthread', required: false) utl = cc.find_library('util', required: false) mth = cc.find_library('m', required: false) -# detect OS -if cc.get_define('__linux__') == '1' - host_os = 'linux' -else - host_os = 'darwin' -endif - platform_deps = [] platform_inc = include_directories(['.', 'libr/include']) if host_machine.system() == 'windows' platform_deps = [cc.find_library('ws2_32')] platform_inc = include_directories(['.', 'libr/include', 'libr/include/msvc']) - host_os = 'windows' if get_option('default_library') == 'static' if get_option('buildtype') == 'release' and not meson.is_subproject() add_project_arguments('/MT', language: 'c') @@ -113,9 +107,11 @@ conf_data.set('plugins_debug', '&r_debug_plugin_' + ',&r_debug_plugin_'.join(deb conf_data.set('plugins_egg', '&r_egg_plugin_' + ',&r_egg_plugin_'.join(egg) + ', 0') conf_data.set('plugins_lang', '&r_lang_plugin_' + ',&r_lang_plugin_'.join(lang) + ', 0') conf_data.set('plugins_parse', '&r_parse_plugin_' + ',&r_parse_plugin_'.join(parse) + ', 0') -config_h = configure_file(input: 'libr/config.h.in', - output: 'config.h', - configuration: conf_data) +config_h = configure_file( + input: 'libr/config.h.in', + output: 'config.h', + configuration: conf_data +) userconf = configuration_data() userconf.set('DEBUGGER', 1) @@ -133,9 +129,11 @@ if host_machine.system() == 'windows' else userconf.set('HAVE_JEMALLOC', 1) endif -r_userconf_h = configure_file(input: 'libr/include/r_userconf.h.in', - output: 'r_userconf.h', - configuration: userconf) +r_userconf_h = configure_file( + input: 'libr/include/r_userconf.h.in', + output: 'r_userconf.h', + configuration: userconf +) install_headers(r_userconf_h, subdir: 'libr') versionconf = configuration_data() @@ -144,9 +142,11 @@ versionconf.set('R2_VERSION', r2version) versionconf.set('R2_GITTAP', gittap) versionconf.set('R2_GITTIP', gittip) versionconf.set('R2_BIRTH', r2birth) -r_version_h = configure_file(input: 'libr/include/r_version.h.in', - output: 'r_version.h', - configuration: versionconf) +r_version_h = configure_file( + input: 'libr/include/r_version.h.in', + output: 'r_version.h', + configuration: versionconf +) install_headers(r_version_h, subdir: 'libr') # Copy missing header @@ -154,14 +154,17 @@ run_command(py3_exe, '-c', '__import__("shutil").copyfile("shlr/spp/config.def.h pcconf = configuration_data() pcconf.set('PREFIX', get_option('prefix')) -pcconf.set('LIBDIR', get_option('libdir')) +pcconf.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) pcconf.set('VERSION', r2version) -libr_pc = configure_file(input: 'libr/libr.pc.acr', - output: 'libr.pc', - configuration: userconf) +libr_pc = configure_file( + input: 'libr/libr.pc.acr', + output: 'libr.pc', + configuration: userconf +) install_data(libr_pc, install_dir: join_paths(get_option('libdir'), 'pkgconfig')) subdir('shlr/') + subdir('libr/util') subdir('libr/hash') subdir('libr/crypto') @@ -185,14 +188,12 @@ subdir('libr/fs') subdir('libr/debug') subdir('libr/core') -subdir('libr/include') - subdir('shlr/sdb') + subdir('libr/anal/d') subdir('libr/asm/d') subdir('libr/bin/d') subdir('libr/syscall/d') - subdir('libr/cons/d') subdir('libr/magic/d') @@ -225,19 +226,17 @@ install_subdir('shlr/www', install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'radare2', r2version) ) -patterned_filelist = [py3_exe, '-c', 'from sys import argv; print(";".join(__import__("glob").glob(argv[1])))'] - -fortunes_files = run_command(patterned_filelist + ['doc/fortunes.*']).stdout().strip().split(';') +fortunes_files = run_command(glob_cmd + ['doc/fortunes.*']).stdout().strip().split(';') install_data(fortunes_files, install_dir: join_paths(get_option('datadir'), 'doc/radare2') ) -man1_files = run_command(patterned_filelist + ['man/*.1']).stdout().strip().split(';') +man1_files = run_command(glob_cmd + ['man/*.1']).stdout().strip().split(';') install_data(man1_files, install_dir: join_paths(get_option('mandir'), 'man1') ) -man7_files = run_command(patterned_filelist + ['man/*.7']).stdout().strip().split(';') +man7_files = run_command(glob_cmd + ['man/*.7']).stdout().strip().split(';') install_data(man7_files, install_dir: join_paths(get_option('mandir'), 'man7') )