* Fix generation and installation of the libr.pc pkg-config file

* Fix parsing of 'f' command as help specifies (already done in r1)
  - get size and offset as 2nd and 3rd args
* Do not hardcode flag size to '1' (use argument given)

--HG--
rename : libr/libr.pc => libr/libr.pc.acr
This commit is contained in:
pancake 2009-03-09 13:08:53 +00:00
parent 4ba2e545ae
commit 597312f494
4 changed files with 27 additions and 15 deletions

View file

@ -36,6 +36,9 @@ install:
@for a in `find */t -perm /u+x -type f | grep 2`; \
do echo " $$a"; cp $$a ${PREFIX}/bin ; done
# plugins
@mkdir -p ${PREFIX}/lib/pkgconfig
@cat libr.pc.acr | sed -e 's,@PREFIX@,${PREFIX},g' > libr.pc
cp libr.pc ${PREFIX}/lib/pkgconfig
@mkdir -p ${PREFIX}/lib/radare2
@for a in `find */p -perm /u+x -type f`; \
do echo " $$a"; cp $$a ${PREFIX}/lib/radare2 ; done
@ -65,6 +68,7 @@ uninstall:
a="${PREFIX}/lib/radare2/`echo $$a|awk -F / '{ print $$NF; }'`"; \
echo $$a ; rm -f $$a ; done
rm -rf ${PREFIX}/lib/radare2
rm -f ${PREFIX}/lib/pkgconfig/libr.pc
# test programs
-@for a in `find */t -perm /u+x -type f | grep -v 2`; do \
a="${PREFIX}/bin-test/`echo $$a|awk -F / '{ print $$NF; }'`"; \

View file

@ -353,22 +353,30 @@ static int cmd_flag(void *data, const char *input)
int len = strlen(input)+1;
char *ptr;
char *str = alloca(len);
//u64 seek = core->seek;
//u64 size = core->blocksize;
memcpy(str, input+1, len);
ptr = strchr(str+1, ' ');
if (ptr) {
*ptr='\0';
ptr = strchr(ptr+1, ' ');
if (ptr) *ptr='\0';
// TODO redefine seek and size here
}
switch(input[0]) {
case '+':
r_flag_set(&core->flags, str, core->seek, core->blocksize, 1);
break;
case ' ':
r_flag_set(&core->flags, str, core->seek, core->blocksize, 0);
case ' ': {
char *s = NULL, *s2 = NULL;
u64 seek = core->seek;
u32 bsze = core->blocksize;
s = strchr(str, ' ');
if (s) {
*s = '\0';
s2 = strchr(s+1, ' ');
if (s2) {
*s2 = '\0';
seek = r_num_math(&core->num, s2+1);
}
bsze = r_num_math(&core->num, s+1);
}
r_flag_set(&core->flags, str, seek, bsze, 0);
if (s) *s=' ';
if (s2) *s2=' ';
}
break;
case '-':
r_flag_unset(&core->flags, input+1);
@ -621,7 +629,7 @@ static int cmd_write(void *data, const char *input)
static int __cb_hit(struct r_search_kw_t *kw, void *user, u64 addr)
{
r_cons_printf("f hit0_%d @ 0x%08llx\n", kw->count, addr);
r_cons_printf("f hit0_%d %d 0x%08llx\n", kw->count, kw->keyword_length, addr);
return R_TRUE;
}

View file

@ -91,7 +91,7 @@ int r_flag_set(struct r_flag_t *fo, const char *name, u64 addr, u32 size, int du
} else {
flag = f;
f->offset = addr + fo->base;
f->size = 1; // XXX
f->size = size; // XXX
f->format = 0; // XXX
// return R_TRUE;
}
@ -110,7 +110,7 @@ int r_flag_set(struct r_flag_t *fo, const char *name, u64 addr, u32 size, int du
flag->name[R_FLAG_NAME_SIZE-1]='\0';
flag->offset = addr + fo->base;
flag->space = fo->space_idx;
flag->size = 1; // XXX
flag->size = size; // XXX
flag->format = 0; // XXX
flag->cmd = NULL;

View file

@ -1,4 +1,4 @@
prefix=${PWD}
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include