Fix pathes for meson (#10536)
This commit is contained in:
parent
f530674780
commit
3e68187c36
4 changed files with 28 additions and 8 deletions
|
|
@ -8,6 +8,22 @@
|
|||
#define HAVE_ARC4RANDOM_UNIFORM @HAVE_ARC4RANDOM_UNIFORM@
|
||||
#define HAVE_EXPLICIT_BZERO @HAVE_EXPLICIT_BZERO@
|
||||
|
||||
#ifdef R_MESON_VERSION
|
||||
#define R2_PREFIX "@PREFIX@"
|
||||
#define R2_LIBDIR "@LIBDIR@"
|
||||
#define R2_INCDIR "@INCLUDEDIR@"
|
||||
#define R2_DATDIR "@DATADIR@"
|
||||
#define R2_WWWROOT "@WWWROOT@"
|
||||
#define R2_PLUGINS "@PLUGINS@"
|
||||
#define R2_EXTRAS "@EXTRAS@"
|
||||
#define R2_BINDINGS "@BINDINGS@"
|
||||
#define R2_SDB "@SDB@"
|
||||
#define R2_ZIGNS "@ZIGNS@"
|
||||
#define R2_THEMES "@THEMES@"
|
||||
#define R2_FORTUNES "@FORTUNES@"
|
||||
#define R2_FLAGS "@FLAGS@"
|
||||
#define R2_HUD "@HUD@"
|
||||
#else
|
||||
#if __WINDOWS__ || __CYGWIN__ || MINGW32 || _MSC_VER || CUTTER
|
||||
#define R2_PREFIX "."
|
||||
#define R2_LIBDIR "lib"
|
||||
|
|
@ -27,13 +43,13 @@
|
|||
#define R2_EXTRAS "lib/radare2-extras/" R2_VERSION
|
||||
#define R2_BINDINGS "lib/radare2-bindings/" R2_VERSION
|
||||
#endif
|
||||
|
||||
#define R2_SDB R_JOIN_3_PATHS ("share", "radare2", R2_VERSION)
|
||||
#define R2_ZIGNS R_JOIN_4_PATHS ("share", "radare2", R2_VERSION, "zigns")
|
||||
#define R2_THEMES R_JOIN_4_PATHS ("share", "radare2", R2_VERSION, "cons")
|
||||
#define R2_FLAGS R_JOIN_4_PATHS ("share", "radare2", R2_VERSION, "flag")
|
||||
#define R2_FORTUNES R_JOIN_3_PATHS ("share", "doc", "radare2")
|
||||
#define R2_HUD R_JOIN_4_PATHS ("share", "radare2", R2_VERSION, "hud")
|
||||
#endif
|
||||
|
||||
#define R2_SDB_FCNSIGN R_JOIN_2_PATHS (R2_SDB, "fcnsign")
|
||||
#define R2_SDB_OPCODES R_JOIN_2_PATHS (R2_SDB, "opcodes")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef R_VERSION_H
|
||||
#define R_VERSION_H 1
|
||||
#define R_MESON_VERSION "@MESON_VERSION@"
|
||||
#define R2_VERSION_COMMIT @VERSIONCOMMIT@
|
||||
#define R2_VERSION "@R2_VERSION@"
|
||||
#define R2_GITTAP "@R2_GITTAP@"
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ R_API const char *r_syscall_reg(RSyscall *s, int idx, int num) {
|
|||
}
|
||||
|
||||
static Sdb *openDatabase(Sdb *db, const char *name) {
|
||||
char *file = r_str_newf ("%s/%s/%s.sdb",
|
||||
r_sys_prefix (NULL), "share/radare2/last", name);
|
||||
char *file = r_str_newf ( R_JOIN_3_PATHS ("%s", R2_SDB, "%s.sdb"),
|
||||
r_sys_prefix (NULL), name);
|
||||
if (r_file_exists (file)) {
|
||||
if (db) {
|
||||
sdb_reset (db);
|
||||
|
|
@ -112,11 +112,13 @@ R_API bool r_syscall_setup(RSyscall *s, const char *arch, int bits, const char *
|
|||
}
|
||||
}
|
||||
|
||||
char *dbName = r_str_newf ("syscall/%s-%s-%d", os, arch, bits);
|
||||
char *dbName = r_str_newf (R_JOIN_2_PATHS ("syscall", "%s-%s-%d"),
|
||||
os, arch, bits);
|
||||
s->db = openDatabase (s->db, dbName);
|
||||
free (dbName);
|
||||
|
||||
dbName = r_str_newf ("sysregs/%s-%d-%s", arch, bits, cpu ? cpu: arch);
|
||||
dbName = r_str_newf (R_JOIN_2_PATHS ("sysregs", "%s-%d-%s"),
|
||||
arch, bits, cpu ? cpu: arch);
|
||||
sdb_free (s->srdb);
|
||||
s->srdb = NULL;
|
||||
s->srdb = openDatabase (s->srdb, dbName);
|
||||
|
|
@ -197,11 +199,11 @@ R_API RSyscallItem *r_syscall_get(RSyscall *s, int num, int swi) {
|
|||
}
|
||||
ret = sdb_const_get (s->db, key, 0);
|
||||
if (!ret) {
|
||||
key = sdb_fmt ("0x%02x.0x%02x", swi, num); // Workaround until Syscall SDB is fixed
|
||||
key = sdb_fmt ("0x%02x.0x%02x", swi, num); // Workaround until Syscall SDB is fixed
|
||||
ret = sdb_const_get (s->db, key, 0);
|
||||
if (!ret) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
ret2 = sdb_const_get (s->db, ret, 0);
|
||||
if (!ret2) {
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ r_userconf_h = configure_file(
|
|||
)
|
||||
|
||||
versionconf = configuration_data()
|
||||
versionconf.set('MESON_VERSION', meson.version())
|
||||
versionconf.set('VERSIONCOMMIT', version_commit)
|
||||
versionconf.set('R2_VERSION', r2_version)
|
||||
versionconf.set('R2_GITTAP', gittap)
|
||||
|
|
@ -269,7 +270,7 @@ pcconf.set('VERSION', r2_version)
|
|||
libr_pc = configure_file(
|
||||
input: 'libr/libr.pc.acr',
|
||||
output: 'libr.pc',
|
||||
configuration: userconf,
|
||||
configuration: pcconf,
|
||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig')
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue