From 6e11572e0788136f77ef67b3cfc182095084da4b Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Wed, 7 Oct 2009 16:54:15 +0000 Subject: Make the database tool buildable from configure. Also update the checkwps makefile to make checkwps builds not break git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22998 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config.h | 4 +--- firmware/include/errno.h | 2 +- firmware/include/rbunicode.h | 2 -- tools/checkwps/checkwps.make | 3 ++- tools/configure | 13 ++++++++++++- tools/database/SOURCES | 37 +++++++++++++++++++++++++++++++++++++ tools/database/database.c | 1 + tools/database/database.make | 42 ++++++++++++++++++++++++++++++++++++++++++ tools/root.make | 2 ++ 9 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 tools/database/SOURCES create mode 100644 tools/database/database.make diff --git a/firmware/export/config.h b/firmware/export/config.h index 941ee5f9b4..4d370aa9cd 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -22,9 +22,7 @@ #ifndef __CONFIG_H__ #define __CONFIG_H__ -#ifndef __PCTOOL__ #include "autoconf.h" -#endif /* symbolic names for multiple choice configurations: */ @@ -620,7 +618,7 @@ Lyre prototype 1*/ /* Enable the directory cache and tagcache in RAM if we have * plenty of RAM. Both features can be enabled independently. */ #if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \ - !defined(BOOTLOADER) + !defined(BOOTLOADER) && !defined(__PCTOOL__) #define HAVE_DIRCACHE #ifdef HAVE_TAGCACHE #define HAVE_TC_RAMCACHE diff --git a/firmware/include/errno.h b/firmware/include/errno.h index 1843b56f1d..846cd0e339 100644 --- a/firmware/include/errno.h +++ b/firmware/include/errno.h @@ -2,7 +2,7 @@ non-reentrant. Instead, its address is returned by the function __errno. */ -#if defined(SIMULATOR) && !defined(__MINGW32__) && !defined(__CYGWIN__) +#if (defined(SIMULATOR)||defined(__PCTOOL__)) && !defined(__MINGW32__) && !defined(__CYGWIN__) #include "/usr/include/errno.h" /* use the host system implementation */ diff --git a/firmware/include/rbunicode.h b/firmware/include/rbunicode.h index a4a1c8b323..a97ebb469b 100644 --- a/firmware/include/rbunicode.h +++ b/firmware/include/rbunicode.h @@ -28,9 +28,7 @@ #ifndef _RBUNICODE_H_ #define _RBUNICODE_H_ -#ifndef __PCTOOL__ #include "config.h" -#endif #define MASK 0xC0 /* 11000000 */ #define COMP 0x80 /* 10x */ diff --git a/tools/checkwps/checkwps.make b/tools/checkwps/checkwps.make index 22a1f07263..b28d8e8411 100644 --- a/tools/checkwps/checkwps.make +++ b/tools/checkwps/checkwps.make @@ -16,7 +16,8 @@ INCLUDES = -I$(ROOTDIR)/apps/gui \ -I$(ROOTDIR)/firmware/export \ -I$(ROOTDIR)/apps \ -I$(ROOTDIR)/apps/recorder \ - -I$(APPSDIR) + -I$(APPSDIR) \ + -I$(BUILDDIR) # Makes mkdepfile happy GCCOPTS+=-D__PCTOOL__ diff --git a/tools/configure b/tools/configure index d61a70966b..e168bf0688 100755 --- a/tools/configure +++ b/tools/configure @@ -2451,7 +2451,7 @@ esac if [ "$ARG_TYPE" ]; then btype=$ARG_TYPE else - echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, $gdbstub(M)anual: (Defaults to N)" + echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)" btype=`input`; fi @@ -2543,6 +2543,17 @@ fi archosrom=''; echo "CheckWPS build selected" ;; + [Dd]) + uname=`uname` + simcc "database" + toolset=''; + t_cpu=''; + GCCOPTS=''; + appsdir='\$(ROOTDIR)/tools/database'; + output='database.'${modelname}; + archosrom=''; + echo "Database tool build selected" + ;; *) if [ "$modelname" = "e200r" ]; then echo "Do not use the e200R target for regular builds. Use e200 instead." diff --git a/tools/database/SOURCES b/tools/database/SOURCES new file mode 100644 index 0000000000..60a70755c4 --- /dev/null +++ b/tools/database/SOURCES @@ -0,0 +1,37 @@ +database.c +../../apps/fixedpoint.c +../../apps/metadata.c +../../apps/metadata/mp3.c +#if CONFIG_CODEC == SWCODEC +../../apps/metadata/metadata_common.c +../../apps/metadata/aiff.c +../../apps/metadata/ape.c +../../apps/metadata/asf.c +../../apps/metadata/adx.c +../../apps/metadata/flac.c +../../apps/metadata/monkeys.c +../../apps/metadata/mp4.c +../../apps/metadata/mpc.c +../../apps/metadata/ogg.c +../../apps/metadata/sid.c +../../apps/metadata/mod.c +../../apps/metadata/spc.c +../../apps/metadata/vorbis.c +../../apps/metadata/wave.c +../../apps/metadata/wavpack.c +../../apps/metadata/a52.c +../../apps/metadata/asap.c +../../apps/metadata/rm.c +../../apps/metadata/nsf.c +../../apps/replaygain.c +#endif +../../apps/misc.c +../../apps/mp3data.c +../../apps/tagcache.c +../../firmware/common/crc32.c +../../firmware/common/ctype.c +../../firmware/common/strlcpy.c +../../firmware/common/structec.c +../../firmware/common/unicode.c +../../firmware/logf.c +../../uisimulator/common/io.c diff --git a/tools/database/database.c b/tools/database/database.c index 1f398c02f0..41e73ae4a3 100644 --- a/tools/database/database.c +++ b/tools/database/database.c @@ -1,5 +1,6 @@ /* A _very_ skeleton file to demonstrate building tagcache db on host. */ +#include #include #include #include "tagcache.h" diff --git a/tools/database/database.make b/tools/database/database.make new file mode 100644 index 0000000000..482b3dfa2a --- /dev/null +++ b/tools/database/database.make @@ -0,0 +1,42 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id: checkwps.make 22680 2009-09-11 17:58:17Z gevaerts $ +# + +FIRMINC = -I../../firmware/include -fno-builtin + +DBDEFINES=-g -DDEBUG -D__PCTOOL__ -DSIMULATOR +CFLAGS+=$(DBDEFINES) + +SRC= $(call preprocess, $(TOOLSDIR)/database/SOURCES) + +FIRMINC = -I$(ROOTDIR)/firmware/include -fno-builtin + +INCLUDES = -I$(ROOTDIR)/apps/gui \ + -I$(ROOTDIR)/firmware/export \ + -I$(ROOTDIR)/apps \ + -I$(APPSDIR) \ + -I$(BUILDDIR) \ + +SIMINCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \ + -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) -I/usr/include/SDL + +# Makes mkdepfile happy +OLDGCCOPTS:=$(GCCOPTS) +GCCOPTS+=-D__PCTOOL__ $(FIRMINC) $(SIMINCLUDES) + +.SECONDEXPANSION: # $$(OBJ) is not populated until after this + +$(BUILDDIR)/$(BINARY): $$(OBJ) + @echo LD $(BINARY) + $(SILENT)$(HOSTCC) $(INCLUDE) $(FLAGS) -ldl -o $@ $+ + +SIMFLAGS += $(SIMINCLUDES) $(DBDEFINES) -DHAVE_CONFIG_H $(OLDGCCOPTS) + +$(BUILDDIR)/tools/database/../../uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@ diff --git a/tools/root.make b/tools/root.make index f0f2c3310b..13768dd33a 100644 --- a/tools/root.make +++ b/tools/root.make @@ -67,6 +67,8 @@ else ifneq (,$(findstring bootbox,$(APPSDIR))) include $(APPSDIR)/bootbox.make else ifneq (,$(findstring checkwps,$(APPSDIR))) include $(APPSDIR)/checkwps.make +else ifneq (,$(findstring database,$(APPSDIR))) + include $(APPSDIR)/database.make else include $(APPSDIR)/apps.make include $(APPSDIR)/lang/lang.make -- cgit v1.2.3