diff options
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 7 | ||||
-rw-r--r-- | tools/rbspeex/Makefile | 14 |
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 |
4 | unix:!mac:!noccache { | 3 | unix:!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 | ||
29 | message("Rockbox Base dir: "$$RBBASE_DIR) | 28 | message("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. |
31 | LIBSPEEX = $$system(pkg-config --libs speex) | ||
32 | !static:!isEmpty(LIBSPEEX) { | ||
33 | LIBS += $$LIBSPEEX | ||
34 | } | ||
32 | !mac { | 35 | !mac { |
33 | rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a | 36 | rbspeex.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 | |||
31 | CFLAGS += -arch $(RBARCH) | 31 | CFLAGS += -arch $(RBARCH) |
32 | endif | 32 | endif |
33 | 33 | ||
34 | # don't try to use the systems libspeex when building a static binary. | ||
35 | ifndef STATIC | ||
36 | SYS_SPEEX = $(shell pkg-config --libs speex) | ||
37 | endif | ||
34 | 38 | ||
39 | # fall back to our own librbspeex if no suitable found. | ||
40 | ifeq ($(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 |
36 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") | 42 | SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#" | grep -v "^$$") |
43 | LIBS = $(TARGET_DIR)librbspeex$(RBARCH).a | ||
44 | else | ||
45 | LIBS = $(SYS_SPEEX) | ||
46 | endif | ||
37 | 47 | ||
38 | OUT = $(TARGET_DIR)build$(RBARCH) | 48 | OUT = $(TARGET_DIR)build$(RBARCH) |
39 | SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c | 49 | SOURCES = $(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 $< |