* Autodetection of --with-ostype in configure.acr

- Rebuild configure script in ACR 0.8.1
* Random minor changes
This commit is contained in:
pancake 2010-02-21 20:24:28 +01:00
parent 9890c6e8b0
commit 14f9fe8b65
12 changed files with 47 additions and 41 deletions

3
TODO
View File

@ -7,6 +7,9 @@
<{include libr/TODO}>
* BUG:
rasm2 -s att -a x86.nasm 'push 0x1e(%esp)'
* is RCore->block and blocksize a RBuf ? refactor!11
* r_cmd must provide a nesting char table indexing for commands

23
configure vendored
View File

@ -1,5 +1,5 @@
#!/bin/sh
# This script was automatically generated by ACR v0.8
# This script was automatically generated by ACR v0.8.1
# @author: pancake <youterm.com>
# @url: http://news.nopcode.org/pancake/acr.html
@ -19,7 +19,7 @@ trap control_c 2
DEBUGGER=1
HAVE_EWF=1
[ -z "${USERCC}" ] && USERCC="gcc"
[ -z "${USEROSTYPE}" ] && USEROSTYPE="gnulinux"
[ -z "${USEROSTYPE}" ] && USEROSTYPE="none"
WITHPIC=1
WANT_VALASWIG=1
WANT_VALA=1
@ -89,9 +89,8 @@ create_environ() {
: ${MANDIR:=${SPREFIX}/man}
: ${LOCALSTATEDIR:=${SPREFIX}/var}
for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do
if [ -e $A/install ]; then
: ${INSTALL:=$A/install}
fi
[ -e $A/ginstall ] && : ${INSTALL:=$A/ginstall} && break
[ -e $A/install ] && : ${INSTALL:=$A/install} && break
done
: ${INSTALL_DIR:=${INSTALL} -d}
: ${INSTALL_DATA:=${INSTALL} -m 644}
@ -146,7 +145,7 @@ printf "\nOptional Features:
--without-debugger disable native debugger features
--without-ewf disable EWF dependency
--with-compiler Define compiler to use (see mk/) (USERCC=gcc)
--with-ostype Choose OS type ( gnulinux windows osx ) (USEROSTYPE=gnulinux)
--with-ostype Choose OS type ( gnulinux windows osx ) (USEROSTYPE=none)
--without-pic do not build libr as a program independent location
--without-valaswig disables the build of the valaswig bindings for python, perl, ruby
--without-vala disables the build of all the vala-dependant parts \n"
@ -171,7 +170,7 @@ take_environ() {
}
show_version() {
echo "radare2-0.4a configuration script done with acr v0.8.
echo "radare2-0.4a configuration script done with acr v0.8.1.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <youterm.com>."
exit 0
@ -193,7 +192,7 @@ echo "VERSION: 0.4a"
echo "LANGS: c"
echo "REQUIRED: libdl lib>=vala-1.0 libvala-1.0>=0.5.0"
echo "OPTIONAL: libewf"
echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ostype=gnulinux --without-pic --without-valaswig --without-vala"
echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ostype=none --without-pic --without-valaswig --without-vala"
exit 0
;;
"--cache-file")
@ -238,7 +237,7 @@ echo "FLAGS: --without-debugger --without-ewf --with-compiler=gcc --with-ost
"--without-debugger") DEBUGGER="0"; ;;
"--without-ewf") HAVE_EWF="0"; ;;
--with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;;
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="gnulinux"; else USEROSTYPE="${value}" ; fi ;;
--with-ostype) if [ -z "${value}" ]; then USEROSTYPE="none"; else USEROSTYPE="${value}" ; fi ;;
"--without-pic") WITHPIC="0"; ;;
"--without-valaswig") WANT_VALASWIG="0"; ;;
"--without-vala") WANT_VALA="0"; ;;
@ -347,6 +346,12 @@ if [ "$HAVE_EWF" = "1" ]; then
HAVE_LIB_EWF="0"; fi
check_library HAVE_LIB_LUA5_1 lua5.1 0
check_library HAVE_LIB_TCC tcc 0
if [ "$USEROSTYPE" = "none" ]; then
if [ "$HOST_OS" = "linux" ]; then
USEROSTYPE="gnulinux"
else
if [ "$HOST_OS" = "darwin" ]; then
USEROSTYPE="darwin"; fi; fi; fi
printf "checking for valaswig... "
if [ -x "${VALASWIG}" ]; then
FIND=${VALASWIG}

View File

@ -19,7 +19,18 @@ CHKLIB tcc
(( rules for the compiler ))
ARG_WITH USERCC=gcc compiler Define compiler to use (see mk/) ;
ARG_WITH USEROSTYPE=gnulinux ostype Choose OS type ( gnulinux windows osx ) ;
ARG_WITH USEROSTYPE=none ostype Choose OS type ( gnulinux windows osx ) ;
(( TODO: throw error if unknown ostype ))
IFEQ USEROSTYPE none ; {
IFEQ HOST_OS linux ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS darwin ; {
USEROSTYPE = darwin ;
}
}
}
ARG_WITHOUT WITHPIC pic do not build libr as a program independent location ;
ARG_WITHOUT WANT_VALASWIG valaswig disables the build of the valaswig bindings for python, perl, ruby ;

View File

@ -6,12 +6,9 @@
#include <r_lib.h>
#include <r_util.h>
#include <r_asm.h>
#include "csr/csr_disasm/dis.h"
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len)
{
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len) {
arch_csr_disasm(aop->buf_asm, buf, a->pc);
return (aop->inst_len=2);
}

View File

@ -2,19 +2,14 @@
#include <stdio.h>
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
#include "fastcall_x86.h"
#include "x86/udis86/types.h"
#include "x86/udis86/extern.h"
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len)
{
static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len) {
static ud_t disasm_obj;
ud_init(&disasm_obj);
@ -34,7 +29,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
struct r_asm_handle_t r_asm_plugin_x86 = {
.name = "x86",
.desc = "X86 disassembly plugin",
.desc = "udis86 disassembly plugin",
.arch = "x86",
.bits = (int[]){ 16, 32, 64, 0 },
.init = NULL,

View File

@ -13,8 +13,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6
}
#endif
static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf)
{
static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) {
int len = 0;
char cmd[R_ASM_BUFSIZE];
ut8 *out;
@ -48,8 +47,7 @@ struct r_lib_struct_t radare_plugin = {
#endif
#if TEST
main()
{
main() {
struct r_asm_fastcall_t *f;
//f = r_asm_plugin_x86_nasm.fastcall;
printf("fastcall=%p\n", *r_asm_plugin_x86_nasm.fastcall);

View File

@ -881,12 +881,10 @@ static int cmd_anal(void *data, const char *input)
}
switch(input[0]) {
case '\0':
r_anal_list (&core->anal);
break;
case 'h':
if (input[1] && !r_anal_use (&core->anal, input+2))
eprintf("Cannot use '%s' anal plugin.\n", input+2);
else r_anal_list (&core->anal);
break;
case 'o':
{

View File

@ -29,7 +29,7 @@ static int config_asm_arch_callback(void *user, void *data) {
int ret = r_asm_use (&core->assembler, node->value);
if (!ret) {
// TODO: control error and restore old value (return false?) show errormsg?
eprintf ("Cannot set this arch (%s)\n", node->value);
eprintf ("asm.arch: Cannot set this arch (%s)\n", node->value);
}
return R_TRUE;
}
@ -403,6 +403,5 @@ R_API int r_core_config_init(struct r_core_t *core)
node->callback = &config_scrheight;
r_config_set("vm.realio", "false");
#endif
return 0;
}

View File

@ -9,7 +9,7 @@ R_API int r_debug_pid_list(struct r_debug_t *dbg)
}
/* processes */
R_API int r_debug_pid_add(struct r_debug_t *dbg)
R_API int r_debug_pid_parent(RDebugPid *pid)
{
// fork in child
return 0;

View File

@ -5,6 +5,7 @@
R_API int r_debug_reg_sync(struct r_debug_t *dbg, int type, int write)
{
ut8 buf[4096]; // XXX hacky!
int size, ret = R_FALSE;
if (write) {
if (dbg && dbg->h && dbg->h->reg_write) {
@ -15,7 +16,6 @@ R_API int r_debug_reg_sync(struct r_debug_t *dbg, int type, int write)
} else {
/* read registers from debugger backend to dbg->regs */
if (dbg && dbg->h && dbg->h->reg_read) {
ut8 buf[4096]; // XXX hacky!
size = dbg->h->reg_read (dbg, type, buf, sizeof (buf));
if (size == R_FALSE)
eprintf ("r_debug_reg: error reading registers\n");

View File

@ -93,10 +93,11 @@ typedef struct r_debug_pid_t {
int pid;
int status; /* stopped, running, zombie, sleeping ,... */
int runnable; /* when using 'run', 'continue', .. this proc will be runnable */
struct list_head threads;
struct list_head childs;
struct r_debug_pid_t *parent;
struct list_head list;
const char *path;
//struct list_head threads;
//struct list_head childs;
//struct r_debug_pid_t *parent;
//struct list_head list;
} RDebugPid;
#ifdef R_API

View File

@ -63,8 +63,7 @@
/* allocating */
#include <stdio.h>
#include <stdarg.h>
static inline int ERR(char *str, ...)
{
static inline int ERR(char *str, ...) {
va_list ap;
va_start(ap, str);
vfprintf(stderr, str, ap);