Add an advanced build option to force compiling and linking our reduced C library (probably useful for the sim).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27059 a1c6a512-1295-4272-9138-f99709370657
diff --git a/firmware/SOURCES b/firmware/SOURCES
index bef2b77..53c38e0 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -46,22 +46,41 @@
/* alsa on linux requires a more advanced sprintf, i.e. not ours */
libc/sprintf.c
#endif /* PLATFORM_NATIVE || __MINGW32__ || __CYGWIN__ */
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(HAVE_ROCKBOX_C_LIBRARY)
libc/atoi.c
+
+#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+/* our ctype.[ch] comes from newlib and is incompitble with most desktop's ctype */
libc/ctype.c
-libc/memcmp.c
+#endif
+
libc/memchr.c
+libc/memcmp.c
+
+#if !defined(CPU_SH) && !defined(CPU_COLDFIRE) && !defined(CPU_ARM)
+#if !defined(CPU_MIPS)
+libc/memcpy.c
+libc/memset.c
+#endif /* CPU_MIPS */
+libc/memmove.c
+#endif /* CPU_* */
+
libc/qsort.c
libc/random.c
libc/strcat.c
libc/strchr.c
libc/strcmp.c
libc/strcpy.c
+
+#if !defined(CPU_SH) && !defined(CPU_COLDFIRE)
+libc/strlen.c
+#endif
+
libc/strncmp.c
libc/strrchr.c
libc/strstr.c
libc/mktime.c
-#endif /* !defined(SIMULATOR)*/
+#endif /* CONFIG_PLATFORM || HAVE_ROCKBOX_C_LIBRARY */
/* Common */
common/version.c
@@ -414,7 +433,6 @@
target/arm/support-arm.S
target/arm/memcpy-arm.S
target/arm/memmove-arm.S
-libc/strlen.c
#ifndef SIMULATOR
target/arm/memset-arm.S
target/arm/memset16-arm.S
@@ -509,10 +527,7 @@
#elif defined(CPU_MIPS)
#undef mips
-/*target/mips/strlen.S*/
-libc/memmove.c
common/memset16.c
-libc/strlen.c
target/mips/ffs-mips.S
target/mips/memcpy-mips.S
target/mips/memset-mips.S
@@ -526,11 +541,7 @@
#ifdef HAVE_PRIORITY_SCHEDULING
common/ffs.c
#endif
-libc/memcpy.c
-libc/memmove.c
-libc/memset.c
common/memset16.c
-libc/strlen.c
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
crt0.S
drivers/i2c.c
diff --git a/firmware/libc/memchr.c b/firmware/libc/memchr.c
index 26bdb9e..8b6b4d6 100644
--- a/firmware/libc/memchr.c
+++ b/firmware/libc/memchr.c
@@ -35,6 +35,7 @@
#include <string.h>
#include <limits.h>
+#include "_ansi.h" /* for _DEFUN */
/* Nonzero if X is not aligned on a "long" boundary. */
#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
diff --git a/firmware/libc/memcmp.c b/firmware/libc/memcmp.c
index 1535fcf..c2fa1bf 100644
--- a/firmware/libc/memcmp.c
+++ b/firmware/libc/memcmp.c
@@ -37,7 +37,7 @@
*/
#include <string.h>
-
+#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
diff --git a/firmware/libc/memcpy.c b/firmware/libc/memcpy.c
index a89ac3c..c5456ab 100644
--- a/firmware/libc/memcpy.c
+++ b/firmware/libc/memcpy.c
@@ -33,7 +33,7 @@
*/
#include "config.h"
-#include <_ansi.h>
+#include "_ansi.h" /* for _DEFUN */
#include <string.h>
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
diff --git a/firmware/libc/strchr.c b/firmware/libc/strchr.c
index 96acf5e..ada6e2d 100644
--- a/firmware/libc/strchr.c
+++ b/firmware/libc/strchr.c
@@ -35,6 +35,7 @@
#include <string.h>
#include <limits.h>
+#include "_ansi.h" /* for _DEFUN */
/* Nonzero if X is not aligned on a "long" boundary. */
#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
diff --git a/firmware/libc/strcmp.c b/firmware/libc/strcmp.c
index bbbf4b1..d540fae 100644
--- a/firmware/libc/strcmp.c
+++ b/firmware/libc/strcmp.c
@@ -37,6 +37,7 @@
#include <string.h>
#include <limits.h>
+#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
diff --git a/firmware/libc/strcpy.c b/firmware/libc/strcpy.c
index 077ae73..035e2bd 100644
--- a/firmware/libc/strcpy.c
+++ b/firmware/libc/strcpy.c
@@ -34,6 +34,7 @@
#include <string.h>
#include <limits.h>
+#include "_ansi.h" /* for _DEFUN */
/*SUPPRESS 560*/
/*SUPPRESS 530*/
diff --git a/firmware/libc/strlen.c b/firmware/libc/strlen.c
index 4d33eaf..649df67 100644
--- a/firmware/libc/strlen.c
+++ b/firmware/libc/strlen.c
@@ -32,7 +32,7 @@
*/
#include "config.h"
-#include <_ansi.h>
+#include "_ansi.h"
#include <string.h>
#include <limits.h>
diff --git a/firmware/libc/strncmp.c b/firmware/libc/strncmp.c
index b1d8d9d..315fae8 100644
--- a/firmware/libc/strncmp.c
+++ b/firmware/libc/strncmp.c
@@ -38,6 +38,7 @@
#include <string.h>
#include <limits.h>
+#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
diff --git a/firmware/libc/strrchr.c b/firmware/libc/strrchr.c
index 31b0d04..0489edd 100644
--- a/firmware/libc/strrchr.c
+++ b/firmware/libc/strrchr.c
@@ -34,6 +34,7 @@
*/
#include <string.h>
+#include "_ansi.h" /* for _DEFUN */
char *
_DEFUN (strrchr, (s, i),
diff --git a/tools/configure b/tools/configure
index 9f5b5cf..277436d 100755
--- a/tools/configure
+++ b/tools/configure
@@ -383,8 +383,9 @@
else
interact=1
echo ""
- echo "Enter your developer options (press enter when done)"
- printf "(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile, (T)est plugins"
+ printf "Enter your developer options (press only enter when done)\n\
+(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\
+(T)est plugins, S(m)all C lib:"
if [ "$memory" = "2" ]; then
printf ", (8)MB MOD"
fi
@@ -425,6 +426,10 @@
echo "logf() support enabled"
logf="yes"
;;
+ [Mm])
+ echo "Using Rockbox' small C library"
+ extradefines="$extradefines -DHAVE_ROCKBOX_C_LIBRARY"
+ ;;
[Tt])
echo "Including test plugins"
extradefines="$extradefines -DHAVE_TEST_PLUGINS"