summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-10-07 16:54:15 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-10-07 16:54:15 +0000
commit6e11572e0788136f77ef67b3cfc182095084da4b (patch)
tree68539f3fdb8055807587b733d43cb38bb1ef7e19
parent9e9a9138296c602370e9c92d5fbd84a261aa17b8 (diff)
downloadrockbox-6e11572e0788136f77ef67b3cfc182095084da4b.tar.gz
rockbox-6e11572e0788136f77ef67b3cfc182095084da4b.zip
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
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/include/errno.h2
-rw-r--r--firmware/include/rbunicode.h2
-rw-r--r--tools/checkwps/checkwps.make3
-rwxr-xr-xtools/configure13
-rw-r--r--tools/database/SOURCES37
-rw-r--r--tools/database/database.c1
-rw-r--r--tools/database/database.make42
-rw-r--r--tools/root.make2
9 files changed, 98 insertions, 8 deletions
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 @@
22#ifndef __CONFIG_H__ 22#ifndef __CONFIG_H__
23#define __CONFIG_H__ 23#define __CONFIG_H__
24 24
25#ifndef __PCTOOL__
26#include "autoconf.h" 25#include "autoconf.h"
27#endif
28 26
29/* symbolic names for multiple choice configurations: */ 27/* symbolic names for multiple choice configurations: */
30 28
@@ -620,7 +618,7 @@ Lyre prototype 1*/
620/* Enable the directory cache and tagcache in RAM if we have 618/* Enable the directory cache and tagcache in RAM if we have
621 * plenty of RAM. Both features can be enabled independently. */ 619 * plenty of RAM. Both features can be enabled independently. */
622#if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \ 620#if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \
623 !defined(BOOTLOADER) 621 !defined(BOOTLOADER) && !defined(__PCTOOL__)
624#define HAVE_DIRCACHE 622#define HAVE_DIRCACHE
625#ifdef HAVE_TAGCACHE 623#ifdef HAVE_TAGCACHE
626#define HAVE_TC_RAMCACHE 624#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 @@
2 non-reentrant. Instead, its address is returned by the function 2 non-reentrant. Instead, its address is returned by the function
3 __errno. */ 3 __errno. */
4 4
5#if defined(SIMULATOR) && !defined(__MINGW32__) && !defined(__CYGWIN__) 5#if (defined(SIMULATOR)||defined(__PCTOOL__)) && !defined(__MINGW32__) && !defined(__CYGWIN__)
6 6
7#include "/usr/include/errno.h" /* use the host system implementation */ 7#include "/usr/include/errno.h" /* use the host system implementation */
8 8
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 @@
28#ifndef _RBUNICODE_H_ 28#ifndef _RBUNICODE_H_
29#define _RBUNICODE_H_ 29#define _RBUNICODE_H_
30 30
31#ifndef __PCTOOL__
32#include "config.h" 31#include "config.h"
33#endif
34 32
35#define MASK 0xC0 /* 11000000 */ 33#define MASK 0xC0 /* 11000000 */
36#define COMP 0x80 /* 10x */ 34#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 \
16 -I$(ROOTDIR)/firmware/export \ 16 -I$(ROOTDIR)/firmware/export \
17 -I$(ROOTDIR)/apps \ 17 -I$(ROOTDIR)/apps \
18 -I$(ROOTDIR)/apps/recorder \ 18 -I$(ROOTDIR)/apps/recorder \
19 -I$(APPSDIR) 19 -I$(APPSDIR) \
20 -I$(BUILDDIR)
20 21
21# Makes mkdepfile happy 22# Makes mkdepfile happy
22GCCOPTS+=-D__PCTOOL__ 23GCCOPTS+=-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
2451if [ "$ARG_TYPE" ]; then 2451if [ "$ARG_TYPE" ]; then
2452 btype=$ARG_TYPE 2452 btype=$ARG_TYPE
2453else 2453else
2454 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, $gdbstub(M)anual: (Defaults to N)" 2454 echo "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, $gdbstub(M)anual: (Defaults to N)"
2455 btype=`input`; 2455 btype=`input`;
2456fi 2456fi
2457 2457
@@ -2543,6 +2543,17 @@ fi
2543 archosrom=''; 2543 archosrom='';
2544 echo "CheckWPS build selected" 2544 echo "CheckWPS build selected"
2545 ;; 2545 ;;
2546 [Dd])
2547 uname=`uname`
2548 simcc "database"
2549 toolset='';
2550 t_cpu='';
2551 GCCOPTS='';
2552 appsdir='\$(ROOTDIR)/tools/database';
2553 output='database.'${modelname};
2554 archosrom='';
2555 echo "Database tool build selected"
2556 ;;
2546 *) 2557 *)
2547 if [ "$modelname" = "e200r" ]; then 2558 if [ "$modelname" = "e200r" ]; then
2548 echo "Do not use the e200R target for regular builds. Use e200 instead." 2559 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 @@
1database.c
2../../apps/fixedpoint.c
3../../apps/metadata.c
4../../apps/metadata/mp3.c
5#if CONFIG_CODEC == SWCODEC
6../../apps/metadata/metadata_common.c
7../../apps/metadata/aiff.c
8../../apps/metadata/ape.c
9../../apps/metadata/asf.c
10../../apps/metadata/adx.c
11../../apps/metadata/flac.c
12../../apps/metadata/monkeys.c
13../../apps/metadata/mp4.c
14../../apps/metadata/mpc.c
15../../apps/metadata/ogg.c
16../../apps/metadata/sid.c
17../../apps/metadata/mod.c
18../../apps/metadata/spc.c
19../../apps/metadata/vorbis.c
20../../apps/metadata/wave.c
21../../apps/metadata/wavpack.c
22../../apps/metadata/a52.c
23../../apps/metadata/asap.c
24../../apps/metadata/rm.c
25../../apps/metadata/nsf.c
26../../apps/replaygain.c
27#endif
28../../apps/misc.c
29../../apps/mp3data.c
30../../apps/tagcache.c
31../../firmware/common/crc32.c
32../../firmware/common/ctype.c
33../../firmware/common/strlcpy.c
34../../firmware/common/structec.c
35../../firmware/common/unicode.c
36../../firmware/logf.c
37../../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 @@
1/* A _very_ skeleton file to demonstrate building tagcache db on host. */ 1/* A _very_ skeleton file to demonstrate building tagcache db on host. */
2 2
3#include <stdbool.h>
3#include <stdio.h> 4#include <stdio.h>
4#include <sys/stat.h> 5#include <sys/stat.h>
5#include "tagcache.h" 6#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 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: checkwps.make 22680 2009-09-11 17:58:17Z gevaerts $
8#
9
10FIRMINC = -I../../firmware/include -fno-builtin
11
12DBDEFINES=-g -DDEBUG -D__PCTOOL__ -DSIMULATOR
13CFLAGS+=$(DBDEFINES)
14
15SRC= $(call preprocess, $(TOOLSDIR)/database/SOURCES)
16
17FIRMINC = -I$(ROOTDIR)/firmware/include -fno-builtin
18
19INCLUDES = -I$(ROOTDIR)/apps/gui \
20 -I$(ROOTDIR)/firmware/export \
21 -I$(ROOTDIR)/apps \
22 -I$(APPSDIR) \
23 -I$(BUILDDIR) \
24
25SIMINCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \
26 -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) -I/usr/include/SDL
27
28# Makes mkdepfile happy
29OLDGCCOPTS:=$(GCCOPTS)
30GCCOPTS+=-D__PCTOOL__ $(FIRMINC) $(SIMINCLUDES)
31
32.SECONDEXPANSION: # $$(OBJ) is not populated until after this
33
34$(BUILDDIR)/$(BINARY): $$(OBJ)
35 @echo LD $(BINARY)
36 $(SILENT)$(HOSTCC) $(INCLUDE) $(FLAGS) -ldl -o $@ $+
37
38SIMFLAGS += $(SIMINCLUDES) $(DBDEFINES) -DHAVE_CONFIG_H $(OLDGCCOPTS)
39
40$(BUILDDIR)/tools/database/../../uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
41 $(SILENT)mkdir -p $(dir $@)
42 $(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)))
67 include $(APPSDIR)/bootbox.make 67 include $(APPSDIR)/bootbox.make
68else ifneq (,$(findstring checkwps,$(APPSDIR))) 68else ifneq (,$(findstring checkwps,$(APPSDIR)))
69 include $(APPSDIR)/checkwps.make 69 include $(APPSDIR)/checkwps.make
70else ifneq (,$(findstring database,$(APPSDIR)))
71 include $(APPSDIR)/database.make
70else 72else
71 include $(APPSDIR)/apps.make 73 include $(APPSDIR)/apps.make
72 include $(APPSDIR)/lang/lang.make 74 include $(APPSDIR)/lang/lang.make