Skip to content

Commit

Permalink
[REVERT ME] Add auto-sync-ppc dev branch to build options.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Jul 8, 2023
1 parent c839323 commit 6cd2178
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 4 deletions.
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ if not capstone_dep.found()
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
capstone_proj = subproject('capstone-v4', default_options: ['default_library=static'])
elif capstone_version == 'auto-sync-arm'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-auto-sync-arm', check: false)
elif capstone_version == 'auto-sync-ppc'
r = run_command(py3_exe, check_meson_subproject_py, 'capstone-auto-sync-ppc', check: false)
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
capstone_proj = subproject('capstone-auto-sync-arm', default_options: ['default_library=static'])
capstone_proj = subproject('capstone-auto-sync-ppc', default_options: ['default_library=static'])
else
error('Wrong capstone version selected. Please use one of the supported versions.')
endif
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ option('rizin_bindings', type: 'string', value: '', description: 'Path where riz

option('checks_level', type: 'integer', value: 9999, description: 'Value between 0 and 3 to enable different level of assert (see RZ_CHECKS_LEVEL). By default its value depends on buildtype (2 on debug, 1 on release).')
option('use_sys_capstone', type: 'feature', value: 'disabled')
option('use_capstone_version', type: 'combo', choices: ['v3', 'v4', 'next', 'bundled', 'auto-sync-arm'], value: 'auto-sync-arm', description: 'Specify which version of capstone to use')
option('use_capstone_version', type: 'combo', choices: ['v3', 'v4', 'next', 'bundled', 'auto-sync-ppc'], value: 'auto-sync-ppc', description: 'Specify which version of capstone to use')
option('use_sys_magic', type: 'feature', value: 'disabled')
option('use_sys_libzip', type: 'feature', value: 'disabled')
option('use_sys_libzip_openssl', type: 'boolean', value: false, description: 'Whether to use or not system openssl dependency to build libzip')
Expand Down
6 changes: 6 additions & 0 deletions subprojects/capstone-auto-sync-ppc.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/Rot127/capstone.git
revision = auto-sync-ppc
directory = capstone-auto-sync-ppc
depth = 1
patch_directory = capstone-auto-sync-ppc
98 changes: 98 additions & 0 deletions subprojects/packagefiles/capstone-auto-sync-ppc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
project('capstone', 'c', version: '5.0', meson_version: '>=0.55.0')

cs_files = [
'arch/AArch64/AArch64BaseInfo.c',
'arch/AArch64/AArch64Disassembler.c',
'arch/AArch64/AArch64InstPrinter.c',
'arch/AArch64/AArch64Mapping.c',
'arch/AArch64/AArch64Module.c',
'arch/ARM/ARMBaseInfo.c',
'arch/ARM/ARMDisassemblerExtension.c',
'arch/ARM/ARMDisassembler.c',
'arch/ARM/ARMInstPrinter.c',
'arch/ARM/ARMMapping.c',
'arch/ARM/ARMModule.c',
'arch/M680X/M680XDisassembler.c',
'arch/M680X/M680XInstPrinter.c',
'arch/M680X/M680XModule.c',
'arch/M68K/M68KDisassembler.c',
'arch/M68K/M68KInstPrinter.c',
'arch/M68K/M68KModule.c',
'arch/Mips/MipsDisassembler.c',
'arch/Mips/MipsInstPrinter.c',
'arch/Mips/MipsMapping.c',
'arch/Mips/MipsModule.c',
'arch/PowerPC/PPCDisassembler.c',
'arch/PowerPC/PPCInstPrinter.c',
'arch/PowerPC/PPCMapping.c',
'arch/PowerPC/PPCModule.c',
'arch/Sparc/SparcDisassembler.c',
'arch/Sparc/SparcInstPrinter.c',
'arch/Sparc/SparcMapping.c',
'arch/Sparc/SparcModule.c',
'arch/SystemZ/SystemZDisassembler.c',
'arch/SystemZ/SystemZInstPrinter.c',
'arch/SystemZ/SystemZMapping.c',
'arch/SystemZ/SystemZMCTargetDesc.c',
'arch/SystemZ/SystemZModule.c',
'arch/TMS320C64x/TMS320C64xDisassembler.c',
'arch/TMS320C64x/TMS320C64xInstPrinter.c',
'arch/TMS320C64x/TMS320C64xMapping.c',
'arch/TMS320C64x/TMS320C64xModule.c',
'arch/X86/X86ATTInstPrinter.c',
'arch/X86/X86Disassembler.c',
'arch/X86/X86DisassemblerDecoder.c',
'arch/X86/X86IntelInstPrinter.c',
'arch/X86/X86Mapping.c',
'arch/X86/X86Module.c',
'arch/X86/X86InstPrinterCommon.c',
'arch/XCore/XCoreDisassembler.c',
'arch/XCore/XCoreInstPrinter.c',
'arch/XCore/XCoreMapping.c',
'arch/XCore/XCoreModule.c',
'arch/TriCore/TriCoreDisassembler.c',
'arch/TriCore/TriCoreInstPrinter.c',
'arch/TriCore/TriCoreMapping.c',
'arch/TriCore/TriCoreModule.c',
'cs.c',
'Mapping.c',
'MCInst.c',
'MCInstrDesc.c',
'MCInstPrinter.c',
'MCRegisterInfo.c',
'SStream.c',
'Mapping.c',
'utils.c',
]

capstone_includes = [include_directories('include'), include_directories('include/capstone')]

libcapstone_c_args = [
'-DCAPSTONE_X86_ATT_DISABLE_NO',
'-DCAPSTONE_X86_REDUCE_NO',
'-DCAPSTONE_USE_SYS_DYN_MEM',
'-DCAPSTONE_DIET_NO',
'-DCAPSTONE_HAS_ARM',
'-DCAPSTONE_HAS_ARM64',
'-DCAPSTONE_HAS_M68K',
'-DCAPSTONE_HAS_M680X',
'-DCAPSTONE_HAS_MIPS',
'-DCAPSTONE_HAS_POWERPC',
'-DCAPSTONE_HAS_SPARC',
'-DCAPSTONE_HAS_SYSZ',
'-DCAPSTONE_HAS_X86',
'-DCAPSTONE_HAS_XCORE',
'-DCAPSTONE_HAS_TMS320C64X',
'-DCAPSTONE_HAS_TRICORE',
]

libcapstone = library('capstone', cs_files,
c_args: libcapstone_c_args,
include_directories: capstone_includes,
implicit_include_directories: false
)

capstone_dep = declare_dependency(
link_with: libcapstone,
include_directories: capstone_includes
)

0 comments on commit 6cd2178

Please sign in to comment.