summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-22 14:48:29 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-22 14:48:29 -0600
commit2c743749420b1fd6ad9cee20de829e7b580b6bb7 (patch)
tree694cad301c08cdcc43e9b569a02ed241b6eaf434
parent440d27c51fed1c66e883a6d0584599e2d0569a94 (diff)
downloadnuttx-2c743749420b1fd6ad9cee20de829e7b580b6bb7.tar.gz
nuttx-2c743749420b1fd6ad9cee20de829e7b580b6bb7.tar.bz2
nuttx-2c743749420b1fd6ad9cee20de829e7b580b6bb7.zip
Changes to try to get P112 to compile with laster SDCC (it still does not)
-rw-r--r--nuttx/configs/p112/ostest/Make.defs11
-rw-r--r--nuttx/configs/p112/ostest/setenv.bat5
-rw-r--r--nuttx/tools/bdf-converter.c77
-rw-r--r--nuttx/tools/mkdeps.c11
4 files changed, 95 insertions, 9 deletions
diff --git a/nuttx/configs/p112/ostest/Make.defs b/nuttx/configs/p112/ostest/Make.defs
index e64c7b5dd..4239f4995 100644
--- a/nuttx/configs/p112/ostest/Make.defs
+++ b/nuttx/configs/p112/ostest/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# configs/p112/ostest/Make.defs
#
-# Copyright (C) 2012 Gregory Nutt. All rights reserved.
+# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -81,7 +81,8 @@ AFLAGS = -x -a -l -o -s -g
SDCCLIB = z180.lib
ASMEXT = .asm
-OBJEXT = .o
+# OBJEXT = .o
+OBJEXT = .rel
LIBEXT = .lib
EXEEXT = .hex
@@ -122,7 +123,9 @@ endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
- HOSTCC = mingw32-gcc.exe
+# You may need to customize the binary name:
+# HOSTCC = mingw32-gcc.exe
+ HOSTCC = x86_64-w64-mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
@@ -130,7 +133,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y)
# Windows-native host tools
- MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
+ MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative # --dep-debug
# Use NTFS links or directory copies
diff --git a/nuttx/configs/p112/ostest/setenv.bat b/nuttx/configs/p112/ostest/setenv.bat
index 19ca1ef57..01eb774dd 100644
--- a/nuttx/configs/p112/ostest/setenv.bat
+++ b/nuttx/configs/p112/ostest/setenv.bat
@@ -2,7 +2,7 @@
rem configs/p112/ostest/setenv.bat
rem
-rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
+rem Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
rem Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,8 @@ set PATH=C:\MinGW\bin;%PATH%
rem This is the location where I installed the SDCC toolchain for windows.
-set PATH=C:\Program Files (x86)\SDCC/bin;%PATH%
+rem set PATH=C:\Program Files (x86)\SDCC/bin;%PATH%
+set PATH=C:\Program Files\SDCC/bin;%PATH%
rem This is the location where I installed the GNUWin32 tools. See
rem http://gnuwin32.sourceforge.net/.
diff --git a/nuttx/tools/bdf-converter.c b/nuttx/tools/bdf-converter.c
index 2c4efa1ec..a93da0f2b 100644
--- a/nuttx/tools/bdf-converter.c
+++ b/nuttx/tools/bdf-converter.c
@@ -116,6 +116,83 @@ typedef struct nx_fontmetric_s
****************************************************************************/
/****************************************************************************
+ * Name: MY_strtok_r
+ *
+ * Description:
+ * MinGW does not seem to provide strtok_r
+ *
+ ****************************************************************************/
+
+#ifndef HAVE_STRTOK_R
+static char *MY_strtok_r(char *str, const char *delim, char **saveptr)
+{
+ char *pbegin;
+ char *pend = NULL;
+
+ /* Decide if we are starting a new string or continuing from
+ * the point we left off.
+ */
+
+ if (str)
+ {
+ pbegin = str;
+ }
+ else if (saveptr && *saveptr)
+ {
+ pbegin = *saveptr;
+ }
+ else
+ {
+ return NULL;
+ }
+
+ /* Find the beginning of the next token */
+
+ for (;
+ *pbegin && strchr(delim, *pbegin) != NULL;
+ pbegin++);
+
+ /* If we are at the end of the string with nothing
+ * but delimiters found, then return NULL.
+ */
+
+ if (!*pbegin)
+ {
+ return NULL;
+ }
+
+ /* Find the end of the token */
+
+ for (pend = pbegin + 1;
+ *pend && strchr(delim, *pend) == NULL;
+ pend++);
+
+ /* pend either points to the end of the string or to
+ * the first delimiter after the string.
+ */
+
+ if (*pend)
+ {
+ /* Turn the delimiter into a null terminator */
+
+ *pend++ = '\0';
+ }
+
+ /* Save the pointer where we left off and return the
+ * beginning of the token.
+ */
+
+ if (saveptr)
+ {
+ *saveptr = pend;
+ }
+ return pbegin;
+}
+
+#define strtok_r MY_strtok_r
+#endif
+
+/****************************************************************************
* Name: trimLine
*
* Description:
diff --git a/nuttx/tools/mkdeps.c b/nuttx/tools/mkdeps.c
index a4bc68955..c0b71e707 100644
--- a/nuttx/tools/mkdeps.c
+++ b/nuttx/tools/mkdeps.c
@@ -473,7 +473,7 @@ static void do_dependency(const char *file, char separator)
dotptr = strrchr(objname, '.');
if (dotptr)
{
- dotptr = '\0';
+ *dotptr = '\0';
}
snprintf(tmp, NAME_MAX+6, " -MT %s" DELIM "%s%s ",
@@ -515,7 +515,7 @@ static void do_dependency(const char *file, char separator)
g_command[cmdlen] = '\0';
/* Make a copy of g_altpath. We need to do this because at least the version
- * of strtok_r above does modifie it.
+ * of strtok_r above does modify it.
*/
alloc = strdup(g_altpath);
@@ -598,6 +598,11 @@ static void do_dependency(const char *file, char separator)
* from the compiler is in WEXITSTATUS(ret).
*/
+ if (g_debug)
+ {
+ fprintf(stderr, "Executing: %s\n", g_command);
+ }
+
ret = system(g_command);
#ifdef WEXITSTATUS
if (ret < 0 || WEXITSTATUS(ret) != 0)
@@ -687,7 +692,7 @@ static char *cywin2windows(const char *str, const char *append, enum slashmode_e
drive = toupper(*str);
if (drive < 'A' || drive > 'Z')
{
- fprintf(stderr, "ERROR: Drive charager: \"%s\"\n", str);
+ fprintf(stderr, "ERROR: Drive character: \"%s\"\n", str);
exit(EXIT_FAILURE);
}