diff --git a/binr/radare2/Makefile b/binr/radare2/Makefile index ee3121b6b3c4c..66bc3f7f7e17a 100644 --- a/binr/radare2/Makefile +++ b/binr/radare2/Makefile @@ -13,7 +13,8 @@ MACSDK=macosx10.10 ENTITL=radare2.xcent #ENTITL=radare2_ios.xml -CFLAGS_INCLUDES+=-I$(SHLR)/sdb/src +include ../../shlr/sdb.mk +CFLAGS_INCLUDES+=$(SDB_CFLAGS) CFLAGS_INCLUDES+=-I$(LIBR)/include ifeq (${COMPILER},emscripten) @@ -94,6 +95,5 @@ include ../../shlr/bochs/deps.mk include ../../shlr/grub/deps.mk include ../../shlr/qnx/deps.mk include ../../shlr/ar/deps.mk -include ../../shlr/sdb.mk LDFLAGS+=$(LINK) diff --git a/binr/rules.mk b/binr/rules.mk index 2aaaa91ef0436..79f2c5de3c7f9 100644 --- a/binr/rules.mk +++ b/binr/rules.mk @@ -65,12 +65,12 @@ LINK+=$(LIBR)/crypto/libr_crypto.a LINK+=$(LIBR)/main/libr_main.a else ifeq (${COMPILER},wasm) LINK+=$(SHLR)/libr_shlr.a -LINK+=$(SHLR)/sdb/src/libsdb.a +LINK+=$(SHLR)/../subprojects/sdb/src/libsdb.a include $(SHLR)/capstone.mk EXT_EXE=.wasm else ifeq (${COMPILER},emscripten) LINK+=$(SHLR)/libr_shlr.a -LINK+=$(SHLR)/sdb/src/libsdb.a +LINK+=$(SHLR)/../subprojects/sdb/src/libsdb.a include $(SHLR)/capstone.mk CFLAGS+= -s SIDE_MODULE=1 #CFLAGS+=-s ERROR_ON_UNDEFINED_SYMBOLS=0 diff --git a/dist/rpm/radare2.spec b/dist/rpm/radare2.spec index 66df3c6161dc3..b4a379d9e8396 100644 --- a/dist/rpm/radare2.spec +++ b/dist/rpm/radare2.spec @@ -56,7 +56,7 @@ CFLAGS="%{optflags} -fPIC -I../include" make %{?_smp_mflags} LIBDIR=%{_libdir} P %install rm -rf %{buildroot} NOSUDO=1 make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} PREFIX=%{_prefix} -cp shlr/sdb/src/libsdb.a %{buildroot}/%{_libdir}/libsdb.a +cp subprojects/sdb/src/libsdb.a %{buildroot}/%{_libdir}/libsdb.a %post -p /sbin/ldconfig %postun -p /sbin/ldconfig diff --git a/doc/emscripten.md b/doc/emscripten.md index 6acfaa0af6399..6bfbca2e64fd5 100644 --- a/doc/emscripten.md +++ b/doc/emscripten.md @@ -1,35 +1,15 @@ -Building for the browser -======================== +# Building for the browser -# Install emscripten: +## Install emscripten: - git clone git://github.com/kripken/emscripten.git - export PATH=/path/to/emscripten:$PATH - make clean +```bash +$ git clone git://github.com/kripken/emscripten.git +$ export PATH=/path/to/emscripten:$PATH +$ make clean +``` +## Build radare -# Build radare - - sys/emscripten.sh - - - +```bash +$ sys/emscripten.sh +``` diff --git a/doc/license.md b/doc/license.md index c17854c2350a6..494e7f48d0270 100644 --- a/doc/license.md +++ b/doc/license.md @@ -82,11 +82,11 @@ should be copied to `./plugins.cfg` before calling `./configure-plugins` to take ### Less restrictive than LGPL * libr/bin/mangling/cxx: GPLv2 or later, with linking exception +* subprojects/sdb: MIT * shlr/capstone: BSD + LLVM * shlr/zip/zip: BSD * shlr/zip/zlib: BSD * shlr/java: Apache2.0 -* shlr/sdb: MIT * shlr/qnx: GPL (will be moved to extras soon) * shlr/grub: GPL (used by some fs plugins) * shlr/lz4: simplified BSD license diff --git a/libr/bin/p/mach064.mk b/libr/bin/p/mach064.mk index 066f3860d7246..ae7ecda44b5a9 100644 --- a/libr/bin/p/mach064.mk +++ b/libr/bin/p/mach064.mk @@ -8,5 +8,6 @@ TARGET_MACH064=bin_mach064.${EXT_SO} ALL_TARGETS+=${TARGET_MACH064} ${TARGET_MACH064}: ${OBJ_MACH064} - -${CC} $(call libname,bin_mach064) -shared ${CFLAGS} -o ${TARGET_MACH064}\ - ${OBJ_MACH064} $(LINK) $(LDFLAGS) $(SHLR)/sdb/src/libsdb.a + -${CC} $(call libname,bin_mach064) \ + -shared ${CFLAGS} -o ${TARGET_MACH064} \ + ${OBJ_MACH064} $(LINK) $(LDFLAGS) diff --git a/libr/core/p/sixref.mk b/libr/core/p/sixref.mk index c26f384b5d22a..4cd83e09a40cc 100644 --- a/libr/core/p/sixref.mk +++ b/libr/core/p/sixref.mk @@ -9,7 +9,7 @@ ALL_TARGETS+=${CORE_TARGET_SIXREF} ${CORE_TARGET_SIXREF}: ${CORE_OBJ_SIXREF} ${CC} $(call libname,core_anal) ${CFLAGS} \ -o core_sixref.${EXT_SO} \ - $(SHLR)/sdb/src/libsdb.a \ + $(SHLR)/../subprojects/sdb/src/libsdb.a \ -L$(LIBR)/crypto -lr_crypto \ ${CORE_OBJ_SIXREF} endif diff --git a/libr/util/str.c b/libr/util/str.c index 4f4520b77e7f1..8944f65e9fac9 100644 --- a/libr/util/str.c +++ b/libr/util/str.c @@ -268,8 +268,8 @@ R_API ut32 r_str_hash(const char *s) { } R_API int r_str_delta(char *p, char a, char b) { - char *_a = strchr (p, a); - char *_b = strchr (p, b); + const char *_a = strchr (p, a); + const char *_b = strchr (p, b); return (!_a || !_b)? 0 : (_a - _b); } @@ -320,10 +320,9 @@ R_API int r_str_word_set0(char *str) { *p = '\0'; // FIX: i++; continue; - } else { - quote = 1; - memmove (p, p + 1, strlen (p + 1) + 1); } + quote = 1; + memmove (p, p + 1, strlen (p + 1) + 1); } if (quote) { continue; diff --git a/shlr/Makefile b/shlr/Makefile index dbc140d9eee17..6960d605ffa5c 100644 --- a/shlr/Makefile +++ b/shlr/Makefile @@ -145,7 +145,7 @@ sdb-host: @echo ">>>>>>>>" @echo $(MAKE) -C $(SDB_ROOT) clean ; rm -f $(SDB_ROOT)/src/*.o $(SDB_ROOT)/include/sdb/version.h - $(MAKE) -C $(SDB_ROOT)/src "CC=${HOST_CC}" LDFLAGS='${HOST_LDFLAGS}' CPPFLAGS='-I$(SHLR)/sdb/include' CFLAGS='${HOST_CFLAGS} ${PIC}' bin + $(MAKE) -C $(SDB_ROOT)/src "CC=${HOST_CC}" LDFLAGS='${HOST_LDFLAGS}' CPPFLAGS='-I$(SDB_ROOT)/include' CFLAGS='${HOST_CFLAGS} ${PIC}' bin cp -f $(SDB_ROOT)/src/sdb${BUILD_EXT_EXE} $(SDB_ROOT)/src/.sdb${BUILD_EXT_EXE} cp -f $(SDB_ROOT)/src/sdb${BUILD_EXT_EXE} $(SDB_ROOT)/sdb$(BUILD_EXT_EXE) rm -f $(SDB_LIBA) @@ -161,11 +161,11 @@ sdb-target: $(MAKE) -C $(SDB_ROOT) clean ; rm -f $(SDB_ROOT)/src/*.o ../include/sdb/version.h $(MAKE) -C $(SDB_ROOT)/src ../include/sdb/version.h ifeq ($(EXT_EXE),.wasm) - $(MAKE) -C $(SDB_ROOT)/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS=-I$(SHLR)/sdb/include \ + $(MAKE) -C $(SDB_ROOT)/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS=-I$(SDB_ROOT)/include \ CFLAGS_SHARED="${CFLAGS_SHARED} -DHAVE_MMAN=0" \ CC="${CC}" AR="${AR}" ARCH=undefined CFLAGS='${CFLAGS} -DHAVE_MMAN=0' LDFLAGS='${LDFLAGS}' libsdb.$(EXT_AR) else - $(MAKE) -C $(SDB_ROOT)/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS="-I$(SHLR)/sdb/include -DHAVE_SYSTEM=0" \ + $(MAKE) -C $(SDB_ROOT)/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS="-I$(SDB_ROOT)/include -DHAVE_SYSTEM=0" \ CFLAGS_SHARED="${CFLAGS_SHARED}" \ CC="${CC}" AR="${AR}" ARCH=undefined LDFLAGS='${LDFLAGS}' libsdb.$(EXT_AR) endif diff --git a/shlr/sdb.mk b/shlr/sdb.mk index 02650e8f62b8f..45957b2cc69a8 100644 --- a/shlr/sdb.mk +++ b/shlr/sdb.mk @@ -1,2 +1,4 @@ # deprecate.. move into subprojects/sdb-deps.mk -CFLAGS+=-I$(SHLR)/../subprojects/sdb/include +SDB_ROOT=$(SHLR)/../subprojects/sdb +SDB_CFLAGS+=-I$(SDB_ROOT)/include +SDB_LDFLAGS+=$(SDB_ROOT)/lib/lib_sdb.a diff --git a/shlr/spp/meson.build b/shlr/spp/meson.build index fc218901437dd..9dd604f3c0b13 100644 --- a/shlr/spp/meson.build +++ b/shlr/spp/meson.build @@ -11,7 +11,7 @@ spp_files = [ inc_dirs = [ '../../libr/include', - '../../shlr/sdb/src' + '../../subprojects/sdb' ] libspp_static = static_library('spp', spp_files, diff --git a/sys/rebuild.sh b/sys/rebuild.sh index ab424ff41e8fd..318b2972aca51 100755 --- a/sys/rebuild.sh +++ b/sys/rebuild.sh @@ -73,7 +73,7 @@ RebuildCapstone() { } RebuildSdb() { - Rebuild shlr/sdb + Rebuild subprojects/sdb Rebuild libr/util }