Support meson build for Linux (Requires meson 0.40)

This commit is contained in:
pancake 2017-05-02 14:18:36 +02:00
parent 60f9667654
commit 3e0c7bc650
9 changed files with 234 additions and 12 deletions

View File

@ -393,7 +393,7 @@ meson-config:
$(MAKE) meson
meson: build
time ninja -C build
ninja -C build
meson-install:
cd build && DESTDIR="$(DESTDIR)" ninja install

View File

@ -22,19 +22,12 @@ files=[
#'p/native/bt.c',
#'p/native/darwin.c',
#'p/native/drx.c',
#'p/native/linux/linux_coredump.c',
#'p/native/linux/linux_debug.c',
#'p/native/maps/darwin.c',
#'p/native/maps/windows.c',
'p/native/procfs.c',
#'p/native/reg.c',
#'p/native/w32.c',
#'p/native/windows/windows_debug.c',
#'p/native/xnu/trap_arm.c',
#'p/native/xnu/trap_x86.c',
'p/native/xnu/xnu_debug.c',
#'p/native/xnu/xnu_excthreads.c',
#'p/native/xnu/xnu_threads.c',
'pid.c',
'plugin.c',
'session.c',
@ -43,9 +36,26 @@ files=[
'trace.c',
]
if host_os == 'linux'
files += [
'p/native/linux/linux_debug.c',
'p/native/linux/linux_coredump.c'
]
endif
if host_os == 'darwin'
files += [
'p/native/xnu/xnu_debug.c',
#'p/native/xnu/trap_arm.c',
#'p/native/xnu/trap_x86.c',
#'p/native/xnu/xnu_excthreads.c',
#'p/native/xnu/xnu_threads.c',
]
endif
r_debug = shared_library('r_debug', files,
include_directories: include_directories(['../include']),
include_directories: include_directories(['../include', '../bin/format/elf']),
c_args: ['-DCORELIB'],
link_with: [r_util, r_hash, r_reg, r_syscall, r_anal, r_flag, r_io, r_bp, r_search, r_cons],
link_with: [r_util, r_hash, r_reg, r_syscall, r_anal, r_flag, r_io, r_bp, r_search, r_cons, r_lang],
install: true
)

View File

@ -17,6 +17,7 @@ files=[
r_hash = shared_library('r_hash', files,
include_directories: include_directories(['../include']),
dependencies: [mth],
link_with: [r_util],
install: true
)

View File

@ -23,7 +23,7 @@ files=[
'p/io_ptrace.c',
#'p/io_qnx.c',
'p/io_r2k.c',
#'p/io_r2k_linux.c',
'p/io_r2k_linux.c',
#'p/io_r2k_windows.c',
'p/io_r2pipe.c',
'p/io_r2web.c',

View File

@ -1,7 +1,7 @@
files=[
'lang.c',
'p/c.c',
'p/cpipe.c',
# 'p/cpipe.c',
'p/lib.c',
'p/pipe.c',
'p/rust.c',

View File

@ -10,6 +10,7 @@ files=[
r_socket = shared_library('r_socket', files,
include_directories: include_directories(['../include']),
dependencies: [utl],
link_with: [r_util],
c_args : '-DCORELIB=1',
install: true

View File

@ -207,6 +207,7 @@ r_zip = static_library('r_zip', zlib_files,
r_util = shared_library('r_util', files,
include_directories: incdir,
dependencies: [ldl, pth, utl],
link_with: [r_zip],
objects: [
r_sdb.extract_all_objects()

View File

@ -1,5 +1,20 @@
project('radare2', 'c')
# system dependencies
cc = meson.get_compiler('c')
# required for linux
ldl = cc.find_library('dl', required: false)
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
subdir('libr/util')
subdir('binr/rax2')

194
plugins.meson.cfg Normal file
View File

@ -0,0 +1,194 @@
STATIC="
anal.arc
anal.arm_cs
anal.avr
anal.i4004
anal.bf
anal.cris
anal.dalvik
anal.i8080
anal.m68k_cs
anal.malbolge
anal.mips_cs
anal.mips_gnu
anal.nios2
anal.null
anal.ppc_cs
anal.ppc_gnu
anal.sh
anal.sparc_cs
anal.sparc_gnu
anal.sysz
anal.ws
anal.xap
anal.x86_cs
anal.xcore_cs
anal.z80
anal.vax
anal.6502
anal.snes
anal.riscv
anal.pic18c
asm.6502
asm.arc
asm.arm_cs
asm.arm_winedbg
asm.avr
asm.bf
asm.cris_gnu
asm.dalvik
asm.dcpu16
asm.gb
asm.h8300
asm.hppa_gnu
asm.i4004
asm.i8080
asm.lm32
asm.tricore
asm.m68k_cs
asm.malbolge
asm.mips_cs
asm.mips_gnu
asm.nios2
asm.ppc_cs
asm.ppc_gnu
asm.riscv
asm.lanai_gnu
asm.sh
asm.snes
asm.sparc_cs
asm.sparc_gnu
asm.spc700
asm.sysz
asm.v850
asm.ws
asm.xap
asm.arm_as
asm.wasm
asm.x86_as
asm.x86_cs
asm.x86_nz
asm.x86_nasm
asm.xcore_cs
asm.z80
asm.vax
asm.mcs96
asm.pic18c
bin.any
bin.wasm
bin.nro
bin.art
bin.bf
bin.bflt
bin.bios
bin.bootimg
bin.cgc
bin.coff
bin.dex
bin.dol
bin.elf
bin.elf64
bin.fs
bin.menuet
bin.mach0
bin.mach064
bin.mbn
bin.mz
bin.nes
bin.nin3ds
bin.ninds
bin.ningb
bin.ningba
bin.omf
bin.p9
bin.pe
bin.pe64
bin.pebble
bin.smd
bin.sms
bin.avr
bin.sfc
bin.spc700
bin.te
bin.vsf
bin.xbe
bin.dyldcache
bin_xtr.xtr_dyldcache
bin_xtr.fatmach0
bin.zimg
bin.psxexe
bp.arm
bp.bf
bp.mips
bp.ppc
bp.x86
core.anal
crypto.aes
crypto.des
crypto.rc4
crypto.cps2
crypto.xor
crypto.blowfish
crypto.rc2
crypto.rot
crypto.rol
crypto.ror
crypto.base64
crypto.base91
crypto.aes_cbc
crypto.punycode
crypto.rc6
debug.bf
debug.io
debug.esil
debug.native
debug.rap
egg.exec
egg.xor
fs.ext2
fs.fat
fs.fb
fs.hfs
fs.hfsplus
fs.iso9660
fs.jfs
fs.minix
fs.ntfs
fs.posix
fs.reiserfs
fs.sfs
fs.tar
fs.udf
fs.ufs
fs.xfs
io.null
io.bfdbg
io.debug
io.default
io.r2pipe
io.gzip
io.http
io.tcp
io.r2web
io.ihex
io.mach
io.malloc
io.sparse
io.mmap
io.procpid
io.ptrace
io.rap
io.self
io.shm
io.r2k
lang.vala
parse.m68k_pseudo
parse.6502_pseudo
parse.arm_pseudo
parse.att2intel
parse.dalvik_pseudo
parse.mips_pseudo
parse.mreplace
parse.ppc_pseudo
parse.x86_pseudo"
SHARED="io.shm"