diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-16 18:23:00 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-16 18:23:00 +0000 |
commit | 805e22b2051e9c6a75377ea6599654d7415da483 (patch) | |
tree | c259697c448b0c6f548f153c48c46a8d7a75970f /gcc/ada/misc.c | |
parent | 2c27ce73ee2229b0871c4ccad2342d8a4be85eff (diff) | |
download | ppe42-gcc-805e22b2051e9c6a75377ea6599654d7415da483.tar.gz ppe42-gcc-805e22b2051e9c6a75377ea6599654d7415da483.zip |
Merge basic-improvements-branch to trunk
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/misc.c')
-rw-r--r-- | gcc/ada/misc.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index ad431066343..a8293e709fb 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -37,6 +37,8 @@ #include "config.h" #include "system.h" +#include "coretypes.h" +#include "tm.h" #include "tree.h" #include "rtl.h" #include "errors.h" @@ -207,8 +209,8 @@ gnat_parse_file (set_yydebug) /* Decode all the language specific options that cannot be decoded by GCC. The option decoding phase of GCC calls this routine on the flags that - it cannot decode. This routine returns 1 if it is successful, otherwise - it returns 0. */ + it cannot decode. This routine returns the number of consecutive arguments + from ARGV that it successfully decoded; 0 indicates failure. */ static int gnat_decode_option (argc, argv) @@ -220,10 +222,28 @@ gnat_decode_option (argc, argv) if (!strncmp (p, "-I", 2)) { - /* Pass the -I switches as-is. */ - gnat_argv[gnat_argc] = p; - gnat_argc ++; - return 1; + /* We might get -I foo or -Ifoo. Canonicalize to the latter. */ + if (p[2] == '\0') + { + char *q; + + if (argv[1] == 0) + return 0; + + q = xmalloc (sizeof("-I") + strlen (argv[1])); + strcpy (q, "-I"); + strcat (q, argv[1]); + + gnat_argv[gnat_argc] = q; + gnat_argc ++; + return 2; /* consumed argument */ + } + else + { + gnat_argv[gnat_argc] = p; + gnat_argc ++; + return 1; + } } else if (!strncmp (p, "-gant", 5)) |