Fix static linking on macOS ##build

This commit is contained in:
pancake 2023-11-22 00:29:16 +01:00 committed by pancake
parent 607d6963ba
commit f2c8b12c1a
5 changed files with 15 additions and 13 deletions

View File

@ -6,7 +6,6 @@ BINS=r2blob
SOURCES= r2blob.c
include ../../config-user.mk
include ../rules.mk
SHLR=../../shlr

View File

@ -12,8 +12,6 @@ BUNDLE=org.radare.radare2
MACSDK=macosx10.10
ENTITL=radare2.xcent
#ENTITL=radare2_ios.xml
#CFLAGS+=-flto
#LDFLAGS+=-flto
CFLAGS_INCLUDES+=-I$(SHLR)/sdb/src
CFLAGS_INCLUDES+=-I$(LIBR)/include

View File

@ -1,7 +1,7 @@
BIN=rahash2
BINDEPS=r_main
include ../rules.mk
ifeq ($(OSTYPE),android)

View File

@ -6,5 +6,6 @@ include ../../libr/main/deps.mk
include ../../shlr/zip/deps.mk
include ../../shlr/java/deps.mk
include ../../shlr/capstone.mk
include ../rules.mk
LDFLAGS+=$(LINK)

View File

@ -111,18 +111,20 @@ all: ${BEXE} ${BINS}
ifeq ($(WITH_LIBR),1)
${BINS}: ${OBJS}
${CC} ${CFLAGS} $@.c ${OBJS} ../../libr/libr.a -o $@ $(LDFLAGS)
${CC} ${CFLAGS} $@.c ${OBJS} ../../libr/libr.a -o $@
#$(LDFLAGS)
${BEXE}: ${OBJ} ${SHARED_OBJ}
ifeq ($(COMPILER),wasi)
ifeq ($(COMPILER),wasi)
${CC} ${CFLAGS} $+ -L.. -o $@ $(LDFLAGS)
else
ifeq ($(CC),emcc)
else
ifeq ($(CC),emcc)
emcc $(BIN).c ../../shlr/libr_shlr.a ../../shlr/capstone/libcapstone.a ../../libr/libr.a ../../shlr/gdb/lib/libgdbr.a ../../shlr/zip/librz.a -I ../../libr/include -o $(BIN).js
else
${CC} ${CFLAGS} $+ -L.. -o $@ ../../libr/libr.a $(LDFLAGS)
endif
endif
else
${CC} ${CFLAGS} $+ -L.. -o $@ ../../libr/libr.a
#$(LDFLAGS)
endif
endif
else
${BINS}: ${OBJS}
@ -131,8 +133,10 @@ ifneq ($(SILENT),)
endif
${CC} ${CFLAGS} $@.c ${OBJS} ${REAL_LDFLAGS} $(LINK) -o $@
# -static fails because -ldl -lpthread static-gcc ...
include ../../config-user.mk
${BEXE}: ${OBJ} ${SHARED_OBJ}
# -static fails because -ldl -lpthread static-gcc ...
ifneq ($(SILENT),)
@echo LD $@
endif