diff options
author | Nils Wallménius <nils@rockbox.org> | 2013-07-01 21:59:44 +0200 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2013-08-23 18:34:30 +0200 |
commit | b2e80edd1671833dc80eb0c5334cb6a2c58808e0 (patch) | |
tree | 68c29c6d53924292b6a0cb9573c755369f472a5a | |
parent | fbc4ef782273020f92604c5e2a2b27d0b690d251 (diff) | |
download | rockbox-b2e80edd1671833dc80eb0c5334cb6a2c58808e0.tar.gz rockbox-b2e80edd1671833dc80eb0c5334cb6a2c58808e0.zip |
Change CODECFLAGS to a "simply-expanded" var to give the individual
codec makefiles larger freedom in what they can do to it.
Use this in libopus to prepend the libopus searchpaths to
CODECFLAGS so that its internal config.h will be picked up before
our global one. This avoids having to do a s/config.h/opus_config.h/
when syncing which will be handy soon.
Change-Id: I018d729aa0c8300fa3149f22a5a8c5668b339dfa
Reviewed-on: http://gerrit.rockbox.org/496
Reviewed-by: Nils Wallménius <nils@rockbox.org>
-rw-r--r-- | apps/rbcodecconfig.h | 3 | ||||
-rw-r--r-- | lib/rbcodec/codecs/codecs.make | 26 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/libopus.make | 6 | ||||
-rw-r--r-- | lib/rbcodec/codecs/libopus/opus_config.h | 2 |
4 files changed, 20 insertions, 17 deletions
diff --git a/apps/rbcodecconfig.h b/apps/rbcodecconfig.h index cc51595cc4..c92415979f 100644 --- a/apps/rbcodecconfig.h +++ b/apps/rbcodecconfig.h | |||
@@ -1,7 +1,8 @@ | |||
1 | #ifndef RBCODECCONFIG_H_INCLUDED | 1 | #ifndef RBCODECCONFIG_H_INCLUDED |
2 | #define RBCODECCONFIG_H_INCLUDED | 2 | #define RBCODECCONFIG_H_INCLUDED |
3 | 3 | ||
4 | #include "config.h" | 4 | /* Explicit path to avoid issues with name clashes (libopus) */ |
5 | #include "../firmware/export/config.h" | ||
5 | 6 | ||
6 | #ifndef __ASSEMBLER__ | 7 | #ifndef __ASSEMBLER__ |
7 | 8 | ||
diff --git a/lib/rbcodec/codecs/codecs.make b/lib/rbcodec/codecs/codecs.make index 08554d9628..13ad28fa65 100644 --- a/lib/rbcodec/codecs/codecs.make +++ b/lib/rbcodec/codecs/codecs.make | |||
@@ -21,6 +21,19 @@ OTHER_INC += -I$(RBCODECLIB_DIR)/codecs/lib | |||
21 | # extra libraries | 21 | # extra libraries |
22 | CODEC_LIBS := $(CODECLIB) $(FIXEDPOINTLIB) | 22 | CODEC_LIBS := $(CODECLIB) $(FIXEDPOINTLIB) |
23 | 23 | ||
24 | # compile flags for codecs | ||
25 | CODECFLAGS := $(CFLAGS) $(RBCODEC_CFLAGS) -fstrict-aliasing \ | ||
26 | -I$(RBCODECLIB_DIR)/codecs -I$(RBCODECLIB_DIR)/codecs/lib -DCODEC | ||
27 | |||
28 | ifdef APP_TYPE | ||
29 | CODECLDFLAGS = $(SHARED_LDFLAG) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map | ||
30 | CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile | ||
31 | else | ||
32 | CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map | ||
33 | CODECFLAGS += -UDEBUG -DNDEBUG | ||
34 | endif | ||
35 | CODECLDFLAGS += $(GLOBAL_LDOPTS) | ||
36 | |||
24 | # the codec libraries | 37 | # the codec libraries |
25 | include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make | 38 | include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make |
26 | include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make | 39 | include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make |
@@ -53,10 +66,6 @@ include $(RBCODECLIB_DIR)/codecs/libgme/libkss.make | |||
53 | include $(RBCODECLIB_DIR)/codecs/libgme/libemu2413.make | 66 | include $(RBCODECLIB_DIR)/codecs/libgme/libemu2413.make |
54 | include $(RBCODECLIB_DIR)/codecs/libopus/libopus.make | 67 | include $(RBCODECLIB_DIR)/codecs/libopus/libopus.make |
55 | 68 | ||
56 | # compile flags for codecs | ||
57 | CODECFLAGS = $(CFLAGS) $(RBCODEC_CFLAGS) -fstrict-aliasing \ | ||
58 | -I$(RBCODECLIB_DIR)/codecs -I$(RBCODECLIB_DIR)/codecs/lib -DCODEC | ||
59 | |||
60 | # set CODECFLAGS per codec lib, since gcc takes the last -Ox and the last | 69 | # set CODECFLAGS per codec lib, since gcc takes the last -Ox and the last |
61 | # in a -ffoo -fno-foo pair, there is no need to filter them out | 70 | # in a -ffoo -fno-foo pair, there is no need to filter them out |
62 | $(A52LIB) : CODECFLAGS += -O1 | 71 | $(A52LIB) : CODECFLAGS += -O1 |
@@ -188,15 +197,6 @@ $(CODECDIR)/%.o: $(RBCODECLIB_DIR)/codecs/%.S | |||
188 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ | 197 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ |
189 | -I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@ | 198 | -I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@ |
190 | 199 | ||
191 | ifdef APP_TYPE | ||
192 | CODECLDFLAGS = $(SHARED_LDFLAG) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map | ||
193 | CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile | ||
194 | else | ||
195 | CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map | ||
196 | CODECFLAGS += -UDEBUG -DNDEBUG | ||
197 | endif | ||
198 | CODECLDFLAGS += $(GLOBAL_LDOPTS) | ||
199 | |||
200 | $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECS_LIBS) | 200 | $(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECS_LIBS) |
201 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*-pre.elf \ | 201 | $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*-pre.elf \ |
202 | $(filter %.o, $^) \ | 202 | $(filter %.o, $^) \ |
diff --git a/lib/rbcodec/codecs/libopus/libopus.make b/lib/rbcodec/codecs/libopus/libopus.make index ab93a5a5cc..5cfb34aac3 100644 --- a/lib/rbcodec/codecs/libopus/libopus.make +++ b/lib/rbcodec/codecs/libopus/libopus.make | |||
@@ -13,10 +13,12 @@ OPUSLIB_SRC := $(call preprocess, $(RBCODECLIB_DIR)/codecs/libopus/SOURCES) | |||
13 | OPUSLIB_OBJ := $(call c2obj, $(OPUSLIB_SRC)) | 13 | OPUSLIB_OBJ := $(call c2obj, $(OPUSLIB_SRC)) |
14 | 14 | ||
15 | # codec specific compilation flags | 15 | # codec specific compilation flags |
16 | $(OPUSLIB) : CODECFLAGS += -DHAVE_CONFIG_H \ | 16 | # prepend paths to avoid name clash issues |
17 | $(OPUSLIB) : CODECFLAGS := -DHAVE_CONFIG_H \ | ||
17 | -I$(RBCODECLIB_DIR)/codecs/libopus \ | 18 | -I$(RBCODECLIB_DIR)/codecs/libopus \ |
18 | -I$(RBCODECLIB_DIR)/codecs/libopus/celt \ | 19 | -I$(RBCODECLIB_DIR)/codecs/libopus/celt \ |
19 | -I$(RBCODECLIB_DIR)/codecs/libopus/silk | 20 | -I$(RBCODECLIB_DIR)/codecs/libopus/silk \ |
21 | $(CODECFLAGS) | ||
20 | 22 | ||
21 | $(OPUSLIB): $(OPUSLIB_OBJ) | 23 | $(OPUSLIB): $(OPUSLIB_OBJ) |
22 | $(SILENT)$(shell rm -f $@) | 24 | $(SILENT)$(shell rm -f $@) |
diff --git a/lib/rbcodec/codecs/libopus/opus_config.h b/lib/rbcodec/codecs/libopus/opus_config.h index 922ec607e5..39abc8d8d4 100644 --- a/lib/rbcodec/codecs/libopus/opus_config.h +++ b/lib/rbcodec/codecs/libopus/opus_config.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef CONFIG_H | 1 | #ifndef CONFIG_H |
2 | #define CONFIG_H | 2 | #define CONFIG_H |
3 | 3 | ||
4 | #include "config.h" | 4 | #include "rbcodecconfig.h" |
5 | #include "codeclib.h" | 5 | #include "codeclib.h" |
6 | #include "ogg/ogg.h" | 6 | #include "ogg/ogg.h" |
7 | 7 | ||