forked from len0rd/rockbox
If available, use the systems libspeex when linking rbspeex(enc|dec) and rbutil dynamically. This is similar to FS#9233 but utilizes pkg-config.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23016 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
df4f9710ba
commit
21a712cba1
2 changed files with 17 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
# ccache
|
# ccache
|
||||||
unix:!mac:!noccache {
|
unix:!mac:!noccache {
|
||||||
CCACHE = $$system(which ccache)
|
CCACHE = $$system(which ccache)
|
||||||
|
@ -28,7 +27,11 @@ RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,)
|
||||||
|
|
||||||
message("Rockbox Base dir: "$$RBBASE_DIR)
|
message("Rockbox Base dir: "$$RBBASE_DIR)
|
||||||
|
|
||||||
# add a custom rule for pre-building librbspeex
|
# check for system speex. Add a custom rule for pre-building librbspeex if not found.
|
||||||
|
LIBSPEEX = $$system(pkg-config --libs speex)
|
||||||
|
!static:!isEmpty(LIBSPEEX) {
|
||||||
|
LIBS += $$LIBSPEEX
|
||||||
|
}
|
||||||
!mac {
|
!mac {
|
||||||
rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
|
rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,19 @@ ifdef RBARCH
|
||||||
CFLAGS += -arch $(RBARCH)
|
CFLAGS += -arch $(RBARCH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# don't try to use the systems libspeex when building a static binary.
|
||||||
|
ifndef STATIC
|
||||||
|
SYS_SPEEX = $(shell pkg-config --libs speex)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# fall back to our own librbspeex if no suitable found.
|
||||||
|
ifeq ($(SYS_SPEEX),)
|
||||||
# This sets up 'SRC' based on the files mentioned in SOURCES
|
# This sets up 'SRC' based on the files mentioned in SOURCES
|
||||||
SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
|
SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
|
||||||
|
LIBS = $(TARGET_DIR)librbspeex$(RBARCH).a
|
||||||
|
else
|
||||||
|
LIBS = $(SYS_SPEEX)
|
||||||
|
endif
|
||||||
|
|
||||||
OUT = $(TARGET_DIR)build$(RBARCH)
|
OUT = $(TARGET_DIR)build$(RBARCH)
|
||||||
SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
|
SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
|
||||||
|
@ -73,11 +83,11 @@ librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
|
||||||
|
|
||||||
../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
|
../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
|
||||||
@echo Linking ../rbspeexenc
|
@echo Linking ../rbspeexenc
|
||||||
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a -lm
|
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
|
||||||
|
|
||||||
../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
|
../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
|
||||||
@echo Linking ../rbspeexdec
|
@echo Linking ../rbspeexdec
|
||||||
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o librbspeex$(RBARCH).a -lm
|
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
|
||||||
|
|
||||||
%.o:
|
%.o:
|
||||||
@echo CC $<
|
@echo CC $<
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue