More emscripten/android build fixes

This commit is contained in:
pancake 2013-09-07 02:20:38 +02:00
parent cc5122e3bd
commit 18cc767292
10 changed files with 56 additions and 19 deletions

View File

@ -1,4 +1,4 @@
BIN=r2agent
BINDEPS=r_socket r_util r_cons
BINDEPS=r_socket r_cons r_util
include ../rules.mk

View File

@ -1,4 +1,4 @@
BIN=ragg2
BINDEPS=r_egg r_bin r_syscall r_asm r_db r_util r_parse r_lib r_flags r_anal r_reg r_diff r_cons
BINDEPS=r_egg r_bin r_syscall r_asm r_db r_parse r_lib r_flags r_anal r_reg r_diff r_cons r_util
include ../rules.mk

View File

@ -1,6 +1,7 @@
BIN=rahash2
BINDEPS=r_io r_hash r_util r_socket r_asm r_cons
BINDEPS+=r_anal r_lib r_syscall r_reg r_diff r_db r_parse
BINDEPS=r_hash
#BINDEPS=r_io r_hash r_util r_socket r_asm r_cons
#BINDEPS+=r_anal r_lib r_syscall r_reg r_diff r_db r_parse
BINDEPS+=r_flags
include ../rules.mk

View File

@ -1,4 +1,4 @@
BIN=rasm2
BINDEPS=r_cons r_flags r_parse r_asm r_lib r_syscall r_anal r_reg r_diff r_db r_util
BINDEPS=r_asm r_parse r_lib r_syscall r_anal r_reg r_diff r_db r_flags r_cons r_util
include ../rules.mk

View File

@ -14,12 +14,18 @@
canvas.emscripten { border: 0px none; }
</style>
</head>
<body>
<body onload="FocusOnInput()">
<center>
<script>
var _(x) { return document.getElementById(x); }
function FocusOnInput() {
_('input').focus();
}
function doin () {
var input=document.getElementById('input');
var input=_('input');
if (false) {
window.location.href = "#"+input.value;
location.reload();

View File

@ -10,21 +10,19 @@ make clean
# Build radare
export CC="emcc --ignore-dynamic-linking"
./configure --prefix=/usr --disable-shared --enable-static --disable-debugger --with-compiler=emscripten --without-ewf --without-pic --with-nonpic --without-gmp
make -j4
sys/emscripten.sh
--- random notes ---
$ ./configure --without-ewf --without-gmp --with-nonpic --without-pic
$ emmake make
export CC="emcc --ignore-dynamic-linking"
./configure --prefix=/usr --disable-shared --enable-static --disable-debugger --with-compiler=emscripten --without-ewf --without-pic --with-nonpic --without-gmp
emmake make -j4
cd binr/radare2
emcc ../../libr/*/*.o radare2.c -I ../../libr/include/ -DR2_BIRTH=\"pop\" -DR2_GITTIP=\"123\" ../../libr/db/sdb/src/*.o
binr/rax2/rax2.js:
emcc -O2 rax2.o ../../libr/util/libr_util.a -o rax2.js

View File

@ -36,7 +36,18 @@ endif
# looks hacky :D
#AR=arm-linux-androideabi-ar
libr.a: $(shell ls */libr_*.a 2>/dev/null)
libr.a:
rm -rf .libr
mkdir .libr
for a in */libr_*.a ; do \
mkdir -p .libr/$$a ; \
cp -f $$a .libr/$$a ; \
(cd .libr/$$a ; ${AR} x *.a ; rm -f *.a ) ; \
done
${AR} qvf libr.a `find .libr/ | grep '\\.o$$'`
rm -rf .libr
gnu_libr.a: $(shell ls */libr_*.a 2>/dev/null)
rm -f libr.a
echo CREATE libr.a > libr.m
for a in */libr_*.a ; do echo ADDLIB $$a >> libr.m ; done

View File

@ -1,7 +1,8 @@
include ../../config-user.mk
include ../../mk/${COMPILER}.mk
CFLAGS+=-g -ggdb -fPIC
#CFLAGS+=-g -ggdb -fPIC
CFLAGS+=-fPIC
CFLAGS+=-I../../libr/include
LDFLAGS+=-L../../libr/util
OBJS=code.o class.o ops.o

View File

@ -1,9 +1,9 @@
include ../../config-user.mk
include ../../mk/gcc.mk
include ../../mk/${COMPILER}.mk
OFILES=i386-gen.o libtcc.o tccelf.o tccgen.o tccpp.o
CFLAGS+=-fPIC -g -ggdb
LDFLAGS=-shared -g -ggdb
CFLAGS+=-fPIC
LDFLAGS=-shared
SOEXT?=dylib
LIBNAME=libr_tcc.${SOEXT}
@ -13,7 +13,7 @@ ${LIBNAME}: ${OFILES}
${CC} -o ${LIBNAME} ${LDFLAGS} ${OFILES}
libr_tcc.a: ${OFILES}
${AR} -r libr_tcc.a ${OFILES}
${AR} q libr_tcc.a ${OFILES}
${RANLIB} libr_tcc.a
clean:

20
sys/emscripten.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# find root
cd `dirname $PWD/$0` ; cd ..
#TODO: add support for ccache
# XXX. fails with >1
[ -z "${MAKE_JOBS}" ] && MAKE_JOBS=8
OLD_LDFLAGS="${LDFLAGS}"
unset LDFLAGS
export CC="emcc --ignore-dynamic-linking"
export AR="emar"
CFGFLAGS="./configure --prefix=/usr --disable-shared --enable-static --disable-debugger --with-compiler=emscripten --without-ewf --without-pic --with-nonpic --without-gmp"
make mrproper
./configure ${CFGFLAGS} --host=emscripten && \
make -s -j ${MAKE_JOBS} DEBUG=0