diff options
Diffstat (limited to 'tools')
-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 $< |