Improve portability by defining util deps properly

This commit is contained in:
pancake 2021-08-25 13:47:36 +02:00
parent 891a9813bf
commit 395a6f2e64
5 changed files with 19 additions and 11 deletions

View File

@ -3,8 +3,11 @@ BINDEPS=r_core r_main
include ../rules.mk
include ../../libr/main/deps.mk
include ../../libr/util/deps.mk
include ../../shlr/zip/deps.mk
include ../../shlr/java/deps.mk
include ../../shlr/gdb/deps.mk
LDFLAGS+=$(LINK)
LDFLAGS+=-lexecinfo

View File

@ -5,6 +5,8 @@ R2DEPS=r_reg r_anal r_bp r_io r_parse r_cons r_syscall r_hash r_flag r_util r_eg
R2DEPS+=r_socket
CFLAGS+=-DR2_PLUGIN_INCORE
include ../util/deps.mk
ifeq (${BUILD_OS},serenityos)
LDFLAGS+=
else
@ -12,6 +14,7 @@ ifeq ($(OSTYPE),bsd)
LDFLAGS+=-lkvm
endif
endif
LDFLAGS+=-lexecinfo
foo:
@${MAKE} libs

View File

@ -4,13 +4,6 @@ NAME=r_util
CFLAGS+=-DR2_PLUGIN_INCORE -I$(TOP)/shlr
PCLIBS=@LIBZIP@ @DL_LIBS@
ifneq ($(OSTYPE),darwin)
ifneq ($(OSTYPE),haiku)
LDFLAGS+=-lm
LINK=-lm
endif
endif
OBJS=binheap.o mem.o unum.o str.o hex.o file.o range.o charset.o
OBJS+=prof.o cache.o sys.o buf.o sys_w32.o ubase64.o base85.o base91.o
OBJS+=list.o flist.o chmod.o graph.o event.o alloc.o donut.o print_code.o

View File

@ -12,9 +12,10 @@ endif
# FreeBSD 10.0 ships with backtrace(3) in -lexecinfo
ifeq (${BUILD_OS},freebsd)
ifneq ($(shell expr "`uname -r`" : '[0-9]\.'), 2)
LDFLAGS+=-lexecinfo
endif
ifneq ($(shell expr "`uname -r`" : '[0-9]\.'), 2)
LDFLAGS+=-lexecinfo
endif
LDFLAGS+=-lutil
endif
ifeq (${BUILD_OS},dragonfly)
@ -24,3 +25,11 @@ endif
ifeq (${BUILD_OS},haiku)
LDFLAGS+=-lexecinfo
endif
ifneq ($(OSTYPE),darwin)
ifneq ($(OSTYPE),haiku)
LDFLAGS+=-lm
LINK+=-lm
endif
endif

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ ! -f config-user.mk ]; then
printf "[*] Configuring the build system ... "
./configure > /dev/null || exit 1
./configure || exit 1
fi
printf "[*] Checking out capstone... "
rm -rf shlr/capstone