Move remaining things from shlr/ to meson subprojects (#2126)

* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
This commit is contained in:
Riccardo Schirone 2021-12-22 02:20:39 +01:00 committed by GitHub
parent 5dafbf7e67
commit 6f40dfe493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
249 changed files with 1601 additions and 3054 deletions

View file

@ -48,7 +48,6 @@ only_commits:
- '**/*.in'
- '**/*.inc'
- '**/meson.build'
- 'shlr/rizin-shell-parser/'
- 'subprojects/'
- 'test/'
- '.appveyor.yml'
@ -71,13 +70,13 @@ install:
build_script:
- appveyor AddMessage "Compiling rizin %RZ_VERSION% (%builder%)"
- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2019_64 ( choco install mingw && refreshenv && set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2019_64 ( choco install mingw && refreshenv && set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
# Run tests only conditionally
for:

6
.gitattributes vendored
View file

@ -1,3 +1,3 @@
shlr/rizin-shell-parser/src/grammar.json linguist-generated=true
shlr/rizin-shell-parser/src/node-types.json linguist-generated=true
shlr/rizin-shell-parser/src/parser.c linguist-generated=true
subprojects/rizin-shell-parser/src/grammar.json linguist-generated=true
subprojects/rizin-shell-parser/src/node-types.json linguist-generated=true
subprojects/rizin-shell-parser/src/parser.c linguist-generated=true

4
.github/labeler.yml vendored
View file

@ -224,12 +224,12 @@ PDB:
- librz/core/cpdb.c
GDB:
- shlr/gdb/**/*
- subprojects/rzgdb/**/*
- librz/io/p/io_gdb.c
- librz/debug/p/debug_gdb.c
WinDbg:
- shlr/winkd/**/*
- subprojects/rzwinkd/**/*
- librz/io/p/io_winkd.c
- librz/io/p/io_windbg.c
- librz/debug/p/debug_winkd.c

1346
.github/workflows/ci.yml vendored

File diff suppressed because it is too large Load diff

View file

@ -99,7 +99,7 @@ jobs:
npm install prettier
- name: Run prettier
run: find . -name "*.js" | grep -v "subprojects" | xargs npx prettier --print-width 120 --check
run: find . -name "*.js" | grep -v "subprojects/tree-sitter-0" | grep -v "bindings/node/index.js" | xargs npx prettier --print-width 120 --check
python:
needs: changes

View file

@ -4,8 +4,8 @@ on:
pull_request:
paths:
- 'subprojects/tree-sitter.wrap'
- 'shlr/rizin-shell-parser/*'
- 'shlr/rizin-shell-parser/**/*'
- 'subprojects/rizin-shell-parser/*'
- 'subprojects/rizin-shell-parser/**/*'
branches:
- dev
@ -18,10 +18,10 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: cd shlr/rizin-shell-parser/ && npm install
- run: cd subprojects/rizin-shell-parser/ && npm install
- name: Run tests
run: |
cd shlr/rizin-shell-parser
cd subprojects/rizin-shell-parser
export PATH=${PATH}:./node_modules/.bin
tree-sitter generate
tree-sitter test

View file

@ -8,7 +8,6 @@ on:
- '**.in'
- '**.inc'
- '**/meson.build'
- 'shlr/rizin-shell-parser/**'
- 'subprojects/**'
- 'test/**'
- '.github/workflows/tcc.yml'
@ -25,7 +24,6 @@ on:
- '**.in'
- '**.inc'
- '**/meson.build'
- 'shlr/rizin-shell-parser/**'
- 'subprojects/**'
- '.github/workflows/tcc.yml'
branches:

15
.gitignore vendored
View file

@ -59,20 +59,7 @@ librz/config.h
librz/include/rz_userconf.h
librz/include/rz_version.h
librz/include/rz_version.h.tmp
shlr/capstone/
shlr/java/out
shlr/java/out.exe
shlr/sdb/sdb
shlr/sdb/sdb.exe
shlr/sdb/src/sdb
shlr/sdb/src/.sdb
shlr/sdb/src/sdb.exe
shlr/sdb/src/.sdb.exe
shlr/sdb/src/sdb-version.h
shlr/sdb/src/sdb_version.h
shlr/sdb/src/libsdb.so*
shlr/spp/config.h
shlr/.cs_tmp.zip
subprojects/spp/config.h
sys/travis/*.txt
sys/.mark_python-deps
sys/.mark_swig

View file

@ -1 +1 @@
shlr/rizin-shell-parser/bindings/node/index.js
subprojects/rizin-shell-parser/bindings/node/index.js

View file

@ -115,7 +115,7 @@ Files: test/prj/*.rzdb
Copyright: 2020 RizinOrg <info@rizin.re>
License: LGPL-3.0-only
Files: shlr/rizin-shell-parser/*
Files: subprojects/rizin-shell-parser/*
Copyright: 2020 ret2libc <sirmy15@gmail.com>
License: LGPL-3.0-only
@ -139,7 +139,7 @@ Files: binrz/rizin/*
Copyright: 2009 RadareOrg <pancake@nopcode.org>
License: LGPL-3.0-only
Files: man/*
Files: binrz/man/*
Copyright: 2020 RizinOrg <info@rizin.re>
License: LGPL-3.0-only
@ -221,21 +221,17 @@ Copyright: 1992, 1993, 1994 Henry Spencer
Copyright: 1992, 1993, 1994 The Regents of the University of California
License: BSD-3-Clause
Files: shlr/arm/omap3430_registers
Copyright: Anton Kochkov <anton.kochkov@gmail.com>
License: LGPL-3.0-only
Files: shlr/heap/include/rz_jemalloc/*
Files: subprojects/rzheap/rz_jemalloc/*
Copyright: 2002-present Jason Evans <jasone@canonware.com>
Copyright: 2007-2012 Mozilla Foundation.
Copyright: 2009-present Facebook, Inc.
License: BSD-2-Clause
Files: shlr/spp/*
Files: subprojects/rzspp/*
Copyright: 2009-2020 pancake <pancake@nopcode.org>
License: MIT
Files: shlr/winkd/profiles.h
Files: subprojects/rzwinkd/profiles.h
Copyright: 2014-2017 The Lemon Man <thatlemon@gmail.com>
Copyright: 2019-2020 GustavoLCR <gugulcr@gmail.com>
License: LGPL-3.0-only

View file

@ -29,8 +29,8 @@ librz/socket/ @XVilka @yossizap
librz/syscall/ @ret2libc @wargio
librz/type/ @XVilka
librz/util/ @ret2libc @thestr4ng3r
shlr/gdb/ @yossizap
shlr/ptrace-wrap/ @thestr4ng3r
shlr/rizin-shell-parser/ @ret2libc
shlr/w32dbg_wrap/ @yossizap
shlr/winkd/ @yossizap
subprojects/rzgdb/ @yossizap
subprojects/ptrace-wrap/ @thestr4ng3r
subprojects/rizin-shell-parser/ @ret2libc
subprojects/rzw32dbg_wrap/ @yossizap
subprojects/rzwinkd/ @yossizap

View file

@ -891,7 +891,6 @@ EXCLUDE_SYMLINKS = NO
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = */test/*
EXCLUDE_PATTERNS += */shlr/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the

35
binrz/meson.build Normal file
View file

@ -0,0 +1,35 @@
if get_option('blob')
subdir('blob')
else
subdir('rz-hash')
subdir('rz-run')
subdir('rz-asm')
subdir('rz-bin')
subdir('rizin')
subdir('rz-gg')
subdir('rz-agent')
subdir('rz-diff')
subdir('rz-find')
subdir('rz-sign')
subdir('rz-ax')
endif
subdir('rz-pm')
if get_option('enable_rz_test')
subdir('rz-test')
endif
install_man(
'man/rz-agent.1',
'man/rz-pm.1',
'man/rz-bin.1',
'man/rizin.1',
'man/rz-diff.1',
'man/rz-find.1',
'man/rz-gg.1',
'man/rz-hash.1',
'man/rz-run.1',
'man/rz-asm.1',
'man/rz-ax.1',
'man/rz-sign.1',
'man/rz-esil.7',
)

View file

@ -18,7 +18,6 @@ EXTRA_FLAGS+= -Duse_sys_lz4=disabled
EXTRA_FLAGS+= -Duse_sys_xxhash=disabled
EXTRA_FLAGS+= -Duse_sys_libuv=disabled
EXTRA_FLAGS+= -Duse_sys_openssl=disabled
EXTRA_FLAGS+= -Duse_webui=false
# architectures with debugging support
DEBUG_SUPPORT=0

View file

@ -124,9 +124,9 @@ language, Evaluable Strings Intermediate Language (ESIL).
### librz/debug/p/debug_gdb.c
A Rizin debugger plug-in that uses a remote GDB server/stub as its backend.
The protocol parsing itself is located at shlr/gdb. And corresponding IO plugin is
located in librz/io/p/io_gdb.c
A Rizin debugger plug-in that uses a remote GDB server/stub as its backend. The
protocol parsing itself is located at subprojects/rzgdb. And corresponding IO
plugin is located in librz/io/p/io_gdb.c
### librz/debug/p/debug_native.c
@ -210,9 +210,9 @@ See doc/rap
### librz/debug/p/debug_winkd.c
A debugger plugin that enables debugging code remotely via WinDbg protocol. WinDbg protocol
parser is located in shlr/winkd. Corresponding IO plugin located in librz/io/p/io_winkd.c
See doc/winkd
A debugger plugin that enables debugging code remotely via WinDbg protocol.
WinDbg protocol parser is located in subprojects/rzwinkd. Corresponding IO
plugin located in librz/io/p/io_winkd.c See doc/winkd.
## Conclusion

View file

@ -1,3 +1,68 @@
analysis_plugins = [
'6502',
'8051',
'amd29k',
'arm_cs',
'avr',
'bf',
'chip8',
'cr16',
'dalvik',
'ebc',
'gb',
'h8300',
'hexagon',
'i4004',
'i8080',
'java',
'luac',
'm68k_cs',
'm680x_cs',
'malbolge',
'mcore',
'mips_cs',
'msp430',
'null',
'or1k',
'pic',
'ppc_cs',
'propeller',
'pyc',
'rsp',
'snes',
'sparc_cs',
'spc700',
'sysz',
'tms320',
#'tms320c64x',
'v810',
'v850',
'wasm',
'x86_cs',
'xap',
'xcore_cs',
]
if capstone_dep.version().split('.')[0].to_int() > 4
analysis_plugins += 'riscv_cs'
endif
if get_option('use_gpl')
analysis_plugins += [
'arc',
'cris',
'mips_gnu',
'nios2',
'riscv',
'sh',
'sparc_gnu',
'tricore',
'vax',
'xtensa',
'z80',
]
endif
rz_analysis_sources = [
'analysis.c',
'arch_platform.c',
@ -208,6 +273,7 @@ rz_analysis = library('rz_analysis', rz_analysis_sources,
rz_analysis_dep = declare_dependency(link_with: rz_analysis,
include_directories: rz_analysis_inc)
meson.override_dependency('rz_analysis', rz_analysis_dep)
pkgconfig_mod.generate(rz_analysis,
subdirs: 'librz',
@ -252,3 +318,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -8,7 +8,7 @@
#include <rz_util.h>
#include <rz_asm.h>
#define USE_R2 1
#include <spp/spp.h>
#include <spp.h>
#include <config.h>
RZ_LIB_VERSION(rz_asm);

View file

@ -1,3 +1,78 @@
asm_plugins = [
'6502',
'8051',
'amd29k',
'arm_as',
'arm_cs',
'avr',
'bf',
'chip8',
'cr16',
'dalvik',
'dcpu16',
'ebc',
'gb',
'h8300',
'hexagon',
'i4004',
'i8080',
'java',
'lh5801',
'lm32',
'luac',
'm68k_cs',
'm680x_cs',
'malbolge',
'mcore',
'mcs96',
'mips_cs',
'msp430',
'or1k',
'pic',
'ppc_as',
'ppc_cs',
'propeller',
'pyc',
'rsp',
'snes',
'sparc_cs',
'spc700',
'sysz',
'tms320',
'tms320c64x',
'v810',
'v850',
'wasm',
'x86_as',
'x86_cs',
'x86_nasm',
'x86_nz',
'xap',
'xcore_cs',
]
if capstone_dep.version().split('.')[0].to_int() > 4
asm_plugins += 'riscv_cs'
endif
if get_option('use_gpl')
asm_plugins += [
'arc',
'cris_gnu',
'hppa_gnu',
'lanai_gnu',
'mips_gnu',
'nios2',
'riscv',
'sh',
'sparc_gnu',
'tricore',
'vax',
'xtensa',
'z80',
]
endif
rz_asm_sources = [
'asm.c',
'aop.c',
@ -202,7 +277,6 @@ endif
rz_asm_inc = [
platform_inc,
include_directories(
'../../shlr',
'arch/include',
'arch',
'arch/h8300',
@ -230,7 +304,7 @@ rz_asm = library('rz_asm', rz_asm_sources,
rz_parse_dep,
rz_bin_dep,
capstone_dep,
spp_dep,
dependency('rzspp'),
],
install: true,
implicit_include_directories: false,
@ -243,6 +317,7 @@ rz_asm = library('rz_asm', rz_asm_sources,
rz_asm_dep = declare_dependency(link_with: rz_asm,
include_directories: rz_asm_inc)
meson.override_dependency('rz_asm', rz_asm_dep)
pkgconfig_mod.generate(rz_asm,
subdirs: 'librz',
@ -280,3 +355,7 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')
subdir('cpus')
subdir('platforms')

View file

@ -1,3 +1,68 @@
bin_plugins = [
'any',
'art',
'avr',
'bf',
'bflt',
'bios',
'bootimg',
'cgc',
'coff',
'dex',
'dmp64',
'dol',
'dyldcache',
'elf',
'elf64',
'java',
'le',
'luac',
'mach0',
'mach064',
'mbn',
'mdmp',
'menuet',
'mz',
'ne',
'nes',
'nin3ds',
'ninds',
'ningb',
'ningba',
'nro',
'nso',
'omf',
'qnx',
'p9',
'pe',
'pe64',
'pebble',
'prg',
'psxexe',
'pyc',
'sfc',
'smd',
'sms',
'spc700',
'symbols',
'te',
'vsf',
'wasm',
'xbe',
'xnu_kernelcache',
'z64',
'zimg',
]
bin_ldr_plugins = [
'ldr_linux',
]
bin_xtr_plugins = [
'xtr_fatmach0',
'xtr_sep64',
]
rz_bin_sources = [
'bin.c',
'bin_language.c',
@ -185,6 +250,7 @@ rz_bin = library('rz_bin', rz_bin_sources,
rz_bin_dep = declare_dependency(link_with: rz_bin,
include_directories: rz_bin_inc)
meson.override_dependency('rz_bin', rz_bin_dep)
pkgconfig_mod.generate(rz_bin,
subdirs: 'librz',
@ -221,3 +287,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -1,3 +1,12 @@
bp_plugins = [
'arm',
'bf',
'mips',
'ppc',
'sh',
'x86'
]
rz_bp_sources = [
'bp.c',
'bp_io.c',
@ -28,6 +37,7 @@ rz_bp = library('rz_bp', rz_bp_sources,
rz_bp_dep = declare_dependency(link_with: rz_bp,
include_directories: [platform_inc])
meson.override_dependency('rz_bp', rz_bp_dep)
pkgconfig_mod.generate(rz_bp,
subdirs: 'librz',

View file

@ -21,6 +21,7 @@ rz_config = library('rz_config', rz_config_sources,
rz_config_dep = declare_dependency(link_with: rz_config,
include_directories: [platform_inc])
meson.override_dependency('rz_config', rz_config_dep)
pkgconfig_mod.generate(rz_config,
subdirs: 'librz',

View file

@ -32,6 +32,7 @@ rz_cons = library('rz_cons', rz_cons_sources,
rz_cons_dep = declare_dependency(link_with: rz_cons,
include_directories: [platform_inc])
meson.override_dependency('rz_cons', rz_cons_dep)
pkgconfig_mod.generate(rz_cons,
subdirs: 'librz',
@ -61,3 +62,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -1,3 +1,7 @@
core_plugins = [
'java',
]
subdir('cmd_descs')
rz_core_sources = [
@ -82,14 +86,13 @@ rz_core_sources = [
'tui/panels.c'
]
rz_core_inc = []
if host_machine.system() != 'windows'
rz_core_inc += ['../../shlr/heap/include']
else
rz_core_inc = ['.']
if host_machine.system() == 'windows'
rz_core_sources += 'windows_heap.c'
rz_core_inc += ['../../shlr/heap/include/rz_windows']
endif
rz_core_inc = [platform_inc, include_directories(rz_core_inc), 'cmd_descs']
rz_core_inc = [platform_inc, 'cmd_descs']
shell_parser_dep = dependency('rizin-shell-parser')
rz_core_deps = [
rz_util_dep,
@ -118,10 +121,11 @@ rz_core_deps = [
rz_config_dep,
rz_bin_dep,
platform_deps,
gdb_dep,
dependency('rzgdb'),
dependency('rzheap'),
shell_parser_dep,
lrt,
mth
mth,
]
if libuv_dep.found()
@ -143,6 +147,7 @@ rz_core = library('rz_core', rz_core_sources,
rz_core_dep = declare_dependency(link_with: rz_core,
include_directories: rz_core_inc)
meson.override_dependency('rz_core', rz_core_dep)
pkgconfig_mod.generate(
rz_core,

View file

@ -4,8 +4,8 @@
#include "rz_core.h"
#include "rz_socket.h"
#include "gdb/include/libgdbr.h"
#include "gdb/include/gdbserver/core.h"
#include <libgdbr.h>
#include <gdbserver/core.h>
#if HAVE_LIBUV
#include <uv.h>

View file

@ -1,3 +1,22 @@
crypto_plugins = [
'aes',
'aes_cbc',
'base64',
'base91',
'blowfish',
'cps2',
'des',
'punycode',
'rc2',
'rc4',
'rc6',
'rol',
'ror',
'rot',
'serpent',
'xor',
]
rz_crypto_sources = [
'des.c',
'crypto.c',
@ -38,6 +57,7 @@ rz_crypto = library('rz_crypto', rz_crypto_sources,
rz_crypto_dep = declare_dependency(link_with: rz_crypto,
include_directories: [platform_inc])
meson.override_dependency('rz_crypto', rz_crypto_dep)
pkgconfig_mod.generate(rz_crypto,
subdirs: 'librz',

View file

@ -1,3 +1,23 @@
debug_plugins = [
'bf',
'bochs',
'esil',
'gdb',
'io',
'native',
'null',
'rap',
'winkd'
]
if get_option('use_gpl')
debug_plugins += 'qnx'
endif
if host_machine.system() == 'windows'
debug_plugins += 'windbg'
endif
rz_debug_sources = [
'ddesc.c',
'debug.c',
@ -32,9 +52,9 @@ rz_debug_sources = [
]
rz_debug_deps = [
gdb_dep,
bochs_dep,
winkd_dep,
dependency('rzgdb'),
dependency('rzbochs'),
dependency('rzwinkd'),
rz_util_dep,
rz_cons_dep,
rz_hash_dep,
@ -47,7 +67,7 @@ rz_debug_deps = [
]
if get_option('use_gpl')
rz_debug_deps += qnx_dep
rz_debug_deps += dependency('rzqnx')
rz_debug_sources += 'p/debug_qnx.c'
endif
@ -65,7 +85,7 @@ if host_machine.system() == 'windows'
'p/native/windows/windows_debug.c',
'p/native/windows/windows_message.c',
]
rz_debug_deps += w32dbg_wrap_dep
rz_debug_deps += dependency('rzw32dbg_wrap')
endif
if host_machine.system() != 'windows'
@ -113,6 +133,7 @@ rz_debug = library('rz_debug', rz_debug_sources,
rz_debug_dep = declare_dependency(link_with: rz_debug,
include_directories: rz_debug_inc)
meson.override_dependency('rz_debug', rz_debug_dep)
pkgconfig_mod.generate(rz_debug,
subdirs: 'librz',

View file

@ -1,3 +1,17 @@
demangler_plugins = [
'java',
'msvc',
'objc',
]
if get_option('use_gpl')
demangler_plugins += ['cpp', 'rust']
endif
if get_option('use_swift_demangler')
demangler_plugins += 'swift'
endif
rz_demangler_sources = [
'demangler.c'
]
@ -18,6 +32,7 @@ rz_demangler = library('rz_demangler', rz_demangler_sources,
)
rz_demangler_dep = declare_dependency(link_with: rz_demangler, include_directories: [platform_inc])
meson.override_dependency('rz_demangler', rz_demangler_dep)
pkgconfig_mod.generate(rz_demangler,
subdirs: 'librz',

View file

@ -20,6 +20,7 @@ rz_diff = library('rz_diff', rz_diff_sources,
rz_diff_dep = declare_dependency(link_with: rz_diff,
include_directories: [platform_inc])
meson.override_dependency('rz_diff', rz_diff_dep)
pkgconfig_mod.generate(rz_diff,
subdirs: 'librz',

View file

@ -1,3 +1,9 @@
egg_plugins = [
'exec',
#'shya',
'xor'
]
rz_egg_sources = [
'egg.c',
'egg_Cfile.c',
@ -34,6 +40,7 @@ rz_egg = library('rz_egg', rz_egg_sources,
rz_egg_dep = declare_dependency(link_with: rz_egg,
include_directories: [platform_inc])
meson.override_dependency('rz_egg', rz_egg_dep)
pkgconfig_mod.generate(rz_egg,
subdirs: 'librz',

View file

@ -22,6 +22,7 @@ rz_flag = library('rz_flag', rz_flag_sources,
rz_flag_dep = declare_dependency(link_with: rz_flag,
include_directories: [platform_inc])
meson.override_dependency('rz_flag', rz_flag_dep)
pkgconfig_mod.generate(rz_flag,
subdirs: 'librz',
@ -51,3 +52,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -53,6 +53,7 @@ rz_hash = library('rz_hash', rz_hash_sources,
rz_hash_dep = declare_dependency(link_with: rz_hash,
include_directories: [platform_inc])
meson.override_dependency('rz_hash', rz_hash_dep)
pkgconfig_mod.generate(rz_hash,
subdirs: 'librz',

View file

@ -38,6 +38,7 @@ rz_il = library('rz_il', rz_il_sources,
rz_il_dep = declare_dependency(link_with: rz_il,
include_directories: rz_il_inc)
meson.override_dependency('rz_il', rz_il_dep)
pkgconfig_mod.generate(rz_il,
subdirs: 'librz',

170
librz/include/meson.build Normal file
View file

@ -0,0 +1,170 @@
include_files = [
'rz_agraph.h',
'rz_analysis.h',
'rz_arch.h',
'rz_asm.h',
'rz_basefind.h',
'rz_bin.h',
'rz_bin_dwarf.h',
'rz_bind.h',
'rz_bp.h',
'rz_cmd.h',
'rz_cmp.h',
'rz_config.h',
'rz_cons.h',
'rz_core.h',
'rz_crypto.h',
'rz_debug.h',
'rz_demangler.h',
'rz_diff.h',
'rz_egg.h',
'rz_endian.h',
'rz_flag.h',
'rz_flirt.h',
'rz_getopt.h',
'rz_heap_glibc.h',
'rz_heap_jemalloc.h',
'rz_il.h',
'rz_io.h',
'rz_lang.h',
'rz_lib.h',
'rz_list.h',
'rz_magic.h',
'rz_main.h',
'rz_msg_digest.h',
'rz_parse.h',
'rz_pdb.h',
'rz_project.h',
'rz_reg.h',
'rz_regex.h',
'rz_search.h',
'rz_sign.h',
'rz_skiplist.h',
'rz_skyline.h',
'rz_socket.h',
'rz_syscall.h',
'rz_th.h',
'rz_type.h',
'rz_types.h',
'rz_types_base.h',
'rz_types_overflow.h',
'rz_util.h',
'rz_vector.h',
'rz_windows_heap.h',
]
install_headers(include_files, install_dir: rizin_incdir)
rz_util_files = [
'rz_util/rz_alloc.h',
'rz_util/rz_annotated_code.h',
'rz_util/rz_ascii_table.h',
'rz_util/rz_asn1.h',
'rz_util/rz_assert.h',
'rz_util/rz_base64.h',
'rz_util/rz_base91.h',
'rz_util/rz_big.h',
'rz_util/rz_bitmap.h',
'rz_util/rz_bitvector.h',
'rz_util/rz_buf.h',
'rz_util/rz_debruijn.h',
'rz_util/rz_event.h',
'rz_util/rz_file.h',
'rz_util/rz_graph.h',
'rz_util/rz_graph_drawable.h',
'rz_util/rz_hex.h',
'rz_util/rz_idpool.h',
'rz_util/rz_intervaltree.h',
'rz_util/rz_itv.h',
'rz_util/rz_json.h',
'rz_util/rz_log.h',
'rz_util/rz_luhn.h',
'rz_util/rz_mem.h',
'rz_util/rz_name.h',
'rz_util/rz_num.h',
'rz_util/rz_path.h',
'rz_util/rz_panels.h',
'rz_util/rz_pj.h',
'rz_util/rz_pkcs7.h',
'rz_util/rz_pool.h',
'rz_util/rz_print.h',
'rz_util/rz_protobuf.h',
'rz_util/rz_punycode.h',
'rz_util/rz_queue.h',
'rz_util/rz_range.h',
'rz_util/rz_rbtree.h',
'rz_util/rz_serialize.h',
'rz_util/rz_signal.h',
'rz_util/rz_spaces.h',
'rz_util/rz_stack.h',
'rz_util/rz_str.h',
'rz_util/rz_str_constpool.h',
'rz_util/rz_str_search.h',
'rz_util/rz_str_util.h',
'rz_util/rz_strbuf.h',
'rz_util/rz_strpool.h',
'rz_util/rz_subprocess.h',
'rz_util/rz_sys.h',
'rz_util/rz_table.h',
'rz_util/rz_time.h',
'rz_util/rz_tree.h',
'rz_util/rz_uleb128.h',
'rz_util/rz_utf16.h',
'rz_util/rz_utf32.h',
'rz_util/rz_utf8.h',
'rz_util/rz_x509.h',
]
install_headers(rz_util_files, install_dir: join_paths(rizin_incdir, 'rz_util'))
rz_il_definitions_files = [
'rz_il/definitions/bag.h',
'rz_il/definitions/bool.h',
'rz_il/definitions/definitions.h',
'rz_il/definitions/label.h',
'rz_il/definitions/mem.h',
'rz_il/definitions/value.h',
'rz_il/definitions/variable.h',
]
install_headers(rz_il_definitions_files, install_dir: join_paths(rizin_incdir, 'rz_il', 'definitions'))
rz_il_files = [
'rz_il/rzil_opcodes.h',
'rz_il/rzil_vm_events.h',
'rz_il/rzil_vm.h',
'rz_il/vm_layer.h',
]
install_headers(rz_il_files, install_dir: join_paths(rizin_incdir, 'rz_il'))
rz_crypto_files = [
'rz_crypto/rz_des.h'
]
install_headers(rz_crypto_files, install_dir: join_paths(rizin_incdir, 'rz_crypto'))
if get_option('use_gpl')
sflib_common_files = [
'sflib/common/sftypes.h',
'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, install_dir: join_paths(rizin_incdir, 'sflib/common'))
foreach arch : sflib_arch
foreach file : sflib_arch_files
install_headers(join_paths('sflib', arch, file), install_dir: join_paths(rizin_incdir, 'sflib', arch))
endforeach
endforeach
endif

View file

@ -1,7 +1,7 @@
#ifndef RZ_HEAP_JEMALLOC_H
#define RZ_HEAP_JEMALLOC_H
#include "rz_jemalloc/internal/jemalloc_internal.h"
#include <rz_jemalloc/internal/jemalloc_internal.h>
#define INC_HEAP32 1
#include "rz_heap_jemalloc.h"

View file

@ -1,17 +0,0 @@
#ifndef RZ_NAKED_H
#define RZ_NAKED_H
#ifdef __cplusplus
extern "C" {
#endif
void *rz_core_new(void);
char *rz_core_cmd_str(void *p, const char *cmd);
void rz_core_free(void *core);
void free(void *);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,3 +1,46 @@
io_plugins = [
'ar',
'fd',
'bfdbg',
'bochs',
'debug',
'default',
'gdb',
'gprobe',
'gzip',
'http',
'ihex',
'srec',
'mach',
'malloc',
'null',
'procpid',
'ptrace',
'rzk',
'rzpipe',
'rzweb',
'rap',
'self',
'shm',
'sparse',
'tcp',
'winkd',
'winedbg',
'zip'
]
if get_option('use_gpl')
io_plugins += 'qnx'
endif
if host_machine.system() == 'windows'
io_plugins += [
'windbg',
'w32dbg',
'w32',
]
endif
rz_io_sources = [
'io.c',
'io_fd.c',
@ -49,11 +92,11 @@ if host_machine.system() == 'windows'
endif
rz_io_deps = [
bochs_dep,
gdb_dep,
winkd_dep,
dependency('rzbochs'),
dependency('rzgdb'),
dependency('rzwinkd'),
libzip_dep,
ar_dep,
dependency('rzar'),
pth,
lrt,
rz_util_dep,
@ -64,12 +107,12 @@ rz_io_deps = [
]
if get_option('use_gpl')
rz_io_deps += qnx_dep
rz_io_deps += dependency('rzqnx')
rz_io_sources += 'p/io_qnx.c'
endif
if host_machine.system() == 'windows'
rz_io_deps += w32dbg_wrap_dep
rz_io_deps += dependency('rzw32dbg_wrap')
endif
if host_machine.system() == 'linux' or host_machine.system() == 'android'
@ -81,7 +124,7 @@ if host_machine.system() == 'linux' or host_machine.system() == 'android'
endif
if use_ptrace_wrap
rz_io_deps += ptrace_wrap_dep
rz_io_deps += dependency('ptrace-wrap', default_options: ['is_static_build=' + is_static_build.to_string()])
endif
rz_io = library('rz_io', rz_io_sources,
@ -99,6 +142,7 @@ rz_io = library('rz_io', rz_io_sources,
rz_io_dep = declare_dependency(link_with: rz_io,
include_directories: platform_inc)
meson.override_dependency('rz_io', rz_io_dep)
pkgconfig_mod.generate(rz_io,
subdirs: 'librz',

View file

@ -1,3 +1,17 @@
lang_plugins = [
'lib',
'pipe',
'rust',
'vala'
]
if host_machine.system() != 'windows'
lang_plugins += [
'c',
'cpipe'
]
endif
rz_lang_sources = [
'lang.c',
# included in lang.c
@ -22,6 +36,7 @@ rz_lang = library('rz_lang', rz_lang_sources,
rz_lang_dep = declare_dependency(link_with: rz_lang,
include_directories: [platform_inc])
meson.override_dependency('rz_lang', rz_lang_dep)
pkgconfig_mod.generate(rz_lang,
subdirs: 'librz',

View file

@ -34,6 +34,7 @@ rz_magic_dep = declare_dependency(
link_with: rz_magic,
include_directories: platform_inc
)
meson.override_dependency('rz_magic', rz_magic_dep)
pkgconfig_mod.generate(rz_magic,
subdirs: 'librz',
@ -64,3 +65,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -55,6 +55,7 @@ rz_main = library('rz_main', rz_main_sources,
rz_main_dep = declare_dependency(link_with: rz_main,
include_directories: [platform_inc],
dependencies: rz_main_deps)
meson.override_dependency('rz_main', rz_main_dep)
pkgconfig_mod.generate(rz_main,
subdirs: 'librz',

View file

@ -1,511 +1,55 @@
analysis_plugins = [
'6502',
'8051',
'amd29k',
'arm_cs',
'avr',
'bf',
'chip8',
'cr16',
'dalvik',
'ebc',
'gb',
'h8300',
'hexagon',
'i4004',
'i8080',
'java',
'luac',
'm68k_cs',
'm680x_cs',
'malbolge',
'mcore',
'mips_cs',
'msp430',
'null',
'or1k',
'pic',
'ppc_cs',
'propeller',
'pyc',
'rsp',
'snes',
'sparc_cs',
'spc700',
'sysz',
'tms320',
#'tms320c64x',
'v810',
'v850',
'wasm',
'x86_cs',
'xap',
'xcore_cs',
]
subdir('include')
asm_plugins = [
'6502',
'8051',
'amd29k',
'arm_as',
'arm_cs',
'avr',
'bf',
'chip8',
'cr16',
'dalvik',
'dcpu16',
'ebc',
'gb',
'h8300',
'hexagon',
'i4004',
'i8080',
'java',
'lh5801',
'lm32',
'luac',
'm68k_cs',
'm680x_cs',
'malbolge',
'mcore',
'mcs96',
'mips_cs',
'msp430',
'or1k',
'pic',
'ppc_as',
'ppc_cs',
'propeller',
'pyc',
'rsp',
'snes',
'sparc_cs',
'spc700',
'sysz',
'tms320',
'tms320c64x',
'v810',
'v850',
'wasm',
'x86_as',
'x86_cs',
'x86_nasm',
'x86_nz',
'xap',
'xcore_cs',
]
subdir('util')
subdir('demangler')
subdir('socket')
subdir('hash')
subdir('crypto')
bin_plugins = [
'any',
'art',
'avr',
'bf',
'bflt',
'bios',
'bootimg',
'cgc',
'coff',
'dex',
'dmp64',
'dol',
'dyldcache',
'elf',
'elf64',
'java',
'le',
'luac',
'mach0',
'mach064',
'mbn',
'mdmp',
'menuet',
'mz',
'ne',
'nes',
'nin3ds',
'ninds',
'ningb',
'ningba',
'nro',
'nso',
'omf',
'qnx',
'p9',
'pe',
'pe64',
'pebble',
'prg',
'psxexe',
'pyc',
'sfc',
'smd',
'sms',
'spc700',
'symbols',
'te',
'vsf',
'wasm',
'xbe',
'xnu_kernelcache',
'z64',
'zimg',
]
subdir('cons')
subdir('diff')
subdir('io')
subdir('bp')
subdir('syscall')
subdir('search')
subdir('magic')
subdir('flag')
subdir('reg')
subdir('type')
subdir('bin')
subdir('config')
subdir('parse')
subdir('lang')
subdir('asm')
subdir('il')
subdir('analysis')
subdir('signature')
subdir('egg')
subdir('debug')
subdir('core')
bin_ldr_plugins = [
'ldr_linux',
]
subdir('main')
bin_xtr_plugins = [
'xtr_fatmach0',
'xtr_sep64',
]
bp_plugins = [
'arm',
'bf',
'mips',
'ppc',
'sh',
'x86'
]
core_plugins = [
'java',
]
crypto_plugins = [
'aes',
'aes_cbc',
'base64',
'base91',
'blowfish',
'cps2',
'des',
'punycode',
'rc2',
'rc4',
'rc6',
'rol',
'ror',
'rot',
'serpent',
'xor',
]
debug_plugins = [
'bf',
'bochs',
'esil',
'gdb',
'io',
'native',
'null',
'rap',
'winkd'
]
egg_plugins = [
'exec',
#'shya',
'xor'
]
io_plugins = [
'ar',
'fd',
'bfdbg',
'bochs',
'debug',
'default',
'gdb',
'gprobe',
'gzip',
'http',
'ihex',
'srec',
'mach',
'malloc',
'null',
'procpid',
'ptrace',
'rzk',
'rzpipe',
'rzweb',
'rap',
'self',
'shm',
'sparse',
'tcp',
'winkd',
'winedbg',
'zip'
]
lang_plugins = [
'lib',
'pipe',
'rust',
'vala'
]
if host_machine.system() != 'windows'
lang_plugins += [
'c',
'cpipe'
]
endif
parse_plugins = [
'6502_pseudo',
'arm_pseudo',
'att2intel',
'avr_pseudo',
'chip8_pseudo',
'tms320_pseudo',
'dalvik_pseudo',
'm68k_pseudo',
'mips_pseudo',
'ppc_pseudo',
'v850_pseudo',
'wasm_pseudo',
'x86_pseudo',
]
demangler_plugins = [
'java',
'msvc',
'objc',
]
if capstone_dep.version().split('.')[0].to_int() > 4
analysis_plugins += 'riscv_cs'
asm_plugins += 'riscv_cs'
endif
if get_option('use_gpl')
io_plugins += 'qnx'
debug_plugins += 'qnx'
demangler_plugins += ['cpp', 'rust']
analysis_plugins += [
'arc',
'cris',
'mips_gnu',
'nios2',
'riscv',
'sh',
'sparc_gnu',
'tricore',
'vax',
'xtensa',
'z80',
]
asm_plugins += [
'arc',
'cris_gnu',
'hppa_gnu',
'lanai_gnu',
'mips_gnu',
'nios2',
'riscv',
'sh',
'sparc_gnu',
'tricore',
'vax',
'xtensa',
'z80',
]
parse_plugins += [
'sh_pseudo',
'riscv_pseudo',
'z80_pseudo'
]
endif
if host_machine.system() == 'windows'
io_plugins += [
'windbg',
'w32dbg',
'w32',
]
debug_plugins += 'windbg'
endif
if get_option('use_swift_demangler')
demangler_plugins += 'swift'
endif
include_files =[
'include/rznaked.h',
'include/rz_agraph.h',
'include/rz_analysis.h',
'include/rz_arch.h',
'include/rz_asm.h',
'include/rz_basefind.h',
'include/rz_bin.h',
'include/rz_bin_dwarf.h',
'include/rz_bind.h',
'include/rz_bp.h',
'include/rz_cmd.h',
'include/rz_cmp.h',
'include/rz_config.h',
'include/rz_cons.h',
'include/rz_core.h',
'include/rz_crypto.h',
'include/rz_debug.h',
'include/rz_demangler.h',
'include/rz_diff.h',
'include/rz_egg.h',
'include/rz_endian.h',
'include/rz_flag.h',
'include/rz_flirt.h',
'include/rz_getopt.h',
'include/rz_heap_glibc.h',
'include/rz_heap_jemalloc.h',
'include/rz_il.h',
'include/rz_io.h',
'include/rz_lang.h',
'include/rz_lib.h',
'include/rz_list.h',
'include/rz_magic.h',
'include/rz_main.h',
'include/rz_msg_digest.h',
'include/rz_parse.h',
'include/rz_pdb.h',
'include/rz_project.h',
'include/rz_reg.h',
'include/rz_regex.h',
'include/rz_search.h',
'include/rz_sign.h',
'include/rz_skiplist.h',
'include/rz_skyline.h',
'include/rz_socket.h',
'include/rz_syscall.h',
'include/rz_th.h',
'include/rz_type.h',
'include/rz_types.h',
'include/rz_types_base.h',
'include/rz_types_overflow.h',
'include/rz_util.h',
'include/rz_vector.h',
'include/rz_windows_heap.h',
]
install_headers(include_files, install_dir: rizin_incdir)
rz_util_files = [
'include/rz_util/rz_alloc.h',
'include/rz_util/rz_annotated_code.h',
'include/rz_util/rz_ascii_table.h',
'include/rz_util/rz_asn1.h',
'include/rz_util/rz_assert.h',
'include/rz_util/rz_base64.h',
'include/rz_util/rz_base91.h',
'include/rz_util/rz_big.h',
'include/rz_util/rz_bitmap.h',
'include/rz_util/rz_bitvector.h',
'include/rz_util/rz_buf.h',
'include/rz_util/rz_debruijn.h',
'include/rz_util/rz_event.h',
'include/rz_util/rz_file.h',
'include/rz_util/rz_graph.h',
'include/rz_util/rz_graph_drawable.h',
'include/rz_util/rz_hex.h',
'include/rz_util/rz_idpool.h',
'include/rz_util/rz_intervaltree.h',
'include/rz_util/rz_itv.h',
'include/rz_util/rz_json.h',
'include/rz_util/rz_log.h',
'include/rz_util/rz_luhn.h',
'include/rz_util/rz_mem.h',
'include/rz_util/rz_name.h',
'include/rz_util/rz_num.h',
'include/rz_util/rz_path.h',
'include/rz_util/rz_panels.h',
'include/rz_util/rz_pj.h',
'include/rz_util/rz_pkcs7.h',
'include/rz_util/rz_pool.h',
'include/rz_util/rz_print.h',
'include/rz_util/rz_protobuf.h',
'include/rz_util/rz_punycode.h',
'include/rz_util/rz_queue.h',
'include/rz_util/rz_range.h',
'include/rz_util/rz_rbtree.h',
'include/rz_util/rz_serialize.h',
'include/rz_util/rz_signal.h',
'include/rz_util/rz_spaces.h',
'include/rz_util/rz_stack.h',
'include/rz_util/rz_str.h',
'include/rz_util/rz_str_constpool.h',
'include/rz_util/rz_str_search.h',
'include/rz_util/rz_str_util.h',
'include/rz_util/rz_strbuf.h',
'include/rz_util/rz_strpool.h',
'include/rz_util/rz_subprocess.h',
'include/rz_util/rz_sys.h',
'include/rz_util/rz_table.h',
'include/rz_util/rz_time.h',
'include/rz_util/rz_tree.h',
'include/rz_util/rz_uleb128.h',
'include/rz_util/rz_utf16.h',
'include/rz_util/rz_utf32.h',
'include/rz_util/rz_utf8.h',
'include/rz_util/rz_x509.h',
]
install_headers(rz_util_files, install_dir: join_paths(rizin_incdir, 'rz_util'))
rz_il_definitions_files = [
'include/rz_il/definitions/bag.h',
'include/rz_il/definitions/bool.h',
'include/rz_il/definitions/definitions.h',
'include/rz_il/definitions/label.h',
'include/rz_il/definitions/mem.h',
'include/rz_il/definitions/value.h',
'include/rz_il/definitions/variable.h',
]
install_headers(rz_il_definitions_files, install_dir: join_paths(rizin_incdir, 'rz_il', 'definitions'))
rz_il_files = [
'include/rz_il/rzil_opcodes.h',
'include/rz_il/rzil_vm_events.h',
'include/rz_il/rzil_vm.h',
'include/rz_il/vm_layer.h',
]
install_headers(rz_il_files, install_dir: join_paths(rizin_incdir, 'rz_il'))
rz_crypto_files = [
'include/rz_crypto/rz_des.h'
]
install_headers(rz_crypto_files, install_dir: join_paths(rizin_incdir, 'rz_crypto'))
if get_option('use_gpl')
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, install_dir: join_paths(rizin_incdir, 'sflib/common'))
foreach arch : sflib_arch
foreach file : sflib_arch_files
install_headers(join_paths('include/sflib', arch, file), install_dir: join_paths(rizin_incdir, 'sflib', arch))
endforeach
endforeach
endif
conf_data = configuration_data()
conf_data.set('plugins_core', '&rz_core_plugin_' + ', &rz_core_plugin_'.join(core_plugins) + ', 0')
conf_data.set('plugins_analysis', '&rz_analysis_plugin_' + ', &rz_analysis_plugin_'.join(analysis_plugins) + ', 0')
conf_data.set('plugins_asm', '&rz_asm_plugin_' + ', &rz_asm_plugin_'.join(asm_plugins) + ', 0')
conf_data.set('plugins_bp', '&rz_bp_plugin_' + ', &rz_bp_plugin_'.join(bp_plugins) + ', 0')
conf_data.set('plugins_bin', '&rz_bin_plugin_' + ', &rz_bin_plugin_'.join(bin_plugins) + ', 0')
conf_data.set('plugins_bin_ldr', '&rz_bin_ldr_plugin_' + ', &rz_bin_ldr_plugin_'.join(bin_ldr_plugins) + ', 0')
conf_data.set('plugins_bin_xtr', '&rz_bin_xtr_plugin_' + ', &rz_bin_xtr_plugin_'.join(bin_xtr_plugins) + ', 0')
conf_data.set('plugins_crypto', '&rz_crypto_plugin_' + ', &rz_crypto_plugin_'.join(crypto_plugins) + ', 0')
conf_data.set('plugins_io', '&rz_io_plugin_' + ', &rz_io_plugin_'.join(io_plugins) + ', 0')
conf_data.set('plugins_debug', '&rz_debug_plugin_' + ', &rz_debug_plugin_'.join(debug_plugins) + ', 0')
conf_data.set('plugins_egg', '&rz_egg_plugin_' + ', &rz_egg_plugin_'.join(egg_plugins) + ', 0')
conf_data.set('plugins_lang', '&rz_lang_plugin_' + ', &rz_lang_plugin_'.join(lang_plugins) + ', 0')
conf_data.set('plugins_parse', '&rz_parse_plugin_' + ', &rz_parse_plugin_'.join(parse_plugins) + ', 0')
conf_data.set('plugins_demangler', '&rz_demangler_plugin_' + ', &rz_demangler_plugin_'.join(demangler_plugins))
config_h = configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: conf_data
)
if not is_static_libs_only
conf = configuration_data()

View file

@ -1,3 +1,27 @@
parse_plugins = [
'6502_pseudo',
'arm_pseudo',
'att2intel',
'avr_pseudo',
'chip8_pseudo',
'tms320_pseudo',
'dalvik_pseudo',
'm68k_pseudo',
'mips_pseudo',
'ppc_pseudo',
'v850_pseudo',
'wasm_pseudo',
'x86_pseudo',
]
if get_option('use_gpl')
parse_plugins += [
'sh_pseudo',
'riscv_pseudo',
'z80_pseudo'
]
endif
rz_parse_sources = [
'filter.c',
'parse.c',
@ -40,6 +64,7 @@ rz_parse = library('rz_parse', rz_parse_sources,
rz_parse_dep = declare_dependency(link_with: rz_parse,
include_directories: platform_inc)
meson.override_dependency('rz_parse', rz_parse_dep)
pkgconfig_mod.generate(rz_parse,
subdirs: 'librz',

View file

@ -22,6 +22,7 @@ rz_reg = library('rz_reg', rz_reg_sources,
rz_reg_dep = declare_dependency(link_with: rz_reg,
include_directories: [platform_inc])
meson.override_dependency('rz_reg', rz_reg_dep)
pkgconfig_mod.generate(rz_reg,
subdirs: 'librz',
@ -54,3 +55,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -23,6 +23,7 @@ rz_search = library('rz_search', rz_search_sources,
rz_search_dep = declare_dependency(link_with: rz_search,
include_directories: [platform_inc])
meson.override_dependency('rz_search', rz_search_dep)
pkgconfig_mod.generate(rz_search,
subdirs: 'librz',

View file

@ -35,6 +35,7 @@ rz_sign = library('rz_sign', rz_sign_sources,
rz_sign_dep = declare_dependency(link_with: rz_sign,
include_directories: rz_sign_inc)
meson.override_dependency('rz_sign', rz_sign_dep)
pkgconfig_mod.generate(rz_sign,
subdirs: 'librz',

View file

@ -39,6 +39,7 @@ rz_socket = library('rz_socket', rz_socket_sources,
rz_socket_dep = declare_dependency(link_with: rz_socket,
dependencies: [rz_util_dep],
include_directories: [platform_inc])
meson.override_dependency('rz_socket', rz_socket_dep)
pkgconfig_mod.generate(rz_socket,
subdirs: 'librz',

View file

@ -17,6 +17,7 @@ rz_syscall = library('rz_syscall', rz_syscall_sources,
rz_syscall_dep = declare_dependency(link_with: rz_syscall,
include_directories: [platform_inc])
meson.override_dependency('rz_syscall', rz_syscall_dep)
pkgconfig_mod.generate(rz_syscall,
subdirs: 'librz',
@ -46,3 +47,5 @@ if not is_static_libs_only
configuration: conf,
)
endif
subdir('d')

View file

@ -18,8 +18,7 @@ if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
tree_sitter_c_proj = subproject('tree-sitter-c', default_options: ['default_library=static'])
tree_sitter_c_dep = tree_sitter_c_proj.get_variable('tree_sitter_c_dep')
tree_sitter_c_dep = dependency('tree-sitter-c')
rz_type_inc = [
platform_inc,
@ -31,7 +30,6 @@ rz_type = library('rz_type', rz_type_sources,
c_args: library_cflags,
dependencies: [
rz_util_dep,
tree_sitter_dep,
tree_sitter_c_dep,
lrt
],
@ -46,6 +44,7 @@ rz_type = library('rz_type', rz_type_sources,
rz_type_dep = declare_dependency(link_with: rz_type,
include_directories: rz_type_inc)
meson.override_dependency('rz_type', rz_type_dep)
pkgconfig_mod.generate(rz_type,
subdirs: 'librz',

View file

@ -114,6 +114,7 @@ rz_util_dep = declare_dependency(
sdb_dep.partial_dependency(includes: true),
]
)
meson.override_dependency('rz_util', rz_util_dep)
pkgconfig_mod.generate(rz_util,
subdirs: ['librz', 'librz/sdb'],

View file

@ -104,7 +104,7 @@ else
endif
platform_deps = []
platform_inc = ['.', 'librz/include']
platform_inc = ['.', 'librz', 'librz/include']
if host_machine.system() == 'windows'
platform_deps = [
cc.find_library('ws2_32'),
@ -263,30 +263,6 @@ if not capstone_dep.found()
capstone_dep = capstone_proj.get_variable('capstone_dep')
endif
# load plugin configuration
subdir('librz')
conf_data = configuration_data()
conf_data.set('plugins_core', '&rz_core_plugin_' + ', &rz_core_plugin_'.join(core_plugins) + ', 0')
conf_data.set('plugins_analysis', '&rz_analysis_plugin_' + ', &rz_analysis_plugin_'.join(analysis_plugins) + ', 0')
conf_data.set('plugins_asm', '&rz_asm_plugin_' + ', &rz_asm_plugin_'.join(asm_plugins) + ', 0')
conf_data.set('plugins_bp', '&rz_bp_plugin_' + ', &rz_bp_plugin_'.join(bp_plugins) + ', 0')
conf_data.set('plugins_bin', '&rz_bin_plugin_' + ', &rz_bin_plugin_'.join(bin_plugins) + ', 0')
conf_data.set('plugins_bin_ldr', '&rz_bin_ldr_plugin_' + ', &rz_bin_ldr_plugin_'.join(bin_ldr_plugins) + ', 0')
conf_data.set('plugins_bin_xtr', '&rz_bin_xtr_plugin_' + ', &rz_bin_xtr_plugin_'.join(bin_xtr_plugins) + ', 0')
conf_data.set('plugins_crypto', '&rz_crypto_plugin_' + ', &rz_crypto_plugin_'.join(crypto_plugins) + ', 0')
conf_data.set('plugins_io', '&rz_io_plugin_' + ', &rz_io_plugin_'.join(io_plugins) + ', 0')
conf_data.set('plugins_debug', '&rz_debug_plugin_' + ', &rz_debug_plugin_'.join(debug_plugins) + ', 0')
conf_data.set('plugins_egg', '&rz_egg_plugin_' + ', &rz_egg_plugin_'.join(egg_plugins) + ', 0')
conf_data.set('plugins_lang', '&rz_lang_plugin_' + ', &rz_lang_plugin_'.join(lang_plugins) + ', 0')
conf_data.set('plugins_parse', '&rz_parse_plugin_' + ', &rz_parse_plugin_'.join(parse_plugins) + ', 0')
conf_data.set('plugins_demangler', '&rz_demangler_plugin_' + ', &rz_demangler_plugin_'.join(demangler_plugins))
config_h = configure_file(
input: 'librz/config.h.in',
output: 'config.h',
configuration: conf_data
)
# handle magic library
sys_magic_opt = get_option('use_sys_magic')
sys_magic = disabler()
@ -365,6 +341,7 @@ if not tree_sitter_dep.found()
tree_sitter_proj = subproject('tree-sitter', default_options: ['default_library=static'])
tree_sitter_dep = tree_sitter_proj.get_variable('tree_sitter_dep')
endif
meson.override_dependency('tree-sitter', tree_sitter_dep)
has_debugger = get_option('debugger')
have_ptrace = not ['windows', 'cygwin', 'sunos', 'haiku'].contains(host_machine.system())
@ -530,9 +507,6 @@ rz_version_h = configure_file(
install_dir: rizin_incdir
)
# Copy missing header
run_command(py3_exe, '-c', '__import__("shutil").copyfile("shlr/spp/config.def.h", "shlr/spp/config.h")')
# handle zlib dependency
r = run_command(py3_exe, check_meson_subproject_py, 'zlib')
if r.returncode() == 1 and get_option('subprojects_check')
@ -573,6 +547,25 @@ if not libzip_dep.found()
libzip_dep = libzip_proj.get_variable('libzip_dep')
endif
# handle mpc dependency
r = run_command(py3_exe, check_meson_subproject_py, 'mpc')
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
mpc_proj = subproject('mpc', default_options: ['default_library=static'])
mpc_dep = mpc_proj.get_variable('mpc_dep')
# handle yxml dependency
r = run_command(py3_exe, check_meson_subproject_py, 'yxml')
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
yxml_proj = subproject('yxml', default_options: ['default_library=static'])
yxml_dep = yxml_proj.get_variable('yxml_dep')
# handle sdb dependency
r = run_command(py3_exe, check_meson_subproject_py, 'sdb')
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
@ -589,24 +582,6 @@ sdb_gen_cmd = [
'@INPUT@'
]
spp_files = [
'shlr/spp/spp.c'
]
spp_inc = [platform_inc, include_directories('shlr/spp')]
librzspp = static_library('rzspp', spp_files,
dependencies: sdb_dep.partial_dependency(includes: true),
include_directories: spp_inc,
c_args: ['-DHAVE_R_UTIL', '-DUSE_R2=1'],
implicit_include_directories: false
)
spp_dep = declare_dependency(
link_whole: librzspp,
include_directories: spp_inc
)
use_rpath = false
use_rpath_absolute = false
if host_machine.system() != 'windows' and get_option('default_library') == 'shared'
@ -673,106 +648,12 @@ if host_machine.system() == 'windows'
]
endif
subdir('librz/util')
subdir('librz/demangler')
subdir('librz/socket')
subdir('librz/hash')
subdir('librz/crypto')
subdir('shlr')
subdir('librz/cons')
subdir('librz/diff')
subdir('shlr/gdb')
subdir('librz/io')
subdir('librz/bp')
subdir('librz/syscall')
subdir('librz/search')
subdir('librz/magic')
subdir('librz/flag')
subdir('librz/reg')
subdir('librz/type')
subdir('librz/bin')
subdir('librz/config')
subdir('librz/parse')
subdir('librz/lang')
subdir('librz/asm')
subdir('librz/il')
subdir('librz/analysis')
subdir('librz/signature')
subdir('librz/egg')
subdir('librz/debug')
subdir('librz/core')
subdir('librz/analysis/d')
subdir('librz/asm/d')
subdir('librz/asm/cpus')
subdir('librz/asm/platforms')
subdir('librz/bin/d')
subdir('librz/syscall/d')
subdir('librz/reg/d')
subdir('librz/cons/d')
subdir('librz/magic/d')
subdir('librz/flag/d')
subdir('librz/main')
subdir('librz')
cli_option = get_option('cli')
if cli_option.auto()
cli_enabled = not meson.is_subproject()
else
cli_enabled = cli_option.enabled()
endif
cli_enabled = cli_option.auto() ? not meson.is_subproject() : cli_option.enabled()
if cli_enabled
if get_option('blob')
subdir('binrz/blob')
else
subdir('binrz/rz-hash')
subdir('binrz/rz-run')
subdir('binrz/rz-asm')
subdir('binrz/rz-bin')
subdir('binrz/rizin')
subdir('binrz/rz-gg')
subdir('binrz/rz-agent')
subdir('binrz/rz-diff')
subdir('binrz/rz-find')
subdir('binrz/rz-sign')
subdir('binrz/rz-ax')
endif
subdir('binrz/rz-pm')
subdir('binrz/rz-test')
endif
if get_option('use_webui')
install_subdir('shlr/www',
install_dir: rizin_wwwroot,
strip_directory: true
)
endif
subdir('test/unit')
subdir('test/integration')
install_data(
'doc/fortunes.fun',
'doc/fortunes.tips',
install_dir: rizin_fortunes
)
if cli_enabled
install_man(
'man/rz-agent.1',
'man/rz-pm.1',
'man/rz-bin.1',
'man/rizin.1',
'man/rz-diff.1',
'man/rz-find.1',
'man/rz-gg.1',
'man/rz-hash.1',
'man/rz-run.1',
'man/rz-asm.1',
'man/rz-ax.1',
'man/rz-sign.1',
'man/rz-esil.7',
)
subdir('binrz')
install_data('doc/hud',
install_dir: rizin_hud,
@ -780,6 +661,14 @@ if cli_enabled
)
endif
subdir('test')
install_data(
'doc/fortunes.fun',
'doc/fortunes.tips',
install_dir: rizin_fortunes
)
dist_script = 'sys/meson_dist_script.py'
if meson.version().version_compare('<0.57.0')
meson.add_dist_script(meson.source_root() / dist_script)

View file

@ -36,7 +36,5 @@ option('use_swift_demangler', type: 'boolean', value: true, description: 'If fal
option('use_gpl', type: 'boolean', value: true, description: 'Set to false when you want to disable gpl code')
option('debugger', type: 'boolean', value: true)
option('use_webui', type: 'boolean', value: false, description: 'Install different WebUIs for rizin')
option('enable_tests', type: 'boolean', value: true, description: 'Build unit tests in test/unit')
option('enable_rz_test', type: 'boolean', value: true, description: 'Build rz-test executable for regression testing')

File diff suppressed because it is too large Load diff

View file

@ -1,7 +0,0 @@
Trying to escape from the librz/core mess, we should put all the heap stuff into a separate place and use it from analysis/heap.c
TODO
* remove all use of assert
* remove unused statements
* convert macros into C code, this should be a runtime library, not a compile time one

View file

@ -1,120 +0,0 @@
# new rizin shell parser
subdir('rizin-shell-parser')
# handle bochs dependency
bochs_files = [
'bochs/src/libbochs.c'
]
bochs_inc = [platform_inc, include_directories('bochs/include')]
librzbochs = static_library('rzbochs', bochs_files,
dependencies: [rz_util_dep],
include_directories: bochs_inc,
implicit_include_directories: false
)
bochs_dep = declare_dependency(
link_with: librzbochs,
include_directories: bochs_inc
)
if get_option('use_gpl')
# handle qnx dependency
qnx_files = [
'qnx/src/core.c',
'qnx/src/packet.c',
'qnx/src/sigutil.c',
'qnx/src/utils.c',
]
qnx_inc = [platform_inc, include_directories('qnx/include')]
librzqnx = static_library('rzqnx', qnx_files,
dependencies: [rz_util_dep, rz_socket_dep],
include_directories: qnx_inc,
implicit_include_directories: false
)
qnx_dep = declare_dependency(
link_with: librzqnx,
include_directories: qnx_inc
)
endif
# handle winkd dependency
winkd_files = [
'winkd/iob_pipe.c',
'winkd/iob_net.c',
'winkd/kd.c',
'winkd/transport.c',
'winkd/winkd.c',
]
winkd_inc = [platform_inc, include_directories('winkd')]
librzwinkd_deps = [rz_util_dep, rz_socket_dep, rz_hash_dep, rz_crypto_dep]
if host_machine.system() == 'haiku'
librzwinkd_deps += [
cc.find_library('network')
]
endif
librzwinkd = static_library('rzwinkd', winkd_files,
dependencies: librzwinkd_deps,
include_directories: winkd_inc,
implicit_include_directories: false
)
winkd_dep = declare_dependency(
link_with: librzwinkd,
include_directories: winkd_inc
)
# handle ar dependency
ar_files = [
'ar/ar.c'
]
ar_inc = [platform_inc, include_directories(['ar'])]
librzar = static_library('rzar', ar_files,
dependencies: [rz_util_dep],
include_directories: ar_inc,
implicit_include_directories: false
)
ar_dep = declare_dependency(
link_with: librzar,
include_directories: ar_inc
)
# handle ptrace-wrap dependency
if use_ptrace_wrap
subdir('ptrace-wrap')
endif
if host_machine.system() == 'windows'
subdir('w32dbg_wrap')
endif
# handle mpc dependency
r = run_command(py3_exe, check_meson_subproject_py, 'mpc')
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
mpc_proj = subproject('mpc', default_options: ['default_library=static'])
mpc_dep = mpc_proj.get_variable('mpc_dep')
# handle yxml dependency
r = run_command(py3_exe, check_meson_subproject_py, 'yxml')
if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
yxml_proj = subproject('yxml', default_options: ['default_library=static'])
yxml_dep = yxml_proj.get_variable('yxml_dep')

View file

@ -1,41 +0,0 @@
project('spp', 'c')
spp_version = '1.2.0'
configure_file(input: 'config.def.h',
output: 'config.h',
copy: true)
spp_files = [
'spp.c',
]
libspp_static = static_library('spp', spp_files,
install: not meson.is_subproject()
)
libspp = shared_library('spp', spp_files,
install: not meson.is_subproject(),
soversion: spp_version
)
spp_static_dep = declare_dependency(
link_with: libspp_static,
)
spp_dep = declare_dependency(
link_with: libspp
)
pkgconfig_mod = import('pkgconfig')
pkgconfig_mod.generate(libspp,
version: spp_version,
name: 'spp',
subdirs: ['.'],
filebase: 'spp',
description: 'spp library'
)
if not meson.is_subproject()
install_headers('spp.h')
subdir('bin')
endif

View file

@ -4,8 +4,7 @@ ts_c_files = [
'src/parser.c'
]
tree_sitter_proj = subproject('tree-sitter', default_options: ['default_library=static'])
tree_sitter_dep = tree_sitter_proj.get_variable('tree_sitter_dep')
tree_sitter_dep = dependency('tree-sitter')
libtsc = static_library('tree-sitter-c', ts_c_files,
include_directories: ['src'],
@ -18,3 +17,4 @@ tree_sitter_c_dep = declare_dependency(
include_directories: ['src/tree_sitter'],
dependencies: tree_sitter_dep
)
meson.override_dependency('tree-sitter-c', tree_sitter_c_dep)

View file

@ -1,7 +1,7 @@
project('ptrace-wrap', 'c')
# project('ptrace-wrap', 'c')
thread_dep = dependency('threads', static: is_static_build)
thread_dep = dependency('threads', static: get_option('is_static_build'))
rz_util_dep = dependency('rz_util')
ptrace_wrap_inc = include_directories('include')
@ -13,5 +13,6 @@ ptrace_wrap_lib = static_library('ptrace_wrap',
dependencies: [thread_dep, rz_util_dep])
ptrace_wrap_dep = declare_dependency(link_with: ptrace_wrap_lib, include_directories: ptrace_wrap_inc)
meson.override_dependency('ptrace-wrap', ptrace_wrap_dep)
# subdir('test')

View file

@ -0,0 +1 @@
option('is_static_build', type: 'boolean', value: false)

View file

@ -17,7 +17,7 @@ When you update something in grammar.js or src/scanner.c you have to re-generate
the parser. The process works as follows:
1. Do changes as needed to grammar.js and/or src/scanner.c
2. Install npm dependencies with: `cd shlr/rizin-shell-parser ; npm install`
2. Install npm dependencies with: `cd subprojects/rizin-shell-parser ; npm install`
3. Make sure tree-sitter is in PATH: `export PATH=$PATH:./node_modules/.bin`
4. Re-generate the parser files: `tree-sitter generate`
5. Check tests still pass: `tree-sitter test`. Use `tree-sitter parse

View file

@ -1,3 +1,8 @@
project('rizin-shell-parser', 'c',
license : [ 'LGPL']
)
tree_sitter_dep = dependency('tree-sitter')
grammar_js = files('grammar.js')
subdir('src')
@ -12,4 +17,5 @@ shell_parser_dep = declare_dependency(
link_with: libshell_parser,
include_directories: shell_parser_inc,
dependencies: tree_sitter_dep
)
)
meson.override_dependency('rizin-shell-parser', shell_parser_dep)

Some files were not shown because too many files have changed in this diff Show more