From d1d77d26ad7d3b1ad212e79758029839865bfbd2 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 2 Dec 2024 04:45:04 +0100 Subject: [PATCH] Delete more references to shlr/sdb --- binr/radare2/Makefile | 4 ++-- binr/rules.mk | 4 ++-- dist/rpm/radare2.spec | 2 +- doc/emscripten.md | 42 +++++++++++------------------------------- doc/license.md | 2 +- libr/bin/p/mach064.mk | 5 +++-- libr/core/p/sixref.mk | 2 +- libr/util/str.c | 9 ++++----- shlr/Makefile | 6 +++--- shlr/sdb.mk | 4 +++- shlr/spp/meson.build | 2 +- sys/rebuild.sh | 2 +- 12 files changed, 33 insertions(+), 51 deletions(-) diff --git a/binr/radare2/Makefile b/binr/radare2/Makefile index ee3121b6b3c4c3..66bc3f7f7e17a0 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 2aaaa91ef04361..79f2c5de3c7f9c 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 66df3c6161dc36..b4a379d9e8396d 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 6acfaa0af6399e..6bfbca2e64fd59 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 c17854c2350a61..494e7f48d0270f 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 066f3860d72461..ae7ecda44b5a96 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 c26f384b5d22ae..4cd83e09a40cc2 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 4f4520b77e7f15..8944f65e9fac9b 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 dbc140d9eee173..6960d605ffa5c1 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 02650e8f62b8f3..45957b2cc69a86 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 fc218901437ddb..9dd604f3c0b13c 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 ab424ff41e8fdd..318b2972aca518 100755 --- a/sys/rebuild.sh +++ b/sys/rebuild.sh @@ -73,7 +73,7 @@ RebuildCapstone() { } RebuildSdb() { - Rebuild shlr/sdb + Rebuild subprojects/sdb Rebuild libr/util }