ifdef all the tagcache code, allows rombox to be compiled again, Thanks Austin Appel


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11338 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/SOURCES b/apps/SOURCES
index d759e49..570ec6e 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -27,7 +27,9 @@
 talk.c
 #endif
 tree.c
+#ifdef HAVE_TAGCACHE
 tagtree.c
+#endif
 filetree.c
 scrobbler.c
 
@@ -82,7 +84,9 @@
 eq_menu.c
 #endif
 metadata.c
+#ifdef HAVE_TAGCACHE
 tagcache.c
+#endif
 #if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
     || (CONFIG_KEYPAD == IRIVER_H300_PAD)
 keymaps/keymap-h1x0_h3x0.c
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 5243519..806744b 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -41,7 +41,9 @@
 #include "misc.h"
 #include "splash.h"
 #include "dircache.h"
+#ifdef HAVE_TAGCACHE
 #include "tagcache.h"
+#endif
 #include "lcd-remote.h"
 #include "crc32.h"
 #include "logf.h"
@@ -1917,6 +1919,7 @@
 #endif /* HAVE_DIRCACHE */
 
 #ifdef HAVE_LCD_BITMAP
+#ifdef HAVE_TAGCACHE
 static bool dbg_tagcache_info(void)
 {
     bool done = false;
@@ -1960,6 +1963,7 @@
     return false;
 }
 #endif
+#endif
 
 #if CONFIG_CPU == SH7034
 bool dbg_save_roms(void)
@@ -2193,7 +2197,9 @@
         { "View dircache info", dbg_dircache_info },
 #endif
 #ifdef HAVE_LCD_BITMAP
+#ifdef HAVE_TAGCACHE
         { "View tagcache info", dbg_tagcache_info },
+#endif
 #if CONFIG_CODEC == SWCODEC || !defined(SIMULATOR)
         { "View audio thread", dbg_audio_thread },
 #endif
diff --git a/apps/main.c b/apps/main.c
index 838a485..4249fd0 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -60,8 +60,10 @@
 #include "misc.h"
 #include "database.h"
 #include "dircache.h"
+#ifdef HAVE_TAGCACHE
 #include "tagcache.h"
 #include "tagtree.h"
+#endif
 #include "lang.h"
 #include "string.h"
 #include "splash.h"
@@ -169,6 +171,7 @@
 #endif
 }
 
+#ifdef HAVE_TAGCACHE
 void init_tagcache(void)
 {
     bool clear = false;
@@ -204,6 +207,7 @@
         show_logo();
     }
 }
+#endif
 
 #ifdef SIMULATOR
 
@@ -230,7 +234,9 @@
     settings_apply();
     init_dircache(true);
     init_dircache(false);
+#ifdef HAVE_TAGCACHE
     init_tagcache();
+#endif
     sleep(HZ/2);
     tree_init();
     playlist_init();
@@ -436,16 +442,19 @@
 #endif
         settings_load(SETTINGS_ALL);
 
-    
     if (init_dircache(true) < 0)
     {
+#ifdef HAVE_TAGCACHE
         remove(TAGCACHE_STATEFILE);
+#endif
     }
     
     gui_sync_wps_init();
     settings_apply();
     init_dircache(false);
+#ifdef HAVE_TAGCACHE
     init_tagcache();
+#endif
 
 #ifdef HAVE_EEPROM_SETTINGS
     if (firmware_settings.initialized)
diff --git a/apps/main_menu.c b/apps/main_menu.c
index bc9934b..0ac4d94 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -370,12 +370,7 @@
 #ifdef HAVE_LCD_CHARCELLS
 static bool do_shutdown(void)
 {
-#ifndef SIMULATOR
-    if (charger_inserted())
-        charging_splash();
-    else
-#endif
-        sys_poweroff();
+    sys_poweroff();
     return false;
 }
 #endif
diff --git a/apps/misc.c b/apps/misc.c
index 0936e85..c36d619 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -543,12 +543,14 @@
 #ifdef X5_BACKLIGHT_SHUTDOWN
         x5_backlight_shutdown();
 #endif
+#ifdef HAVE_TAGCACHE
         if (!tagcache_prepare_shutdown())
         {
             cancel_shutdown();
             gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY));
             return false;
         }
+#endif
     
         gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN));
         
diff --git a/apps/onplay.c b/apps/onplay.c
index 4fd9d41..60a7379 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -64,7 +64,9 @@
 #endif
 #include "playlist_menu.h"
 #include "playlist_catalog.h"
+#ifdef HAVE_TAGCACHE
 #include "tagtree.h"
+#endif
 
 static int context;
 static char* selected_file = NULL;
@@ -181,11 +183,13 @@
     if (position == PLAYLIST_INSERT_SHUFFLED)
         srand(current_tick);
 
+#ifdef HAVE_TAGCACHE
     if (context == CONTEXT_ID3DB)
     {
         tagtree_insert_selection_playlist(position, queue);
     }
     else
+#endif
     {
         if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA)
             playlist_insert_track(NULL, selected_file, position, queue, true);
@@ -207,7 +211,7 @@
         else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U)
             playlist_insert_playlist(NULL, selected_file, position, queue);
     }
-    
+	
     if (new_playlist && (playlist_amount() > 0))
     {
         /* nothing is currently playing so begin playing what we just
diff --git a/apps/playback.c b/apps/playback.c
index b68a8b8..7b952e6 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -59,7 +59,9 @@
 #include "buffer.h"
 #include "dsp.h"
 #include "abrepeat.h"
+#ifdef HAVE_TAGCACHE
 #include "tagcache.h"
+#endif
 #ifdef HAVE_LCD_BITMAP
 #include "icons.h"
 #include "peakmeter.h"
diff --git a/apps/screens.c b/apps/screens.c
index 7836a8e..9787e68 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -574,7 +574,9 @@
         [SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) },
         [SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) },
         [SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) },
+#ifdef HAVE_TAGCACHE
         [SHOW_ID3DB]={ STR(LANG_SYSFONT_FILTER_ID3DB) }
+#endif
     };
     static const struct opt_items right_items[] = {
         [REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) },
diff --git a/apps/settings.c b/apps/settings.c
index 1795f78..9d618eb 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -419,7 +419,11 @@
 
     /* browser */
     {3, S_O(dirfilter), SHOW_SUPPORTED,
-        "show files", "all,supported,music,playlists,id3 database" },
+        "show files", "all,supported,music,playlists"
+#ifdef HAVE_TAGCACHE
+        ",id3 database" 
+#endif
+        },
     {1, S_O(sort_case), false, "sort case", off_on },
     {1, S_O(browse_current), false, "follow playlist", off_on },
     /* playlist */
@@ -593,10 +597,13 @@
     {1, S_O(dircache), false, "dircache", off_on },
     {22, S_O(dircache_size), 0, NULL, NULL },
 #endif
+
+#ifdef HAVE_TAGCACHE
 #ifdef HAVE_TC_RAMCACHE
     {1, S_O(tagcache_ram), 0, "tagcache_ram", off_on },
 #endif
     {1, S_O(tagcache_autoupdate), 0, "tagcache_autoupdate", off_on },
+#endif
 
     {4, S_O(default_codepage), 0, "default codepage",
         "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8,cp1256" },
diff --git a/apps/settings.h b/apps/settings.h
index 5fc8c7e..0dca114 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -389,10 +389,12 @@
     bool dircache;          /* enable directory cache */
     int dircache_size;      /* directory cache structure last size, 22 bits */
 #endif
+#ifdef HAVE_TAGCACHE
 #ifdef HAVE_TC_RAMCACHE
     bool tagcache_ram;        /* load tagcache to ram? */
 #endif
     bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
+#endif
     int default_codepage;   /* set default codepage for tag conversion */
 #ifdef HAVE_REMOTE_LCD
     unsigned char rwps_file[MAX_FILENAME+1];  /* last remote-wps */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index b661042..0cbe534 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -49,8 +49,10 @@
 #include "database.h"
 #include "dir.h"
 #include "dircache.h"
+#ifdef HAVE_TAGCACHE
 #include "tagcache.h"
 #include "tagtree.h"
+#endif
 #include "rbunicode.h"
 #include "splash.h"
 #include "yesno.h"
@@ -749,10 +751,17 @@
         { STR(LANG_FILTER_SUPPORTED) },
         { STR(LANG_FILTER_MUSIC) },
         { STR(LANG_FILTER_PLAYLIST) },
+#ifdef HAVE_TAGCACHE
         { STR(LANG_FILTER_ID3DB) }
+#endif
     };
+#ifdef HAVE_TAGCACHE
     return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
                        names, 5, NULL );
+#else
+    return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
+                       names, 4, NULL );
+#endif
 }
 
 static bool sort_case(void)
@@ -1632,6 +1641,7 @@
 }
 #endif /* HAVE_DIRCACHE */
 
+#ifdef HAVE_TAGCACHE
 #ifdef HAVE_TC_RAMCACHE
 static bool tagcache_ram(void)
 {
@@ -1688,6 +1698,7 @@
     menu_exit(m);
     return result;
 }
+#endif
 
 #ifdef HAVE_HEADPHONE_DETECTION
 static bool unplug_mode(void)
@@ -1853,7 +1864,9 @@
         { ID2P(LANG_FOLLOW),                browse_current        },
         { ID2P(LANG_SHOW_ICONS),            show_icons            },
         { ID2P(LANG_SHOW_PATH),             show_path             },
+#ifdef HAVE_TAGCACHE
         { ID2P(LANG_TAGCACHE),              tagcache_settings_menu},
+#endif
     };
 
     m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
diff --git a/apps/tagcache.h b/apps/tagcache.h
index cdd4722..26c500e 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -16,6 +16,7 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
+#ifdef HAVE_TAGCACHE
 #ifndef _TAGCACHE_H
 #define _TAGCACHE_H
 
@@ -178,3 +179,4 @@
 bool tagcache_rebuild(void);
 
 #endif
+#endif
diff --git a/apps/tagdb/album.c b/apps/tagdb/album.c
index 53b3660..0c06329 100644
--- a/apps/tagdb/album.c
+++ b/apps/tagdb/album.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "malloc.h" // realloc() and free()
 #include <strings.h> // strncasecmp()
 #include <string.h> // strlen()
@@ -452,3 +453,4 @@
 	
 	return ERR_NO_INPLACE_UPDATE;
 }
+#endif
diff --git a/apps/tagdb/album.h b/apps/tagdb/album.h
index 08995a2..3f4eacd 100644
--- a/apps/tagdb/album.h
+++ b/apps/tagdb/album.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __ALBUM_H__
 #define __ALBUM_H__
 
@@ -101,3 +102,4 @@
  */
 
 #endif
+#endif
diff --git a/apps/tagdb/array_buffer.c b/apps/tagdb/array_buffer.c
index 24772d6..2b8b017 100644
--- a/apps/tagdb/array_buffer.c
+++ b/apps/tagdb/array_buffer.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "malloc.h" // malloc() and free()
 
 #include "array_buffer.h"
@@ -664,4 +665,4 @@
 
 	return ERR_NONE;
 }
-
+#endif
diff --git a/apps/tagdb/array_buffer.h b/apps/tagdb/array_buffer.h
index 6dccefe..d098c7a 100644
--- a/apps/tagdb/array_buffer.h
+++ b/apps/tagdb/array_buffer.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __ARRAY_BUFFER_H__
 #define __ARRAY_BUFFER_H__
 
@@ -157,3 +158,4 @@
  */
 
 #endif
+#endif
diff --git a/apps/tagdb/artist.c b/apps/tagdb/artist.c
index 82db81d..36ce560 100644
--- a/apps/tagdb/artist.c
+++ b/apps/tagdb/artist.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "malloc.h" // realloc() and free()
 #include <string.h> // strncasecmp()
 
@@ -368,3 +369,4 @@
 	
 	return ERR_NO_INPLACE_UPDATE;
 }
+#endif
diff --git a/apps/tagdb/artist.h b/apps/tagdb/artist.h
index c741594..102e287 100644
--- a/apps/tagdb/artist.h
+++ b/apps/tagdb/artist.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __ARTIST_H__
 #define __ARTIST_H__
 
@@ -98,3 +99,4 @@
  */
 
 #endif
+#endif
diff --git a/apps/tagdb/config.h b/apps/tagdb/config.h
index 8646134..5e5e870 100644
--- a/apps/tagdb/config.h
+++ b/apps/tagdb/config.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __CONFIG_H	// Include me only once
 #define __CONFIG_H
 
@@ -37,3 +38,4 @@
 #include <assert.h>
 
 #endif
+#endif
diff --git a/apps/tagdb/db.c b/apps/tagdb/db.c
index 1c84b2b..4dfeb47 100644
--- a/apps/tagdb/db.c
+++ b/apps/tagdb/db.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include <string.h> // strlen() strcpy() strcat()
 
 #include "malloc.h"
@@ -601,3 +602,4 @@
 
 	return ERR_NONE;
 }
+#endif
diff --git a/apps/tagdb/db.h b/apps/tagdb/db.h
index be29581..709bf1f 100644
--- a/apps/tagdb/db.h
+++ b/apps/tagdb/db.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __DB_H__
 #define __DB_H__
 
@@ -35,3 +36,4 @@
 int tag_info_destruct(struct tag_info *t);
 
 #endif
+#endif
diff --git a/apps/tagdb/file.c b/apps/tagdb/file.c
index de641fe..762f008 100644
--- a/apps/tagdb/file.c
+++ b/apps/tagdb/file.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "malloc.h" // realloc() and free()
 #include <string.h> // strncasecmp()
 
@@ -266,3 +267,4 @@
 	free(s);
 	return ERR_NONE;
 }
+#endif
diff --git a/apps/tagdb/file.h b/apps/tagdb/file.h
index d2538a7..103a601 100644
--- a/apps/tagdb/file.h
+++ b/apps/tagdb/file.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __FILE_H__
 #define __FILE_H__
 
@@ -82,3 +83,4 @@
  */
 
 #endif
+#ifdef HAVE_TAGCACHE
diff --git a/apps/tagdb/header.c b/apps/tagdb/header.c
index 01f9738..524c5b7 100644
--- a/apps/tagdb/header.c
+++ b/apps/tagdb/header.c
@@ -1,4 +1,4 @@
-
+#ifdef HAVE_TAGCACHE
 #include <stdio.h>
 
 #include "header.h"
@@ -119,3 +119,4 @@
 	
 	return ERR_NONE;
 }
+#endif
diff --git a/apps/tagdb/header.h b/apps/tagdb/header.h
index 08a563e..28a28d3 100644
--- a/apps/tagdb/header.h
+++ b/apps/tagdb/header.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __HEADER_H__
 #define __HEADER_H__
 
@@ -37,3 +38,4 @@
 int header_write(FILE *fd, const struct header *header);
 
 #endif
+#endif
diff --git a/apps/tagdb/main.c b/apps/tagdb/main.c
index 61a0330..ce695e6 100644
--- a/apps/tagdb/main.c
+++ b/apps/tagdb/main.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "config.h"
 
 #include <stdio.h>
@@ -113,3 +114,4 @@
 	
 	return 0;
 }
+#endif
diff --git a/apps/tagdb/malloc.c b/apps/tagdb/malloc.c
index 78d24f9..dbc2c5b 100644
--- a/apps/tagdb/malloc.c
+++ b/apps/tagdb/malloc.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "config.h"
 #include "malloc.h"
 
@@ -129,3 +130,4 @@
 	printf("  Maximum amount of allocated memory: %dbytes\n", max_total);
 	printf("  Current amount of allocated memory: %dbytes\n", total);
 }
+#endif
diff --git a/apps/tagdb/malloc.h b/apps/tagdb/malloc.h
index c8c885b..c09649b 100644
--- a/apps/tagdb/malloc.h
+++ b/apps/tagdb/malloc.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __MALLOC_H__
 #define __MALLOC_H__
 
@@ -14,3 +15,4 @@
 void malloc_stats();
 
 #endif
+#endif
diff --git a/apps/tagdb/parser.c b/apps/tagdb/parser.c
index 6eec3ba..6e2eeff 100644
--- a/apps/tagdb/parser.c
+++ b/apps/tagdb/parser.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -215,3 +216,4 @@
 	
 	return 0;
 }
+#endif
diff --git a/apps/tagdb/song.c b/apps/tagdb/song.c
index 16ae385..f62ecad 100644
--- a/apps/tagdb/song.c
+++ b/apps/tagdb/song.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "malloc.h" // realloc() and free()
 #include <string.h> // strncasecmp()
 
@@ -448,3 +449,4 @@
 	free(s);
 	return ERR_NONE;
 }
+#endif
diff --git a/apps/tagdb/song.h b/apps/tagdb/song.h
index 1be81cc..ac155b4 100644
--- a/apps/tagdb/song.h
+++ b/apps/tagdb/song.h
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #ifndef __SONG_H__
 #define __SONG_H__
 
@@ -91,3 +92,4 @@
  */
 
 #endif
+#endif
diff --git a/apps/tagdb/tag_dummy.c b/apps/tagdb/tag_dummy.c
index f0125f3..4318724 100644
--- a/apps/tagdb/tag_dummy.c
+++ b/apps/tagdb/tag_dummy.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "config.h"
 #include "malloc.h"
 
@@ -9,3 +10,4 @@
 	strcpy(t->song, file);
 	return ERR_NONE;
 }
+#endif
diff --git a/apps/tagdb/tag_dummy.h b/apps/tagdb/tag_dummy.h
index 856a0a5..e05595a 100644
--- a/apps/tagdb/tag_dummy.h
+++ b/apps/tagdb/tag_dummy.h
@@ -1,3 +1,5 @@
+#ifdef HAVE_TAGCACHE
 #include "db.h"
 
 int tag_dummy(char *file, struct tag_info *t);
+#endif
diff --git a/apps/tagdb/unique.c b/apps/tagdb/unique.c
index 471f59e..3fd4359 100644
--- a/apps/tagdb/unique.c
+++ b/apps/tagdb/unique.c
@@ -1,3 +1,4 @@
+#ifdef HAVE_TAGCACHE
 #include "unique.h"
 
 #include <string.h>
@@ -14,3 +15,4 @@
 
 	return buffer;
 }
+#endif
diff --git a/apps/tagdb/unique.h b/apps/tagdb/unique.h
index 03dc2611..bd5ebd8 100644
--- a/apps/tagdb/unique.h
+++ b/apps/tagdb/unique.h
@@ -1,6 +1,8 @@
+#ifdef
 #ifndef __UNIQUE_H__
 #define __UNIQUE_H__
 
 char *create_unique_name(char *buffer, const char *prefix, const char *suffix, int digits);
 
 #endif
+#endif
diff --git a/apps/tagtree.h b/apps/tagtree.h
index 2c85bf9..ccb71c4 100644
--- a/apps/tagtree.h
+++ b/apps/tagtree.h
@@ -16,6 +16,7 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
+#ifdef HAVE_TAGCACHE
 #ifndef _TAGTREE_H
 #define _TAGTREE_H
 
@@ -53,3 +54,4 @@
 int tagtree_get_filename(struct tree_context* c, char *buf, int buflen);
 
 #endif
+#endif
diff --git a/apps/tree.c b/apps/tree.c
index bfb6412..772e235 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -61,7 +61,9 @@
 #include "recorder/recording.h"
 #include "rtc.h"
 #include "dircache.h"
+#ifdef HAVE_TAGCACHE
 #include "tagcache.h"
+#endif
 #include "yesno.h"
 #include "gwps-common.h"
 #include "eeprom_settings.h"
@@ -177,6 +179,7 @@
     struct tree_context * local_tc=(struct tree_context *)data;
     char *name;
     int attr=0;
+#ifdef HAVE_TAGCACHE
     bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
 
     if (id3db)
@@ -184,6 +187,7 @@
         return tagtree_get_entry(&tc, selected_item)->name;
     }
     else 
+#endif
     {
         struct entry* dc = local_tc->dircache;
         struct entry* e = &dc[selected_item];
@@ -205,11 +209,14 @@
 void tree_get_fileicon(int selected_item, void * data, ICON * icon)
 {
     struct tree_context * local_tc=(struct tree_context *)data;
+#ifdef HAVE_TAGCACHE
     bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
     if (id3db) {
         *icon = (ICON)tagtree_get_icon(&tc);
     }
-    else {
+    else
+#endif
+		{
         struct entry* dc = local_tc->dircache;
         struct entry* e = &dc[selected_item];
         *icon = (ICON)filetype_get_icon(e->attr);
@@ -304,8 +311,9 @@
  */
 static int update_dir(void)
 {
+  bool changed = false;
+#ifdef HAVE_TAGCACHE
     bool id3db = *tc.dirfilter == SHOW_ID3DB;
-    bool changed = false;
     /* Checks for changes */
     if (id3db) {
         if (tc.currtable != lasttable ||
@@ -322,7 +330,9 @@
             changed = true;
         }
     }
-    else {
+    else 
+#endif
+		{
         /* if the tc.currdir has been changed, reload it ...*/
         if (strncmp(tc.currdir, lastdir, sizeof(lastdir)) || reload_dir) {
 
@@ -345,12 +355,17 @@
     }
     if (changed)
     {
-        if(!id3db && (tc.dirfull ||
+        if(
+#ifdef HAVE_TAGCACHE
+		!id3db && 
+#endif
+		(tc.dirfull ||
                       tc.filesindir == global_settings.max_files_in_dir) )
         {
             gui_syncsplash(HZ, true, str(LANG_SHOWDIR_BUFFER_FULL));
         }
     }
+#ifdef HAVE_TAGCACHE
     if (id3db) 
     {
         if (global_settings.show_path_in_browser == SHOW_PATH_FULL
@@ -366,6 +381,7 @@
         } 
     }
     else
+#endif
     {
         if (global_settings.show_path_in_browser == SHOW_PATH_FULL)
         {
@@ -417,7 +433,9 @@
 /* load tracks from specified directory to resume play */
 void resume_directory(const char *dir)
 {
+#ifdef HAVE_TAGCACHE
     bool id3db = *tc.dirfilter == SHOW_ID3DB;
+#endif
 
     if (ft_load(&tc, dir) < 0)
         return;
@@ -425,8 +443,10 @@
 
     ft_build_playlist(&tc, 0);
 
+#ifdef HAVE_TAGCACHE
     if (id3db)
         tagtree_load(&tc);
+#endif
 }
 
 /* Returns the current working directory and also writes cwd to buf if
@@ -504,10 +524,12 @@
     char *name;
     int i;
 
+#ifdef HAVE_TAGCACHE
     /* in ID3DB mode it is a bad idea to call this function */
     /* (only happens with `follow playlist') */
     if( *tc.dirfilter == SHOW_ID3DB )
         return;
+#endif
 
     /* separate directory from filename */
     /* gets the directory's name and put it into tc.currdir */
@@ -552,6 +574,7 @@
     }
 }
 
+#ifdef HAVE_TAGCACHE
 static bool check_changed_id3mode(bool currmode)
 {
     if (currmode != (global_settings.dirfilter == SHOW_ID3DB)) {
@@ -571,6 +594,8 @@
     }
     return currmode;
 }
+#endif
+
 /* main loop, handles key events */
 static bool dirbrowse(void)
 {
@@ -586,11 +611,13 @@
     long thumbnail_time = -1; /* for delaying a thumbnail */
 
     char* currdir = tc.currdir; /* just a shortcut */
+#ifdef HAVE_TAGCACHE
     bool id3db = *tc.dirfilter == SHOW_ID3DB;
 
     if (id3db)
         curr_context=CONTEXT_ID3DB;
     else
+#endif
         curr_context=CONTEXT_TREE;
     tc.selected_item = 0;
     tc.dirlevel=0;
@@ -659,7 +686,11 @@
                 if ( numentries == 0 )
                     break;
 
+#ifdef HAVE_TAGCACHE
                 switch (id3db?tagtree_enter(&tc):ft_enter(&tc))
+#else
+                switch (ft_enter(&tc))
+#endif
                 {
                     case 1: reload_dir = true; break;
                     case 2: start_wps = true; break;
@@ -677,10 +708,12 @@
                 /* if we are in /, nothing to do */
                 if (tc.dirlevel == 0 && !strcmp(currdir,"/"))
                     break;
-                
+
+#ifdef HAVE_TAGCACHE
                 if (id3db)
                     tagtree_exit(&tc);
                 else
+#endif
                     if (ft_exit(&tc) == 3)
                         exit_func = true;
                 
@@ -737,9 +770,11 @@
                         reload_dir = true;
                     restore = true;
 
+#ifdef HAVE_TAGCACHE
                     id3db = check_changed_id3mode(id3db);
                     if(id3db)
                         reload_dir = true;
+#endif
                 }
                 else /* use it as a quick exit instead */
                     exit_func = true;
@@ -769,8 +804,10 @@
                         reload_dir = true;
                     restore = true;
 
+#ifdef HAVE_TAGCACHE
                     id3db = check_changed_id3mode(id3db);
                     reload_dir = true;
+#endif
                 }
                 break;
 #endif
@@ -794,6 +831,7 @@
                 if(!numentries)
                     onplay_result = onplay(NULL, 0, curr_context);
                 else {
+#ifdef HAVE_TAGCACHE
                     if (id3db)
                     {
                         if (tagtree_get_attr(&tc) == TREE_ATTR_MPA)
@@ -805,6 +843,7 @@
                             attr = ATTR_DIRECTORY;
                     }
                     else
+#endif
                     {
                         attr = dircache[tc.selected_item].attr;
 
@@ -843,12 +882,14 @@
                     int attr;
                     char* name;
 
+#ifdef HAVE_TAGCACHE
                     if (id3db)
                     {
                         attr = tagtree_get_attr(&tc);
                         name = tagtree_get_entry(&tc, lasti)->name;
                     }
                     else
+#endif
                     {
                         attr = dircache[lasti].attr;
                         name = dircache[lasti].name;
@@ -880,7 +921,9 @@
 
 #ifdef HAVE_HOTSWAP
             case SYS_FS_CHANGED:
+#ifdef HAVE_TAGCACHE
                 if (!id3db)
+#endif
                     reload_dir = true;
                 /* The 'dir no longer valid' situation will be caught later
                  * by checking the showdir() result. */
@@ -916,13 +959,17 @@
                 reload_dir = true;
 #ifdef HAVE_HOTSWAP
             else
+#ifdef HAVE_TAGCACHE
                 if (!id3db) /* Try reload to catch 'no longer valid' case. */
+#endif
                     reload_dir = true;
 #endif
 #ifdef HAVE_LCD_COLOR
             show_main_backdrop();
 #endif
+#ifdef HAVE_TAGCACHE
             id3db = check_changed_id3mode(id3db);
+#endif
             restore = true;
             start_wps=false;
         }
@@ -985,12 +1032,14 @@
                     thumbnail_time = -1; /* Cancel whatever we were
                                             about to say */
 
+#ifdef HAVE_TAGCACHE
                     if (id3db)
                     {
                         attr = tagtree_get_attr(&tc);
                         name = tagtree_get_entry(&tc, tc.selected_item)->name;
                     }
                     else
+#endif
                     {
                         attr = dircache[tc.selected_item].attr;
                         name = dircache[tc.selected_item].name;
@@ -1380,7 +1429,9 @@
 void tree_flush(void)
 {
     scrobbler_shutdown();
+#ifdef HAVE_TAGCACHE
     tagcache_shutdown();
+#endif
     playlist_shutdown();
 
 #ifdef HAVE_TC_RAMCACHE
@@ -1440,6 +1491,8 @@
         }
     }
 #endif
+#ifdef HAVE_TAGCACHE
     tagcache_start_scan();
+#endif
     scrobbler_init();
 }
diff --git a/docs/CREDITS b/docs/CREDITS
index b39c9c6..abac76d 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -244,3 +244,4 @@
 Jared Stafford
 Martin Hensel
 Stéphane Doyen
+Austin Appel
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index 3793a71..e0c2457 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -18,6 +18,9 @@
 /* define this if you have access to the quickscreen */
 #define HAVE_QUICKSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  176
 #define LCD_HEIGHT 220
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 995ca36..d9377bc 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -15,6 +15,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  112
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
index fee2b79..ea72c34 100644
--- a/firmware/export/config-gigabeat.h
+++ b/firmware/export/config-gigabeat.h
@@ -14,6 +14,9 @@
 /* define this if you have a colour LCD */
 #define HAVE_LCD_COLOR 1
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  240
 #define LCD_HEIGHT 320
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
index 5aed9a5..a393b17 100644
--- a/firmware/export/config-gmini120.h
+++ b/firmware/export/config-gmini120.h
@@ -16,6 +16,9 @@
 /* define this if you have RTC RAM available for settings */
 #define HAVE_RTC_RAM 1
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  128
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h
index b309c17..1c1f299 100644
--- a/firmware/export/config-gminisp.h
+++ b/firmware/export/config-gminisp.h
@@ -7,6 +7,9 @@
 /* define this if you can invert the colours on your LCD */
 #define HAVE_LCD_INVERT
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  128
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index dbb7583..8cea98d 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 71baa83..12f1066 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -24,6 +24,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h
index 6fcc0f2..26042e8 100644
--- a/firmware/export/config-h10_5gb.h
+++ b/firmware/export/config-h10_5gb.h
@@ -22,6 +22,8 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
 
 /* LCD dimensions */
 #define LCD_WIDTH  128
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index d8038f2..21451dc 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -20,6 +20,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index c42965d..c9aad43 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -20,6 +20,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  220
 #define LCD_HEIGHT 176
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 83f0767..df24850 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -24,6 +24,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
index cebb319..9b8693a 100644
--- a/firmware/export/config-ifp7xx.h
+++ b/firmware/export/config-ifp7xx.h
@@ -15,6 +15,9 @@
 /* define this if you have a colour LCD */
 /* #define HAVE_LCD_COLOR 1 */
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  128
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 446f56b..1cb4f88 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index cbaa150..065c653 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  160
 #define LCD_HEIGHT 128
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 1c583e9..efc5726 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  220
 #define LCD_HEIGHT 176
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 09ce7d6..2e5da2e 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  138
 #define LCD_HEIGHT 110
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index 5020ac6..8f1fc1a 100755
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  138
 #define LCD_HEIGHT 110
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index e4a2b80..db85fa8 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  176
 #define LCD_HEIGHT 132
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index 113bcc2..543bfbf 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -22,6 +22,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  320
 #define LCD_HEIGHT 240
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 745b1ba..0ccba0d 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -10,6 +10,9 @@
 /* define this if you can invert the colours on your LCD */
 #define HAVE_LCD_INVERT
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  112
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 19c59c3..a535e47 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -7,6 +7,9 @@
 /* define this if you can invert the colours on your LCD */
 #define HAVE_LCD_INVERT
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  112
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index 3dfdb0e..76f3415 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -1,6 +1,9 @@
 /* define this if you have a charcell LCD display */
 #define HAVE_LCD_CHARCELLS 1
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions (for the simulator) */
 #define LCD_WIDTH       132 /* Display width in pixels */
 #define LCD_HEIGHT      64  /* Display height in pixels */
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index a3ba43e..4b79e0b 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -15,6 +15,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  112
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index 58a0b78..38ca974 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -15,6 +15,9 @@
 /* define this if you have access to the pitchscreen */
 #define HAVE_PITCHSCREEN
 
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
 /* LCD dimensions */
 #define LCD_WIDTH  112
 #define LCD_HEIGHT 64
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 6a3091d..6f6d253 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -217,8 +217,10 @@
  * plenty of RAM. Both features can be enabled independently. */
 #if (MEMORYSIZE > 8 || MEM > 8) && !defined(BOOTLOADER)
 #define HAVE_DIRCACHE
+#ifdef HAVE_TAGCACHE
 #define HAVE_TC_RAMCACHE
 #endif
+#endif
 
 #if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR) && !defined(BOOTLOADER)
 #define HAVE_PRIORITY_SCHEDULING