* device/lib/pic16/configure, device/lib/pic16/configure.ac,
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 22 Aug 2008 21:07:50 +0000 (21:07 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 22 Aug 2008 21:07:50 +0000 (21:07 +0000)
  src/pic16/main.c: allow spaces in gpasm and gplink paths

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5217 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/pic16/configure
device/lib/pic16/configure.ac
src/pic16/main.c

index f6d7a4bf0954d65218ba5bd6970e6df2605e4fb6..2218b51ee5bc60e2a917e4d2b732e1225a4abde5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,13 @@
+2008-08-22 Borut Razem <borut.razem AT siol.net>
+
+       * device/lib/pic16/configure, device/lib/pic16/configure.ac,
+          src/pic16/main.c: allow spaces in gpasm and gplink paths
+
 2008-08-15 Philipp Klaus Krause <pkk AT spth.de>
 
        * src/z80/peep.c,
        * src/z80/peeph-z80.def: minor peephole improvement
 
-
 2008-08-15 Raphael Neider <rneider AT web.de>
 
        * src/z80/gen.c (_vemit2): suppress compiler warning
index 2532d4d476ee9a35874f5674538f0d5d0d92d37a..cc871d8fc275180fa3db4cba85406d9e06af789e 100755 (executable)
@@ -2230,6 +2230,8 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+CCAS=\"$CCAS\"
+
 CCASFLAGS="-p$ARCH"
 
 # Extract the first word of "gplink", so it can be a program name with args.
@@ -2273,6 +2275,8 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+LD=\"$LD\"
+
 # Extract the first word of "gplib", so it can be a program name with args.
 set dummy gplib; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -2314,6 +2318,8 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+AR=\"$AR\"
+
 ARFLAGS=-c
 
 
index 2e1b27dc073790efd9cfaaad0657433e958f26c1..30de488e7336afc5dd310a8f8b218e56360305da 100644 (file)
@@ -42,9 +42,12 @@ AC_SUBST(ARCH, [${ARCH-18f452}])
 AC_SUBST(CC, [${CC-$abs_top_builddir/../../../bin/sdcc}])
 AC_SUBST(CFLAGS, ["-mpic16 -p$ARCH"])
 AC_PATH_PROG(CCAS, gpasm, :)
+AC_SUBST(CCAS, [\"$CCAS\"])
 AC_SUBST(CCASFLAGS, ["-p$ARCH"])
 AC_PATH_PROG(LD, gplink, :)
+AC_SUBST(LD, [\"$LD\"])
 AC_PATH_PROG(AR, gplib, :)
+AC_SUBST(AR, [\"$AR\"])
 AC_SUBST(ARFLAGS, [-c])
 
 # $RANLIB is called by the autotools but not provided nor required
index 2347601982b412db123c72b3f4cc6d7a425c1dce..246007b22db0257a3d156946aa2cd9d935f5f53e 100644 (file)
@@ -487,35 +487,35 @@ _process_pragma(const char *s)
   return process_pragma_tbl(pragma_tbl, s);
 }
 
-#define REP_UDATA       "--preplace-udata-with="
+#define REP_UDATA         "--preplace-udata-with="
 
-#define STACK_MODEL     "--pstack-model="
-#define OPT_BANKSEL     "--obanksel="
+#define STACK_MODEL       "--pstack-model="
+#define OPT_BANKSEL       "--obanksel="
 
-#define ALT_ASM         "--asm="
-#define ALT_LINK        "--link="
+#define ALT_ASM           "--asm="
+#define ALT_LINK          "--link="
 
-#define IVT_LOC         "--ivt-loc="
-#define NO_DEFLIBS      "--nodefaultlibs"
-#define MPLAB_COMPAT    "--mplab-comp"
+#define IVT_LOC           "--ivt-loc="
+#define NO_DEFLIBS        "--nodefaultlibs"
+#define MPLAB_COMPAT      "--mplab-comp"
 
-#define USE_CRT         "--use-crt="
+#define USE_CRT           "--use-crt="
 
-#define OFMSG_LRSUPPORT "--flr-support"
+#define OFMSG_LRSUPPORT   "--flr-support"
 
-#define NO_OPTIMIZE_GOTO    "--no-optimize-goto"
-#define OPTIMIZE_CMP        "--optimize-cmp"
-#define OPTIMIZE_DF         "--optimize-df"
+#define NO_OPTIMIZE_GOTO  "--no-optimize-goto"
+#define OPTIMIZE_CMP      "--optimize-cmp"
+#define OPTIMIZE_DF       "--optimize-df"
 
-char *alt_asm=NULL;
-char *alt_link=NULL;
+char *alt_asm = NULL;
+char *alt_link = NULL;
 
-int pic16_mplab_comp=0;
+int pic16_mplab_comp = 0;
 extern int pic16_debug_verbose;
 extern int pic16_ralloc_debug;
 extern int pic16_pcode_verbose;
 
-int pic16_enable_peeps=0;
+int pic16_enable_peeps = 0;
 
 OPTION pic16_optionsTable[]= {
     /* code generation options */
@@ -725,32 +725,33 @@ static void _pic16_linkEdit(void)
 static void
 _pic16_finaliseOptions (void)
 {
-    char devlib[512];
+  port->mem.default_local_map = data;
+  port->mem.default_globl_map = data;
 
-    port->mem.default_local_map = data;
-    port->mem.default_globl_map = data;
+  /* peepholes are disabled for the time being */
+  options.nopeep = 1;
 
-    /* peepholes are disabled for the time being */
-    options.nopeep = 1;
+  /* explicit enable peepholes for testing */
+  if (pic16_enable_peeps)
+    options.nopeep = 0;
 
-    /* explicit enable peepholes for testing */
-    if(pic16_enable_peeps)
-      options.nopeep = 0;
-
-    options.all_callee_saves = 1;       // always callee saves
+  options.all_callee_saves = 1;       // always callee saves
 
 #if 0
-    options.float_rent = 1;
-    options.intlong_rent = 1;
+  options.float_rent = 1;
+  options.intlong_rent = 1;
 #endif
 
-    setMainValue("mcu", pic16->name[2] );
-    addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
+  setMainValue("mcu", pic16->name[2] );
+  addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
+
+  setMainValue("mcu1", pic16->name[1] );
+  addSet(&preArgvSet, Safe_strdup("-D__{mcu1}"));
 
-    setMainValue("mcu1", pic16->name[1] );
-    addSet(&preArgvSet, Safe_strdup("-D__{mcu1}"));
+  if (!pic16_options.nodefaultlibs)
+    {
+      char devlib[512];
 
-    if(!pic16_options.nodefaultlibs) {
       /* now add the library for the device */
       sprintf(devlib, "libdev%s.a", pic16->name[1]);   /* e.g., libdev18f452.a */
       addSet(&libFilesSet, Safe_strdup(devlib));
@@ -759,35 +760,56 @@ _pic16_finaliseOptions (void)
       addSet(&libFilesSet, Safe_strdup( "libsdcc.a" ));
     }
 
-    if(alt_asm && strlen(alt_asm))
-      pic16_asmCmd[0] = alt_asm;
+  if (alt_asm && alt_asm[0] != '\0')
+    {
+      size_t len = strlen(alt_asm);
+      char *cmd = malloc(len + 3);
+
+      cmd[0] = '"';
+      memcpy(&cmd[1], alt_asm, len);
+      cmd[len + 1] = '"';
+      cmd[len + 2] = '\0';
+      pic16_linkCmd[0] = cmd;
+    }
 
-    if(alt_link && strlen(alt_link))
-      pic16_linkCmd[0] = alt_link;
+  if (alt_link && alt_link[0] != '\0')
+    {
+      size_t len = strlen(alt_asm);
+      char *cmd = malloc(len + 3);
+
+      cmd[0] = '"';
+      memcpy(&cmd[1], alt_link, len);
+      cmd[len + 1] = '"';
+      cmd[len + 2] = '\0';
+      pic16_linkCmd[0] = cmd;
+    }
 
-    if(!pic16_options.no_crt) {
+  if  (!pic16_options.no_crt)
+    {
       pic16_options.omit_ivt = 1;
       pic16_options.leave_reset = 0;
     }
 
-    if(options.model == MODEL_SMALL)
-      addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_SMALL"));
-    else
-    if(options.model == MODEL_LARGE)
-      addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_LARGE"));
-
+  if  (options.model == MODEL_SMALL)
+    addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_SMALL"));
+  else if(options.model == MODEL_LARGE)
     {
       char buf[128];
 
-        sprintf(buf, "-D%s -D__%s", pic16->name[2], pic16->name[1]);
-        *(strrchr(buf, 'f')) = 'F';
-        addSet(&asmOptionsSet, Safe_strdup( buf ));
+      addSet(&asmOptionsSet, Safe_strdup("-DSDCC_MODEL_LARGE"));
+
+      sprintf(buf, "-D%s -D__%s", pic16->name[2], pic16->name[1]);
+      *(strrchr(buf, 'f')) = 'F';
+      addSet(&asmOptionsSet, Safe_strdup(buf));
     }
 
-    if(STACK_MODEL_LARGE) {
+  if  (STACK_MODEL_LARGE)
+    {
       addSet(&preArgvSet, Safe_strdup("-DSTACK_MODEL_LARGE"));
       addSet(&asmOptionsSet, Safe_strdup("-DSTACK_MODEL_LARGE"));
-    } else {
+    }
+  else
+    {
       addSet(&preArgvSet, Safe_strdup("-DSTACK_MODEL_SMALL"));
       addSet(&asmOptionsSet, Safe_strdup("-DSTACK_MODEL_SMALL"));
     }