summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2013-07-01 21:59:44 +0200
committerNils Wallménius <nils@rockbox.org>2013-08-23 18:34:30 +0200
commitb2e80edd1671833dc80eb0c5334cb6a2c58808e0 (patch)
tree68c29c6d53924292b6a0cb9573c755369f472a5a /lib
parentfbc4ef782273020f92604c5e2a2b27d0b690d251 (diff)
downloadrockbox-b2e80edd1671833dc80eb0c5334cb6a2c58808e0.tar.gz
rockbox-b2e80edd1671833dc80eb0c5334cb6a2c58808e0.tar.bz2
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/codecs.make26
-rw-r--r--lib/rbcodec/codecs/libopus/libopus.make6
-rw-r--r--lib/rbcodec/codecs/libopus/opus_config.h2
3 files changed, 18 insertions, 16 deletions
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
# extra libraries
CODEC_LIBS := $(CODECLIB) $(FIXEDPOINTLIB)
+# compile flags for codecs
+CODECFLAGS := $(CFLAGS) $(RBCODEC_CFLAGS) -fstrict-aliasing \
+ -I$(RBCODECLIB_DIR)/codecs -I$(RBCODECLIB_DIR)/codecs/lib -DCODEC
+
+ifdef APP_TYPE
+ CODECLDFLAGS = $(SHARED_LDFLAG) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
+ CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
+else
+ CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
+ CODECFLAGS += -UDEBUG -DNDEBUG
+endif
+CODECLDFLAGS += $(GLOBAL_LDOPTS)
+
# the codec libraries
include $(RBCODECLIB_DIR)/codecs/demac/libdemac.make
include $(RBCODECLIB_DIR)/codecs/liba52/liba52.make
@@ -53,10 +66,6 @@ include $(RBCODECLIB_DIR)/codecs/libgme/libkss.make
include $(RBCODECLIB_DIR)/codecs/libgme/libemu2413.make
include $(RBCODECLIB_DIR)/codecs/libopus/libopus.make
-# compile flags for codecs
-CODECFLAGS = $(CFLAGS) $(RBCODEC_CFLAGS) -fstrict-aliasing \
- -I$(RBCODECLIB_DIR)/codecs -I$(RBCODECLIB_DIR)/codecs/lib -DCODEC
-
# set CODECFLAGS per codec lib, since gcc takes the last -Ox and the last
# in a -ffoo -fno-foo pair, there is no need to filter them out
$(A52LIB) : CODECFLAGS += -O1
@@ -188,15 +197,6 @@ $(CODECDIR)/%.o: $(RBCODECLIB_DIR)/codecs/%.S
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
-I$(dir $<) $(CODECFLAGS) $(ASMFLAGS) -c $< -o $@
-ifdef APP_TYPE
- CODECLDFLAGS = $(SHARED_LDFLAG) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
- CODECFLAGS += $(SHARED_CFLAGS) # <-- from Makefile
-else
- CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
- CODECFLAGS += -UDEBUG -DNDEBUG
-endif
-CODECLDFLAGS += $(GLOBAL_LDOPTS)
-
$(CODECDIR)/%-pre.map: $(CODEC_CRT0) $(CODECLINK_LDS) $(CODECDIR)/%.o $(CODECS_LIBS)
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*-pre.elf \
$(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)
OPUSLIB_OBJ := $(call c2obj, $(OPUSLIB_SRC))
# codec specific compilation flags
-$(OPUSLIB) : CODECFLAGS += -DHAVE_CONFIG_H \
+# prepend paths to avoid name clash issues
+$(OPUSLIB) : CODECFLAGS := -DHAVE_CONFIG_H \
-I$(RBCODECLIB_DIR)/codecs/libopus \
-I$(RBCODECLIB_DIR)/codecs/libopus/celt \
- -I$(RBCODECLIB_DIR)/codecs/libopus/silk
+ -I$(RBCODECLIB_DIR)/codecs/libopus/silk \
+ $(CODECFLAGS)
$(OPUSLIB): $(OPUSLIB_OBJ)
$(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 @@
#ifndef CONFIG_H
#define CONFIG_H
-#include "config.h"
+#include "rbcodecconfig.h"
#include "codeclib.h"
#include "ogg/ogg.h"