diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-10-08 21:26:39 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-10-08 21:26:39 +0000 |
commit | 21a712cba1e49eea5a141b441b62a41965bd380e (patch) | |
tree | 6707ce35590811dc452847178a0fb50be335e864 /tools/rbspeex/Makefile | |
parent | df4f9710ba39b4c8e55ac011b0e88074dfe111ac (diff) | |
download | rockbox-21a712cba1e49eea5a141b441b62a41965bd380e.tar.gz rockbox-21a712cba1e49eea5a141b441b62a41965bd380e.zip |
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
Diffstat (limited to 'tools/rbspeex/Makefile')
-rw-r--r-- | tools/rbspeex/Makefile | 14 |
1 files changed, 12 insertions, 2 deletions
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 $< |