summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro7
-rw-r--r--tools/rbspeex/Makefile14
2 files changed, 17 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index df542be84a..fb306d9774 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -1,5 +1,4 @@
1 1
2
3# ccache 2# ccache
4unix:!mac:!noccache { 3unix:!mac:!noccache {
5 CCACHE = $$system(which ccache) 4 CCACHE = $$system(which ccache)
@@ -28,7 +27,11 @@ RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,)
28 27
29message("Rockbox Base dir: "$$RBBASE_DIR) 28message("Rockbox Base dir: "$$RBBASE_DIR)
30 29
31# add a custom rule for pre-building librbspeex 30# check for system speex. Add a custom rule for pre-building librbspeex if not found.
31LIBSPEEX = $$system(pkg-config --libs speex)
32!static:!isEmpty(LIBSPEEX) {
33 LIBS += $$LIBSPEEX
34}
32!mac { 35!mac {
33rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a 36rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
34} 37}
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile
index 41bf775d38..8c46677ce8 100644
--- a/tools/rbspeex/Makefile
+++ b/tools/rbspeex/Makefile
@@ -31,9 +31,19 @@ ifdef RBARCH
31CFLAGS += -arch $(RBARCH) 31CFLAGS += -arch $(RBARCH)
32endif 32endif
33 33
34# don't try to use the systems libspeex when building a static binary.
35ifndef STATIC
36SYS_SPEEX = $(shell pkg-config --libs speex)
37endif
34 38
39# fall back to our own librbspeex if no suitable found.
40ifeq ($(SYS_SPEEX),)
35# This sets up 'SRC' based on the files mentioned in SOURCES 41# This sets up 'SRC' based on the files mentioned in SOURCES
36SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") 42SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$")
43LIBS = $(TARGET_DIR)librbspeex$(RBARCH).a
44else
45LIBS = $(SYS_SPEEX)
46endif
37 47
38OUT = $(TARGET_DIR)build$(RBARCH) 48OUT = $(TARGET_DIR)build$(RBARCH)
39SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c 49SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
@@ -73,11 +83,11 @@ librbspeex$(RBARCH).a: $(OUT)/librbspeex.a
73 83
74../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a 84../rbspeexenc: $(OBJS) $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a
75 @echo Linking ../rbspeexenc 85 @echo Linking ../rbspeexenc
76 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o librbspeex$(RBARCH).a -lm 86 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc $(OUT)/rbspeexenc.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
77 87
78../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o 88../rbspeexdec: $(OBJS) librbspeex$(RBARCH).a $(OUT)/rbspeexdec.o
79 @echo Linking ../rbspeexdec 89 @echo Linking ../rbspeexdec
80 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o librbspeex$(RBARCH).a -lm 90 $(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec $(OUT)/rbspeexdec.o $(LIBS) -lm $(TARGET_DIR)librbspeex$(RBARCH).a
81 91
82%.o: 92%.o:
83 @echo CC $< 93 @echo CC $<